From e45daacfb9dce97d3271d7052fdddf6ebebdffb3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 26 Oct 2022 14:52:00 -0700 Subject: [PATCH 001/112] feat(dialogflow-v2): Added support for the streaming_analyze_content call (#19340) feat(dialogflow-v2): Added obfuscated_external_user_id to Participant feat(dialogflow-v2): Can directly set Cloud Speech model on the SpeechToTextConfig --- .../.owlbot-manifest.json | 1 + .../gapic_metadata.json | 5 + .../cloud/dialogflow/v2/audio_config_pb.rb | 25 +++ .../cloud/dialogflow/v2/participant_pb.rb | 34 +++ .../dialogflow/v2/participant_services_pb.rb | 16 ++ .../dialogflow/v2/participants/client.rb | 101 +++++++++ .../cloud/dialogflow/v2/sessions/client.rb | 2 +- .../cloud/dialogflow/v2/audio_config.rb | 77 ++++++- .../dialogflow/v2/conversation_profile.rb | 4 +- .../google/cloud/dialogflow/v2/participant.rb | 201 ++++++++++++++++++ .../google/cloud/dialogflow/v2/session.rb | 2 +- .../participants/streaming_analyze_content.rb | 42 ++++ ...t_metadata_google.cloud.dialogflow.v2.json | 40 ++++ .../cloud/dialogflow/v2/participants_test.rb | 104 +++++++++ 14 files changed, 648 insertions(+), 6 deletions(-) create mode 100644 google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb diff --git a/google-cloud-dialogflow-v2/.owlbot-manifest.json b/google-cloud-dialogflow-v2/.owlbot-manifest.json index 8c3640fb9a8c..85667e83e7f8 100644 --- a/google-cloud-dialogflow-v2/.owlbot-manifest.json +++ b/google-cloud-dialogflow-v2/.owlbot-manifest.json @@ -251,6 +251,7 @@ "snippets/participants/create_participant.rb", "snippets/participants/get_participant.rb", "snippets/participants/list_participants.rb", + "snippets/participants/streaming_analyze_content.rb", "snippets/participants/suggest_articles.rb", "snippets/participants/suggest_faq_answers.rb", "snippets/participants/suggest_smart_replies.rb", diff --git a/google-cloud-dialogflow-v2/gapic_metadata.json b/google-cloud-dialogflow-v2/gapic_metadata.json index 8f62a710d54e..07a514c5fe2c 100644 --- a/google-cloud-dialogflow-v2/gapic_metadata.json +++ b/google-cloud-dialogflow-v2/gapic_metadata.json @@ -284,6 +284,11 @@ "analyze_content" ] }, + "StreamingAnalyzeContent": { + "methods": [ + "streaming_analyze_content" + ] + }, "SuggestArticles": { "methods": [ "suggest_articles" diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb index 03b9164f834c..1ee832d69a98 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/audio_config_pb.rb @@ -47,8 +47,12 @@ optional :sample_rate_hertz, :int32, 2 optional :synthesize_speech_config, :message, 3, "google.cloud.dialogflow.v2.SynthesizeSpeechConfig" end + add_message "google.cloud.dialogflow.v2.TelephonyDtmfEvents" do + repeated :dtmf_events, :enum, 1, "google.cloud.dialogflow.v2.TelephonyDtmf" + end add_message "google.cloud.dialogflow.v2.SpeechToTextConfig" do optional :speech_model_variant, :enum, 1, "google.cloud.dialogflow.v2.SpeechModelVariant" + optional :model, :string, 2 end add_enum "google.cloud.dialogflow.v2.AudioEncoding" do value :AUDIO_ENCODING_UNSPECIFIED, 0 @@ -80,6 +84,25 @@ value :OUTPUT_AUDIO_ENCODING_OGG_OPUS, 3 value :OUTPUT_AUDIO_ENCODING_MULAW, 5 end + add_enum "google.cloud.dialogflow.v2.TelephonyDtmf" do + value :TELEPHONY_DTMF_UNSPECIFIED, 0 + value :DTMF_ONE, 1 + value :DTMF_TWO, 2 + value :DTMF_THREE, 3 + value :DTMF_FOUR, 4 + value :DTMF_FIVE, 5 + value :DTMF_SIX, 6 + value :DTMF_SEVEN, 7 + value :DTMF_EIGHT, 8 + value :DTMF_NINE, 9 + value :DTMF_ZERO, 10 + value :DTMF_A, 11 + value :DTMF_B, 12 + value :DTMF_C, 13 + value :DTMF_D, 14 + value :DTMF_STAR, 15 + value :DTMF_POUND, 16 + end end end @@ -93,11 +116,13 @@ module V2 VoiceSelectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.VoiceSelectionParams").msgclass SynthesizeSpeechConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SynthesizeSpeechConfig").msgclass OutputAudioConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioConfig").msgclass + TelephonyDtmfEvents = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmfEvents").msgclass SpeechToTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechToTextConfig").msgclass AudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AudioEncoding").enummodule SpeechModelVariant = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SpeechModelVariant").enummodule SsmlVoiceGender = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SsmlVoiceGender").enummodule OutputAudioEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.OutputAudioEncoding").enummodule + TelephonyDtmf = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.TelephonyDtmf").enummodule end end end diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb index 41278dccc480..f080c9c2d66f 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_pb.rb @@ -20,6 +20,7 @@ optional :name, :string, 1 optional :role, :enum, 2, "google.cloud.dialogflow.v2.Participant.Role" optional :sip_recording_media_label, :string, 6 + optional :obfuscated_external_user_id, :string, 7 map :documents_metadata_filters, :string, :string, 8 end add_enum "google.cloud.dialogflow.v2.Participant.Role" do @@ -83,6 +84,33 @@ repeated :end_user_suggestion_results, :message, 7, "google.cloud.dialogflow.v2.SuggestionResult" optional :dtmf_parameters, :message, 9, "google.cloud.dialogflow.v2.DtmfParameters" end + add_message "google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest" do + optional :participant, :string, 1 + optional :reply_audio_config, :message, 4, "google.cloud.dialogflow.v2.OutputAudioConfig" + optional :query_params, :message, 7, "google.cloud.dialogflow.v2.QueryParameters" + optional :assist_query_params, :message, 8, "google.cloud.dialogflow.v2.AssistQueryParameters" + optional :cx_parameters, :message, 13, "google.protobuf.Struct" + optional :enable_partial_automated_agent_reply, :bool, 12 + oneof :config do + optional :audio_config, :message, 2, "google.cloud.dialogflow.v2.InputAudioConfig" + optional :text_config, :message, 3, "google.cloud.dialogflow.v2.InputTextConfig" + end + oneof :input do + optional :input_audio, :bytes, 5 + optional :input_text, :string, 6 + optional :input_dtmf, :message, 9, "google.cloud.dialogflow.v2.TelephonyDtmfEvents" + end + end + add_message "google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse" do + optional :recognition_result, :message, 1, "google.cloud.dialogflow.v2.StreamingRecognitionResult" + optional :reply_text, :string, 2 + optional :reply_audio, :message, 3, "google.cloud.dialogflow.v2.OutputAudio" + optional :automated_agent_reply, :message, 4, "google.cloud.dialogflow.v2.AutomatedAgentReply" + optional :message, :message, 6, "google.cloud.dialogflow.v2.Message" + repeated :human_agent_suggestion_results, :message, 7, "google.cloud.dialogflow.v2.SuggestionResult" + repeated :end_user_suggestion_results, :message, 8, "google.cloud.dialogflow.v2.SuggestionResult" + optional :dtmf_parameters, :message, 10, "google.cloud.dialogflow.v2.DtmfParameters" + end add_message "google.cloud.dialogflow.v2.SuggestArticlesRequest" do optional :parent, :string, 1 optional :latest_message, :string, 2 @@ -159,6 +187,9 @@ optional :suggest_smart_replies_response, :message, 4, "google.cloud.dialogflow.v2.SuggestSmartRepliesResponse" end end + add_message "google.cloud.dialogflow.v2.InputTextConfig" do + optional :language_code, :string, 1 + end add_message "google.cloud.dialogflow.v2.AnnotatedMessagePart" do optional :text, :string, 1 optional :entity_type, :string, 2 @@ -189,6 +220,8 @@ module V2 AnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentRequest").msgclass DtmfParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.DtmfParameters").msgclass AnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnalyzeContentResponse").msgclass + StreamingAnalyzeContentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest").msgclass + StreamingAnalyzeContentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse").msgclass SuggestArticlesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesRequest").msgclass SuggestArticlesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestArticlesResponse").msgclass SuggestFaqAnswersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestFaqAnswersRequest").msgclass @@ -202,6 +235,7 @@ module V2 FaqAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.FaqAnswer").msgclass SmartReplyAnswer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SmartReplyAnswer").msgclass SuggestionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.SuggestionResult").msgclass + InputTextConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.InputTextConfig").msgclass AnnotatedMessagePart = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AnnotatedMessagePart").msgclass MessageAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.MessageAnnotation").msgclass AssistQueryParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.v2.AssistQueryParameters").msgclass diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb index 3cac5a5cbc08..85bcf466db80 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participant_services_pb.rb @@ -48,6 +48,22 @@ class Service # sent to virtual agents. See [Versions and # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). rpc :AnalyzeContent, ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # Note: This method is only available through the gRPC API (not REST). + # + # The top-level message sent to the client by the server is + # `StreamingAnalyzeContentResponse`. Multiple response messages can be + # returned in order. The first one or more messages contain the + # `recognition_result` field. Each result represents a more complete + # transcript of what the user said. The next message contains the + # `reply_text` field and potentially the `reply_audio` field. The message can + # also contain the `automated_agent_reply` field. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + rpc :StreamingAnalyzeContent, stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest), stream(::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse) # Gets suggested articles for a participant based on specific historical # messages. rpc :SuggestArticles, ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb index 452e67951dad..4ab533feae01 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/participants/client.rb @@ -75,6 +75,8 @@ def self.configure initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14] } + default_config.rpcs.streaming_analyze_content.timeout = 220.0 + default_config end yield @configure if block_given? @@ -647,6 +649,98 @@ def analyze_content request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Adds a text (chat, for example), or audio (phone recording, for example) + # message from a participant into the conversation. + # Note: This method is only available through the gRPC API (not REST). + # + # The top-level message sent to the client by the server is + # `StreamingAnalyzeContentResponse`. Multiple response messages can be + # returned in order. The first one or more messages contain the + # `recognition_result` field. Each result represents a more complete + # transcript of what the user said. The next message contains the + # `reply_text` field and potentially the `reply_audio` field. The message can + # also contain the `automated_agent_reply` field. + # + # Note: Always use agent versions for production traffic + # sent to virtual agents. See [Versions and + # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, ::Hash>] + # An enumerable of {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/dialogflow/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Dialogflow::V2::Participants::Client.new + # + # # Create an input stream + # input = Gapic::StreamInput.new + # + # # Call the streaming_analyze_content method to start streaming. + # output = client.streaming_analyze_content input + # + # # Send requests on the stream. For each request, pass in keyword + # # arguments to set fields. Be sure to close the stream when done. + # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + # input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + # input.close + # + # # Handle streamed responses. These may be interleaved with inputs. + # # Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse. + # output.each do |response| + # p response + # end + # + def streaming_analyze_content request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest + end + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.streaming_analyze_content.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.streaming_analyze_content.timeout, + metadata: metadata, + retry_policy: @config.rpcs.streaming_analyze_content.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @participants_stub.call_rpc :streaming_analyze_content, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Gets suggested articles for a participant based on specific historical # messages. @@ -1110,6 +1204,11 @@ class Rpcs # attr_reader :analyze_content ## + # RPC-specific configuration for `streaming_analyze_content` + # @return [::Gapic::Config::Method] + # + attr_reader :streaming_analyze_content + ## # RPC-specific configuration for `suggest_articles` # @return [::Gapic::Config::Method] # @@ -1137,6 +1236,8 @@ def initialize parent_rpcs = nil @update_participant = ::Gapic::Config::Method.new update_participant_config analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content @analyze_content = ::Gapic::Config::Method.new analyze_content_config + streaming_analyze_content_config = parent_rpcs.streaming_analyze_content if parent_rpcs.respond_to? :streaming_analyze_content + @streaming_analyze_content = ::Gapic::Config::Method.new streaming_analyze_content_config suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb index 3fbfe6268448..36a435879732 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/sessions/client.rb @@ -322,7 +322,7 @@ def detect_intent request, options = nil # If you might use # [Agent Assist](https://cloud.google.com/dialogflow/docs/#aa) # or other CCAI products now or in the future, consider using - # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content StreamingAnalyzeContent} # instead of `StreamingDetectIntent`. `StreamingAnalyzeContent` has # additional functionality for Agent Assist and other CCAI products. # diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb index f1b12292f24c..962459bbc206 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/audio_config.rb @@ -156,7 +156,7 @@ class SpeechWordInfo # @!attribute [rw] disable_no_speech_recognized_event # @return [::Boolean] # Only used in {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} and - # [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}. # If `false` and recognition doesn't return any result, trigger # `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. class InputAudioConfig @@ -238,16 +238,34 @@ class OutputAudioConfig extend ::Google::Protobuf::MessageExts::ClassMethods end + # A wrapper of repeated TelephonyDtmf digits. + # @!attribute [rw] dtmf_events + # @return [::Array<::Google::Cloud::Dialogflow::V2::TelephonyDtmf>] + # A sequence of TelephonyDtmf digits. + class TelephonyDtmfEvents + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Configures speech transcription for {::Google::Cloud::Dialogflow::V2::ConversationProfile ConversationProfile}. # @!attribute [rw] speech_model_variant # @return [::Google::Cloud::Dialogflow::V2::SpeechModelVariant] # The speech model used in speech to text. # `SPEECH_MODEL_VARIANT_UNSPECIFIED`, `USE_BEST_AVAILABLE` will be treated as # `USE_ENHANCED`. It can be overridden in {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest AnalyzeContentRequest} and - # [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] request. + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest StreamingAnalyzeContentRequest} request. # If enhanced model variant is specified and an enhanced # version of the specified model for the language does not exist, then it # would emit an error. + # @!attribute [rw] model + # @return [::String] + # Which Speech model to select. Select the model best suited to your domain + # to get best results. If a model is not explicitly specified, then a default + # model is used. + # Refer to + # [Cloud Speech API + # documentation](https://cloud.google.com/speech-to-text/docs/basics#select-model) + # for more details. class SpeechToTextConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -386,6 +404,61 @@ module OutputAudioEncoding # 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. OUTPUT_AUDIO_ENCODING_MULAW = 5 end + + # [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) + # digit in Telephony Gateway. + module TelephonyDtmf + # Not specified. This value may be used to indicate an absent digit. + TELEPHONY_DTMF_UNSPECIFIED = 0 + + # Number: '1'. + DTMF_ONE = 1 + + # Number: '2'. + DTMF_TWO = 2 + + # Number: '3'. + DTMF_THREE = 3 + + # Number: '4'. + DTMF_FOUR = 4 + + # Number: '5'. + DTMF_FIVE = 5 + + # Number: '6'. + DTMF_SIX = 6 + + # Number: '7'. + DTMF_SEVEN = 7 + + # Number: '8'. + DTMF_EIGHT = 8 + + # Number: '9'. + DTMF_NINE = 9 + + # Number: '0'. + DTMF_ZERO = 10 + + # Letter: 'A'. + DTMF_A = 11 + + # Letter: 'B'. + DTMF_B = 12 + + # Letter: 'C'. + DTMF_C = 13 + + # Letter: 'D'. + DTMF_D = 14 + + # Asterisk/star: '*'. + DTMF_STAR = 15 + + # Pound/diamond/hash/square/gate/octothorpe: '#'. + DTMF_POUND = 16 + end end end end diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb index 9f6847d8ca70..6222c3ad98ac 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb @@ -418,8 +418,8 @@ class ConversationProcessConfig # and identifies the prevailing subjective opinion, especially to determine # a user's attitude as positive, negative, or neutral: # https://cloud.google.com/natural-language/docs/basics#sentiment_analysis - # For [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method, result will be in - # [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + # For {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} method, result will be in + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#message StreamingAnalyzeContentResponse.message.SentimentAnalysisResult}. # For {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} method, result will be in # {::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse#message AnalyzeContentResponse.message.SentimentAnalysisResult} # For {::Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages Conversations.ListMessages} method, result will be in diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb index 73e924858cf9..97f676a758fb 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/participant.rb @@ -36,6 +36,36 @@ module V2 # Optional. Label applied to streams representing this participant in SIPREC # XML metadata and SDP. This is used to assign transcriptions from that # media stream to this participant. This field can be updated. + # @!attribute [rw] obfuscated_external_user_id + # @return [::String] + # Optional. Obfuscated user id that should be associated with the created participant. + # + # You can specify a user id as follows: + # + # 1. If you set this field in + # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest#participant CreateParticipantRequest} or + # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest#participant UpdateParticipantRequest}, + # Dialogflow adds the obfuscated user id with the participant. + # + # 2. If you set this field in + # [AnalyzeContent][google.cloud.dialogflow.v2.AnalyzeContentRequest.obfuscated_external_user_id] or + # [StreamingAnalyzeContent][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + # Dialogflow will update {::Google::Cloud::Dialogflow::V2::Participant#obfuscated_external_user_id Participant.obfuscated_external_user_id}. + # + # Dialogflow returns an error if you try to add a user id for a + # non-{::Google::Cloud::Dialogflow::V2::Participant::Role::END_USER END_USER} participant. + # + # Dialogflow uses this user id for billing and measurement purposes. For + # example, Dialogflow determines whether a user in one conversation returned + # in a later conversation. + # + # Note: + # + # * Please never pass raw user ids to Dialogflow. Always obfuscate your user + # id first. + # * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + # hash function like SHA-512. + # * The length of the user id must be <= 256 characters. # @!attribute [rw] documents_metadata_filters # @return [::Google::Protobuf::Map{::String => ::String}] # Optional. Key-value filters on the metadata of documents returned by article @@ -298,6 +328,166 @@ class AnalyzeContentResponse extend ::Google::Protobuf::MessageExts::ClassMethods end + # The top-level message sent by the client to the + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent} method. + # + # Multiple request messages should be sent in order: + # + # 1. The first message must contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#participant participant}, + # [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#query_params query_params}. If you want + # to receive an audio response, it should also contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#reply_audio_config reply_audio_config}. + # The message must not contain + # [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input]. + # + # 2. If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message + # was set to {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#audio_config audio_config}, + # all subsequent messages must contain + # {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_audio input_audio} to continue + # with Speech recognition. + # However, note that: + # + # * Dialogflow will bill you for the audio so far. + # * Dialogflow discards all Speech recognition results in favor of the + # text input. + # + # 3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set + # to {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#text_config StreamingAnalyzeContentRequest.text_config}, then the second message + # must contain only {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest#input_text input_text}. + # Moreover, you must not send more than two messages. + # + # After you sent all input, you must half-close or abort the request stream. + # @!attribute [rw] participant + # @return [::String] + # Required. The name of the participant this text comes from. + # Format: `projects//locations//conversations//participants/`. + # @!attribute [rw] audio_config + # @return [::Google::Cloud::Dialogflow::V2::InputAudioConfig] + # Instructs the speech recognizer how to process the speech audio. + # @!attribute [rw] text_config + # @return [::Google::Cloud::Dialogflow::V2::InputTextConfig] + # The natural language text to be processed. + # @!attribute [rw] reply_audio_config + # @return [::Google::Cloud::Dialogflow::V2::OutputAudioConfig] + # Speech synthesis configuration. + # The speech synthesis settings for a virtual agent that may be configured + # for the associated conversation profile are not used when calling + # StreamingAnalyzeContent. If this configuration is not supplied, speech + # synthesis is disabled. + # @!attribute [rw] input_audio + # @return [::String] + # The input audio content to be recognized. Must be sent if `audio_config` + # is set in the first message. The complete audio over all streaming + # messages must not exceed 1 minute. + # @!attribute [rw] input_text + # @return [::String] + # The UTF-8 encoded natural language text to be processed. Must be sent if + # `text_config` is set in the first message. Text length must not exceed + # 256 bytes for virtual agent interactions. The `input_text` field can be + # only sent once. + # @!attribute [rw] input_dtmf + # @return [::Google::Cloud::Dialogflow::V2::TelephonyDtmfEvents] + # The DTMF digits used to invoke intent and fill in parameter value. + # + # This input is ignored if the previous response indicated that DTMF input + # is not accepted. + # @!attribute [rw] query_params + # @return [::Google::Cloud::Dialogflow::V2::QueryParameters] + # Parameters for a Dialogflow virtual-agent query. + # @!attribute [rw] assist_query_params + # @return [::Google::Cloud::Dialogflow::V2::AssistQueryParameters] + # Parameters for a human assist query. + # @!attribute [rw] cx_parameters + # @return [::Google::Protobuf::Struct] + # Additional parameters to be put into Dialogflow CX session parameters. To + # remove a parameter from the session, clients should explicitly set the + # parameter value to null. + # + # Note: this field should only be used if you are connecting to a Dialogflow + # CX agent. + # @!attribute [rw] enable_partial_automated_agent_reply + # @return [::Boolean] + # Enable partial virtual agent responses. If this flag is not enabled, + # response stream still contains only one final response even if some + # `Fulfillment`s in Dialogflow virtual agent have been configured to return + # partial responses. + class StreamingAnalyzeContentRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The top-level message returned from the `StreamingAnalyzeContent` method. + # + # Multiple response messages can be returned in order: + # + # 1. If the input was set to streaming audio, the first one or more messages + # contain `recognition_result`. Each `recognition_result` represents a more + # complete transcript of what the user said. The last `recognition_result` + # has `is_final` set to `true`. + # + # 2. In virtual agent stage: if `enable_partial_automated_agent_reply` is + # true, the following N (currently 1 <= N <= 4) messages + # contain `automated_agent_reply` and optionally `reply_audio` + # returned by the virtual agent. The first (N-1) + # `automated_agent_reply`s will have `automated_agent_reply_type` set to + # `PARTIAL`. The last `automated_agent_reply` has + # `automated_agent_reply_type` set to `FINAL`. + # If `enable_partial_automated_agent_reply` is not enabled, response stream + # only contains the final reply. + # + # In human assist stage: the following N (N >= 1) messages contain + # `human_agent_suggestion_results`, `end_user_suggestion_results` or + # `message`. + # @!attribute [rw] recognition_result + # @return [::Google::Cloud::Dialogflow::V2::StreamingRecognitionResult] + # The result of speech recognition. + # @!attribute [rw] reply_text + # @return [::String] + # The output text content. + # This field is set if an automated agent responded with a text for the user. + # @!attribute [rw] reply_audio + # @return [::Google::Cloud::Dialogflow::V2::OutputAudio] + # The audio data bytes encoded as specified in the request. + # This field is set if: + # + # - The `reply_audio_config` field is specified in the request. + # - The automated agent, which this output comes from, responded with audio. + # In such case, the `reply_audio.config` field contains settings used to + # synthesize the speech. + # + # In some scenarios, multiple output audio fields may be present in the + # response structure. In these cases, only the top-most-level audio output + # has content. + # @!attribute [rw] automated_agent_reply + # @return [::Google::Cloud::Dialogflow::V2::AutomatedAgentReply] + # Only set if a Dialogflow automated agent has responded. + # Note that: [AutomatedAgentReply.detect_intent_response.output_audio][] + # and [AutomatedAgentReply.detect_intent_response.output_audio_config][] + # are always empty, use {::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse#reply_audio reply_audio} instead. + # @!attribute [rw] message + # @return [::Google::Cloud::Dialogflow::V2::Message] + # Message analyzed by CCAI. + # @!attribute [rw] human_agent_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for most recent human agent. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#human_agent_suggestion_config HumanAgentAssistantConfig.human_agent_suggestion_config}. + # @!attribute [rw] end_user_suggestion_results + # @return [::Array<::Google::Cloud::Dialogflow::V2::SuggestionResult>] + # The suggestions for end user. The order is the same as + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig::SuggestionConfig#feature_configs HumanAgentAssistantConfig.SuggestionConfig.feature_configs} of + # {::Google::Cloud::Dialogflow::V2::HumanAgentAssistantConfig#end_user_suggestion_config HumanAgentAssistantConfig.end_user_suggestion_config}. + # @!attribute [rw] dtmf_parameters + # @return [::Google::Cloud::Dialogflow::V2::DtmfParameters] + # Indicates the parameters of DTMF. + class StreamingAnalyzeContentResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The request message for {::Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles Participants.SuggestArticles}. # @!attribute [rw] parent # @return [::String] @@ -613,6 +803,17 @@ class SuggestionResult extend ::Google::Protobuf::MessageExts::ClassMethods end + # Defines the language used in the input text. + # @!attribute [rw] language_code + # @return [::String] + # Required. The language of this conversational query. See [Language + # Support](https://cloud.google.com/dialogflow/docs/reference/language) + # for a list of the currently supported language codes. + class InputTextConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents a part of a message possibly annotated with an entity. The part # can be an entity or purely a part of the message between two entities or # message start/end. diff --git a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb index 2f80858451a2..92410fc9b320 100644 --- a/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb +++ b/google-cloud-dialogflow-v2/proto_docs/google/cloud/dialogflow/v2/session.rb @@ -623,7 +623,7 @@ class SentimentAnalysisRequestConfig # [Participants.StreamingDetectIntent][], it needs to be configured in # {::Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest#query_params StreamingDetectIntentRequest.query_params}. # And for {::Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content Participants.AnalyzeContent} and - # [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent], it needs to be configured in + # {::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content Participants.StreamingAnalyzeContent}, it needs to be configured in # {::Google::Cloud::Dialogflow::V2::ConversationProfile#human_agent_assistant_config ConversationProfile.human_agent_assistant_config} # @!attribute [rw] query_text_sentiment # @return [::Google::Cloud::Dialogflow::V2::Sentiment] diff --git a/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb b/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb new file mode 100644 index 000000000000..2c1815c7d317 --- /dev/null +++ b/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] +require "google/cloud/dialogflow/v2" + +# Create a client object. The client can be reused for multiple calls. +client = Google::Cloud::Dialogflow::V2::Participants::Client.new + +# Create an input stream +input = Gapic::StreamInput.new + +# Call the streaming_analyze_content method to start streaming. +output = client.streaming_analyze_content input + +# Send requests on the stream. For each request, pass in keyword +# arguments to set fields. Be sure to close the stream when done. +input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new +input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new +input.close + +# Handle streamed responses. These may be interleaved with inputs. +# Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse. +output.each do |response| + p response +end +# [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json index ad82a3d84bbc..3cc5949b409d 100644 --- a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json +++ b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json @@ -1771,6 +1771,46 @@ } ] }, + { + "region_tag": "dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync", + "title": "Snippet for streaming_analyze_content in Participants", + "description": "Basic snippet for streaming_analyze_content in Participants", + "file": "participants/streaming_analyze_content.rb", + "language": "RUBY", + "client_method": { + "short_name": "streaming_analyze_content", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse", + "client": { + "short_name": "Participants::Client", + "full_name": "::Google::Cloud::Dialogflow::V2::Participants::Client" + }, + "method": { + "short_name": "StreamingAnalyzeContent", + "full_name": "google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent", + "service": { + "short_name": "Participants", + "full_name": "google.cloud.dialogflow.v2.Participants" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 41, + "type": "FULL" + } + ] + }, { "region_tag": "dialogflow_v2_generated_Participants_SuggestArticles_sync", "title": "Snippet for suggest_articles in Participants", diff --git a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb index 8fa629dd4fb3..be20a74be284 100644 --- a/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb +++ b/google-cloud-dialogflow-v2/test/google/cloud/dialogflow/v2/participants_test.rb @@ -363,6 +363,110 @@ def test_analyze_content end end + def test_streaming_analyze_content + # Create GRPC objects. + grpc_response = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a bidi streaming method. + participant = "hello world" + audio_config = {} + reply_audio_config = {} + input_audio = "hello world" + query_params = {} + assist_query_params = {} + cx_parameters = {} + enable_partial_automated_agent_reply = true + + streaming_analyze_content_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :streaming_analyze_content, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, streaming_analyze_content_client_stub do + # Create client + client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply + enum_input = [request_hash, request_proto].to_enum + client.streaming_analyze_content enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply + stream_input = Gapic::StreamInput.new + client.streaming_analyze_content stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply + enum_input = [request_hash, request_proto].to_enum + client.streaming_analyze_content enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply } + request_proto = ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new participant: participant, audio_config: audio_config, reply_audio_config: reply_audio_config, input_audio: input_audio, query_params: query_params, assist_query_params: assist_query_params, cx_parameters: cx_parameters, enable_partial_automated_agent_reply: enable_partial_automated_agent_reply + stream_input = Gapic::StreamInput.new + client.streaming_analyze_content stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, streaming_analyze_content_client_stub.call_rpc_count + streaming_analyze_content_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest, r + assert_equal "hello world", r["participant"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::InputAudioConfig), r["audio_config"] + assert_equal :audio_config, r.config + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::OutputAudioConfig), r["reply_audio_config"] + assert_equal "hello world", r["input_audio"] + assert_equal :input_audio, r.input + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::QueryParameters), r["query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Dialogflow::V2::AssistQueryParameters), r["assist_query_params"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Struct), r["cx_parameters"] + assert_equal true, r["enable_partial_automated_agent_reply"] + end + end + end + end + def test_suggest_articles # Create GRPC objects. grpc_response = ::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.new From cc2bc19e33fa196ac694d99d3b6a3030c826ed0a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Oct 2022 14:35:51 -0700 Subject: [PATCH 002/112] feat(build-v1): Added allow_failure, exit_code, and allow_exit_code fields to BuildStep type (#19349) --- .../devtools/cloudbuild/v1/cloudbuild_pb.rb | 3 +++ .../google/devtools/cloudbuild/v1/cloudbuild.rb | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb b/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb index 81010982e391..5c0b2b61ac4e 100644 --- a/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb +++ b/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb @@ -75,6 +75,9 @@ optional :pull_timing, :message, 13, "google.devtools.cloudbuild.v1.TimeSpan" optional :timeout, :message, 11, "google.protobuf.Duration" optional :status, :enum, 12, "google.devtools.cloudbuild.v1.Build.Status" + optional :allow_failure, :bool, 14 + optional :exit_code, :int32, 16 + repeated :allow_exit_codes, :int32, 18 optional :script, :string, 19 end add_message "google.devtools.cloudbuild.v1.Volume" do diff --git a/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb b/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb index dd804f834aeb..5560c9a180e1 100644 --- a/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb +++ b/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb @@ -277,6 +277,21 @@ class BuiltImage # Output only. Status of the build step. At this time, build step status is # only updated on build completion; step status is not updated in real-time # as the build progresses. + # @!attribute [rw] allow_failure + # @return [::Boolean] + # Allow this build step to fail without failing the entire build. + # + # If false, the entire build will fail if this step fails. Otherwise, the + # build will succeed, but this step will still have a failure status. + # Error information will be reported in the failure_detail field. + # @!attribute [r] exit_code + # @return [::Integer] + # Output only. Return code from running the step. + # @!attribute [rw] allow_exit_codes + # @return [::Array<::Integer>] + # Allow this build step to fail without failing the entire build if and + # only if the exit code is one of the specified codes. If allow_failure + # is also specified, this field will take precedence. # @!attribute [rw] script # @return [::String] # A shell script to be executed in the step. From 71170e9f4adc748c845e3f80b5249dc415ddcea2 Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Mon, 31 Oct 2022 09:54:20 -0700 Subject: [PATCH 003/112] samples(stitcher): Add Video Stitcher samples and tests (#19333) --- google-cloud-video-stitcher/samples/Gemfile | 28 +++++++ google-cloud-video-stitcher/samples/Rakefile | 23 ++++++ .../samples/acceptance/create_slate_test.rb | 29 +++++++ .../samples/acceptance/delete_slate_test.rb | 34 +++++++++ .../samples/acceptance/get_slate_test.rb | 31 ++++++++ .../samples/acceptance/helper.rb | 76 +++++++++++++++++++ .../samples/acceptance/list_slates_test.rb | 28 +++++++ .../samples/acceptance/slate_definition.rb | 7 ++ .../samples/acceptance/update_slate_test.rb | 32 ++++++++ .../samples/create_slate.rb | 44 +++++++++++ .../samples/delete_slate.rb | 38 ++++++++++ .../samples/get_slate.rb | 38 ++++++++++ .../samples/list_slates.rb | 39 ++++++++++ .../samples/update_slate.rb | 49 ++++++++++++ 14 files changed, 496 insertions(+) create mode 100644 google-cloud-video-stitcher/samples/Gemfile create mode 100644 google-cloud-video-stitcher/samples/Rakefile create mode 100644 google-cloud-video-stitcher/samples/acceptance/create_slate_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/delete_slate_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_slate_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/helper.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/list_slates_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/slate_definition.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/update_slate_test.rb create mode 100644 google-cloud-video-stitcher/samples/create_slate.rb create mode 100644 google-cloud-video-stitcher/samples/delete_slate.rb create mode 100644 google-cloud-video-stitcher/samples/get_slate.rb create mode 100644 google-cloud-video-stitcher/samples/list_slates.rb create mode 100644 google-cloud-video-stitcher/samples/update_slate.rb diff --git a/google-cloud-video-stitcher/samples/Gemfile b/google-cloud-video-stitcher/samples/Gemfile new file mode 100644 index 000000000000..990c3804f97f --- /dev/null +++ b/google-cloud-video-stitcher/samples/Gemfile @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +source "https://rubygems.org" + +master = ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" + +gem "google-cloud-video-stitcher", path: master ? "../../google-cloud-video-stitcher" : nil +gem "google-cloud-video-stitcher-v1", path: master ? "../../google-cloud-video-stitcher-v1" : nil + +group :test do + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" + gem "minitest-focus", "~> 1.1" + gem "minitest-rg", "~> 5.2" + gem "rake" +end diff --git a/google-cloud-video-stitcher/samples/Rakefile b/google-cloud-video-stitcher/samples/Rakefile new file mode 100644 index 000000000000..7255eb7b106e --- /dev/null +++ b/google-cloud-video-stitcher/samples/Rakefile @@ -0,0 +1,23 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "rake/testtask" +require "rubocop/rake_task" + +Rake::TestTask.new "test" do |t| + t.test_files = FileList["acceptance/*_test.rb"] + t.warning = false +end + +# RuboCop::RakeTask.new diff --git a/google-cloud-video-stitcher/samples/acceptance/create_slate_test.rb b/google-cloud-video-stitcher/samples/acceptance/create_slate_test.rb new file mode 100644 index 000000000000..c4d0e67c5d57 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/create_slate_test.rb @@ -0,0 +1,29 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#create_slate", :stitcher_snippet do + it "creates a slate" do + sample = SampleLoader.load "create_slate.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, slate_id: slate_id, slate_uri: slate_uri + end + @slate_created = true + + slate_id_regex = Regexp.escape slate_id + assert_match %r{Slate: projects/\S+/locations/#{location_id}/slates/#{slate_id_regex}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/delete_slate_test.rb b/google-cloud-video-stitcher/samples/acceptance/delete_slate_test.rb new file mode 100644 index 000000000000..ad455b86e5bc --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/delete_slate_test.rb @@ -0,0 +1,34 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#delete_slate", :stitcher_snippet do + it "deletes a slate" do + sample = SampleLoader.load "delete_slate.rb" + + refute_nil slate + @slate_created = true + + client.get_slate name: slate_name + + assert_output(/Deleted slate/) do + sample.run project_id: project_id, location: location_id, slate_id: slate_id + end + + assert_raises Google::Cloud::NotFoundError do + client.get_slate name: slate_name + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_slate_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_slate_test.rb new file mode 100644 index 000000000000..971e18900434 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_slate_test.rb @@ -0,0 +1,31 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_slate", :stitcher_snippet do + it "gets the slate" do + sample = SampleLoader.load "get_slate.rb" + + refute_nil slate + @slate_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, slate_id: slate_id + end + + slate_id_regex = Regexp.escape slate_id + assert_match %r{Slate: projects/\S+/locations/#{location_id}/slates/#{slate_id_regex}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/helper.rb b/google-cloud-video-stitcher/samples/acceptance/helper.rb new file mode 100644 index 000000000000..d1ed81d97bdb --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/helper.rb @@ -0,0 +1,76 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" + +require "google/cloud/video/stitcher" + +require_relative "slate_definition" +require_relative "../../../.toys/.lib/sample_loader" + + +DELETION_THRESHOLD_TIME_HOURS_IN_MILLISECONDS = 10_800_000 + +class StitcherSnippetSpec < Minitest::Spec + let(:credentials) { ENV["GOOGLE_CLOUD_CREDENTIALS"] || raise("missing GOOGLE_CLOUD_CREDENTIALS") } + let(:client) { Google::Cloud::Video::Stitcher.video_stitcher_service } + let(:project_id) { ENV["GOOGLE_CLOUD_PROJECT"] || raise("missing GOOGLE_CLOUD_PROJECT") } + let(:location_id) { "us-central1" } + let(:location_path) { client.location_path project: project_id, location: location_id } + let(:slate_id) { "my-slate-test-#{(Time.now.to_f * 1000).to_i}" } + let(:slate_name) { "projects/#{project_id}/locations/#{location_id}/slates/#{slate_id}" } + let(:slate_uri) { "https://storage.googleapis.com/cloud-samples-data/media/ForBiggerEscapes.mp4" } + let(:updated_slate_uri) { "https://storage.googleapis.com/cloud-samples-data/media/ForBiggerJoyrides.mp4" } + + attr_writer :slate_created + + before do + @slate_created = false + # Remove old slates in the test project if they exist + response = client.list_slates parent: location_path + response.each do |slate| + tmp = slate.name.to_s.split "-" + create_time = tmp.last.to_i + now = (Time.now.to_f * 1000).to_i # Milliseconds, preserves float value for precision + next if create_time >= (now - DELETION_THRESHOLD_TIME_HOURS_IN_MILLISECONDS) + begin + client.delete_slate name: slate.name.to_s + rescue Google::Cloud::NotFoundError => e + puts "Rescued: #{e.inspect}" + end + end + end + + let :slate do + client.create_slate( + parent: location_path, + slate_id: slate_id, + slate: slate_def(slate_uri) + ) + end + + after do + if @slate_created + begin + client.delete_slate name: slate_name + rescue Google::Cloud::NotFoundError, Google::Cloud::FailedPreconditionError => e + puts "Rescued: #{e.inspect}" + end + end + end + + register_spec_type(self) { |*descs| descs.include? :stitcher_snippet } +end diff --git a/google-cloud-video-stitcher/samples/acceptance/list_slates_test.rb b/google-cloud-video-stitcher/samples/acceptance/list_slates_test.rb new file mode 100644 index 000000000000..2eab8849d682 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/list_slates_test.rb @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#list_slates", :stitcher_snippet do + it "lists the slates" do + sample = SampleLoader.load "list_slates.rb" + + refute_nil slate + @slate_created = true + + assert_output(/Slates:\n#{slate_name}/) do + sample.run project_id: project_id, location: location_id + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/slate_definition.rb b/google-cloud-video-stitcher/samples/acceptance/slate_definition.rb new file mode 100644 index 000000000000..8b6abe848d9b --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/slate_definition.rb @@ -0,0 +1,7 @@ +require "google/cloud/video/stitcher" + +def slate_def slate_uri + { + uri: slate_uri + } +end diff --git a/google-cloud-video-stitcher/samples/acceptance/update_slate_test.rb b/google-cloud-video-stitcher/samples/acceptance/update_slate_test.rb new file mode 100644 index 000000000000..e1b1b1b3bd48 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/update_slate_test.rb @@ -0,0 +1,32 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#update_slate", :stitcher_snippet do + it "updates a slate" do + sample = SampleLoader.load "update_slate.rb" + + refute_nil slate + @slate_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, slate_id: slate_id, slate_uri: updated_slate_uri + end + + slate_id_regex = Regexp.escape slate_id + assert_match %r{Updated slate: projects/\S+/locations/#{location_id}/slates/#{slate_id_regex}}, out + assert_match %r{Updated uri: #{updated_slate_uri}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/create_slate.rb b/google-cloud-video-stitcher/samples/create_slate.rb new file mode 100644 index 000000000000..0a248fa823d7 --- /dev/null +++ b/google-cloud-video-stitcher/samples/create_slate.rb @@ -0,0 +1,44 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_create_slate] +require "google/cloud/video/stitcher" + +## +# Create a slate +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param slate_id [String] Your slate name (e.g. "my-slate") +# @param slate_uri [String] The URI of an MP4 video with at least one audio track +# (e.g. "https://my-slate-uri/test.mp4") +# +def create_slate project_id:, location:, slate_id:, slate_uri: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + + # Set the slate fields. + new_slate = { + uri: slate_uri + } + + response = client.create_slate parent: parent, slate_id: slate_id, slate: new_slate + + # Print the slate name. + puts "Slate: #{response.name}" +end +# [END videostitcher_create_slate] diff --git a/google-cloud-video-stitcher/samples/delete_slate.rb b/google-cloud-video-stitcher/samples/delete_slate.rb new file mode 100644 index 000000000000..5ceca0b48fc9 --- /dev/null +++ b/google-cloud-video-stitcher/samples/delete_slate.rb @@ -0,0 +1,38 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_delete_slate] +require "google/cloud/video/stitcher" + +## +# Delete a slate +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param slate_id [String] Your slate name (e.g. "my-slate") +# +def delete_slate project_id:, location:, slate_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the slate. + name = client.slate_path project: project_id, location: location, slate: slate_id + + # Delete the slate. + client.delete_slate name: name + + # Print a success message. + puts "Deleted slate" +end +# [END videostitcher_delete_slate] diff --git a/google-cloud-video-stitcher/samples/get_slate.rb b/google-cloud-video-stitcher/samples/get_slate.rb new file mode 100644 index 000000000000..a5b2c2b172c7 --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_slate.rb @@ -0,0 +1,38 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_slate] +require "google/cloud/video/stitcher" + +## +# Get a slate +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param slate_id [String] Your slate name (e.g. "my-slate") +# +def get_slate project_id:, location:, slate_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the slate. + name = client.slate_path project: project_id, location: location, slate: slate_id + + # Get the slate. + slate = client.get_slate name: name + + # Print the slate name. + puts "Slate: #{slate.name}" +end +# [END videostitcher_get_slate] diff --git a/google-cloud-video-stitcher/samples/list_slates.rb b/google-cloud-video-stitcher/samples/list_slates.rb new file mode 100644 index 000000000000..a6ac9e52e291 --- /dev/null +++ b/google-cloud-video-stitcher/samples/list_slates.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_list_slates] +require "google/cloud/video/stitcher" + +## +# List slates for a given location +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# +def list_slates project_id:, location: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + + response = client.list_slates parent: parent + + puts "Slates:" + # Print out all slates. + response.each do |slate| + puts slate.name.to_s + end +end +# [END videostitcher_list_slates] diff --git a/google-cloud-video-stitcher/samples/update_slate.rb b/google-cloud-video-stitcher/samples/update_slate.rb new file mode 100644 index 000000000000..2eded8c9ca0f --- /dev/null +++ b/google-cloud-video-stitcher/samples/update_slate.rb @@ -0,0 +1,49 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_update_slate] +require "google/cloud/video/stitcher" + +## +# Update a slate +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param slate_id [String] Your slate name (e.g. "my-slate") +# @param slate_uri [String] The URI of an MP4 video with at least one audio track +# (e.g. "https://my-slate-uri/test.mp4") +# +def update_slate project_id:, location:, slate_id:, slate_uri: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the slate. + name = client.slate_path project: project_id, location: location, slate: slate_id + + # Set the update mask. + update_mask = { paths: ["uri"] } + + # Set the slate fields. + update_slate = { + name: name, + uri: slate_uri + } + + response = client.update_slate slate: update_slate, update_mask: update_mask + + # Print the slate name. + puts "Updated slate: #{response.name}" + puts "Updated uri: #{response.uri}" +end +# [END videostitcher_update_slate] From 42515a3b6c898e771bdea85cb798e240ce04bc21 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:16:06 -0700 Subject: [PATCH 004/112] feat(build-v1): Support for uploading Python packages and Maven artifacts to Artifact Registry (#19353) --- .../devtools/cloudbuild/v1/cloudbuild_pb.rb | 29 +++++ .../devtools/cloudbuild/v1/cloudbuild.rb | 108 ++++++++++++++++++ 2 files changed, 137 insertions(+) diff --git a/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb b/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb index 5c0b2b61ac4e..3b6b585df231 100644 --- a/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb +++ b/google-cloud-build-v1/lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb @@ -61,6 +61,16 @@ optional :digest, :string, 3 optional :push_timing, :message, 4, "google.devtools.cloudbuild.v1.TimeSpan" end + add_message "google.devtools.cloudbuild.v1.UploadedPythonPackage" do + optional :uri, :string, 1 + optional :file_hashes, :message, 2, "google.devtools.cloudbuild.v1.FileHashes" + optional :push_timing, :message, 3, "google.devtools.cloudbuild.v1.TimeSpan" + end + add_message "google.devtools.cloudbuild.v1.UploadedMavenArtifact" do + optional :uri, :string, 1 + optional :file_hashes, :message, 2, "google.devtools.cloudbuild.v1.FileHashes" + optional :push_timing, :message, 3, "google.devtools.cloudbuild.v1.TimeSpan" + end add_message "google.devtools.cloudbuild.v1.BuildStep" do optional :name, :string, 1 repeated :env, :string, 2 @@ -91,6 +101,8 @@ optional :num_artifacts, :int64, 5 repeated :build_step_outputs, :bytes, 6 optional :artifact_timing, :message, 7, "google.devtools.cloudbuild.v1.TimeSpan" + repeated :python_packages, :message, 8, "google.devtools.cloudbuild.v1.UploadedPythonPackage" + repeated :maven_artifacts, :message, 9, "google.devtools.cloudbuild.v1.UploadedMavenArtifact" end add_message "google.devtools.cloudbuild.v1.ArtifactResult" do optional :location, :string, 1 @@ -165,12 +177,25 @@ add_message "google.devtools.cloudbuild.v1.Artifacts" do repeated :images, :string, 1 optional :objects, :message, 2, "google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects" + repeated :maven_artifacts, :message, 3, "google.devtools.cloudbuild.v1.Artifacts.MavenArtifact" + repeated :python_packages, :message, 5, "google.devtools.cloudbuild.v1.Artifacts.PythonPackage" end add_message "google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects" do optional :location, :string, 1 repeated :paths, :string, 2 optional :timing, :message, 3, "google.devtools.cloudbuild.v1.TimeSpan" end + add_message "google.devtools.cloudbuild.v1.Artifacts.MavenArtifact" do + optional :repository, :string, 1 + optional :path, :string, 2 + optional :artifact_id, :string, 3 + optional :group_id, :string, 4 + optional :version, :string, 5 + end + add_message "google.devtools.cloudbuild.v1.Artifacts.PythonPackage" do + optional :repository, :string, 1 + repeated :paths, :string, 2 + end add_message "google.devtools.cloudbuild.v1.TimeSpan" do optional :start_time, :message, 1, "google.protobuf.Timestamp" optional :end_time, :message, 2, "google.protobuf.Timestamp" @@ -525,6 +550,8 @@ module V1 StorageSourceManifest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.StorageSourceManifest").msgclass Source = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Source").msgclass BuiltImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuiltImage").msgclass + UploadedPythonPackage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.UploadedPythonPackage").msgclass + UploadedMavenArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.UploadedMavenArtifact").msgclass BuildStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildStep").msgclass Volume = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Volume").msgclass Results = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Results").msgclass @@ -537,6 +564,8 @@ module V1 Build::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Build.Status").enummodule Artifacts = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Artifacts").msgclass Artifacts::ArtifactObjects = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Artifacts.ArtifactObjects").msgclass + Artifacts::MavenArtifact = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Artifacts.MavenArtifact").msgclass + Artifacts::PythonPackage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.Artifacts.PythonPackage").msgclass TimeSpan = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.TimeSpan").msgclass BuildOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.BuildOperationMetadata").msgclass SourceProvenance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.devtools.cloudbuild.v1.SourceProvenance").msgclass diff --git a/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb b/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb index 5560c9a180e1..5caf17bfbd67 100644 --- a/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb +++ b/google-cloud-build-v1/proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb @@ -184,6 +184,36 @@ class BuiltImage extend ::Google::Protobuf::MessageExts::ClassMethods end + # Artifact uploaded using the PythonPackage directive. + # @!attribute [rw] uri + # @return [::String] + # URI of the uploaded artifact. + # @!attribute [rw] file_hashes + # @return [::Google::Cloud::Build::V1::FileHashes] + # Hash types and values of the Python Artifact. + # @!attribute [r] push_timing + # @return [::Google::Cloud::Build::V1::TimeSpan] + # Output only. Stores timing information for pushing the specified artifact. + class UploadedPythonPackage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Maven artifact uploaded using the MavenArtifact directive. + # @!attribute [rw] uri + # @return [::String] + # URI of the uploaded artifact. + # @!attribute [rw] file_hashes + # @return [::Google::Cloud::Build::V1::FileHashes] + # Hash types and values of the Maven Artifact. + # @!attribute [r] push_timing + # @return [::Google::Cloud::Build::V1::TimeSpan] + # Output only. Stores timing information for pushing the specified artifact. + class UploadedMavenArtifact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # A step in the build pipeline. # @!attribute [rw] name # @return [::String] @@ -346,6 +376,12 @@ class Volume # @!attribute [rw] artifact_timing # @return [::Google::Cloud::Build::V1::TimeSpan] # Time to push all non-container artifacts. + # @!attribute [rw] python_packages + # @return [::Array<::Google::Cloud::Build::V1::UploadedPythonPackage>] + # Python artifacts uploaded to Artifact Registry at the end of the build. + # @!attribute [rw] maven_artifacts + # @return [::Array<::Google::Cloud::Build::V1::UploadedMavenArtifact>] + # Maven artifacts uploaded to Artifact Registry at the end of the build. class Results include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -664,6 +700,24 @@ module Status # Build resource's results field. # # If any objects fail to be pushed, the build is marked FAILURE. + # @!attribute [rw] maven_artifacts + # @return [::Array<::Google::Cloud::Build::V1::Artifacts::MavenArtifact>] + # A list of Maven artifacts to be uploaded to Artifact Registry upon + # successful completion of all build steps. + # + # Artifacts in the workspace matching specified paths globs will be uploaded + # to the specified Artifact Registry repository using the builder service + # account's credentials. + # + # If any artifacts fail to be pushed, the build is marked FAILURE. + # @!attribute [rw] python_packages + # @return [::Array<::Google::Cloud::Build::V1::Artifacts::PythonPackage>] + # A list of Python packages to be uploaded to Artifact Registry upon + # successful completion of all build steps. + # + # The build service account credentials will be used to perform the upload. + # + # If any objects fail to be pushed, the build is marked FAILURE. class Artifacts include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -688,6 +742,60 @@ class ArtifactObjects include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # A Maven artifact to upload to Artifact Registry upon successful completion + # of all build steps. + # @!attribute [rw] repository + # @return [::String] + # Artifact Registry repository, in the form + # "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY" + # + # Artifact in the workspace specified by path will be uploaded to + # Artifact Registry with this location as a prefix. + # @!attribute [rw] path + # @return [::String] + # Path to an artifact in the build's workspace to be uploaded to + # Artifact Registry. + # This can be either an absolute path, + # e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar + # or a relative path from /workspace, + # e.g. my-app/target/my-app-1.0.SNAPSHOT.jar. + # @!attribute [rw] artifact_id + # @return [::String] + # Maven `artifactId` value used when uploading the artifact to Artifact + # Registry. + # @!attribute [rw] group_id + # @return [::String] + # Maven `groupId` value used when uploading the artifact to Artifact + # Registry. + # @!attribute [rw] version + # @return [::String] + # Maven `version` value used when uploading the artifact to Artifact + # Registry. + class MavenArtifact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Python package to upload to Artifact Registry upon successful completion + # of all build steps. A package can encapsulate multiple objects to be + # uploaded to a single repository. + # @!attribute [rw] repository + # @return [::String] + # Artifact Registry repository, in the form + # "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY" + # + # Files in the workspace matching any path pattern will be uploaded to + # Artifact Registry with this location as a prefix. + # @!attribute [rw] paths + # @return [::Array<::String>] + # Path globs used to match files in the build's workspace. For Python/ + # Twine, this is usually `dist/*`, and sometimes additionally an `.asc` + # file. + class PythonPackage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Start and end times for a build execution phase. From fbb2a97f0425e7ea4083d1546cc98c459d270e85 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 31 Oct 2022 14:43:14 -0700 Subject: [PATCH 005/112] feat: Initial generation of google-cloud-dataform (#19355) --- google-cloud-dataform/.OwlBot.yaml | 3 + google-cloud-dataform/.gitignore | 22 ++ google-cloud-dataform/.owlbot-manifest.json | 24 +++ google-cloud-dataform/.repo-metadata.json | 17 ++ google-cloud-dataform/.rubocop.yml | 39 ++++ google-cloud-dataform/.yardopts | 11 + google-cloud-dataform/AUTHENTICATION.md | 149 +++++++++++++ google-cloud-dataform/CHANGELOG.md | 2 + google-cloud-dataform/Gemfile | 5 + google-cloud-dataform/LICENSE.md | 201 ++++++++++++++++++ google-cloud-dataform/README.md | 130 +++++++++++ google-cloud-dataform/Rakefile | 201 ++++++++++++++++++ .../google-cloud-dataform.gemspec | 36 ++++ .../lib/google-cloud-dataform.rb | 19 ++ .../lib/google/cloud/dataform.rb | 116 ++++++++++ .../lib/google/cloud/dataform/version.rb | 26 +++ .../test/google/cloud/dataform/client_test.rb | 34 +++ .../google/cloud/dataform/version_test.rb | 26 +++ google-cloud-dataform/test/helper.rb | 23 ++ 19 files changed, 1084 insertions(+) create mode 100644 google-cloud-dataform/.OwlBot.yaml create mode 100644 google-cloud-dataform/.gitignore create mode 100644 google-cloud-dataform/.owlbot-manifest.json create mode 100644 google-cloud-dataform/.repo-metadata.json create mode 100644 google-cloud-dataform/.rubocop.yml create mode 100644 google-cloud-dataform/.yardopts create mode 100644 google-cloud-dataform/AUTHENTICATION.md create mode 100644 google-cloud-dataform/CHANGELOG.md create mode 100644 google-cloud-dataform/Gemfile create mode 100644 google-cloud-dataform/LICENSE.md create mode 100644 google-cloud-dataform/README.md create mode 100644 google-cloud-dataform/Rakefile create mode 100644 google-cloud-dataform/google-cloud-dataform.gemspec create mode 100644 google-cloud-dataform/lib/google-cloud-dataform.rb create mode 100644 google-cloud-dataform/lib/google/cloud/dataform.rb create mode 100644 google-cloud-dataform/lib/google/cloud/dataform/version.rb create mode 100644 google-cloud-dataform/test/google/cloud/dataform/client_test.rb create mode 100644 google-cloud-dataform/test/google/cloud/dataform/version_test.rb create mode 100644 google-cloud-dataform/test/helper.rb diff --git a/google-cloud-dataform/.OwlBot.yaml b/google-cloud-dataform/.OwlBot.yaml new file mode 100644 index 000000000000..b7899416b8bf --- /dev/null +++ b/google-cloud-dataform/.OwlBot.yaml @@ -0,0 +1,3 @@ +deep-copy-regex: + - source: /google/cloud/dataform/[^/]+-ruby/(.*) + dest: /owl-bot-staging/google-cloud-dataform/$1 diff --git a/google-cloud-dataform/.gitignore b/google-cloud-dataform/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/google-cloud-dataform/.gitignore @@ -0,0 +1,22 @@ +# Ignore bundler lockfiles +Gemfile.lock +gems.locked + +# Ignore documentation output +doc/* +.yardoc/* + +# Ignore test output +coverage/* + +# Ignore build artifacts +pkg/* + +# Ignore files commonly present in certain dev environments +.vagrant +.DS_STORE +.idea +*.iml + +# Ignore synth output +__pycache__ diff --git a/google-cloud-dataform/.owlbot-manifest.json b/google-cloud-dataform/.owlbot-manifest.json new file mode 100644 index 000000000000..9fd32a240414 --- /dev/null +++ b/google-cloud-dataform/.owlbot-manifest.json @@ -0,0 +1,24 @@ +{ + "generated": [ + ".gitignore", + ".repo-metadata.json", + ".rubocop.yml", + ".yardopts", + "AUTHENTICATION.md", + "CHANGELOG.md", + "Gemfile", + "LICENSE.md", + "README.md", + "Rakefile", + "google-cloud-dataform.gemspec", + "lib/google-cloud-dataform.rb", + "lib/google/cloud/dataform.rb", + "lib/google/cloud/dataform/version.rb", + "test/google/cloud/dataform/client_test.rb", + "test/google/cloud/dataform/version_test.rb", + "test/helper.rb" + ], + "static": [ + ".OwlBot.yaml" + ] +} diff --git a/google-cloud-dataform/.repo-metadata.json b/google-cloud-dataform/.repo-metadata.json new file mode 100644 index 000000000000..d9c358e8e136 --- /dev/null +++ b/google-cloud-dataform/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "dataform.googleapis.com", + "api_shortname": "dataform", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-dataform/latest", + "distribution_name": "google-cloud-dataform", + "is_cloud": true, + "language": "ruby", + "name": "dataform", + "name_pretty": "Dataform API", + "product_documentation": "https://cloud.google.com/dataform", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery.", + "ruby-cloud-product-url": "https://cloud.google.com/dataform", + "library_type": "GAPIC_MANUAL" +} diff --git a/google-cloud-dataform/.rubocop.yml b/google-cloud-dataform/.rubocop.yml new file mode 100644 index 000000000000..b84434209877 --- /dev/null +++ b/google-cloud-dataform/.rubocop.yml @@ -0,0 +1,39 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-dataform.gemspec" + - "Rakefile" + - "acceptance/**/*" + - "test/**/*" + +Bundler/OrderedGems: + Enabled: false +Documentation: + Enabled: false +Layout/LineLength: + Enabled: false +Metrics/BlockLength: + Exclude: + - "samples/**/acceptance/*.rb" +Metrics/AbcSize: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false + +Naming/FileName: + Exclude: + - "lib/google-cloud-dataform.rb" + +Style/BlockDelimiters: + Exclude: + - "samples/**/acceptance/*.rb" diff --git a/google-cloud-dataform/.yardopts b/google-cloud-dataform/.yardopts new file mode 100644 index 000000000000..573e0df1ce0e --- /dev/null +++ b/google-cloud-dataform/.yardopts @@ -0,0 +1,11 @@ +--no-private +--title="Dataform API" +--exclude _pb\.rb$ +--markup markdown +--markup-provider redcarpet + +./lib/**/*.rb +- +README.md +AUTHENTICATION.md +LICENSE.md diff --git a/google-cloud-dataform/AUTHENTICATION.md b/google-cloud-dataform/AUTHENTICATION.md new file mode 100644 index 000000000000..7c93820e1438 --- /dev/null +++ b/google-cloud-dataform/AUTHENTICATION.md @@ -0,0 +1,149 @@ +# Authentication + +In general, the google-cloud-dataform library uses +[Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) +credentials to connect to Google Cloud services. When running within +[Google Cloud Platform environments](#google-cloud-platform-environments) the +credentials will be discovered automatically. When running on other +environments, the Service Account credentials can be specified by providing the +path to the +[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) +for the account (or the JSON itself) in +[environment variables](#environment-variables). Additionally, Cloud SDK +credentials can also be discovered automatically, but this is only recommended +during development. + +## Quickstart + +1. [Create a service account and credentials](#creating-a-service-account). +2. Set the [environment variable](#environment-variables). + +```sh +export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json +``` + +3. Initialize the client. + +```ruby +require "google/cloud/dataform" + +client = Google::Cloud::Dataform.dataform +``` + +## Credential Lookup + +The google-cloud-dataform library aims to make authentication +as simple as possible, and provides several mechanisms to configure your system +without requiring **Service Account Credentials** directly in code. + +**Credentials** are discovered in the following order: + +1. Specify credentials in method arguments +2. Specify credentials in configuration +3. Discover credentials path in environment variables +4. Discover credentials JSON in environment variables +5. Discover credentials file in the Cloud SDK's path +6. Discover GCP credentials + +### Google Cloud Platform environments + +When running on Google Cloud Platform (GCP), including Google Compute Engine +(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud +Functions (GCF) and Cloud Run, **Credentials** are discovered automatically. +Code should be written as if already authenticated. + +### Environment Variables + +The **Credentials JSON** can be placed in environment variables instead of +declaring them directly in code. Each service has its own environment variable, +allowing for different service accounts to be used for different services. (See +the READMEs for the individual service gems for details.) The path to the +**Credentials JSON** file can be stored in the environment variable, or the +**Credentials JSON** itself can be stored for environments such as Docker +containers where writing files is difficult or not encouraged. + +The environment variables that google-cloud-dataform +checks for credentials are configured on the service Credentials class (such as +`::Google::Cloud::Dataform::V1beta1::Dataform::Credentials`): + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/cloud/dataform" + +ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" + +client = Google::Cloud::Dataform.dataform +``` + +### Configuration + +The path to the **Credentials JSON** file can be configured instead of storing +it in an environment variable. Either on an individual client initialization: + +```ruby +require "google/cloud/dataform" + +client = Google::Cloud::Dataform.dataform do |config| + config.credentials = "path/to/keyfile.json" +end +``` + +Or globally for all clients: + +```ruby +require "google/cloud/dataform" + +Google::Cloud::Dataform.configure do |config| + config.credentials = "path/to/keyfile.json" +end + +client = Google::Cloud::Dataform.dataform +``` + +### Cloud SDK + +This option allows for an easy way to authenticate during development. If +credentials are not provided in code or in environment variables, then Cloud SDK +credentials are discovered. + +To configure your system for this, simply: + +1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) +2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login` +3. Write code as if already authenticated. + +**NOTE:** This is _not_ recommended for running in production. The Cloud SDK +*should* only be used during development. + +## Creating a Service Account + +Google Cloud requires **Service Account Credentials** to +connect to the APIs. You will use the **JSON key file** to +connect to most services with google-cloud-dataform. + +If you are not running this client within +[Google Cloud Platform environments](#google-cloud-platform-environments), you +need a Google Developers service account. + +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). +2. Create a new project or click on an existing project. +3. Activate the menu in the upper left and select **APIs & Services**. From + here, you will enable the APIs that your application requires. + + *Note: You may need to enable billing in order to use these services.* + +4. Select **Credentials** from the side navigation. + + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. + + If you want to re-use an existing service account, you can easily generate a + new key file. Just select the account you wish to re-use, click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. + + The key file you download will be used by this library to authenticate API + requests and should be stored in a secure location. diff --git a/google-cloud-dataform/CHANGELOG.md b/google-cloud-dataform/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/google-cloud-dataform/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/google-cloud-dataform/Gemfile b/google-cloud-dataform/Gemfile new file mode 100644 index 000000000000..c4fd48a7006b --- /dev/null +++ b/google-cloud-dataform/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gemspec + +gem "google-cloud-dataform-v1beta1", path: "../google-cloud-dataform-v1beta1" diff --git a/google-cloud-dataform/LICENSE.md b/google-cloud-dataform/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/google-cloud-dataform/LICENSE.md @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/google-cloud-dataform/README.md b/google-cloud-dataform/README.md new file mode 100644 index 000000000000..16439da1f68b --- /dev/null +++ b/google-cloud-dataform/README.md @@ -0,0 +1,130 @@ +# Ruby Client for the Dataform API + +API Client library for the Dataform API + +Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery. + +Actual client classes for the various versions of this API are defined in +_versioned_ client gems, with names of the form `google-cloud-dataform-v*`. +The gem `google-cloud-dataform` is the main client library that brings the +verisoned gems in as dependencies, and provides high-level methods for +constructing clients. More information on versioned clients can be found below +in the section titled *Which client should I use?*. + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-dataform/latest) +for this library, google-cloud-dataform, to see the convenience methods for +constructing client objects. Reference documentation for the client objects +themselves can be found in the client library documentation for the versioned +client gems: +[google-cloud-dataform-v1beta1](https://googleapis.dev/ruby/google-cloud-dataform-v1beta1/latest). + +See also the [Product Documentation](https://cloud.google.com/dataform) +for more usage information. + +## Quick Start + +``` +$ gem install google-cloud-dataform +``` + +In order to use this library, you first need to go through the following steps: + +1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project) +1. [Enable billing for your project.](https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project) +1. [Enable the API.](https://console.cloud.google.com/apis/library/dataform.googleapis.com) +1. {file:AUTHENTICATION.md Set up authentication.} + +## Enabling Logging + +To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. +The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below, +or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest) +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) +and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. + +Configuring a Ruby stdlib logger: + +```ruby +require "logger" + +module MyLogger + LOGGER = Logger.new $stderr, level: Logger::WARN + def logger + LOGGER + end +end + +# Define a gRPC module-level logger method before grpc/logconfig.rb loads. +module GRPC + extend MyLogger +end +``` + +## Supported Ruby Versions + +This library is supported on Ruby 2.6+. + +Google provides official support for Ruby versions that are actively supported +by Ruby Core—that is, Ruby versions that are either in normal maintenance or +in security maintenance, and not end of life. Older versions of Ruby _may_ +still work, but are unsupported and not recommended. See +https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby +support schedule. + +## Which client should I use? + +Most modern Ruby client libraries for Google APIs come in two flavors: the main +client library with a name such as `google-cloud-dataform`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-dataform-v1beta1`. +_In most cases, you should install the main client._ + +### What's the difference between the main client and a versioned client? + +A _versioned client_ provides a basic set of data types and client classes for +a _single version_ of a specific service. (That is, for a service with multiple +versions, there might be a separate versioned client for each service version.) +Most versioned clients are written and maintained by a code generator. + +The _main client_ is designed to provide you with the _recommended_ client +interfaces for the service. There will be only one main client for any given +service, even a service with multiple versions. The main client includes +factory methods for constructing the client objects we recommend for most +users. In some cases, those will be classes provided by an underlying versioned +client; in other cases, they will be handwritten higher-level client objects +with additional capabilities, convenience methods, or best practices built in. +Generally, the main client will default to a recommended service version, +although in some cases you can override this if you need to talk to a specific +service version. + +### Why would I want to use the main client? + +We recommend that most users install the main client gem for a service. You can +identify this gem as the one _without_ a version in its name, e.g. +`google-cloud-dataform`. +The main client is recommended because it will embody the best practices for +accessing the service, and may also provide more convenient interfaces or +tighter integration into frameworks and third-party libraries. In addition, the +documentation and samples published by Google will generally demonstrate use of +the main client. + +### Why would I want to use a versioned client? + +You can use a versioned client if you are content with a possibly lower-level +class interface, you explicitly want to avoid features provided by the main +client, or you want to access a specific service version not be covered by the +main client. You can identify versioned client gems because the service version +is part of the name, e.g. `google-cloud-dataform-v1beta1`. + +### What about the google-apis- clients? + +Client library gems with names that begin with `google-apis-` are based on an +older code generation technology. They talk to a REST/JSON backend (whereas +most modern clients talk to a [gRPC](https://grpc.io/) backend) and they may +not offer the same performance, features, and ease of use provided by more +modern clients. + +The `google-apis-` clients have wide coverage across Google services, so you +might need to use one if there is no modern client available for the service. +However, if a modern client is available, we generally recommend it over the +older `google-apis-` clients. diff --git a/google-cloud-dataform/Rakefile b/google-cloud-dataform/Rakefile new file mode 100644 index 000000000000..2f0dc6cda515 --- /dev/null +++ b/google-cloud-dataform/Rakefile @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "bundler/setup" +require "bundler/gem_tasks" + +require "rubocop/rake_task" +RuboCop::RakeTask.new + +require "rake/testtask" +desc "Run tests." +Rake::TestTask.new do |t| + t.libs << "test" + t.test_files = FileList["test/**/*_test.rb"] + t.warning = true +end + +namespace :test do + desc "Runs tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-dataform" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:test].invoke + end +end + +desc "Runs the smoke tests." +Rake::TestTask.new :smoke_test do |t| + t.test_files = FileList["acceptance/**/*smoke_test.rb"] + t.warning = false +end + +namespace :smoke_test do + desc "Runs smoke tests with coverage." + task :coverage do + require "simplecov" + SimpleCov.start do + command_name "google-cloud-dataform" + track_files "lib/**/*.rb" + add_filter "test/" + end + + Rake::Task[:smoke_test].invoke + end +end + +# Acceptance tests +desc "Run the google-cloud-dataform acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE_JSON"] || + ENV["GCLOUD_TEST_KEYFILE_JSON"] + end + if project.nil? || keyfile.nil? + fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/dataform/v1beta1/dataform/credentials" + ::Google::Cloud::Dataform::V1beta1::Dataform::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_KEYFILE_JSON"] = keyfile + + Rake::Task["acceptance:run"].invoke +end + +namespace :acceptance do + task :run do + if File.directory? "acceptance" + Rake::Task[:smoke_test].invoke + else + puts "The google-cloud-dataform gem has no acceptance tests." + end + end + + desc "Run acceptance tests with coverage." + task :coverage do + end + + desc "Run acceptance cleanup." + task :cleanup do + end +end + +task :samples do + Rake::Task["samples:latest"].invoke +end + +namespace :samples do + task :latest do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-dataform gem has no samples to test." + end + end + + task :master do + if File.directory? "samples" + Dir.chdir "samples" do + Bundler.with_clean_env do + ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" + sh "bundle update" + sh "bundle exec rake test" + end + end + else + puts "The google-cloud-dataform gem has no samples to test." + end + end +end + +require "yard" +require "yard/rake/yardoc_task" +YARD::Rake::YardocTask.new do |y| + y.options << "--fail-on-warning" +end + +desc "Run yard-doctest example tests." +task :doctest do + puts "The google-cloud-dataform gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-dataform" + header "google-cloud-dataform rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-dataform yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-dataform test", "*" + Rake::Task[:test].invoke +end + +namespace :ci do + desc "Run the CI build, with smoke tests." + task :smoke_test do + Rake::Task[:ci].invoke + header "google-cloud-dataform smoke_test", "*" + Rake::Task[:smoke_test].invoke + end + desc "Run the CI build, with acceptance tests." + task :acceptance do + Rake::Task[:ci].invoke + header "google-cloud-dataform acceptance", "*" + Rake::Task[:acceptance].invoke + end + task :a do + # This is a handy shortcut to save typing + Rake::Task["ci:acceptance"].invoke + end +end + +task default: :test + +def header str, token = "#" + line_length = str.length + 8 + puts "" + puts token * line_length + puts "#{token * 3} #{str} #{token * 3}" + puts token * line_length + puts "" +end diff --git a/google-cloud-dataform/google-cloud-dataform.gemspec b/google-cloud-dataform/google-cloud-dataform.gemspec new file mode 100644 index 000000000000..d23b00d43f81 --- /dev/null +++ b/google-cloud-dataform/google-cloud-dataform.gemspec @@ -0,0 +1,36 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/dataform/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-dataform" + gem.version = Google::Cloud::Dataform::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery." + gem.summary = "API Client library for the Dataform API" + gem.homepage = "https://github.com/googleapis/google-cloud-ruby" + gem.license = "Apache-2.0" + + gem.platform = Gem::Platform::RUBY + + gem.files = `git ls-files -- lib/*`.split("\n") + + ["README.md", "AUTHENTICATION.md", "LICENSE.md", ".yardopts"] + gem.require_paths = ["lib"] + + gem.required_ruby_version = ">= 2.6" + + gem.add_dependency "google-cloud-core", "~> 1.6" + gem.add_dependency "google-cloud-dataform-v1beta1", ">= 0.0", "< 2.a" + + gem.add_development_dependency "google-style", "~> 1.26.1" + gem.add_development_dependency "minitest", "~> 5.16" + gem.add_development_dependency "minitest-focus", "~> 1.1" + gem.add_development_dependency "minitest-rg", "~> 5.2" + gem.add_development_dependency "rake", ">= 13.0" + gem.add_development_dependency "redcarpet", "~> 3.0" + gem.add_development_dependency "simplecov", "~> 0.9" + gem.add_development_dependency "yard", "~> 0.9" +end diff --git a/google-cloud-dataform/lib/google-cloud-dataform.rb b/google-cloud-dataform/lib/google-cloud-dataform.rb new file mode 100644 index 000000000000..790ccb41765c --- /dev/null +++ b/google-cloud-dataform/lib/google-cloud-dataform.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/dataform" unless defined? Google::Cloud::Dataform::VERSION diff --git a/google-cloud-dataform/lib/google/cloud/dataform.rb b/google-cloud-dataform/lib/google/cloud/dataform.rb new file mode 100644 index 000000000000..92ae7754cc51 --- /dev/null +++ b/google-cloud-dataform/lib/google/cloud/dataform.rb @@ -0,0 +1,116 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# Require this file early so that the version constant gets defined before +# requiring "google/cloud". This is because google-cloud-core will load the +# entrypoint (gem name) file, which in turn re-requires this file (hence +# causing a require cycle) unless the version constant is already defined. +require "google/cloud/dataform/version" + +require "googleauth" +gem "google-cloud-core" +require "google/cloud" unless defined? ::Google::Cloud.new +require "google/cloud/config" + +# Set the default configuration +::Google::Cloud.configure.add_config! :dataform do |config| + config.add_field! :endpoint, "dataform.googleapis.com", match: ::String + config.add_field! :credentials, nil, match: [::String, ::Hash, ::Google::Auth::Credentials] + config.add_field! :scope, nil, match: [::Array, ::String] + config.add_field! :lib_name, nil, match: ::String + config.add_field! :lib_version, nil, match: ::String + config.add_field! :interceptors, nil, match: ::Array + config.add_field! :timeout, nil, match: ::Numeric + config.add_field! :metadata, nil, match: ::Hash + config.add_field! :retry_policy, nil, match: [::Hash, ::Proc] + config.add_field! :quota_project, nil, match: ::String +end + +module Google + module Cloud + module Dataform + ## + # Create a new client object for Dataform. + # + # By default, this returns an instance of + # [Google::Cloud::Dataform::V1beta1::Dataform::Client](https://googleapis.dev/ruby/google-cloud-dataform-v1beta1/latest/Google/Cloud/Dataform/V1beta1/Dataform/Client.html) + # for version V1beta1 of the API. + # However, you can specify specify a different API version by passing it in the + # `version` parameter. If the Dataform service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # ## About Dataform + # + # Dataform is a service to develop, create, document, test, and update curated + # tables in BigQuery. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1beta1`. + # @return [Dataform::Client] A client object for the specified version. + # + def self.dataform version: :v1beta1, &block + require "google/cloud/dataform/#{version.to_s.downcase}" + + package_name = Google::Cloud::Dataform + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + package_module = Google::Cloud::Dataform.const_get package_name + package_module.const_get(:Dataform).const_get(:Client).new(&block) + end + + ## + # Configure the google-cloud-dataform library. + # + # The following configuration parameters are supported: + # + # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - + # The path to the keyfile as a String, the contents of the keyfile as a + # Hash, or a Google::Auth::Credentials object. + # * `lib_name` (*type:* `String`) - + # The library name as recorded in instrumentation and logging. + # * `lib_version` (*type:* `String`) - + # The library version as recorded in instrumentation and logging. + # * `interceptors` (*type:* `Array`) - + # An array of interceptors that are run before calls are executed. + # * `timeout` (*type:* `Numeric`) - + # Default timeout in seconds. + # * `metadata` (*type:* `Hash{Symbol=>String}`) - + # Additional gRPC headers to be sent with the call. + # * `retry_policy` (*type:* `Hash`) - + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - + # The error codes that should trigger a retry. + # + # @return [::Google::Cloud::Config] The default configuration used by this library + # + def self.configure + yield ::Google::Cloud.configure.dataform if block_given? + + ::Google::Cloud.configure.dataform + end + end + end +end + +helper_path = ::File.join __dir__, "dataform", "helpers.rb" +require "google/cloud/dataform/helpers" if ::File.file? helper_path diff --git a/google-cloud-dataform/lib/google/cloud/dataform/version.rb b/google-cloud-dataform/lib/google/cloud/dataform/version.rb new file mode 100644 index 000000000000..116183f30eb1 --- /dev/null +++ b/google-cloud-dataform/lib/google/cloud/dataform/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Dataform + VERSION = "0.0.1" + end + end +end diff --git a/google-cloud-dataform/test/google/cloud/dataform/client_test.rb b/google-cloud-dataform/test/google/cloud/dataform/client_test.rb new file mode 100644 index 000000000000..d081145610bc --- /dev/null +++ b/google-cloud-dataform/test/google/cloud/dataform/client_test.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/dataform" +require "gapic/common" +require "gapic/grpc" + +class Google::Cloud::Dataform::ClientConstructionMinitest < Minitest::Test + def test_dataform + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Dataform.dataform do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Dataform::V1beta1::Dataform::Client, client + end + end +end diff --git a/google-cloud-dataform/test/google/cloud/dataform/version_test.rb b/google-cloud-dataform/test/google/cloud/dataform/version_test.rb new file mode 100644 index 000000000000..b2e150729588 --- /dev/null +++ b/google-cloud-dataform/test/google/cloud/dataform/version_test.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" +require "google/cloud/dataform/version" + +class Google::Cloud::Dataform::VersionMinitest < Minitest::Test + def test_has_a_version + refute_nil Google::Cloud::Dataform::VERSION + end +end diff --git a/google-cloud-dataform/test/helper.rb b/google-cloud-dataform/test/helper.rb new file mode 100644 index 000000000000..122d71f790e0 --- /dev/null +++ b/google-cloud-dataform/test/helper.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "simplecov" + +require "minitest/autorun" +require "minitest/focus" +require "minitest/rg" From 81fa74707a212ea1a72097d13f4701b4cfb9ca5a Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:26:29 -0700 Subject: [PATCH 006/112] chore: Bootstrap release manifest for new packages (#19356) --- .release-please-manifest.json | 4 ++++ release-please-config.json | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 59acd24d62bc..4fab03dab2f8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -191,6 +191,10 @@ "google-cloud-dataflow+FILLER": "0.0.0", "google-cloud-dataflow-v1beta3": "0.4.0", "google-cloud-dataflow-v1beta3+FILLER": "0.0.0", + "google-cloud-dataform": "0.0.1", + "google-cloud-dataform+FILLER": "0.0.0", + "google-cloud-dataform-v1beta1": "0.0.1", + "google-cloud-dataform-v1beta1+FILLER": "0.0.0", "google-cloud-dataplex": "0.3.0", "google-cloud-dataplex+FILLER": "0.0.0", "google-cloud-dataplex-v1": "0.5.0", diff --git a/release-please-config.json b/release-please-config.json index f92bfeacb0bd..f708ca386ca5 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -395,6 +395,14 @@ "component": "google-cloud-dataflow-v1beta3", "version_file": "lib/google/cloud/dataflow/v1beta3/version.rb" }, + "google-cloud-dataform": { + "component": "google-cloud-dataform", + "version_file": "lib/google/cloud/dataform/version.rb" + }, + "google-cloud-dataform-v1beta1": { + "component": "google-cloud-dataform-v1beta1", + "version_file": "lib/google/cloud/dataform/v1beta1/version.rb" + }, "google-cloud-dataplex": { "component": "google-cloud-dataplex", "version_file": "lib/google/cloud/dataplex/version.rb" From ad174050bacbc5cf01a85ee5c9f202b44631ee21 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:37:50 -0700 Subject: [PATCH 007/112] chore: Update autogenerated Ruby samples to include snippet methods (#19357) --- google-analytics-admin-v1alpha/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../acknowledge_user_data_collection.rb | 22 +- ...splay_video360_advertiser_link_proposal.rb | 22 +- .../archive_audience.rb | 22 +- .../archive_custom_dimension.rb | 22 +- .../archive_custom_metric.rb | 22 +- .../audit_user_links.rb | 32 +- .../batch_create_user_links.rb | 22 +- .../batch_delete_user_links.rb | 22 +- .../batch_get_user_links.rb | 22 +- .../batch_update_user_links.rb | 22 +- ...splay_video360_advertiser_link_proposal.rb | 22 +- .../create_audience.rb | 22 +- .../create_conversion_event.rb | 22 +- .../create_custom_dimension.rb | 22 +- .../create_custom_metric.rb | 22 +- .../create_data_stream.rb | 22 +- ...create_display_video360_advertiser_link.rb | 22 +- ...splay_video360_advertiser_link_proposal.rb | 22 +- .../create_firebase_link.rb | 22 +- .../create_google_ads_link.rb | 22 +- .../create_measurement_protocol_secret.rb | 22 +- .../create_property.rb | 22 +- .../create_user_link.rb | 22 +- .../analytics_admin_service/delete_account.rb | 22 +- .../delete_conversion_event.rb | 22 +- .../delete_data_stream.rb | 22 +- ...delete_display_video360_advertiser_link.rb | 22 +- ...splay_video360_advertiser_link_proposal.rb | 22 +- .../delete_firebase_link.rb | 22 +- .../delete_google_ads_link.rb | 22 +- .../delete_measurement_protocol_secret.rb | 22 +- .../delete_property.rb | 22 +- .../delete_user_link.rb | 22 +- .../analytics_admin_service/get_account.rb | 22 +- .../get_attribution_settings.rb | 22 +- .../analytics_admin_service/get_audience.rb | 22 +- .../get_conversion_event.rb | 22 +- .../get_custom_dimension.rb | 22 +- .../get_custom_metric.rb | 22 +- .../get_data_retention_settings.rb | 22 +- .../get_data_sharing_settings.rb | 22 +- .../get_data_stream.rb | 22 +- .../get_display_video360_advertiser_link.rb | 22 +- ...splay_video360_advertiser_link_proposal.rb | 22 +- .../get_global_site_tag.rb | 22 +- .../get_google_signals_settings.rb | 22 +- .../get_measurement_protocol_secret.rb | 22 +- .../analytics_admin_service/get_property.rb | 22 +- .../analytics_admin_service/get_user_link.rb | 22 +- .../list_account_summaries.rb | 32 +- .../analytics_admin_service/list_accounts.rb | 32 +- .../analytics_admin_service/list_audiences.rb | 32 +- .../list_conversion_events.rb | 32 +- .../list_custom_dimensions.rb | 32 +- .../list_custom_metrics.rb | 32 +- .../list_data_streams.rb | 32 +- ...play_video360_advertiser_link_proposals.rb | 32 +- .../list_display_video360_advertiser_links.rb | 32 +- .../list_firebase_links.rb | 32 +- .../list_google_ads_links.rb | 32 +- .../list_measurement_protocol_secrets.rb | 32 +- .../list_properties.rb | 32 +- .../list_user_links.rb | 32 +- .../provision_account_ticket.rb | 22 +- .../run_access_report.rb | 22 +- .../search_change_history_events.rb | 32 +- .../analytics_admin_service/update_account.rb | 22 +- .../update_attribution_settings.rb | 22 +- .../update_audience.rb | 22 +- .../update_custom_dimension.rb | 22 +- .../update_custom_metric.rb | 22 +- .../update_data_retention_settings.rb | 22 +- .../update_data_stream.rb | 22 +- ...update_display_video360_advertiser_link.rb | 22 +- .../update_google_ads_link.rb | 22 +- .../update_google_signals_settings.rb | 22 +- .../update_measurement_protocol_secret.rb | 22 +- .../update_property.rb | 22 +- .../update_user_link.rb | 22 +- ...tadata_google.analytics.admin.v1alpha.json | 158 +++---- google-analytics-data-v1beta/.rubocop.yml | 3 + google-analytics-data-v1beta/snippets/Gemfile | 4 +- .../analytics_data/batch_run_pivot_reports.rb | 22 +- .../analytics_data/batch_run_reports.rb | 22 +- .../analytics_data/check_compatibility.rb | 22 +- .../snippets/analytics_data/get_metadata.rb | 22 +- .../analytics_data/run_pivot_report.rb | 22 +- .../analytics_data/run_realtime_report.rb | 22 +- .../snippets/analytics_data/run_report.rb | 22 +- ...metadata_google.analytics.data.v1beta.json | 14 +- google-area120-tables-v1alpha1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...tadata_google.area120.tables.v1alpha1.json | 24 +- .../tables_service/batch_create_rows.rb | 22 +- .../tables_service/batch_delete_rows.rb | 22 +- .../tables_service/batch_update_rows.rb | 22 +- .../snippets/tables_service/create_row.rb | 22 +- .../snippets/tables_service/delete_row.rb | 22 +- .../snippets/tables_service/get_row.rb | 22 +- .../snippets/tables_service/get_table.rb | 22 +- .../snippets/tables_service/get_workspace.rb | 22 +- .../snippets/tables_service/list_rows.rb | 32 +- .../snippets/tables_service/list_tables.rb | 32 +- .../tables_service/list_workspaces.rb | 32 +- .../snippets/tables_service/update_row.rb | 22 +- google-cloud-access_approval-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../approve_approval_request.rb | 22 +- .../delete_access_approval_settings.rb | 22 +- .../dismiss_approval_request.rb | 22 +- .../get_access_approval_service_account.rb | 22 +- .../get_access_approval_settings.rb | 22 +- .../access_approval/get_approval_request.rb | 22 +- .../invalidate_approval_request.rb | 22 +- .../access_approval/list_approval_requests.rb | 32 +- .../update_access_approval_settings.rb | 22 +- ...tadata_google.cloud.accessapproval.v1.json | 18 +- google-cloud-ai_platform-v1/.rubocop.yml | 3 + google-cloud-ai_platform-v1/snippets/Gemfile | 4 +- .../dataset_service/create_dataset.rb | 34 +- .../dataset_service/delete_dataset.rb | 34 +- .../snippets/dataset_service/export_data.rb | 34 +- .../dataset_service/get_annotation_spec.rb | 22 +- .../snippets/dataset_service/get_dataset.rb | 22 +- .../snippets/dataset_service/import_data.rb | 34 +- .../dataset_service/list_annotations.rb | 32 +- .../dataset_service/list_data_items.rb | 32 +- .../snippets/dataset_service/list_datasets.rb | 32 +- .../dataset_service/list_saved_queries.rb | 32 +- .../dataset_service/update_dataset.rb | 22 +- .../endpoint_service/create_endpoint.rb | 34 +- .../endpoint_service/delete_endpoint.rb | 34 +- .../snippets/endpoint_service/deploy_model.rb | 34 +- .../snippets/endpoint_service/get_endpoint.rb | 22 +- .../endpoint_service/list_endpoints.rb | 32 +- .../endpoint_service/undeploy_model.rb | 34 +- .../endpoint_service/update_endpoint.rb | 22 +- .../read_feature_values.rb | 22 +- .../streaming_read_feature_values.rb | 26 +- .../batch_create_features.rb | 34 +- .../batch_read_feature_values.rb | 34 +- .../create_entity_type.rb | 34 +- .../featurestore_service/create_feature.rb | 34 +- .../create_featurestore.rb | 34 +- .../delete_entity_type.rb | 34 +- .../featurestore_service/delete_feature.rb | 34 +- .../delete_featurestore.rb | 34 +- .../export_feature_values.rb | 34 +- .../featurestore_service/get_entity_type.rb | 22 +- .../featurestore_service/get_feature.rb | 22 +- .../featurestore_service/get_featurestore.rb | 22 +- .../import_feature_values.rb | 34 +- .../featurestore_service/list_entity_types.rb | 32 +- .../featurestore_service/list_features.rb | 32 +- .../list_featurestores.rb | 32 +- .../featurestore_service/search_features.rb | 32 +- .../update_entity_type.rb | 22 +- .../featurestore_service/update_feature.rb | 22 +- .../update_featurestore.rb | 34 +- .../create_index_endpoint.rb | 34 +- .../delete_index_endpoint.rb | 34 +- .../index_endpoint_service/deploy_index.rb | 34 +- .../get_index_endpoint.rb | 22 +- .../list_index_endpoints.rb | 32 +- .../mutate_deployed_index.rb | 34 +- .../index_endpoint_service/undeploy_index.rb | 34 +- .../update_index_endpoint.rb | 22 +- .../snippets/index_service/create_index.rb | 34 +- .../snippets/index_service/delete_index.rb | 34 +- .../snippets/index_service/get_index.rb | 22 +- .../snippets/index_service/list_indexes.rb | 32 +- .../index_service/remove_datapoints.rb | 22 +- .../snippets/index_service/update_index.rb | 34 +- .../index_service/upsert_datapoints.rb | 22 +- .../cancel_batch_prediction_job.rb | 22 +- .../snippets/job_service/cancel_custom_job.rb | 22 +- .../job_service/cancel_data_labeling_job.rb | 22 +- .../cancel_hyperparameter_tuning_job.rb | 22 +- .../create_batch_prediction_job.rb | 22 +- .../snippets/job_service/create_custom_job.rb | 22 +- .../job_service/create_data_labeling_job.rb | 22 +- .../create_hyperparameter_tuning_job.rb | 22 +- .../create_model_deployment_monitoring_job.rb | 22 +- .../delete_batch_prediction_job.rb | 34 +- .../snippets/job_service/delete_custom_job.rb | 34 +- .../job_service/delete_data_labeling_job.rb | 34 +- .../delete_hyperparameter_tuning_job.rb | 34 +- .../delete_model_deployment_monitoring_job.rb | 34 +- .../job_service/get_batch_prediction_job.rb | 22 +- .../snippets/job_service/get_custom_job.rb | 22 +- .../job_service/get_data_labeling_job.rb | 22 +- .../get_hyperparameter_tuning_job.rb | 22 +- .../get_model_deployment_monitoring_job.rb | 22 +- .../job_service/list_batch_prediction_jobs.rb | 32 +- .../snippets/job_service/list_custom_jobs.rb | 32 +- .../job_service/list_data_labeling_jobs.rb | 32 +- .../list_hyperparameter_tuning_jobs.rb | 32 +- .../list_model_deployment_monitoring_jobs.rb | 32 +- .../pause_model_deployment_monitoring_job.rb | 22 +- .../resume_model_deployment_monitoring_job.rb | 22 +- ...l_deployment_monitoring_stats_anomalies.rb | 32 +- .../update_model_deployment_monitoring_job.rb | 34 +- .../add_context_artifacts_and_executions.rb | 22 +- .../metadata_service/add_context_children.rb | 22 +- .../metadata_service/add_execution_events.rb | 22 +- .../metadata_service/create_artifact.rb | 22 +- .../metadata_service/create_context.rb | 22 +- .../metadata_service/create_execution.rb | 22 +- .../create_metadata_schema.rb | 22 +- .../metadata_service/create_metadata_store.rb | 34 +- .../metadata_service/delete_artifact.rb | 34 +- .../metadata_service/delete_context.rb | 34 +- .../metadata_service/delete_execution.rb | 34 +- .../metadata_service/delete_metadata_store.rb | 34 +- .../snippets/metadata_service/get_artifact.rb | 22 +- .../snippets/metadata_service/get_context.rb | 22 +- .../metadata_service/get_execution.rb | 22 +- .../metadata_service/get_metadata_schema.rb | 22 +- .../metadata_service/get_metadata_store.rb | 22 +- .../metadata_service/list_artifacts.rb | 32 +- .../metadata_service/list_contexts.rb | 32 +- .../metadata_service/list_executions.rb | 32 +- .../metadata_service/list_metadata_schemas.rb | 32 +- .../metadata_service/list_metadata_stores.rb | 32 +- .../metadata_service/purge_artifacts.rb | 34 +- .../metadata_service/purge_contexts.rb | 34 +- .../metadata_service/purge_executions.rb | 34 +- .../query_artifact_lineage_subgraph.rb | 22 +- .../query_context_lineage_subgraph.rb | 22 +- .../query_execution_inputs_and_outputs.rb | 22 +- .../remove_context_children.rb | 22 +- .../metadata_service/update_artifact.rb | 22 +- .../metadata_service/update_context.rb | 22 +- .../metadata_service/update_execution.rb | 22 +- .../batch_migrate_resources.rb | 34 +- .../search_migratable_resources.rb | 32 +- .../batch_import_model_evaluation_slices.rb | 22 +- .../snippets/model_service/delete_model.rb | 34 +- .../model_service/delete_model_version.rb | 34 +- .../snippets/model_service/export_model.rb | 34 +- .../snippets/model_service/get_model.rb | 22 +- .../model_service/get_model_evaluation.rb | 22 +- .../get_model_evaluation_slice.rb | 22 +- .../model_service/import_model_evaluation.rb | 22 +- .../list_model_evaluation_slices.rb | 32 +- .../model_service/list_model_evaluations.rb | 32 +- .../model_service/list_model_versions.rb | 32 +- .../snippets/model_service/list_models.rb | 32 +- .../model_service/merge_version_aliases.rb | 22 +- .../snippets/model_service/update_model.rb | 22 +- .../snippets/model_service/upload_model.rb | 34 +- .../pipeline_service/cancel_pipeline_job.rb | 22 +- .../cancel_training_pipeline.rb | 22 +- .../pipeline_service/create_pipeline_job.rb | 22 +- .../create_training_pipeline.rb | 22 +- .../pipeline_service/delete_pipeline_job.rb | 34 +- .../delete_training_pipeline.rb | 34 +- .../pipeline_service/get_pipeline_job.rb | 22 +- .../pipeline_service/get_training_pipeline.rb | 22 +- .../pipeline_service/list_pipeline_jobs.rb | 32 +- .../list_training_pipelines.rb | 32 +- .../snippets/prediction_service/explain.rb | 22 +- .../snippets/prediction_service/predict.rb | 22 +- .../prediction_service/raw_predict.rb | 22 +- ...t_metadata_google.cloud.aiplatform.v1.json | 386 +++++++++--------- .../create_specialist_pool.rb | 34 +- .../delete_specialist_pool.rb | 34 +- .../get_specialist_pool.rb | 22 +- .../list_specialist_pools.rb | 32 +- .../update_specialist_pool.rb | 34 +- .../batch_create_tensorboard_runs.rb | 22 +- .../batch_create_tensorboard_time_series.rb | 22 +- ...batch_read_tensorboard_time_series_data.rb | 22 +- .../tensorboard_service/create_tensorboard.rb | 34 +- .../create_tensorboard_experiment.rb | 22 +- .../create_tensorboard_run.rb | 22 +- .../create_tensorboard_time_series.rb | 22 +- .../tensorboard_service/delete_tensorboard.rb | 34 +- .../delete_tensorboard_experiment.rb | 34 +- .../delete_tensorboard_run.rb | 34 +- .../delete_tensorboard_time_series.rb | 34 +- .../export_tensorboard_time_series_data.rb | 32 +- .../tensorboard_service/get_tensorboard.rb | 22 +- .../get_tensorboard_experiment.rb | 22 +- .../get_tensorboard_run.rb | 22 +- .../get_tensorboard_time_series.rb | 22 +- .../list_tensorboard_experiments.rb | 32 +- .../list_tensorboard_runs.rb | 32 +- .../list_tensorboard_time_series.rb | 32 +- .../tensorboard_service/list_tensorboards.rb | 32 +- .../read_tensorboard_blob_data.rb | 26 +- .../read_tensorboard_time_series_data.rb | 22 +- .../tensorboard_service/update_tensorboard.rb | 34 +- .../update_tensorboard_experiment.rb | 22 +- .../update_tensorboard_run.rb | 22 +- .../update_tensorboard_time_series.rb | 22 +- .../write_tensorboard_experiment_data.rb | 22 +- .../write_tensorboard_run_data.rb | 22 +- .../vizier_service/add_trial_measurement.rb | 22 +- .../check_trial_early_stopping_state.rb | 34 +- .../snippets/vizier_service/complete_trial.rb | 22 +- .../snippets/vizier_service/create_study.rb | 22 +- .../snippets/vizier_service/create_trial.rb | 22 +- .../snippets/vizier_service/delete_study.rb | 22 +- .../snippets/vizier_service/delete_trial.rb | 22 +- .../snippets/vizier_service/get_study.rb | 22 +- .../snippets/vizier_service/get_trial.rb | 22 +- .../vizier_service/list_optimal_trials.rb | 22 +- .../snippets/vizier_service/list_studies.rb | 32 +- .../snippets/vizier_service/list_trials.rb | 32 +- .../snippets/vizier_service/lookup_study.rb | 22 +- .../snippets/vizier_service/stop_trial.rb | 22 +- .../snippets/vizier_service/suggest_trials.rb | 34 +- google-cloud-api_gateway-v1/.rubocop.yml | 3 + google-cloud-api_gateway-v1/snippets/Gemfile | 4 +- .../api_gateway_service/create_api.rb | 34 +- .../api_gateway_service/create_api_config.rb | 34 +- .../api_gateway_service/create_gateway.rb | 34 +- .../api_gateway_service/delete_api.rb | 34 +- .../api_gateway_service/delete_api_config.rb | 34 +- .../api_gateway_service/delete_gateway.rb | 34 +- .../snippets/api_gateway_service/get_api.rb | 22 +- .../api_gateway_service/get_api_config.rb | 22 +- .../api_gateway_service/get_gateway.rb | 22 +- .../api_gateway_service/list_api_configs.rb | 32 +- .../snippets/api_gateway_service/list_apis.rb | 32 +- .../api_gateway_service/list_gateways.rb | 32 +- .../api_gateway_service/update_api.rb | 34 +- .../api_gateway_service/update_api_config.rb | 34 +- .../api_gateway_service/update_gateway.rb | 34 +- ...t_metadata_google.cloud.apigateway.v1.json | 30 +- google-cloud-api_keys-v2/.rubocop.yml | 3 + google-cloud-api_keys-v2/snippets/Gemfile | 4 +- .../snippets/api_keys/create_key.rb | 34 +- .../snippets/api_keys/delete_key.rb | 34 +- .../snippets/api_keys/get_key.rb | 22 +- .../snippets/api_keys/get_key_string.rb | 22 +- .../snippets/api_keys/list_keys.rb | 32 +- .../snippets/api_keys/lookup_key.rb | 22 +- .../snippets/api_keys/undelete_key.rb | 34 +- .../snippets/api_keys/update_key.rb | 34 +- ...nippet_metadata_google.api.apikeys.v2.json | 16 +- google-cloud-apigee_connect-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../connection_service/list_connections.rb | 32 +- ...etadata_google.cloud.apigeeconnect.v1.json | 4 +- .../snippets/tether/egress.rb | 44 +- google-cloud-apigee_registry-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/provisioning/create_instance.rb | 34 +- .../snippets/provisioning/delete_instance.rb | 34 +- .../snippets/provisioning/get_instance.rb | 22 +- .../snippets/registry/create_api.rb | 22 +- .../registry/create_api_deployment.rb | 22 +- .../snippets/registry/create_api_spec.rb | 22 +- .../snippets/registry/create_api_version.rb | 22 +- .../snippets/registry/create_artifact.rb | 22 +- .../snippets/registry/delete_api.rb | 22 +- .../registry/delete_api_deployment.rb | 22 +- .../delete_api_deployment_revision.rb | 22 +- .../snippets/registry/delete_api_spec.rb | 22 +- .../registry/delete_api_spec_revision.rb | 22 +- .../snippets/registry/delete_api_version.rb | 22 +- .../snippets/registry/delete_artifact.rb | 22 +- .../snippets/registry/get_api.rb | 22 +- .../snippets/registry/get_api_deployment.rb | 22 +- .../snippets/registry/get_api_spec.rb | 22 +- .../registry/get_api_spec_contents.rb | 22 +- .../snippets/registry/get_api_version.rb | 22 +- .../snippets/registry/get_artifact.rb | 22 +- .../registry/get_artifact_contents.rb | 22 +- .../registry/list_api_deployment_revisions.rb | 32 +- .../snippets/registry/list_api_deployments.rb | 32 +- .../registry/list_api_spec_revisions.rb | 32 +- .../snippets/registry/list_api_specs.rb | 32 +- .../snippets/registry/list_api_versions.rb | 32 +- .../snippets/registry/list_apis.rb | 32 +- .../snippets/registry/list_artifacts.rb | 32 +- .../snippets/registry/replace_artifact.rb | 22 +- .../registry/rollback_api_deployment.rb | 22 +- .../snippets/registry/rollback_api_spec.rb | 22 +- .../registry/tag_api_deployment_revision.rb | 22 +- .../registry/tag_api_spec_revision.rb | 22 +- .../snippets/registry/update_api.rb | 22 +- .../registry/update_api_deployment.rb | 22 +- .../snippets/registry/update_api_spec.rb | 22 +- .../snippets/registry/update_api_version.rb | 22 +- ...tadata_google.cloud.apigeeregistry.v1.json | 76 ++-- google-cloud-app_engine-v1/.rubocop.yml | 3 + google-cloud-app_engine-v1/snippets/Gemfile | 4 +- .../applications/create_application.rb | 34 +- .../snippets/applications/get_application.rb | 22 +- .../applications/repair_application.rb | 34 +- .../applications/update_application.rb | 34 +- .../create_authorized_certificate.rb | 22 +- .../delete_authorized_certificate.rb | 22 +- .../get_authorized_certificate.rb | 22 +- .../list_authorized_certificates.rb | 32 +- .../update_authorized_certificate.rb | 22 +- .../list_authorized_domains.rb | 32 +- .../domain_mappings/create_domain_mapping.rb | 34 +- .../domain_mappings/delete_domain_mapping.rb | 34 +- .../domain_mappings/get_domain_mapping.rb | 22 +- .../domain_mappings/list_domain_mappings.rb | 32 +- .../domain_mappings/update_domain_mapping.rb | 34 +- .../firewall/batch_update_ingress_rules.rb | 22 +- .../snippets/firewall/create_ingress_rule.rb | 22 +- .../snippets/firewall/delete_ingress_rule.rb | 22 +- .../snippets/firewall/get_ingress_rule.rb | 22 +- .../snippets/firewall/list_ingress_rules.rb | 32 +- .../snippets/firewall/update_ingress_rule.rb | 22 +- .../snippets/instances/debug_instance.rb | 34 +- .../snippets/instances/delete_instance.rb | 34 +- .../snippets/instances/get_instance.rb | 22 +- .../snippets/instances/list_instances.rb | 32 +- .../snippets/services/delete_service.rb | 34 +- .../snippets/services/get_service.rb | 22 +- .../snippets/services/list_services.rb | 32 +- .../snippets/services/update_service.rb | 34 +- .../snippet_metadata_google.appengine.v1.json | 68 +-- .../snippets/versions/create_version.rb | 34 +- .../snippets/versions/delete_version.rb | 34 +- .../snippets/versions/get_version.rb | 22 +- .../snippets/versions/list_versions.rb | 32 +- .../snippets/versions/update_version.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../artifact_registry/create_repository.rb | 34 +- .../snippets/artifact_registry/create_tag.rb | 22 +- .../artifact_registry/delete_package.rb | 34 +- .../artifact_registry/delete_repository.rb | 34 +- .../snippets/artifact_registry/delete_tag.rb | 22 +- .../artifact_registry/delete_version.rb | 34 +- .../artifact_registry/get_docker_image.rb | 22 +- .../snippets/artifact_registry/get_file.rb | 22 +- .../artifact_registry/get_iam_policy.rb | 22 +- .../snippets/artifact_registry/get_package.rb | 22 +- .../artifact_registry/get_project_settings.rb | 22 +- .../artifact_registry/get_repository.rb | 22 +- .../snippets/artifact_registry/get_tag.rb | 22 +- .../snippets/artifact_registry/get_version.rb | 22 +- .../artifact_registry/import_apt_artifacts.rb | 34 +- .../artifact_registry/import_yum_artifacts.rb | 34 +- .../artifact_registry/list_docker_images.rb | 32 +- .../snippets/artifact_registry/list_files.rb | 32 +- .../artifact_registry/list_packages.rb | 32 +- .../artifact_registry/list_repositories.rb | 32 +- .../snippets/artifact_registry/list_tags.rb | 32 +- .../artifact_registry/list_versions.rb | 32 +- .../artifact_registry/set_iam_policy.rb | 22 +- .../artifact_registry/test_iam_permissions.rb | 22 +- .../update_project_settings.rb | 22 +- .../artifact_registry/update_repository.rb | 22 +- .../snippets/artifact_registry/update_tag.rb | 22 +- ...a_google.devtools.artifactregistry.v1.json | 54 +-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../artifact_registry/create_repository.rb | 34 +- .../snippets/artifact_registry/create_tag.rb | 22 +- .../artifact_registry/delete_package.rb | 34 +- .../artifact_registry/delete_repository.rb | 34 +- .../snippets/artifact_registry/delete_tag.rb | 22 +- .../artifact_registry/delete_version.rb | 34 +- .../snippets/artifact_registry/get_file.rb | 22 +- .../artifact_registry/get_iam_policy.rb | 22 +- .../snippets/artifact_registry/get_package.rb | 22 +- .../artifact_registry/get_project_settings.rb | 22 +- .../artifact_registry/get_repository.rb | 22 +- .../snippets/artifact_registry/get_tag.rb | 22 +- .../snippets/artifact_registry/get_version.rb | 22 +- .../artifact_registry/import_apt_artifacts.rb | 34 +- .../artifact_registry/import_yum_artifacts.rb | 34 +- .../snippets/artifact_registry/list_files.rb | 32 +- .../artifact_registry/list_packages.rb | 32 +- .../artifact_registry/list_repositories.rb | 32 +- .../snippets/artifact_registry/list_tags.rb | 32 +- .../artifact_registry/list_versions.rb | 32 +- .../artifact_registry/set_iam_policy.rb | 22 +- .../artifact_registry/test_iam_permissions.rb | 22 +- .../update_project_settings.rb | 22 +- .../artifact_registry/update_repository.rb | 22 +- .../snippets/artifact_registry/update_tag.rb | 22 +- ...gle.devtools.artifactregistry.v1beta2.json | 50 +-- google-cloud-asset-v1/.repo-metadata.json | 2 +- google-cloud-asset-v1/.rubocop.yml | 3 + google-cloud-asset-v1/snippets/Gemfile | 4 +- .../asset_service/analyze_iam_policy.rb | 22 +- .../analyze_iam_policy_longrunning.rb | 34 +- .../snippets/asset_service/analyze_move.rb | 22 +- .../asset_service/batch_get_assets_history.rb | 22 +- .../batch_get_effective_iam_policies.rb | 22 +- .../snippets/asset_service/create_feed.rb | 22 +- .../asset_service/create_saved_query.rb | 22 +- .../snippets/asset_service/delete_feed.rb | 22 +- .../asset_service/delete_saved_query.rb | 22 +- .../snippets/asset_service/export_assets.rb | 34 +- .../snippets/asset_service/get_feed.rb | 22 +- .../snippets/asset_service/get_saved_query.rb | 22 +- .../snippets/asset_service/list_assets.rb | 32 +- .../snippets/asset_service/list_feeds.rb | 22 +- .../asset_service/list_saved_queries.rb | 32 +- .../snippets/asset_service/query_assets.rb | 22 +- .../asset_service/search_all_iam_policies.rb | 32 +- .../asset_service/search_all_resources.rb | 32 +- .../snippets/asset_service/update_feed.rb | 22 +- .../asset_service/update_saved_query.rb | 22 +- ...nippet_metadata_google.cloud.asset.v1.json | 40 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../acknowledge_violation.rb | 22 +- .../create_workload.rb | 34 +- .../delete_workload.rb | 22 +- .../get_violation.rb | 22 +- .../assured_workloads_service/get_workload.rb | 22 +- .../list_violations.rb | 32 +- .../list_workloads.rb | 32 +- .../restrict_allowed_resources.rb | 22 +- .../update_workload.rb | 22 +- ...data_google.cloud.assuredworkloads.v1.json | 18 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../analyze_workload_move.rb | 22 +- .../create_workload.rb | 34 +- .../delete_workload.rb | 22 +- .../assured_workloads_service/get_workload.rb | 22 +- .../list_workloads.rb | 32 +- .../restrict_allowed_resources.rb | 22 +- .../update_workload.rb | 22 +- ...google.cloud.assuredworkloads.v1beta1.json | 14 +- google-cloud-automl-v1/.repo-metadata.json | 2 +- google-cloud-automl-v1/.rubocop.yml | 3 + google-cloud-automl-v1/snippets/Gemfile | 4 +- .../snippets/automl/create_dataset.rb | 34 +- .../snippets/automl/create_model.rb | 34 +- .../snippets/automl/delete_dataset.rb | 34 +- .../snippets/automl/delete_model.rb | 34 +- .../snippets/automl/deploy_model.rb | 34 +- .../snippets/automl/export_data.rb | 34 +- .../snippets/automl/export_model.rb | 34 +- .../snippets/automl/get_annotation_spec.rb | 22 +- .../snippets/automl/get_dataset.rb | 22 +- .../snippets/automl/get_model.rb | 22 +- .../snippets/automl/get_model_evaluation.rb | 22 +- .../snippets/automl/import_data.rb | 34 +- .../snippets/automl/list_datasets.rb | 32 +- .../snippets/automl/list_model_evaluations.rb | 32 +- .../snippets/automl/list_models.rb | 32 +- .../snippets/automl/undeploy_model.rb | 34 +- .../snippets/automl/update_dataset.rb | 22 +- .../snippets/automl/update_model.rb | 22 +- .../prediction_service/batch_predict.rb | 34 +- .../snippets/prediction_service/predict.rb | 22 +- ...ippet_metadata_google.cloud.automl.v1.json | 40 +- .../.repo-metadata.json | 2 +- google-cloud-automl-v1beta1/.rubocop.yml | 3 + google-cloud-automl-v1beta1/snippets/Gemfile | 4 +- .../snippets/automl/create_dataset.rb | 22 +- .../snippets/automl/create_model.rb | 34 +- .../snippets/automl/delete_dataset.rb | 34 +- .../snippets/automl/delete_model.rb | 34 +- .../snippets/automl/deploy_model.rb | 34 +- .../snippets/automl/export_data.rb | 34 +- .../automl/export_evaluated_examples.rb | 34 +- .../snippets/automl/export_model.rb | 34 +- .../snippets/automl/get_annotation_spec.rb | 22 +- .../snippets/automl/get_column_spec.rb | 22 +- .../snippets/automl/get_dataset.rb | 22 +- .../snippets/automl/get_model.rb | 22 +- .../snippets/automl/get_model_evaluation.rb | 22 +- .../snippets/automl/get_table_spec.rb | 22 +- .../snippets/automl/import_data.rb | 34 +- .../snippets/automl/list_column_specs.rb | 32 +- .../snippets/automl/list_datasets.rb | 32 +- .../snippets/automl/list_model_evaluations.rb | 32 +- .../snippets/automl/list_models.rb | 32 +- .../snippets/automl/list_table_specs.rb | 32 +- .../snippets/automl/undeploy_model.rb | 34 +- .../snippets/automl/update_column_spec.rb | 22 +- .../snippets/automl/update_dataset.rb | 22 +- .../snippets/automl/update_table_spec.rb | 22 +- .../prediction_service/batch_predict.rb | 34 +- .../snippets/prediction_service/predict.rb | 22 +- ..._metadata_google.cloud.automl.v1beta1.json | 52 +-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../bare_metal_solution/detach_lun.rb | 34 +- .../bare_metal_solution/get_instance.rb | 22 +- .../snippets/bare_metal_solution/get_lun.rb | 22 +- .../bare_metal_solution/get_network.rb | 22 +- .../bare_metal_solution/get_nfs_share.rb | 22 +- .../bare_metal_solution/get_volume.rb | 22 +- .../bare_metal_solution/list_instances.rb | 32 +- .../snippets/bare_metal_solution/list_luns.rb | 32 +- .../bare_metal_solution/list_network_usage.rb | 22 +- .../bare_metal_solution/list_networks.rb | 32 +- .../bare_metal_solution/list_nfs_shares.rb | 32 +- .../bare_metal_solution/list_volumes.rb | 32 +- .../bare_metal_solution/reset_instance.rb | 34 +- .../bare_metal_solution/resize_volume.rb | 34 +- .../bare_metal_solution/start_instance.rb | 34 +- .../bare_metal_solution/stop_instance.rb | 34 +- .../bare_metal_solution/update_instance.rb | 34 +- .../bare_metal_solution/update_network.rb | 34 +- .../bare_metal_solution/update_nfs_share.rb | 34 +- .../bare_metal_solution/update_volume.rb | 34 +- ...ata_google.cloud.baremetalsolution.v2.json | 40 +- google-cloud-batch-v1/.rubocop.yml | 3 + google-cloud-batch-v1/snippets/Gemfile | 4 +- .../snippets/batch_service/create_job.rb | 22 +- .../snippets/batch_service/delete_job.rb | 34 +- .../snippets/batch_service/get_job.rb | 22 +- .../snippets/batch_service/get_task.rb | 22 +- .../snippets/batch_service/list_jobs.rb | 32 +- .../snippets/batch_service/list_tasks.rb | 32 +- ...nippet_metadata_google.cloud.batch.v1.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_app_connection.rb | 34 +- .../delete_app_connection.rb | 34 +- .../get_app_connection.rb | 22 +- .../list_app_connections.rb | 32 +- .../resolve_app_connections.rb | 32 +- .../update_app_connection.rb | 34 +- ...le.cloud.beyondcorp.appconnections.v1.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_app_connector.rb | 34 +- .../delete_app_connector.rb | 34 +- .../get_app_connector.rb | 22 +- .../list_app_connectors.rb | 32 +- .../app_connectors_service/report_status.rb | 34 +- .../update_app_connector.rb | 34 +- ...gle.cloud.beyondcorp.appconnectors.v1.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_app_gateway.rb | 34 +- .../delete_app_gateway.rb | 34 +- .../app_gateways_service/get_app_gateway.rb | 22 +- .../app_gateways_service/list_app_gateways.rb | 32 +- ...oogle.cloud.beyondcorp.appgateways.v1.json | 8 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_client_connector_service.rb | 34 +- .../delete_client_connector_service.rb | 34 +- .../get_client_connector_service.rb | 22 +- .../list_client_connector_services.rb | 32 +- .../update_client_connector_service.rb | 34 +- ...beyondcorp.clientconnectorservices.v1.json | 10 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_client_gateway.rb | 34 +- .../delete_client_gateway.rb | 34 +- .../get_client_gateway.rb | 22 +- .../list_client_gateways.rb | 32 +- ...le.cloud.beyondcorp.clientgateways.v1.json | 8 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_data_exchange.rb | 22 +- .../analytics_hub_service/create_listing.rb | 22 +- .../delete_data_exchange.rb | 22 +- .../analytics_hub_service/delete_listing.rb | 22 +- .../get_data_exchange.rb | 22 +- .../analytics_hub_service/get_iam_policy.rb | 22 +- .../analytics_hub_service/get_listing.rb | 22 +- .../list_data_exchanges.rb | 32 +- .../analytics_hub_service/list_listings.rb | 32 +- .../list_org_data_exchanges.rb | 32 +- .../analytics_hub_service/set_iam_policy.rb | 22 +- .../subscribe_listing.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../update_data_exchange.rb | 22 +- .../analytics_hub_service/update_listing.rb | 22 +- ...google.cloud.bigquery.analyticshub.v1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../connection_service/create_connection.rb | 22 +- .../connection_service/delete_connection.rb | 22 +- .../connection_service/get_connection.rb | 22 +- .../connection_service/get_iam_policy.rb | 22 +- .../connection_service/list_connections.rb | 32 +- .../connection_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../connection_service/update_connection.rb | 22 +- ...a_google.cloud.bigquery.connection.v1.json | 16 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_data_exchange.rb | 22 +- .../analytics_hub_service/create_listing.rb | 22 +- .../delete_data_exchange.rb | 22 +- .../analytics_hub_service/delete_listing.rb | 22 +- .../get_data_exchange.rb | 22 +- .../analytics_hub_service/get_iam_policy.rb | 22 +- .../analytics_hub_service/get_listing.rb | 22 +- .../list_data_exchanges.rb | 32 +- .../analytics_hub_service/list_listings.rb | 32 +- .../list_org_data_exchanges.rb | 32 +- .../analytics_hub_service/set_iam_policy.rb | 22 +- .../subscribe_listing.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../update_data_exchange.rb | 22 +- .../analytics_hub_service/update_listing.rb | 22 +- ...e.cloud.bigquery.dataexchange.v1beta1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../data_policy_service/create_data_policy.rb | 22 +- .../data_policy_service/delete_data_policy.rb | 22 +- .../data_policy_service/get_data_policy.rb | 22 +- .../data_policy_service/get_iam_policy.rb | 22 +- .../data_policy_service/list_data_policies.rb | 32 +- .../data_policy_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../data_policy_service/update_data_policy.rb | 22 +- ...e.cloud.bigquery.datapolicies.v1beta1.json | 16 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../check_valid_creds.rb | 22 +- .../create_transfer_config.rb | 22 +- .../delete_transfer_config.rb | 22 +- .../delete_transfer_run.rb | 22 +- .../enroll_data_sources.rb | 22 +- .../data_transfer_service/get_data_source.rb | 22 +- .../get_transfer_config.rb | 22 +- .../data_transfer_service/get_transfer_run.rb | 22 +- .../list_data_sources.rb | 32 +- .../list_transfer_configs.rb | 32 +- .../list_transfer_logs.rb | 32 +- .../list_transfer_runs.rb | 32 +- .../schedule_transfer_runs.rb | 22 +- .../start_manual_transfer_runs.rb | 22 +- .../update_transfer_config.rb | 22 +- ...google.cloud.bigquery.datatransfer.v1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_migration_workflow.rb | 22 +- .../delete_migration_workflow.rb | 22 +- .../get_migration_subtask.rb | 22 +- .../get_migration_workflow.rb | 22 +- .../list_migration_subtasks.rb | 32 +- .../list_migration_workflows.rb | 32 +- .../start_migration_workflow.rb | 22 +- ...ta_google.cloud.bigquery.migration.v2.json | 14 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../reservation_service/create_assignment.rb | 22 +- .../create_capacity_commitment.rb | 22 +- .../reservation_service/create_reservation.rb | 22 +- .../reservation_service/delete_assignment.rb | 22 +- .../delete_capacity_commitment.rb | 22 +- .../reservation_service/delete_reservation.rb | 22 +- .../reservation_service/get_bi_reservation.rb | 22 +- .../get_capacity_commitment.rb | 22 +- .../reservation_service/get_reservation.rb | 22 +- .../reservation_service/list_assignments.rb | 32 +- .../list_capacity_commitments.rb | 32 +- .../reservation_service/list_reservations.rb | 32 +- .../merge_capacity_commitments.rb | 22 +- .../reservation_service/move_assignment.rb | 22 +- .../search_all_assignments.rb | 32 +- .../reservation_service/search_assignments.rb | 32 +- .../split_capacity_commitment.rb | 22 +- .../reservation_service/update_assignment.rb | 22 +- .../update_bi_reservation.rb | 22 +- .../update_capacity_commitment.rb | 22 +- .../reservation_service/update_reservation.rb | 22 +- ..._google.cloud.bigquery.reservation.v1.json | 42 +- google-cloud-bigquery-storage-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../big_query_read/create_read_session.rb | 22 +- .../snippets/big_query_read/read_rows.rb | 26 +- .../big_query_read/split_read_stream.rb | 22 +- .../snippets/big_query_write/append_rows.rb | 44 +- .../batch_commit_write_streams.rb | 22 +- .../big_query_write/create_write_stream.rb | 22 +- .../big_query_write/finalize_write_stream.rb | 22 +- .../snippets/big_query_write/flush_rows.rb | 22 +- .../big_query_write/get_write_stream.rb | 22 +- ...data_google.cloud.bigquery.storage.v1.json | 18 +- google-cloud-bigtable-admin-v2/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_app_profile.rb | 22 +- .../bigtable_instance_admin/create_cluster.rb | 34 +- .../create_instance.rb | 34 +- .../delete_app_profile.rb | 22 +- .../bigtable_instance_admin/delete_cluster.rb | 22 +- .../delete_instance.rb | 22 +- .../get_app_profile.rb | 22 +- .../bigtable_instance_admin/get_cluster.rb | 22 +- .../bigtable_instance_admin/get_iam_policy.rb | 22 +- .../bigtable_instance_admin/get_instance.rb | 22 +- .../list_app_profiles.rb | 32 +- .../bigtable_instance_admin/list_clusters.rb | 22 +- .../list_hot_tablets.rb | 32 +- .../bigtable_instance_admin/list_instances.rb | 22 +- .../partial_update_cluster.rb | 34 +- .../partial_update_instance.rb | 34 +- .../bigtable_instance_admin/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../update_app_profile.rb | 34 +- .../bigtable_instance_admin/update_cluster.rb | 34 +- .../update_instance.rb | 22 +- .../bigtable_table_admin/check_consistency.rb | 22 +- .../bigtable_table_admin/create_backup.rb | 34 +- .../bigtable_table_admin/create_table.rb | 22 +- .../create_table_from_snapshot.rb | 34 +- .../bigtable_table_admin/delete_backup.rb | 22 +- .../bigtable_table_admin/delete_snapshot.rb | 22 +- .../bigtable_table_admin/delete_table.rb | 22 +- .../bigtable_table_admin/drop_row_range.rb | 22 +- .../generate_consistency_token.rb | 22 +- .../bigtable_table_admin/get_backup.rb | 22 +- .../bigtable_table_admin/get_iam_policy.rb | 22 +- .../bigtable_table_admin/get_snapshot.rb | 22 +- .../bigtable_table_admin/get_table.rb | 22 +- .../bigtable_table_admin/list_backups.rb | 32 +- .../bigtable_table_admin/list_snapshots.rb | 32 +- .../bigtable_table_admin/list_tables.rb | 32 +- .../modify_column_families.rb | 22 +- .../bigtable_table_admin/restore_table.rb | 34 +- .../bigtable_table_admin/set_iam_policy.rb | 22 +- .../bigtable_table_admin/snapshot_table.rb | 34 +- .../test_iam_permissions.rb | 22 +- .../bigtable_table_admin/undelete_table.rb | 34 +- .../bigtable_table_admin/update_backup.rb | 22 +- .../bigtable_table_admin/update_table.rb | 34 +- ...pet_metadata_google.bigtable.admin.v2.json | 90 ++-- google-cloud-bigtable-v2/.repo-metadata.json | 2 +- google-cloud-bigtable-v2/.rubocop.yml | 3 + google-cloud-bigtable-v2/snippets/Gemfile | 4 +- .../snippets/bigtable/check_and_mutate_row.rb | 22 +- .../snippets/bigtable/mutate_row.rb | 22 +- .../snippets/bigtable/mutate_rows.rb | 26 +- .../snippets/bigtable/ping_and_warm.rb | 22 +- .../bigtable/read_modify_write_row.rb | 22 +- .../snippets/bigtable/read_rows.rb | 26 +- .../snippets/bigtable/sample_row_keys.rb | 26 +- .../snippet_metadata_google.bigtable.v2.json | 14 +- google-cloud-billing-budgets-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/budget_service/create_budget.rb | 22 +- .../snippets/budget_service/delete_budget.rb | 22 +- .../snippets/budget_service/get_budget.rb | 22 +- .../snippets/budget_service/list_budgets.rb | 32 +- .../snippets/budget_service/update_budget.rb | 22 +- ...adata_google.cloud.billing.budgets.v1.json | 10 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/budget_service/create_budget.rb | 22 +- .../snippets/budget_service/delete_budget.rb | 22 +- .../snippets/budget_service/get_budget.rb | 22 +- .../snippets/budget_service/list_budgets.rb | 32 +- .../snippets/budget_service/update_budget.rb | 22 +- ..._google.cloud.billing.budgets.v1beta1.json | 10 +- google-cloud-billing-v1/.rubocop.yml | 3 + google-cloud-billing-v1/snippets/Gemfile | 4 +- .../cloud_billing/create_billing_account.rb | 22 +- .../cloud_billing/get_billing_account.rb | 22 +- .../snippets/cloud_billing/get_iam_policy.rb | 22 +- .../cloud_billing/get_project_billing_info.rb | 22 +- .../cloud_billing/list_billing_accounts.rb | 32 +- .../list_project_billing_info.rb | 32 +- .../snippets/cloud_billing/set_iam_policy.rb | 22 +- .../cloud_billing/test_iam_permissions.rb | 22 +- .../cloud_billing/update_billing_account.rb | 22 +- .../update_project_billing_info.rb | 22 +- .../snippets/cloud_catalog/list_services.rb | 32 +- .../snippets/cloud_catalog/list_skus.rb | 32 +- ...ppet_metadata_google.cloud.billing.v1.json | 24 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_attestor.rb | 22 +- .../delete_attestor.rb | 22 +- .../get_attestor.rb | 22 +- .../binauthz_management_service/get_policy.rb | 22 +- .../list_attestors.rb | 32 +- .../update_attestor.rb | 22 +- .../update_policy.rb | 22 +- ...a_google.cloud.binaryauthorization.v1.json | 18 +- .../system_policy/get_system_policy.rb | 22 +- .../validate_attestation_occurrence.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_attestor.rb | 22 +- .../delete_attestor.rb | 22 +- .../get_attestor.rb | 22 +- .../binauthz_management_service/get_policy.rb | 22 +- .../list_attestors.rb | 32 +- .../update_attestor.rb | 22 +- .../update_policy.rb | 22 +- ...gle.cloud.binaryauthorization.v1beta1.json | 16 +- .../system_policy/get_system_policy.rb | 22 +- google-cloud-build-v1/.rubocop.yml | 3 + google-cloud-build-v1/snippets/Gemfile | 4 +- .../snippets/cloud_build/approve_build.rb | 34 +- .../snippets/cloud_build/cancel_build.rb | 22 +- .../snippets/cloud_build/create_build.rb | 34 +- .../cloud_build/create_build_trigger.rb | 22 +- .../cloud_build/create_worker_pool.rb | 34 +- .../cloud_build/delete_build_trigger.rb | 22 +- .../cloud_build/delete_worker_pool.rb | 34 +- .../snippets/cloud_build/get_build.rb | 22 +- .../snippets/cloud_build/get_build_trigger.rb | 22 +- .../snippets/cloud_build/get_worker_pool.rb | 22 +- .../cloud_build/list_build_triggers.rb | 32 +- .../snippets/cloud_build/list_builds.rb | 32 +- .../snippets/cloud_build/list_worker_pools.rb | 32 +- .../cloud_build/receive_trigger_webhook.rb | 22 +- .../snippets/cloud_build/retry_build.rb | 34 +- .../snippets/cloud_build/run_build_trigger.rb | 34 +- .../cloud_build/update_build_trigger.rb | 22 +- .../cloud_build/update_worker_pool.rb | 34 +- ...etadata_google.devtools.cloudbuild.v1.json | 36 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../certificate_manager/create_certificate.rb | 34 +- .../create_certificate_issuance_config.rb | 34 +- .../create_certificate_map.rb | 34 +- .../create_certificate_map_entry.rb | 34 +- .../create_dns_authorization.rb | 34 +- .../certificate_manager/delete_certificate.rb | 34 +- .../delete_certificate_issuance_config.rb | 34 +- .../delete_certificate_map.rb | 34 +- .../delete_certificate_map_entry.rb | 34 +- .../delete_dns_authorization.rb | 34 +- .../certificate_manager/get_certificate.rb | 22 +- .../get_certificate_issuance_config.rb | 22 +- .../get_certificate_map.rb | 22 +- .../get_certificate_map_entry.rb | 22 +- .../get_dns_authorization.rb | 22 +- .../list_certificate_issuance_configs.rb | 32 +- .../list_certificate_map_entries.rb | 32 +- .../list_certificate_maps.rb | 32 +- .../certificate_manager/list_certificates.rb | 32 +- .../list_dns_authorizations.rb | 32 +- .../certificate_manager/update_certificate.rb | 34 +- .../update_certificate_map.rb | 34 +- .../update_certificate_map_entry.rb | 34 +- .../update_dns_authorization.rb | 34 +- ...ta_google.cloud.certificatemanager.v1.json | 48 +-- google-cloud-channel-v1/.rubocop.yml | 3 + google-cloud-channel-v1/snippets/Gemfile | 4 +- .../fetch_report_results.rb | 32 +- .../list_reports.rb | 32 +- .../run_report_job.rb | 34 +- .../activate_entitlement.rb | 34 +- .../cancel_entitlement.rb | 34 +- .../cloud_channel_service/change_offer.rb | 34 +- .../change_parameters.rb | 34 +- .../change_renewal_settings.rb | 34 +- .../check_cloud_identity_accounts_exist.rb | 22 +- .../create_channel_partner_link.rb | 22 +- ...create_channel_partner_repricing_config.rb | 22 +- .../cloud_channel_service/create_customer.rb | 22 +- .../create_customer_repricing_config.rb | 22 +- .../create_entitlement.rb | 34 +- ...delete_channel_partner_repricing_config.rb | 22 +- .../cloud_channel_service/delete_customer.rb | 22 +- .../delete_customer_repricing_config.rb | 22 +- .../get_channel_partner_link.rb | 22 +- .../get_channel_partner_repricing_config.rb | 22 +- .../cloud_channel_service/get_customer.rb | 22 +- .../get_customer_repricing_config.rb | 22 +- .../cloud_channel_service/get_entitlement.rb | 22 +- .../cloud_channel_service/import_customer.rb | 22 +- .../list_channel_partner_links.rb | 32 +- .../list_channel_partner_repricing_configs.rb | 32 +- .../list_customer_repricing_configs.rb | 32 +- .../cloud_channel_service/list_customers.rb | 32 +- .../list_entitlements.rb | 32 +- .../cloud_channel_service/list_offers.rb | 32 +- .../cloud_channel_service/list_products.rb | 32 +- .../list_purchasable_offers.rb | 32 +- .../list_purchasable_skus.rb | 32 +- .../cloud_channel_service/list_skus.rb | 32 +- .../cloud_channel_service/list_subscribers.rb | 22 +- .../list_transferable_offers.rb | 32 +- .../list_transferable_skus.rb | 32 +- .../cloud_channel_service/lookup_offer.rb | 22 +- .../provision_cloud_identity.rb | 34 +- .../register_subscriber.rb | 22 +- .../start_paid_service.rb | 34 +- .../suspend_entitlement.rb | 34 +- .../transfer_entitlements.rb | 34 +- .../transfer_entitlements_to_google.rb | 34 +- .../unregister_subscriber.rb | 22 +- .../update_channel_partner_link.rb | 22 +- ...update_channel_partner_repricing_config.rb | 22 +- .../cloud_channel_service/update_customer.rb | 22 +- .../update_customer_repricing_config.rb | 22 +- ...ppet_metadata_google.cloud.channel.v1.json | 96 ++--- google-cloud-cloud_dms-v1/.rubocop.yml | 3 + google-cloud-cloud_dms-v1/snippets/Gemfile | 4 +- .../create_connection_profile.rb | 34 +- .../create_migration_job.rb | 34 +- .../delete_connection_profile.rb | 34 +- .../delete_migration_job.rb | 34 +- .../generate_ssh_script.rb | 22 +- .../get_connection_profile.rb | 22 +- .../get_migration_job.rb | 22 +- .../list_connection_profiles.rb | 32 +- .../list_migration_jobs.rb | 32 +- .../promote_migration_job.rb | 34 +- .../restart_migration_job.rb | 34 +- .../resume_migration_job.rb | 34 +- .../start_migration_job.rb | 34 +- .../stop_migration_job.rb | 34 +- .../update_connection_profile.rb | 34 +- .../update_migration_job.rb | 34 +- .../verify_migration_job.rb | 34 +- ...pet_metadata_google.cloud.clouddms.v1.json | 34 +- google-cloud-compute-v1/.repo-metadata.json | 2 +- google-cloud-compute-v1/.rubocop.yml | 3 + .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../calculate_issue_model_stats.rb | 22 +- .../calculate_stats.rb | 22 +- .../create_analysis.rb | 34 +- .../create_conversation.rb | 22 +- .../create_issue_model.rb | 34 +- .../create_phrase_matcher.rb | 22 +- .../contact_center_insights/create_view.rb | 22 +- .../delete_analysis.rb | 22 +- .../delete_conversation.rb | 22 +- .../delete_issue_model.rb | 34 +- .../delete_phrase_matcher.rb | 22 +- .../contact_center_insights/delete_view.rb | 22 +- .../deploy_issue_model.rb | 34 +- .../export_insights_data.rb | 34 +- .../contact_center_insights/get_analysis.rb | 22 +- .../get_conversation.rb | 22 +- .../contact_center_insights/get_issue.rb | 22 +- .../get_issue_model.rb | 22 +- .../get_phrase_matcher.rb | 22 +- .../contact_center_insights/get_settings.rb | 22 +- .../contact_center_insights/get_view.rb | 22 +- .../contact_center_insights/list_analyses.rb | 32 +- .../list_conversations.rb | 32 +- .../list_issue_models.rb | 22 +- .../contact_center_insights/list_issues.rb | 22 +- .../list_phrase_matchers.rb | 32 +- .../contact_center_insights/list_views.rb | 32 +- .../undeploy_issue_model.rb | 34 +- .../update_conversation.rb | 22 +- .../contact_center_insights/update_issue.rb | 22 +- .../update_issue_model.rb | 22 +- .../update_phrase_matcher.rb | 22 +- .../update_settings.rb | 22 +- .../contact_center_insights/update_view.rb | 22 +- ...google.cloud.contactcenterinsights.v1.json | 68 +-- google-cloud-container-v1/.rubocop.yml | 3 + google-cloud-container-v1/snippets/Gemfile | 4 +- .../cluster_manager/cancel_operation.rb | 22 +- .../cluster_manager/complete_ip_rotation.rb | 22 +- .../complete_node_pool_upgrade.rb | 22 +- .../cluster_manager/create_cluster.rb | 22 +- .../cluster_manager/create_node_pool.rb | 22 +- .../cluster_manager/delete_cluster.rb | 22 +- .../cluster_manager/delete_node_pool.rb | 22 +- .../snippets/cluster_manager/get_cluster.rb | 22 +- .../cluster_manager/get_json_web_keys.rb | 22 +- .../snippets/cluster_manager/get_node_pool.rb | 22 +- .../snippets/cluster_manager/get_operation.rb | 22 +- .../cluster_manager/get_server_config.rb | 22 +- .../snippets/cluster_manager/list_clusters.rb | 22 +- .../cluster_manager/list_node_pools.rb | 22 +- .../cluster_manager/list_operations.rb | 22 +- .../list_usable_subnetworks.rb | 32 +- .../rollback_node_pool_upgrade.rb | 22 +- .../cluster_manager/set_addons_config.rb | 22 +- .../snippets/cluster_manager/set_labels.rb | 22 +- .../cluster_manager/set_legacy_abac.rb | 22 +- .../snippets/cluster_manager/set_locations.rb | 22 +- .../cluster_manager/set_logging_service.rb | 22 +- .../cluster_manager/set_maintenance_policy.rb | 22 +- .../cluster_manager/set_master_auth.rb | 22 +- .../cluster_manager/set_monitoring_service.rb | 22 +- .../cluster_manager/set_network_policy.rb | 22 +- .../set_node_pool_autoscaling.rb | 22 +- .../set_node_pool_management.rb | 22 +- .../cluster_manager/set_node_pool_size.rb | 22 +- .../cluster_manager/start_ip_rotation.rb | 22 +- .../cluster_manager/update_cluster.rb | 22 +- .../snippets/cluster_manager/update_master.rb | 22 +- .../cluster_manager/update_node_pool.rb | 22 +- .../snippet_metadata_google.container.v1.json | 66 +-- google-cloud-container-v1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../cluster_manager/cancel_operation.rb | 22 +- .../cluster_manager/complete_ip_rotation.rb | 22 +- .../complete_node_pool_upgrade.rb | 22 +- .../cluster_manager/create_cluster.rb | 22 +- .../cluster_manager/create_node_pool.rb | 22 +- .../cluster_manager/delete_cluster.rb | 22 +- .../cluster_manager/delete_node_pool.rb | 22 +- .../snippets/cluster_manager/get_cluster.rb | 22 +- .../cluster_manager/get_json_web_keys.rb | 22 +- .../snippets/cluster_manager/get_node_pool.rb | 22 +- .../snippets/cluster_manager/get_operation.rb | 22 +- .../cluster_manager/get_server_config.rb | 22 +- .../snippets/cluster_manager/list_clusters.rb | 22 +- .../cluster_manager/list_locations.rb | 22 +- .../cluster_manager/list_node_pools.rb | 22 +- .../cluster_manager/list_operations.rb | 22 +- .../list_usable_subnetworks.rb | 32 +- .../rollback_node_pool_upgrade.rb | 22 +- .../cluster_manager/set_addons_config.rb | 22 +- .../snippets/cluster_manager/set_labels.rb | 22 +- .../cluster_manager/set_legacy_abac.rb | 22 +- .../snippets/cluster_manager/set_locations.rb | 22 +- .../cluster_manager/set_logging_service.rb | 22 +- .../cluster_manager/set_maintenance_policy.rb | 22 +- .../cluster_manager/set_master_auth.rb | 22 +- .../cluster_manager/set_monitoring_service.rb | 22 +- .../cluster_manager/set_network_policy.rb | 22 +- .../set_node_pool_autoscaling.rb | 22 +- .../set_node_pool_management.rb | 22 +- .../cluster_manager/set_node_pool_size.rb | 22 +- .../cluster_manager/start_ip_rotation.rb | 22 +- .../cluster_manager/update_cluster.rb | 22 +- .../snippets/cluster_manager/update_master.rb | 22 +- .../cluster_manager/update_node_pool.rb | 22 +- ...pet_metadata_google.container.v1beta1.json | 68 +-- .../.repo-metadata.json | 2 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../container_analysis/get_iam_policy.rb | 22 +- .../get_vulnerability_occurrences_summary.rb | 22 +- .../container_analysis/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- ..._google.devtools.containeranalysis.v1.json | 8 +- google-cloud-data_catalog-v1/.rubocop.yml | 3 + google-cloud-data_catalog-v1/snippets/Gemfile | 4 +- .../snippets/data_catalog/create_entry.rb | 22 +- .../data_catalog/create_entry_group.rb | 22 +- .../snippets/data_catalog/create_tag.rb | 22 +- .../data_catalog/create_tag_template.rb | 22 +- .../data_catalog/create_tag_template_field.rb | 22 +- .../snippets/data_catalog/delete_entry.rb | 22 +- .../data_catalog/delete_entry_group.rb | 22 +- .../snippets/data_catalog/delete_tag.rb | 22 +- .../data_catalog/delete_tag_template.rb | 22 +- .../data_catalog/delete_tag_template_field.rb | 22 +- .../snippets/data_catalog/get_entry.rb | 22 +- .../snippets/data_catalog/get_entry_group.rb | 22 +- .../snippets/data_catalog/get_iam_policy.rb | 22 +- .../snippets/data_catalog/get_tag_template.rb | 22 +- .../snippets/data_catalog/list_entries.rb | 32 +- .../data_catalog/list_entry_groups.rb | 32 +- .../snippets/data_catalog/list_tags.rb | 32 +- .../snippets/data_catalog/lookup_entry.rb | 22 +- .../data_catalog/modify_entry_contacts.rb | 22 +- .../data_catalog/modify_entry_overview.rb | 22 +- .../data_catalog/rename_tag_template_field.rb | 22 +- .../rename_tag_template_field_enum_value.rb | 22 +- .../snippets/data_catalog/search_catalog.rb | 32 +- .../snippets/data_catalog/set_iam_policy.rb | 22 +- .../snippets/data_catalog/star_entry.rb | 22 +- .../data_catalog/test_iam_permissions.rb | 22 +- .../snippets/data_catalog/unstar_entry.rb | 22 +- .../snippets/data_catalog/update_entry.rb | 22 +- .../data_catalog/update_entry_group.rb | 22 +- .../snippets/data_catalog/update_tag.rb | 22 +- .../data_catalog/update_tag_template.rb | 22 +- .../data_catalog/update_tag_template_field.rb | 22 +- .../policy_tag_manager/create_policy_tag.rb | 22 +- .../policy_tag_manager/create_taxonomy.rb | 22 +- .../policy_tag_manager/delete_policy_tag.rb | 22 +- .../policy_tag_manager/delete_taxonomy.rb | 22 +- .../policy_tag_manager/get_iam_policy.rb | 22 +- .../policy_tag_manager/get_policy_tag.rb | 22 +- .../policy_tag_manager/get_taxonomy.rb | 22 +- .../policy_tag_manager/list_policy_tags.rb | 32 +- .../policy_tag_manager/list_taxonomies.rb | 32 +- .../policy_tag_manager/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../policy_tag_manager/update_policy_tag.rb | 22 +- .../policy_tag_manager/update_taxonomy.rb | 22 +- .../export_taxonomies.rb | 22 +- .../import_taxonomies.rb | 22 +- .../replace_taxonomy.rb | 22 +- ..._metadata_google.cloud.datacatalog.v1.json | 96 ++--- google-cloud-data_fusion-v1/.rubocop.yml | 3 + google-cloud-data_fusion-v1/snippets/Gemfile | 4 +- .../snippets/data_fusion/create_instance.rb | 34 +- .../snippets/data_fusion/delete_instance.rb | 34 +- .../snippets/data_fusion/get_instance.rb | 22 +- .../data_fusion/list_available_versions.rb | 32 +- .../snippets/data_fusion/list_instances.rb | 32 +- .../snippets/data_fusion/restart_instance.rb | 34 +- .../snippets/data_fusion/update_instance.rb | 34 +- ...t_metadata_google.cloud.datafusion.v1.json | 14 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_annotation_spec_set.rb | 22 +- .../data_labeling_service/create_dataset.rb | 22 +- .../create_evaluation_job.rb | 22 +- .../create_instruction.rb | 34 +- .../delete_annotated_dataset.rb | 22 +- .../delete_annotation_spec_set.rb | 22 +- .../data_labeling_service/delete_dataset.rb | 22 +- .../delete_evaluation_job.rb | 22 +- .../delete_instruction.rb | 22 +- .../data_labeling_service/export_data.rb | 34 +- .../get_annotated_dataset.rb | 22 +- .../get_annotation_spec_set.rb | 22 +- .../data_labeling_service/get_data_item.rb | 22 +- .../data_labeling_service/get_dataset.rb | 22 +- .../data_labeling_service/get_evaluation.rb | 22 +- .../get_evaluation_job.rb | 22 +- .../data_labeling_service/get_example.rb | 22 +- .../data_labeling_service/get_instruction.rb | 22 +- .../data_labeling_service/import_data.rb | 34 +- .../data_labeling_service/label_image.rb | 34 +- .../data_labeling_service/label_text.rb | 34 +- .../data_labeling_service/label_video.rb | 34 +- .../list_annotated_datasets.rb | 32 +- .../list_annotation_spec_sets.rb | 32 +- .../data_labeling_service/list_data_items.rb | 32 +- .../data_labeling_service/list_datasets.rb | 32 +- .../list_evaluation_jobs.rb | 32 +- .../data_labeling_service/list_examples.rb | 32 +- .../list_instructions.rb | 32 +- .../pause_evaluation_job.rb | 22 +- .../resume_evaluation_job.rb | 22 +- .../search_evaluations.rb | 32 +- .../search_example_comparisons.rb | 32 +- .../update_evaluation_job.rb | 22 +- ...ata_google.cloud.datalabeling.v1beta1.json | 68 +-- google-cloud-dataflow-v1beta3/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../launch_flex_template.rb | 22 +- .../snippets/jobs/aggregated_list_jobs.rb | 32 +- .../snippets/jobs/check_active_jobs.rb | 22 +- .../snippets/jobs/create_job.rb | 22 +- .../snippets/jobs/get_job.rb | 22 +- .../snippets/jobs/list_jobs.rb | 32 +- .../snippets/jobs/snapshot_job.rb | 22 +- .../snippets/jobs/update_job.rb | 22 +- .../snippets/messages/list_job_messages.rb | 32 +- .../metrics/get_job_execution_details.rb | 32 +- .../snippets/metrics/get_job_metrics.rb | 22 +- .../metrics/get_stage_execution_details.rb | 32 +- .../snippets/snapshots/delete_snapshot.rb | 22 +- .../snippets/snapshots/get_snapshot.rb | 22 +- .../snippets/snapshots/list_snapshots.rb | 22 +- ...ppet_metadata_google.dataflow.v1beta3.json | 36 +- .../create_job_from_template.rb | 22 +- .../templates_service/get_template.rb | 22 +- .../templates_service/launch_template.rb | 22 +- google-cloud-dataform-v1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../dataform/cancel_workflow_invocation.rb | 22 +- .../dataform/commit_workspace_changes.rb | 22 +- .../dataform/create_compilation_result.rb | 22 +- .../snippets/dataform/create_repository.rb | 22 +- .../dataform/create_workflow_invocation.rb | 22 +- .../snippets/dataform/create_workspace.rb | 22 +- .../snippets/dataform/delete_repository.rb | 22 +- .../dataform/delete_workflow_invocation.rb | 22 +- .../snippets/dataform/delete_workspace.rb | 22 +- .../snippets/dataform/fetch_file_diff.rb | 22 +- .../dataform/fetch_file_git_statuses.rb | 22 +- .../dataform/fetch_git_ahead_behind.rb | 22 +- .../dataform/fetch_remote_branches.rb | 22 +- .../dataform/get_compilation_result.rb | 22 +- .../snippets/dataform/get_repository.rb | 22 +- .../dataform/get_workflow_invocation.rb | 22 +- .../snippets/dataform/get_workspace.rb | 22 +- .../snippets/dataform/install_npm_packages.rb | 22 +- .../dataform/list_compilation_results.rb | 32 +- .../snippets/dataform/list_repositories.rb | 32 +- .../dataform/list_workflow_invocations.rb | 32 +- .../snippets/dataform/list_workspaces.rb | 32 +- .../snippets/dataform/make_directory.rb | 22 +- .../snippets/dataform/move_directory.rb | 22 +- .../snippets/dataform/move_file.rb | 22 +- .../snippets/dataform/pull_git_commits.rb | 22 +- .../snippets/dataform/push_git_commits.rb | 22 +- .../query_compilation_result_actions.rb | 32 +- .../dataform/query_directory_contents.rb | 32 +- .../query_workflow_invocation_actions.rb | 32 +- .../snippets/dataform/read_file.rb | 22 +- .../snippets/dataform/remove_directory.rb | 22 +- .../snippets/dataform/remove_file.rb | 22 +- .../dataform/reset_workspace_changes.rb | 22 +- .../snippets/dataform/update_repository.rb | 22 +- .../snippets/dataform/write_file.rb | 22 +- ...etadata_google.cloud.dataform.v1beta1.json | 72 ++-- google-cloud-dataplex-v1/.rubocop.yml | 3 + google-cloud-dataplex-v1/snippets/Gemfile | 4 +- .../content_service/create_content.rb | 22 +- .../content_service/delete_content.rb | 22 +- .../snippets/content_service/get_content.rb | 22 +- .../content_service/get_iam_policy.rb | 22 +- .../snippets/content_service/list_content.rb | 32 +- .../content_service/set_iam_policy.rb | 22 +- .../content_service/test_iam_permissions.rb | 22 +- .../content_service/update_content.rb | 22 +- .../snippets/dataplex_service/cancel_job.rb | 22 +- .../snippets/dataplex_service/create_asset.rb | 34 +- .../dataplex_service/create_environment.rb | 34 +- .../snippets/dataplex_service/create_lake.rb | 34 +- .../snippets/dataplex_service/create_task.rb | 34 +- .../snippets/dataplex_service/create_zone.rb | 34 +- .../snippets/dataplex_service/delete_asset.rb | 34 +- .../dataplex_service/delete_environment.rb | 34 +- .../snippets/dataplex_service/delete_lake.rb | 34 +- .../snippets/dataplex_service/delete_task.rb | 34 +- .../snippets/dataplex_service/delete_zone.rb | 34 +- .../snippets/dataplex_service/get_asset.rb | 22 +- .../dataplex_service/get_environment.rb | 22 +- .../snippets/dataplex_service/get_job.rb | 22 +- .../snippets/dataplex_service/get_lake.rb | 22 +- .../snippets/dataplex_service/get_task.rb | 22 +- .../snippets/dataplex_service/get_zone.rb | 22 +- .../dataplex_service/list_asset_actions.rb | 32 +- .../snippets/dataplex_service/list_assets.rb | 32 +- .../dataplex_service/list_environments.rb | 32 +- .../snippets/dataplex_service/list_jobs.rb | 32 +- .../dataplex_service/list_lake_actions.rb | 32 +- .../snippets/dataplex_service/list_lakes.rb | 32 +- .../dataplex_service/list_sessions.rb | 32 +- .../snippets/dataplex_service/list_tasks.rb | 32 +- .../dataplex_service/list_zone_actions.rb | 32 +- .../snippets/dataplex_service/list_zones.rb | 32 +- .../snippets/dataplex_service/update_asset.rb | 34 +- .../dataplex_service/update_environment.rb | 34 +- .../snippets/dataplex_service/update_lake.rb | 34 +- .../snippets/dataplex_service/update_task.rb | 34 +- .../snippets/dataplex_service/update_zone.rb | 34 +- .../metadata_service/create_entity.rb | 22 +- .../metadata_service/create_partition.rb | 22 +- .../metadata_service/delete_entity.rb | 22 +- .../metadata_service/delete_partition.rb | 22 +- .../snippets/metadata_service/get_entity.rb | 22 +- .../metadata_service/get_partition.rb | 22 +- .../metadata_service/list_entities.rb | 32 +- .../metadata_service/list_partitions.rb | 32 +- .../metadata_service/update_entity.rb | 22 +- ...pet_metadata_google.cloud.dataplex.v1.json | 98 ++--- google-cloud-dataproc-v1/.rubocop.yml | 3 + google-cloud-dataproc-v1/snippets/Gemfile | 4 +- .../create_autoscaling_policy.rb | 22 +- .../delete_autoscaling_policy.rb | 22 +- .../get_autoscaling_policy.rb | 22 +- .../list_autoscaling_policies.rb | 32 +- .../update_autoscaling_policy.rb | 22 +- .../snippets/batch_controller/create_batch.rb | 34 +- .../snippets/batch_controller/delete_batch.rb | 22 +- .../snippets/batch_controller/get_batch.rb | 22 +- .../snippets/batch_controller/list_batches.rb | 32 +- .../cluster_controller/create_cluster.rb | 34 +- .../cluster_controller/delete_cluster.rb | 34 +- .../cluster_controller/diagnose_cluster.rb | 34 +- .../cluster_controller/get_cluster.rb | 22 +- .../cluster_controller/list_clusters.rb | 32 +- .../cluster_controller/start_cluster.rb | 34 +- .../cluster_controller/stop_cluster.rb | 34 +- .../cluster_controller/update_cluster.rb | 34 +- .../snippets/job_controller/cancel_job.rb | 22 +- .../snippets/job_controller/delete_job.rb | 22 +- .../snippets/job_controller/get_job.rb | 22 +- .../snippets/job_controller/list_jobs.rb | 32 +- .../snippets/job_controller/submit_job.rb | 22 +- .../job_controller/submit_job_as_operation.rb | 34 +- .../snippets/job_controller/update_job.rb | 22 +- ...pet_metadata_google.cloud.dataproc.v1.json | 62 +-- .../create_workflow_template.rb | 22 +- .../delete_workflow_template.rb | 22 +- .../get_workflow_template.rb | 22 +- .../instantiate_inline_workflow_template.rb | 34 +- .../instantiate_workflow_template.rb | 34 +- .../list_workflow_templates.rb | 32 +- .../update_workflow_template.rb | 22 +- google-cloud-dataqna-v1alpha/.rubocop.yml | 3 + google-cloud-dataqna-v1alpha/snippets/Gemfile | 4 +- .../suggest_queries.rb | 22 +- .../question_service/create_question.rb | 22 +- .../question_service/execute_question.rb | 22 +- .../snippets/question_service/get_question.rb | 22 +- .../question_service/get_user_feedback.rb | 22 +- .../question_service/update_user_feedback.rb | 22 +- ...metadata_google.cloud.dataqna.v1alpha.json | 12 +- google-cloud-datastore-admin-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/datastore_admin/create_index.rb | 34 +- .../snippets/datastore_admin/delete_index.rb | 34 +- .../datastore_admin/export_entities.rb | 34 +- .../snippets/datastore_admin/get_index.rb | 22 +- .../datastore_admin/import_entities.rb | 34 +- .../snippets/datastore_admin/list_indexes.rb | 32 +- ...et_metadata_google.datastore.admin.v1.json | 12 +- google-cloud-datastore-v1/.rubocop.yml | 3 + google-cloud-datastore-v1/snippets/Gemfile | 4 +- .../snippets/datastore/allocate_ids.rb | 22 +- .../snippets/datastore/begin_transaction.rb | 22 +- .../snippets/datastore/commit.rb | 22 +- .../snippets/datastore/lookup.rb | 22 +- .../snippets/datastore/reserve_ids.rb | 22 +- .../snippets/datastore/rollback.rb | 22 +- .../datastore/run_aggregation_query.rb | 22 +- .../snippets/datastore/run_query.rb | 22 +- .../snippet_metadata_google.datastore.v1.json | 16 +- google-cloud-datastream-v1/.rubocop.yml | 3 + google-cloud-datastream-v1/snippets/Gemfile | 4 +- .../datastream/create_connection_profile.rb | 34 +- .../datastream/create_private_connection.rb | 34 +- .../snippets/datastream/create_route.rb | 34 +- .../snippets/datastream/create_stream.rb | 34 +- .../datastream/delete_connection_profile.rb | 34 +- .../datastream/delete_private_connection.rb | 34 +- .../snippets/datastream/delete_route.rb | 34 +- .../snippets/datastream/delete_stream.rb | 34 +- .../datastream/discover_connection_profile.rb | 22 +- .../snippets/datastream/fetch_static_ips.rb | 22 +- .../datastream/get_connection_profile.rb | 22 +- .../datastream/get_private_connection.rb | 22 +- .../snippets/datastream/get_route.rb | 22 +- .../snippets/datastream/get_stream.rb | 22 +- .../snippets/datastream/get_stream_object.rb | 22 +- .../datastream/list_connection_profiles.rb | 32 +- .../datastream/list_private_connections.rb | 32 +- .../snippets/datastream/list_routes.rb | 32 +- .../datastream/list_stream_objects.rb | 32 +- .../snippets/datastream/list_streams.rb | 32 +- .../datastream/lookup_stream_object.rb | 22 +- .../snippets/datastream/start_backfill_job.rb | 22 +- .../snippets/datastream/stop_backfill_job.rb | 22 +- .../datastream/update_connection_profile.rb | 34 +- .../snippets/datastream/update_stream.rb | 34 +- ...t_metadata_google.cloud.datastream.v1.json | 50 +-- google-cloud-datastream-v1alpha1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../datastream/create_connection_profile.rb | 34 +- .../datastream/create_private_connection.rb | 34 +- .../snippets/datastream/create_route.rb | 34 +- .../snippets/datastream/create_stream.rb | 34 +- .../datastream/delete_connection_profile.rb | 34 +- .../datastream/delete_private_connection.rb | 34 +- .../snippets/datastream/delete_route.rb | 34 +- .../snippets/datastream/delete_stream.rb | 34 +- .../datastream/discover_connection_profile.rb | 22 +- .../snippets/datastream/fetch_errors.rb | 34 +- .../snippets/datastream/fetch_static_ips.rb | 22 +- .../datastream/get_connection_profile.rb | 22 +- .../datastream/get_private_connection.rb | 22 +- .../snippets/datastream/get_route.rb | 22 +- .../snippets/datastream/get_stream.rb | 22 +- .../datastream/list_connection_profiles.rb | 32 +- .../datastream/list_private_connections.rb | 32 +- .../snippets/datastream/list_routes.rb | 32 +- .../snippets/datastream/list_streams.rb | 32 +- .../datastream/update_connection_profile.rb | 34 +- .../snippets/datastream/update_stream.rb | 34 +- ...data_google.cloud.datastream.v1alpha1.json | 42 +- google-cloud-debugger-v2/.rubocop.yml | 3 + google-cloud-debugger-v2/snippets/Gemfile | 4 +- .../controller/list_active_breakpoints.rb | 22 +- .../snippets/controller/register_debuggee.rb | 22 +- .../controller/update_active_breakpoint.rb | 22 +- .../snippets/debugger/delete_breakpoint.rb | 22 +- .../snippets/debugger/get_breakpoint.rb | 22 +- .../snippets/debugger/list_breakpoints.rb | 22 +- .../snippets/debugger/list_debuggees.rb | 22 +- .../snippets/debugger/set_breakpoint.rb | 22 +- ...data_google.devtools.clouddebugger.v2.json | 16 +- google-cloud-deploy-v1/.rubocop.yml | 3 + google-cloud-deploy-v1/snippets/Gemfile | 4 +- .../snippets/cloud_deploy/abandon_release.rb | 22 +- .../snippets/cloud_deploy/approve_rollout.rb | 22 +- .../cloud_deploy/create_delivery_pipeline.rb | 34 +- .../snippets/cloud_deploy/create_release.rb | 34 +- .../snippets/cloud_deploy/create_rollout.rb | 34 +- .../snippets/cloud_deploy/create_target.rb | 34 +- .../cloud_deploy/delete_delivery_pipeline.rb | 34 +- .../snippets/cloud_deploy/delete_target.rb | 34 +- .../snippets/cloud_deploy/get_config.rb | 22 +- .../cloud_deploy/get_delivery_pipeline.rb | 22 +- .../snippets/cloud_deploy/get_job_run.rb | 22 +- .../snippets/cloud_deploy/get_release.rb | 22 +- .../snippets/cloud_deploy/get_rollout.rb | 22 +- .../snippets/cloud_deploy/get_target.rb | 22 +- .../cloud_deploy/list_delivery_pipelines.rb | 32 +- .../snippets/cloud_deploy/list_job_runs.rb | 32 +- .../snippets/cloud_deploy/list_releases.rb | 32 +- .../snippets/cloud_deploy/list_rollouts.rb | 32 +- .../snippets/cloud_deploy/list_targets.rb | 32 +- .../snippets/cloud_deploy/retry_job.rb | 22 +- .../cloud_deploy/update_delivery_pipeline.rb | 34 +- .../snippets/cloud_deploy/update_target.rb | 34 +- ...ippet_metadata_google.cloud.deploy.v1.json | 44 +- google-cloud-dialogflow-cx-v3/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/agents/create_agent.rb | 22 +- .../snippets/agents/delete_agent.rb | 22 +- .../snippets/agents/export_agent.rb | 34 +- .../snippets/agents/get_agent.rb | 22 +- .../agents/get_agent_validation_result.rb | 22 +- .../snippets/agents/list_agents.rb | 32 +- .../snippets/agents/restore_agent.rb | 34 +- .../snippets/agents/update_agent.rb | 22 +- .../snippets/agents/validate_agent.rb | 22 +- .../snippets/changelogs/get_changelog.rb | 22 +- .../snippets/changelogs/list_changelogs.rb | 32 +- .../snippets/deployments/get_deployment.rb | 22 +- .../snippets/deployments/list_deployments.rb | 32 +- .../entity_types/create_entity_type.rb | 22 +- .../entity_types/delete_entity_type.rb | 22 +- .../snippets/entity_types/get_entity_type.rb | 22 +- .../entity_types/list_entity_types.rb | 32 +- .../entity_types/update_entity_type.rb | 22 +- .../environments/create_environment.rb | 34 +- .../environments/delete_environment.rb | 22 +- .../snippets/environments/deploy_flow.rb | 34 +- .../snippets/environments/get_environment.rb | 22 +- .../list_continuous_test_results.rb | 32 +- .../environments/list_environments.rb | 32 +- .../lookup_environment_history.rb | 32 +- .../environments/run_continuous_test.rb | 34 +- .../environments/update_environment.rb | 34 +- .../snippets/experiments/create_experiment.rb | 22 +- .../snippets/experiments/delete_experiment.rb | 22 +- .../snippets/experiments/get_experiment.rb | 22 +- .../snippets/experiments/list_experiments.rb | 32 +- .../snippets/experiments/start_experiment.rb | 22 +- .../snippets/experiments/stop_experiment.rb | 22 +- .../snippets/experiments/update_experiment.rb | 22 +- .../snippets/flows/create_flow.rb | 22 +- .../snippets/flows/delete_flow.rb | 22 +- .../snippets/flows/export_flow.rb | 34 +- .../snippets/flows/get_flow.rb | 22 +- .../flows/get_flow_validation_result.rb | 22 +- .../snippets/flows/import_flow.rb | 34 +- .../snippets/flows/list_flows.rb | 32 +- .../snippets/flows/train_flow.rb | 34 +- .../snippets/flows/update_flow.rb | 22 +- .../snippets/flows/validate_flow.rb | 22 +- .../snippets/intents/create_intent.rb | 22 +- .../snippets/intents/delete_intent.rb | 22 +- .../snippets/intents/get_intent.rb | 22 +- .../snippets/intents/list_intents.rb | 32 +- .../snippets/intents/update_intent.rb | 22 +- .../snippets/pages/create_page.rb | 22 +- .../snippets/pages/delete_page.rb | 22 +- .../snippets/pages/get_page.rb | 22 +- .../snippets/pages/list_pages.rb | 32 +- .../snippets/pages/update_page.rb | 22 +- .../create_security_settings.rb | 22 +- .../delete_security_settings.rb | 22 +- .../get_security_settings.rb | 22 +- .../list_security_settings.rb | 32 +- .../update_security_settings.rb | 22 +- .../create_session_entity_type.rb | 22 +- .../delete_session_entity_type.rb | 22 +- .../get_session_entity_type.rb | 22 +- .../list_session_entity_types.rb | 32 +- .../update_session_entity_type.rb | 22 +- .../snippets/sessions/detect_intent.rb | 22 +- .../snippets/sessions/fulfill_intent.rb | 22 +- .../snippets/sessions/match_intent.rb | 22 +- .../sessions/streaming_detect_intent.rb | 44 +- ...etadata_google.cloud.dialogflow.cx.v3.json | 194 ++++----- .../test_cases/batch_delete_test_cases.rb | 22 +- .../test_cases/batch_run_test_cases.rb | 34 +- .../snippets/test_cases/calculate_coverage.rb | 22 +- .../snippets/test_cases/create_test_case.rb | 22 +- .../snippets/test_cases/export_test_cases.rb | 34 +- .../snippets/test_cases/get_test_case.rb | 22 +- .../test_cases/get_test_case_result.rb | 22 +- .../snippets/test_cases/import_test_cases.rb | 34 +- .../test_cases/list_test_case_results.rb | 32 +- .../snippets/test_cases/list_test_cases.rb | 32 +- .../snippets/test_cases/run_test_case.rb | 34 +- .../snippets/test_cases/update_test_case.rb | 22 +- .../create_transition_route_group.rb | 22 +- .../delete_transition_route_group.rb | 22 +- .../get_transition_route_group.rb | 22 +- .../list_transition_route_groups.rb | 32 +- .../update_transition_route_group.rb | 22 +- .../snippets/versions/compare_versions.rb | 22 +- .../snippets/versions/create_version.rb | 34 +- .../snippets/versions/delete_version.rb | 22 +- .../snippets/versions/get_version.rb | 22 +- .../snippets/versions/list_versions.rb | 32 +- .../snippets/versions/load_version.rb | 34 +- .../snippets/versions/update_version.rb | 22 +- .../snippets/webhooks/create_webhook.rb | 22 +- .../snippets/webhooks/delete_webhook.rb | 22 +- .../snippets/webhooks/get_webhook.rb | 22 +- .../snippets/webhooks/list_webhooks.rb | 32 +- .../snippets/webhooks/update_webhook.rb | 22 +- google-cloud-dialogflow-v2/.rubocop.yml | 3 + google-cloud-dialogflow-v2/snippets/Gemfile | 4 +- .../snippets/agents/delete_agent.rb | 22 +- .../snippets/agents/export_agent.rb | 34 +- .../snippets/agents/get_agent.rb | 22 +- .../snippets/agents/get_validation_result.rb | 22 +- .../snippets/agents/import_agent.rb | 34 +- .../snippets/agents/restore_agent.rb | 34 +- .../snippets/agents/search_agents.rb | 32 +- .../snippets/agents/set_agent.rb | 22 +- .../snippets/agents/train_agent.rb | 34 +- .../answer_records/list_answer_records.rb | 32 +- .../answer_records/update_answer_record.rb | 22 +- .../snippets/contexts/create_context.rb | 22 +- .../snippets/contexts/delete_all_contexts.rb | 22 +- .../snippets/contexts/delete_context.rb | 22 +- .../snippets/contexts/get_context.rb | 22 +- .../snippets/contexts/list_contexts.rb | 32 +- .../snippets/contexts/update_context.rb | 22 +- .../create_conversation_dataset.rb | 34 +- .../delete_conversation_dataset.rb | 34 +- .../get_conversation_dataset.rb | 22 +- .../import_conversation_data.rb | 34 +- .../list_conversation_datasets.rb | 32 +- .../create_conversation_model.rb | 34 +- .../create_conversation_model_evaluation.rb | 34 +- .../delete_conversation_model.rb | 34 +- .../deploy_conversation_model.rb | 34 +- .../get_conversation_model.rb | 22 +- .../get_conversation_model_evaluation.rb | 22 +- .../list_conversation_model_evaluations.rb | 32 +- .../list_conversation_models.rb | 32 +- .../undeploy_conversation_model.rb | 34 +- .../clear_suggestion_feature_config.rb | 34 +- .../create_conversation_profile.rb | 22 +- .../delete_conversation_profile.rb | 22 +- .../get_conversation_profile.rb | 22 +- .../list_conversation_profiles.rb | 32 +- .../set_suggestion_feature_config.rb | 34 +- .../update_conversation_profile.rb | 22 +- .../conversations/complete_conversation.rb | 22 +- .../conversations/create_conversation.rb | 22 +- .../conversations/get_conversation.rb | 22 +- .../conversations/list_conversations.rb | 32 +- .../snippets/conversations/list_messages.rb | 32 +- .../snippets/documents/create_document.rb | 34 +- .../snippets/documents/delete_document.rb | 34 +- .../snippets/documents/export_document.rb | 34 +- .../snippets/documents/get_document.rb | 22 +- .../snippets/documents/import_documents.rb | 34 +- .../snippets/documents/list_documents.rb | 32 +- .../snippets/documents/reload_document.rb | 34 +- .../snippets/documents/update_document.rb | 34 +- .../entity_types/batch_create_entities.rb | 34 +- .../entity_types/batch_delete_entities.rb | 34 +- .../entity_types/batch_delete_entity_types.rb | 34 +- .../entity_types/batch_update_entities.rb | 34 +- .../entity_types/batch_update_entity_types.rb | 34 +- .../entity_types/create_entity_type.rb | 22 +- .../entity_types/delete_entity_type.rb | 22 +- .../snippets/entity_types/get_entity_type.rb | 22 +- .../entity_types/list_entity_types.rb | 32 +- .../entity_types/update_entity_type.rb | 22 +- .../environments/create_environment.rb | 22 +- .../environments/delete_environment.rb | 22 +- .../snippets/environments/get_environment.rb | 22 +- .../environments/get_environment_history.rb | 32 +- .../environments/list_environments.rb | 32 +- .../environments/update_environment.rb | 22 +- .../snippets/fulfillments/get_fulfillment.rb | 22 +- .../fulfillments/update_fulfillment.rb | 22 +- .../snippets/intents/batch_delete_intents.rb | 34 +- .../snippets/intents/batch_update_intents.rb | 34 +- .../snippets/intents/create_intent.rb | 22 +- .../snippets/intents/delete_intent.rb | 22 +- .../snippets/intents/get_intent.rb | 22 +- .../snippets/intents/list_intents.rb | 32 +- .../snippets/intents/update_intent.rb | 22 +- .../knowledge_bases/create_knowledge_base.rb | 22 +- .../knowledge_bases/delete_knowledge_base.rb | 22 +- .../knowledge_bases/get_knowledge_base.rb | 22 +- .../knowledge_bases/list_knowledge_bases.rb | 32 +- .../knowledge_bases/update_knowledge_base.rb | 22 +- .../snippets/participants/analyze_content.rb | 22 +- .../participants/create_participant.rb | 22 +- .../snippets/participants/get_participant.rb | 22 +- .../participants/list_participants.rb | 32 +- .../participants/streaming_analyze_content.rb | 44 +- .../snippets/participants/suggest_articles.rb | 22 +- .../participants/suggest_faq_answers.rb | 22 +- .../participants/suggest_smart_replies.rb | 22 +- .../participants/update_participant.rb | 22 +- .../create_session_entity_type.rb | 22 +- .../delete_session_entity_type.rb | 22 +- .../get_session_entity_type.rb | 22 +- .../list_session_entity_types.rb | 32 +- .../update_session_entity_type.rb | 22 +- .../snippets/sessions/detect_intent.rb | 22 +- .../sessions/streaming_detect_intent.rb | 44 +- ...t_metadata_google.cloud.dialogflow.v2.json | 204 ++++----- .../snippets/versions/create_version.rb | 22 +- .../snippets/versions/delete_version.rb | 22 +- .../snippets/versions/get_version.rb | 22 +- .../snippets/versions/list_versions.rb | 32 +- .../snippets/versions/update_version.rb | 22 +- google-cloud-dlp-v2/.rubocop.yml | 3 + google-cloud-dlp-v2/snippets/Gemfile | 4 +- .../dlp_service/activate_job_trigger.rb | 22 +- .../snippets/dlp_service/cancel_dlp_job.rb | 22 +- .../dlp_service/create_deidentify_template.rb | 22 +- .../snippets/dlp_service/create_dlp_job.rb | 22 +- .../dlp_service/create_inspect_template.rb | 22 +- .../dlp_service/create_job_trigger.rb | 22 +- .../dlp_service/create_stored_info_type.rb | 22 +- .../dlp_service/deidentify_content.rb | 22 +- .../dlp_service/delete_deidentify_template.rb | 22 +- .../snippets/dlp_service/delete_dlp_job.rb | 22 +- .../dlp_service/delete_inspect_template.rb | 22 +- .../dlp_service/delete_job_trigger.rb | 22 +- .../dlp_service/delete_stored_info_type.rb | 22 +- .../snippets/dlp_service/finish_dlp_job.rb | 22 +- .../dlp_service/get_deidentify_template.rb | 22 +- .../snippets/dlp_service/get_dlp_job.rb | 22 +- .../dlp_service/get_inspect_template.rb | 22 +- .../snippets/dlp_service/get_job_trigger.rb | 22 +- .../dlp_service/get_stored_info_type.rb | 22 +- .../dlp_service/hybrid_inspect_dlp_job.rb | 22 +- .../dlp_service/hybrid_inspect_job_trigger.rb | 22 +- .../snippets/dlp_service/inspect_content.rb | 22 +- .../dlp_service/list_deidentify_templates.rb | 32 +- .../snippets/dlp_service/list_dlp_jobs.rb | 32 +- .../snippets/dlp_service/list_info_types.rb | 22 +- .../dlp_service/list_inspect_templates.rb | 32 +- .../snippets/dlp_service/list_job_triggers.rb | 32 +- .../dlp_service/list_stored_info_types.rb | 32 +- .../snippets/dlp_service/redact_image.rb | 22 +- .../dlp_service/reidentify_content.rb | 22 +- .../dlp_service/update_deidentify_template.rb | 22 +- .../dlp_service/update_inspect_template.rb | 22 +- .../dlp_service/update_job_trigger.rb | 22 +- .../dlp_service/update_stored_info_type.rb | 22 +- ...nippet_metadata_google.privacy.dlp.v2.json | 68 +-- google-cloud-document_ai-v1/.rubocop.yml | 3 + google-cloud-document_ai-v1/snippets/Gemfile | 4 +- .../batch_process_documents.rb | 34 +- .../create_processor.rb | 22 +- .../delete_processor.rb | 34 +- .../delete_processor_version.rb | 34 +- .../deploy_processor_version.rb | 34 +- .../disable_processor.rb | 34 +- .../enable_processor.rb | 34 +- .../fetch_processor_types.rb | 22 +- .../get_processor.rb | 22 +- .../get_processor_version.rb | 22 +- .../list_processor_types.rb | 32 +- .../list_processor_versions.rb | 32 +- .../list_processors.rb | 32 +- .../process_document.rb | 22 +- .../review_document.rb | 34 +- .../set_default_processor_version.rb | 34 +- .../undeploy_processor_version.rb | 34 +- ...t_metadata_google.cloud.documentai.v1.json | 34 +- google-cloud-document_ai-v1beta3/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../batch_process_documents.rb | 34 +- .../create_processor.rb | 22 +- .../delete_processor.rb | 34 +- .../delete_processor_version.rb | 34 +- .../deploy_processor_version.rb | 34 +- .../disable_processor.rb | 34 +- .../enable_processor.rb | 34 +- .../fetch_processor_types.rb | 22 +- .../get_processor.rb | 22 +- .../get_processor_version.rb | 22 +- .../list_processor_types.rb | 32 +- .../list_processor_versions.rb | 32 +- .../list_processors.rb | 32 +- .../process_document.rb | 22 +- .../review_document.rb | 34 +- .../set_default_processor_version.rb | 34 +- .../undeploy_processor_version.rb | 34 +- ...adata_google.cloud.documentai.v1beta3.json | 34 +- google-cloud-domains-v1/.rubocop.yml | 3 + google-cloud-domains-v1/snippets/Gemfile | 4 +- .../domains/configure_contact_settings.rb | 34 +- .../domains/configure_dns_settings.rb | 34 +- .../domains/configure_management_settings.rb | 34 +- .../snippets/domains/delete_registration.rb | 34 +- .../snippets/domains/export_registration.rb | 34 +- .../snippets/domains/get_registration.rb | 22 +- .../snippets/domains/list_registrations.rb | 32 +- .../snippets/domains/register_domain.rb | 34 +- .../domains/reset_authorization_code.rb | 22 +- .../domains/retrieve_authorization_code.rb | 22 +- .../domains/retrieve_register_parameters.rb | 22 +- .../domains/retrieve_transfer_parameters.rb | 22 +- .../snippets/domains/search_domains.rb | 22 +- .../snippets/domains/transfer_domain.rb | 34 +- .../snippets/domains/update_registration.rb | 34 +- ...ppet_metadata_google.cloud.domains.v1.json | 30 +- google-cloud-domains-v1beta1/.rubocop.yml | 3 + google-cloud-domains-v1beta1/snippets/Gemfile | 4 +- .../domains/configure_contact_settings.rb | 34 +- .../domains/configure_dns_settings.rb | 34 +- .../domains/configure_management_settings.rb | 34 +- .../snippets/domains/delete_registration.rb | 34 +- .../snippets/domains/export_registration.rb | 34 +- .../snippets/domains/get_registration.rb | 22 +- .../snippets/domains/list_registrations.rb | 32 +- .../snippets/domains/register_domain.rb | 34 +- .../domains/reset_authorization_code.rb | 22 +- .../domains/retrieve_authorization_code.rb | 22 +- .../domains/retrieve_register_parameters.rb | 22 +- .../domains/retrieve_transfer_parameters.rb | 22 +- .../snippets/domains/search_domains.rb | 22 +- .../snippets/domains/transfer_domain.rb | 34 +- .../snippets/domains/update_registration.rb | 34 +- ...metadata_google.cloud.domains.v1beta1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/error_group_service/get_group.rb | 22 +- .../error_group_service/update_group.rb | 22 +- .../error_stats_service/delete_events.rb | 22 +- .../error_stats_service/list_events.rb | 32 +- .../error_stats_service/list_group_stats.rb | 32 +- .../report_error_event.rb | 22 +- ....devtools.clouderrorreporting.v1beta1.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../compute_contacts.rb | 32 +- .../create_contact.rb | 22 +- .../delete_contact.rb | 22 +- .../essential_contacts_service/get_contact.rb | 22 +- .../list_contacts.rb | 32 +- .../send_test_message.rb | 22 +- .../update_contact.rb | 22 +- ...ata_google.cloud.essentialcontacts.v1.json | 14 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../publish_channel_connection_events.rb | 22 +- .../snippets/publisher/publish_events.rb | 22 +- ...a_google.cloud.eventarc.publishing.v1.json | 4 +- google-cloud-eventarc-v1/.rubocop.yml | 3 + google-cloud-eventarc-v1/snippets/Gemfile | 4 +- .../snippets/eventarc/create_channel.rb | 34 +- .../eventarc/create_channel_connection.rb | 34 +- .../snippets/eventarc/create_trigger.rb | 34 +- .../snippets/eventarc/delete_channel.rb | 34 +- .../eventarc/delete_channel_connection.rb | 34 +- .../snippets/eventarc/delete_trigger.rb | 34 +- .../snippets/eventarc/get_channel.rb | 22 +- .../eventarc/get_channel_connection.rb | 22 +- .../snippets/eventarc/get_provider.rb | 22 +- .../snippets/eventarc/get_trigger.rb | 22 +- .../eventarc/list_channel_connections.rb | 32 +- .../snippets/eventarc/list_channels.rb | 32 +- .../snippets/eventarc/list_providers.rb | 32 +- .../snippets/eventarc/list_triggers.rb | 32 +- .../snippets/eventarc/update_channel.rb | 34 +- .../snippets/eventarc/update_trigger.rb | 34 +- ...pet_metadata_google.cloud.eventarc.v1.json | 32 +- google-cloud-filestore-v1/.rubocop.yml | 3 + google-cloud-filestore-v1/snippets/Gemfile | 4 +- .../cloud_filestore_manager/create_backup.rb | 34 +- .../create_instance.rb | 34 +- .../cloud_filestore_manager/delete_backup.rb | 34 +- .../delete_instance.rb | 34 +- .../cloud_filestore_manager/get_backup.rb | 22 +- .../cloud_filestore_manager/get_instance.rb | 22 +- .../cloud_filestore_manager/list_backups.rb | 32 +- .../cloud_filestore_manager/list_instances.rb | 32 +- .../restore_instance.rb | 34 +- .../cloud_filestore_manager/update_backup.rb | 34 +- .../update_instance.rb | 34 +- ...et_metadata_google.cloud.filestore.v1.json | 22 +- google-cloud-firestore-admin-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/firestore_admin/create_index.rb | 34 +- .../snippets/firestore_admin/delete_index.rb | 22 +- .../firestore_admin/export_documents.rb | 34 +- .../snippets/firestore_admin/get_database.rb | 22 +- .../snippets/firestore_admin/get_field.rb | 22 +- .../snippets/firestore_admin/get_index.rb | 22 +- .../firestore_admin/import_documents.rb | 34 +- .../firestore_admin/list_databases.rb | 22 +- .../snippets/firestore_admin/list_fields.rb | 32 +- .../snippets/firestore_admin/list_indexes.rb | 32 +- .../firestore_admin/update_database.rb | 34 +- .../snippets/firestore_admin/update_field.rb | 34 +- ...et_metadata_google.firestore.admin.v1.json | 24 +- google-cloud-firestore-v1/.rubocop.yml | 3 + google-cloud-firestore-v1/snippets/Gemfile | 4 +- .../snippets/firestore/batch_get_documents.rb | 26 +- .../snippets/firestore/batch_write.rb | 22 +- .../snippets/firestore/begin_transaction.rb | 22 +- .../snippets/firestore/commit.rb | 22 +- .../snippets/firestore/create_document.rb | 22 +- .../snippets/firestore/delete_document.rb | 22 +- .../snippets/firestore/get_document.rb | 22 +- .../snippets/firestore/list_collection_ids.rb | 22 +- .../snippets/firestore/list_documents.rb | 32 +- .../snippets/firestore/listen.rb | 44 +- .../snippets/firestore/partition_query.rb | 32 +- .../snippets/firestore/rollback.rb | 22 +- .../firestore/run_aggregation_query.rb | 26 +- .../snippets/firestore/run_query.rb | 26 +- .../snippets/firestore/update_document.rb | 22 +- .../snippets/firestore/write.rb | 44 +- .../snippet_metadata_google.firestore.v1.json | 32 +- google-cloud-functions-v1/.rubocop.yml | 3 + google-cloud-functions-v1/snippets/Gemfile | 4 +- .../cloud_functions_service/call_function.rb | 22 +- .../create_function.rb | 34 +- .../delete_function.rb | 34 +- .../generate_download_url.rb | 22 +- .../generate_upload_url.rb | 22 +- .../cloud_functions_service/get_function.rb | 22 +- .../cloud_functions_service/get_iam_policy.rb | 22 +- .../cloud_functions_service/list_functions.rb | 32 +- .../cloud_functions_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../update_function.rb | 34 +- ...et_metadata_google.cloud.functions.v1.json | 22 +- google-cloud-functions-v2/.rubocop.yml | 3 + google-cloud-functions-v2/snippets/Gemfile | 4 +- .../function_service/create_function.rb | 34 +- .../function_service/delete_function.rb | 34 +- .../function_service/generate_download_url.rb | 22 +- .../function_service/generate_upload_url.rb | 22 +- .../snippets/function_service/get_function.rb | 22 +- .../function_service/list_functions.rb | 32 +- .../function_service/list_runtimes.rb | 22 +- .../function_service/update_function.rb | 34 +- ...et_metadata_google.cloud.functions.v2.json | 16 +- google-cloud-gaming-v1/.rubocop.yml | 3 + google-cloud-gaming-v1/snippets/Gemfile | 4 +- .../create_game_server_cluster.rb | 34 +- .../delete_game_server_cluster.rb | 34 +- .../get_game_server_cluster.rb | 22 +- .../list_game_server_clusters.rb | 32 +- .../preview_create_game_server_cluster.rb | 22 +- .../preview_delete_game_server_cluster.rb | 22 +- .../preview_update_game_server_cluster.rb | 22 +- .../update_game_server_cluster.rb | 34 +- .../create_game_server_config.rb | 34 +- .../delete_game_server_config.rb | 34 +- .../get_game_server_config.rb | 22 +- .../list_game_server_configs.rb | 32 +- .../create_game_server_deployment.rb | 34 +- .../delete_game_server_deployment.rb | 34 +- .../fetch_deployment_state.rb | 22 +- .../get_game_server_deployment.rb | 22 +- .../get_game_server_deployment_rollout.rb | 22 +- .../list_game_server_deployments.rb | 32 +- .../preview_game_server_deployment_rollout.rb | 22 +- .../update_game_server_deployment.rb | 34 +- .../update_game_server_deployment_rollout.rb | 34 +- .../snippets/realms_service/create_realm.rb | 34 +- .../snippets/realms_service/delete_realm.rb | 34 +- .../snippets/realms_service/get_realm.rb | 22 +- .../snippets/realms_service/list_realms.rb | 32 +- .../realms_service/preview_realm_update.rb | 22 +- .../snippets/realms_service/update_realm.rb | 34 +- ...ippet_metadata_google.cloud.gaming.v1.json | 54 +-- google-cloud-gke_backup-v1/.rubocop.yml | 3 + google-cloud-gke_backup-v1/snippets/Gemfile | 4 +- .../snippets/backup_for_gke/create_backup.rb | 34 +- .../backup_for_gke/create_backup_plan.rb | 34 +- .../snippets/backup_for_gke/create_restore.rb | 34 +- .../backup_for_gke/create_restore_plan.rb | 34 +- .../snippets/backup_for_gke/delete_backup.rb | 34 +- .../backup_for_gke/delete_backup_plan.rb | 34 +- .../snippets/backup_for_gke/delete_restore.rb | 34 +- .../backup_for_gke/delete_restore_plan.rb | 34 +- .../snippets/backup_for_gke/get_backup.rb | 22 +- .../backup_for_gke/get_backup_plan.rb | 22 +- .../snippets/backup_for_gke/get_restore.rb | 22 +- .../backup_for_gke/get_restore_plan.rb | 22 +- .../backup_for_gke/get_volume_backup.rb | 22 +- .../backup_for_gke/get_volume_restore.rb | 22 +- .../backup_for_gke/list_backup_plans.rb | 32 +- .../snippets/backup_for_gke/list_backups.rb | 32 +- .../backup_for_gke/list_restore_plans.rb | 32 +- .../snippets/backup_for_gke/list_restores.rb | 32 +- .../backup_for_gke/list_volume_backups.rb | 32 +- .../backup_for_gke/list_volume_restores.rb | 32 +- .../snippets/backup_for_gke/update_backup.rb | 34 +- .../backup_for_gke/update_backup_plan.rb | 34 +- .../snippets/backup_for_gke/update_restore.rb | 34 +- .../backup_for_gke/update_restore_plan.rb | 34 +- ...et_metadata_google.cloud.gkebackup.v1.json | 48 +-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../gateway_service/delete_resource.rb | 22 +- .../snippets/gateway_service/get_resource.rb | 22 +- .../gateway_service/patch_resource.rb | 22 +- .../snippets/gateway_service/post_resource.rb | 22 +- .../snippets/gateway_service/put_resource.rb | 22 +- ...ogle.cloud.gkeconnect.gateway.v1beta1.json | 10 +- google-cloud-gke_hub-v1/.rubocop.yml | 3 + google-cloud-gke_hub-v1/snippets/Gemfile | 4 +- .../snippets/gke_hub/create_feature.rb | 34 +- .../snippets/gke_hub/create_membership.rb | 34 +- .../snippets/gke_hub/delete_feature.rb | 34 +- .../snippets/gke_hub/delete_membership.rb | 34 +- .../gke_hub/generate_connect_manifest.rb | 22 +- .../snippets/gke_hub/get_feature.rb | 22 +- .../snippets/gke_hub/get_membership.rb | 22 +- .../snippets/gke_hub/list_features.rb | 32 +- .../snippets/gke_hub/list_memberships.rb | 32 +- .../snippets/gke_hub/update_feature.rb | 34 +- .../snippets/gke_hub/update_membership.rb | 34 +- ...ippet_metadata_google.cloud.gkehub.v1.json | 22 +- google-cloud-gke_hub-v1beta1/.rubocop.yml | 3 + google-cloud-gke_hub-v1beta1/snippets/Gemfile | 4 +- .../create_membership.rb | 34 +- .../delete_membership.rb | 34 +- .../generate_connect_manifest.rb | 22 +- .../generate_exclusivity_manifest.rb | 22 +- .../get_membership.rb | 22 +- .../list_memberships.rb | 32 +- .../update_membership.rb | 34 +- .../validate_exclusivity.rb | 22 +- ..._metadata_google.cloud.gkehub.v1beta1.json | 16 +- google-cloud-gke_multi_cloud-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../aws_clusters/create_aws_cluster.rb | 34 +- .../aws_clusters/create_aws_node_pool.rb | 34 +- .../aws_clusters/delete_aws_cluster.rb | 34 +- .../aws_clusters/delete_aws_node_pool.rb | 34 +- .../aws_clusters/generate_aws_access_token.rb | 22 +- .../snippets/aws_clusters/get_aws_cluster.rb | 22 +- .../aws_clusters/get_aws_node_pool.rb | 22 +- .../aws_clusters/get_aws_server_config.rb | 22 +- .../aws_clusters/list_aws_clusters.rb | 32 +- .../aws_clusters/list_aws_node_pools.rb | 32 +- .../aws_clusters/update_aws_cluster.rb | 34 +- .../aws_clusters/update_aws_node_pool.rb | 34 +- .../azure_clusters/create_azure_client.rb | 34 +- .../azure_clusters/create_azure_cluster.rb | 34 +- .../azure_clusters/create_azure_node_pool.rb | 34 +- .../azure_clusters/delete_azure_client.rb | 34 +- .../azure_clusters/delete_azure_cluster.rb | 34 +- .../azure_clusters/delete_azure_node_pool.rb | 34 +- .../generate_azure_access_token.rb | 22 +- .../azure_clusters/get_azure_client.rb | 22 +- .../azure_clusters/get_azure_cluster.rb | 22 +- .../azure_clusters/get_azure_node_pool.rb | 22 +- .../azure_clusters/get_azure_server_config.rb | 22 +- .../azure_clusters/list_azure_clients.rb | 32 +- .../azure_clusters/list_azure_clusters.rb | 32 +- .../azure_clusters/list_azure_node_pools.rb | 32 +- .../azure_clusters/update_azure_cluster.rb | 34 +- .../azure_clusters/update_azure_node_pool.rb | 34 +- ...etadata_google.cloud.gkemulticloud.v1.json | 56 +-- google-cloud-iap-v1/.rubocop.yml | 3 + google-cloud-iap-v1/snippets/Gemfile | 4 +- .../create_tunnel_dest_group.rb | 22 +- .../delete_tunnel_dest_group.rb | 22 +- .../get_iam_policy.rb | 22 +- .../get_iap_settings.rb | 22 +- .../get_tunnel_dest_group.rb | 22 +- .../list_tunnel_dest_groups.rb | 32 +- .../set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../update_iap_settings.rb | 22 +- .../update_tunnel_dest_group.rb | 22 +- .../create_brand.rb | 22 +- .../create_identity_aware_proxy_client.rb | 22 +- .../delete_identity_aware_proxy_client.rb | 22 +- .../get_brand.rb | 22 +- .../get_identity_aware_proxy_client.rb | 22 +- .../list_brands.rb | 22 +- .../list_identity_aware_proxy_clients.rb | 32 +- ...eset_identity_aware_proxy_client_secret.rb | 22 +- .../snippet_metadata_google.cloud.iap.v1.json | 36 +- google-cloud-ids-v1/.rubocop.yml | 3 + google-cloud-ids-v1/snippets/Gemfile | 4 +- .../snippets/ids/create_endpoint.rb | 34 +- .../snippets/ids/delete_endpoint.rb | 34 +- .../snippets/ids/get_endpoint.rb | 22 +- .../snippets/ids/list_endpoints.rb | 32 +- .../snippet_metadata_google.cloud.ids.v1.json | 8 +- google-cloud-iot-v1/.rubocop.yml | 3 + google-cloud-iot-v1/snippets/Gemfile | 4 +- .../device_manager/bind_device_to_gateway.rb | 22 +- .../snippets/device_manager/create_device.rb | 22 +- .../device_manager/create_device_registry.rb | 22 +- .../snippets/device_manager/delete_device.rb | 22 +- .../device_manager/delete_device_registry.rb | 22 +- .../snippets/device_manager/get_device.rb | 22 +- .../device_manager/get_device_registry.rb | 22 +- .../snippets/device_manager/get_iam_policy.rb | 22 +- .../list_device_config_versions.rb | 22 +- .../device_manager/list_device_registries.rb | 32 +- .../device_manager/list_device_states.rb | 22 +- .../snippets/device_manager/list_devices.rb | 32 +- .../modify_cloud_to_device_config.rb | 22 +- .../device_manager/send_command_to_device.rb | 22 +- .../snippets/device_manager/set_iam_policy.rb | 22 +- .../device_manager/test_iam_permissions.rb | 22 +- .../unbind_device_from_gateway.rb | 22 +- .../snippets/device_manager/update_device.rb | 22 +- .../device_manager/update_device_registry.rb | 22 +- .../snippet_metadata_google.cloud.iot.v1.json | 38 +- google-cloud-kms-v1/.repo-metadata.json | 2 +- google-cloud-kms-v1/.rubocop.yml | 3 + google-cloud-kms-v1/snippets/Gemfile | 4 +- .../ekm_service/create_ekm_connection.rb | 22 +- .../ekm_service/get_ekm_connection.rb | 22 +- .../ekm_service/list_ekm_connections.rb | 32 +- .../ekm_service/update_ekm_connection.rb | 22 +- .../asymmetric_decrypt.rb | 22 +- .../key_management_service/asymmetric_sign.rb | 22 +- .../create_crypto_key.rb | 22 +- .../create_crypto_key_version.rb | 22 +- .../create_import_job.rb | 22 +- .../key_management_service/create_key_ring.rb | 22 +- .../key_management_service/decrypt.rb | 22 +- .../destroy_crypto_key_version.rb | 22 +- .../key_management_service/encrypt.rb | 22 +- .../generate_random_bytes.rb | 22 +- .../key_management_service/get_crypto_key.rb | 22 +- .../get_crypto_key_version.rb | 22 +- .../key_management_service/get_import_job.rb | 22 +- .../key_management_service/get_key_ring.rb | 22 +- .../key_management_service/get_public_key.rb | 22 +- .../import_crypto_key_version.rb | 22 +- .../list_crypto_key_versions.rb | 32 +- .../list_crypto_keys.rb | 32 +- .../list_import_jobs.rb | 32 +- .../key_management_service/list_key_rings.rb | 32 +- .../key_management_service/mac_sign.rb | 22 +- .../key_management_service/mac_verify.rb | 22 +- .../restore_crypto_key_version.rb | 22 +- .../update_crypto_key.rb | 22 +- .../update_crypto_key_primary_version.rb | 22 +- .../update_crypto_key_version.rb | 22 +- .../snippet_metadata_google.cloud.kms.v1.json | 60 +-- google-cloud-language-v1/.rubocop.yml | 3 + google-cloud-language-v1/snippets/Gemfile | 4 +- .../language_service/analyze_entities.rb | 22 +- .../analyze_entity_sentiment.rb | 22 +- .../language_service/analyze_sentiment.rb | 22 +- .../language_service/analyze_syntax.rb | 22 +- .../language_service/annotate_text.rb | 22 +- .../language_service/classify_text.rb | 22 +- ...pet_metadata_google.cloud.language.v1.json | 12 +- google-cloud-language-v1beta2/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../language_service/analyze_entities.rb | 22 +- .../analyze_entity_sentiment.rb | 22 +- .../language_service/analyze_sentiment.rb | 22 +- .../language_service/analyze_syntax.rb | 22 +- .../language_service/annotate_text.rb | 22 +- .../language_service/classify_text.rb | 22 +- ...etadata_google.cloud.language.v1beta2.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...data_google.cloud.lifesciences.v2beta.json | 2 +- .../workflows_service/run_pipeline.rb | 34 +- google-cloud-location/.repo-metadata.json | 2 +- google-cloud-location/.rubocop.yml | 3 + google-cloud-location/snippets/Gemfile | 4 +- .../snippets/locations/get_location.rb | 22 +- .../snippets/locations/list_locations.rb | 32 +- ...nippet_metadata_google.cloud.location.json | 4 +- google-cloud-logging-v2/.rubocop.yml | 3 + google-cloud-logging-v2/snippets/Gemfile | 4 +- .../config_service/copy_log_entries.rb | 34 +- .../snippets/config_service/create_bucket.rb | 22 +- .../config_service/create_exclusion.rb | 22 +- .../snippets/config_service/create_sink.rb | 22 +- .../snippets/config_service/create_view.rb | 22 +- .../snippets/config_service/delete_bucket.rb | 22 +- .../config_service/delete_exclusion.rb | 22 +- .../snippets/config_service/delete_sink.rb | 22 +- .../snippets/config_service/delete_view.rb | 22 +- .../snippets/config_service/get_bucket.rb | 22 +- .../config_service/get_cmek_settings.rb | 22 +- .../snippets/config_service/get_exclusion.rb | 22 +- .../snippets/config_service/get_settings.rb | 22 +- .../snippets/config_service/get_sink.rb | 22 +- .../snippets/config_service/get_view.rb | 22 +- .../snippets/config_service/list_buckets.rb | 32 +- .../config_service/list_exclusions.rb | 32 +- .../snippets/config_service/list_sinks.rb | 32 +- .../snippets/config_service/list_views.rb | 32 +- .../config_service/undelete_bucket.rb | 22 +- .../snippets/config_service/update_bucket.rb | 22 +- .../config_service/update_cmek_settings.rb | 22 +- .../config_service/update_exclusion.rb | 22 +- .../config_service/update_settings.rb | 22 +- .../snippets/config_service/update_sink.rb | 22 +- .../snippets/config_service/update_view.rb | 22 +- .../snippets/logging_service/delete_log.rb | 22 +- .../logging_service/list_log_entries.rb | 32 +- .../snippets/logging_service/list_logs.rb | 22 +- .../list_monitored_resource_descriptors.rb | 32 +- .../logging_service/tail_log_entries.rb | 44 +- .../logging_service/write_log_entries.rb | 22 +- .../metrics_service/create_log_metric.rb | 22 +- .../metrics_service/delete_log_metric.rb | 22 +- .../metrics_service/get_log_metric.rb | 22 +- .../metrics_service/list_log_metrics.rb | 32 +- .../metrics_service/update_log_metric.rb | 22 +- .../snippet_metadata_google.logging.v2.json | 74 ++-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../attach_trust.rb | 34 +- .../create_microsoft_ad_domain.rb | 34 +- .../delete_domain.rb | 34 +- .../detach_trust.rb | 34 +- .../managed_identities_service/get_domain.rb | 22 +- .../list_domains.rb | 32 +- .../reconfigure_trust.rb | 34 +- .../reset_admin_password.rb | 22 +- .../update_domain.rb | 34 +- .../validate_trust.rb | 34 +- ...ata_google.cloud.managedidentities.v1.json | 20 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...google.cloud.mediatranslation.v1beta1.json | 2 +- .../streaming_translate_speech.rb | 44 +- google-cloud-memcache-v1/.rubocop.yml | 3 + google-cloud-memcache-v1/snippets/Gemfile | 4 +- .../cloud_memcache/apply_parameters.rb | 34 +- .../cloud_memcache/create_instance.rb | 34 +- .../cloud_memcache/delete_instance.rb | 34 +- .../snippets/cloud_memcache/get_instance.rb | 22 +- .../snippets/cloud_memcache/list_instances.rb | 32 +- .../cloud_memcache/update_instance.rb | 34 +- .../cloud_memcache/update_parameters.rb | 34 +- ...pet_metadata_google.cloud.memcache.v1.json | 14 +- google-cloud-memcache-v1beta2/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../cloud_memcache/apply_parameters.rb | 34 +- .../cloud_memcache/apply_software_update.rb | 34 +- .../cloud_memcache/create_instance.rb | 34 +- .../cloud_memcache/delete_instance.rb | 34 +- .../snippets/cloud_memcache/get_instance.rb | 22 +- .../snippets/cloud_memcache/list_instances.rb | 32 +- .../cloud_memcache/update_instance.rb | 34 +- .../cloud_memcache/update_parameters.rb | 34 +- ...etadata_google.cloud.memcache.v1beta2.json | 16 +- google-cloud-metastore-v1/.rubocop.yml | 3 + google-cloud-metastore-v1/snippets/Gemfile | 4 +- .../dataproc_metastore/create_backup.rb | 34 +- .../create_metadata_import.rb | 34 +- .../dataproc_metastore/create_service.rb | 34 +- .../dataproc_metastore/delete_backup.rb | 34 +- .../dataproc_metastore/delete_service.rb | 34 +- .../dataproc_metastore/export_metadata.rb | 34 +- .../snippets/dataproc_metastore/get_backup.rb | 22 +- .../dataproc_metastore/get_metadata_import.rb | 22 +- .../dataproc_metastore/get_service.rb | 22 +- .../dataproc_metastore/list_backups.rb | 32 +- .../list_metadata_imports.rb | 32 +- .../dataproc_metastore/list_services.rb | 32 +- .../dataproc_metastore/restore_service.rb | 34 +- .../update_metadata_import.rb | 34 +- .../dataproc_metastore/update_service.rb | 34 +- ...et_metadata_google.cloud.metastore.v1.json | 30 +- google-cloud-metastore-v1beta/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../dataproc_metastore/create_backup.rb | 34 +- .../create_metadata_import.rb | 34 +- .../dataproc_metastore/create_service.rb | 34 +- .../dataproc_metastore/delete_backup.rb | 34 +- .../dataproc_metastore/delete_service.rb | 34 +- .../dataproc_metastore/export_metadata.rb | 34 +- .../snippets/dataproc_metastore/get_backup.rb | 22 +- .../dataproc_metastore/get_metadata_import.rb | 22 +- .../dataproc_metastore/get_service.rb | 22 +- .../dataproc_metastore/list_backups.rb | 32 +- .../list_metadata_imports.rb | 32 +- .../dataproc_metastore/list_services.rb | 32 +- .../dataproc_metastore/restore_service.rb | 34 +- .../update_metadata_import.rb | 34 +- .../dataproc_metastore/update_service.rb | 34 +- ...etadata_google.cloud.metastore.v1beta.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../dashboards_service/create_dashboard.rb | 22 +- .../dashboards_service/delete_dashboard.rb | 22 +- .../dashboards_service/get_dashboard.rb | 22 +- .../dashboards_service/list_dashboards.rb | 32 +- .../dashboards_service/update_dashboard.rb | 22 +- ...tadata_google.monitoring.dashboard.v1.json | 10 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_monitored_project.rb | 34 +- .../delete_monitored_project.rb | 34 +- .../metrics_scopes/get_metrics_scope.rb | 22 +- ...ist_metrics_scopes_by_monitored_project.rb | 22 +- ...ata_google.monitoring.metricsscope.v1.json | 8 +- google-cloud-monitoring-v3/.rubocop.yml | 3 + google-cloud-monitoring-v3/snippets/Gemfile | 4 +- .../create_alert_policy.rb | 22 +- .../delete_alert_policy.rb | 22 +- .../alert_policy_service/get_alert_policy.rb | 22 +- .../list_alert_policies.rb | 32 +- .../update_alert_policy.rb | 22 +- .../snippets/group_service/create_group.rb | 22 +- .../snippets/group_service/delete_group.rb | 22 +- .../snippets/group_service/get_group.rb | 22 +- .../group_service/list_group_members.rb | 32 +- .../snippets/group_service/list_groups.rb | 32 +- .../snippets/group_service/update_group.rb | 22 +- .../create_metric_descriptor.rb | 22 +- .../create_service_time_series.rb | 22 +- .../metric_service/create_time_series.rb | 22 +- .../delete_metric_descriptor.rb | 22 +- .../metric_service/get_metric_descriptor.rb | 22 +- .../get_monitored_resource_descriptor.rb | 22 +- .../metric_service/list_metric_descriptors.rb | 32 +- .../list_monitored_resource_descriptors.rb | 32 +- .../metric_service/list_time_series.rb | 32 +- .../create_notification_channel.rb | 22 +- .../delete_notification_channel.rb | 22 +- .../get_notification_channel.rb | 22 +- .../get_notification_channel_descriptor.rb | 22 +- ..._notification_channel_verification_code.rb | 22 +- .../list_notification_channel_descriptors.rb | 32 +- .../list_notification_channels.rb | 32 +- ..._notification_channel_verification_code.rb | 22 +- .../update_notification_channel.rb | 22 +- .../verify_notification_channel.rb | 22 +- .../query_service/query_time_series.rb | 32 +- .../create_service.rb | 22 +- .../create_service_level_objective.rb | 22 +- .../delete_service.rb | 22 +- .../delete_service_level_objective.rb | 22 +- .../service_monitoring_service/get_service.rb | 22 +- .../get_service_level_objective.rb | 22 +- .../list_service_level_objectives.rb | 32 +- .../list_services.rb | 32 +- .../update_service.rb | 22 +- .../update_service_level_objective.rb | 22 +- ...snippet_metadata_google.monitoring.v3.json | 94 ++--- .../create_uptime_check_config.rb | 22 +- .../delete_uptime_check_config.rb | 22 +- .../get_uptime_check_config.rb | 22 +- .../list_uptime_check_configs.rb | 32 +- .../list_uptime_check_ips.rb | 32 +- .../update_uptime_check_config.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/hub_service/create_hub.rb | 34 +- .../snippets/hub_service/create_spoke.rb | 34 +- .../snippets/hub_service/delete_hub.rb | 34 +- .../snippets/hub_service/delete_spoke.rb | 34 +- .../snippets/hub_service/get_hub.rb | 22 +- .../snippets/hub_service/get_spoke.rb | 22 +- .../snippets/hub_service/list_hubs.rb | 32 +- .../snippets/hub_service/list_spokes.rb | 32 +- .../snippets/hub_service/update_hub.rb | 34 +- .../snippets/hub_service/update_spoke.rb | 34 +- ...a_google.cloud.networkconnectivity.v1.json | 20 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/hub_service/create_hub.rb | 34 +- .../snippets/hub_service/create_spoke.rb | 34 +- .../snippets/hub_service/delete_hub.rb | 34 +- .../snippets/hub_service/delete_spoke.rb | 34 +- .../snippets/hub_service/get_hub.rb | 22 +- .../snippets/hub_service/get_spoke.rb | 22 +- .../snippets/hub_service/list_hubs.rb | 32 +- .../snippets/hub_service/list_spokes.rb | 32 +- .../snippets/hub_service/update_hub.rb | 34 +- .../snippets/hub_service/update_spoke.rb | 34 +- ...le.cloud.networkconnectivity.v1alpha1.json | 20 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_connectivity_test.rb | 34 +- .../delete_connectivity_test.rb | 34 +- .../get_connectivity_test.rb | 22 +- .../list_connectivity_tests.rb | 32 +- .../rerun_connectivity_test.rb | 34 +- .../update_connectivity_test.rb | 34 +- ...ata_google.cloud.networkmanagement.v1.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_authorization_policy.rb | 34 +- .../create_client_tls_policy.rb | 34 +- .../create_server_tls_policy.rb | 34 +- .../delete_authorization_policy.rb | 34 +- .../delete_client_tls_policy.rb | 34 +- .../delete_server_tls_policy.rb | 34 +- .../get_authorization_policy.rb | 22 +- .../network_security/get_client_tls_policy.rb | 22 +- .../network_security/get_server_tls_policy.rb | 22 +- .../list_authorization_policies.rb | 32 +- .../list_client_tls_policies.rb | 32 +- .../list_server_tls_policies.rb | 32 +- .../update_authorization_policy.rb | 34 +- .../update_client_tls_policy.rb | 34 +- .../update_server_tls_policy.rb | 34 +- ..._google.cloud.networksecurity.v1beta1.json | 30 +- google-cloud-notebooks-v1/.rubocop.yml | 3 + google-cloud-notebooks-v1/snippets/Gemfile | 4 +- .../create_runtime.rb | 34 +- .../delete_runtime.rb | 34 +- .../managed_notebook_service/get_runtime.rb | 22 +- .../managed_notebook_service/list_runtimes.rb | 32 +- .../refresh_runtime_token_internal.rb | 22 +- .../report_runtime_event.rb | 34 +- .../managed_notebook_service/reset_runtime.rb | 34 +- .../managed_notebook_service/start_runtime.rb | 34 +- .../managed_notebook_service/stop_runtime.rb | 34 +- .../switch_runtime.rb | 34 +- .../notebook_service/create_environment.rb | 34 +- .../notebook_service/create_execution.rb | 34 +- .../notebook_service/create_instance.rb | 34 +- .../notebook_service/create_schedule.rb | 34 +- .../notebook_service/delete_environment.rb | 34 +- .../notebook_service/delete_execution.rb | 34 +- .../notebook_service/delete_instance.rb | 34 +- .../notebook_service/delete_schedule.rb | 34 +- .../notebook_service/get_environment.rb | 22 +- .../notebook_service/get_execution.rb | 22 +- .../snippets/notebook_service/get_instance.rb | 22 +- .../notebook_service/get_instance_health.rb | 22 +- .../snippets/notebook_service/get_schedule.rb | 22 +- .../is_instance_upgradeable.rb | 22 +- .../notebook_service/list_environments.rb | 32 +- .../notebook_service/list_executions.rb | 32 +- .../notebook_service/list_instances.rb | 32 +- .../notebook_service/list_schedules.rb | 32 +- .../notebook_service/register_instance.rb | 34 +- .../notebook_service/report_instance_info.rb | 34 +- .../notebook_service/reset_instance.rb | 34 +- .../notebook_service/rollback_instance.rb | 34 +- .../set_instance_accelerator.rb | 34 +- .../notebook_service/set_instance_labels.rb | 34 +- .../set_instance_machine_type.rb | 34 +- .../notebook_service/start_instance.rb | 34 +- .../notebook_service/stop_instance.rb | 34 +- .../notebook_service/trigger_schedule.rb | 34 +- .../update_instance_config.rb | 34 +- .../update_instance_metadata_items.rb | 22 +- .../update_shielded_instance_config.rb | 34 +- .../notebook_service/upgrade_instance.rb | 34 +- .../upgrade_instance_internal.rb | 34 +- ...et_metadata_google.cloud.notebooks.v1.json | 86 ++-- google-cloud-notebooks-v1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../notebook_service/create_environment.rb | 34 +- .../notebook_service/create_instance.rb | 34 +- .../notebook_service/delete_environment.rb | 34 +- .../notebook_service/delete_instance.rb | 34 +- .../notebook_service/get_environment.rb | 22 +- .../snippets/notebook_service/get_instance.rb | 22 +- .../is_instance_upgradeable.rb | 22 +- .../notebook_service/list_environments.rb | 32 +- .../notebook_service/list_instances.rb | 32 +- .../notebook_service/register_instance.rb | 34 +- .../notebook_service/report_instance_info.rb | 34 +- .../notebook_service/reset_instance.rb | 34 +- .../set_instance_accelerator.rb | 34 +- .../notebook_service/set_instance_labels.rb | 34 +- .../set_instance_machine_type.rb | 34 +- .../notebook_service/start_instance.rb | 34 +- .../notebook_service/stop_instance.rb | 34 +- .../notebook_service/upgrade_instance.rb | 34 +- .../upgrade_instance_internal.rb | 34 +- ...tadata_google.cloud.notebooks.v1beta1.json | 38 +- google-cloud-optimization-v1/.rubocop.yml | 3 + google-cloud-optimization-v1/snippets/Gemfile | 4 +- .../fleet_routing/batch_optimize_tours.rb | 34 +- .../snippets/fleet_routing/optimize_tours.rb | 22 +- ...metadata_google.cloud.optimization.v1.json | 4 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../environments/create_environment.rb | 34 +- .../environments/delete_environment.rb | 34 +- .../snippets/environments/get_environment.rb | 22 +- .../environments/list_environments.rb | 32 +- .../environments/update_environment.rb | 34 +- .../image_versions/list_image_versions.rb | 32 +- ...loud.orchestration.airflow.service.v1.json | 12 +- google-cloud-org_policy-v2/.rubocop.yml | 3 + google-cloud-org_policy-v2/snippets/Gemfile | 4 +- .../snippets/org_policy/create_policy.rb | 22 +- .../snippets/org_policy/delete_policy.rb | 22 +- .../org_policy/get_effective_policy.rb | 22 +- .../snippets/org_policy/get_policy.rb | 22 +- .../snippets/org_policy/list_constraints.rb | 32 +- .../snippets/org_policy/list_policies.rb | 32 +- .../snippets/org_policy/update_policy.rb | 22 +- ...et_metadata_google.cloud.orgpolicy.v2.json | 14 +- google-cloud-os_config-v1/.rubocop.yml | 3 + google-cloud-os_config-v1/snippets/Gemfile | 4 +- .../os_config_service/cancel_patch_job.rb | 22 +- .../create_patch_deployment.rb | 22 +- .../delete_patch_deployment.rb | 22 +- .../os_config_service/execute_patch_job.rb | 22 +- .../os_config_service/get_patch_deployment.rb | 22 +- .../os_config_service/get_patch_job.rb | 22 +- .../list_patch_deployments.rb | 32 +- .../list_patch_job_instance_details.rb | 32 +- .../os_config_service/list_patch_jobs.rb | 32 +- .../pause_patch_deployment.rb | 22 +- .../resume_patch_deployment.rb | 22 +- .../update_patch_deployment.rb | 22 +- .../create_os_policy_assignment.rb | 34 +- .../delete_os_policy_assignment.rb | 34 +- .../os_config_zonal_service/get_inventory.rb | 22 +- .../get_os_policy_assignment.rb | 22 +- .../get_os_policy_assignment_report.rb | 22 +- .../get_vulnerability_report.rb | 22 +- .../list_inventories.rb | 32 +- .../list_os_policy_assignment_reports.rb | 32 +- .../list_os_policy_assignment_revisions.rb | 32 +- .../list_os_policy_assignments.rb | 32 +- .../list_vulnerability_reports.rb | 32 +- .../update_os_policy_assignment.rb | 34 +- ...pet_metadata_google.cloud.osconfig.v1.json | 48 +-- google-cloud-os_config-v1alpha/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_os_policy_assignment.rb | 34 +- .../delete_os_policy_assignment.rb | 34 +- .../get_instance_os_policies_compliance.rb | 22 +- .../os_config_zonal_service/get_inventory.rb | 22 +- .../get_os_policy_assignment.rb | 22 +- .../get_os_policy_assignment_report.rb | 22 +- .../get_vulnerability_report.rb | 22 +- .../list_instance_os_policies_compliances.rb | 32 +- .../list_inventories.rb | 32 +- .../list_os_policy_assignment_reports.rb | 32 +- .../list_os_policy_assignment_revisions.rb | 32 +- .../list_os_policy_assignments.rb | 32 +- .../list_vulnerability_reports.rb | 32 +- .../update_os_policy_assignment.rb | 34 +- ...etadata_google.cloud.osconfig.v1alpha.json | 28 +- google-cloud-os_login-v1/.rubocop.yml | 3 + google-cloud-os_login-v1/snippets/Gemfile | 4 +- .../os_login_service/delete_posix_account.rb | 22 +- .../os_login_service/delete_ssh_public_key.rb | 22 +- .../os_login_service/get_login_profile.rb | 22 +- .../os_login_service/get_ssh_public_key.rb | 22 +- .../os_login_service/import_ssh_public_key.rb | 22 +- .../os_login_service/update_ssh_public_key.rb | 22 +- ...ppet_metadata_google.cloud.oslogin.v1.json | 12 +- google-cloud-os_login-v1beta/.rubocop.yml | 3 + google-cloud-os_login-v1beta/snippets/Gemfile | 4 +- .../os_login_service/delete_posix_account.rb | 22 +- .../os_login_service/delete_ssh_public_key.rb | 22 +- .../os_login_service/get_login_profile.rb | 22 +- .../os_login_service/get_ssh_public_key.rb | 22 +- .../os_login_service/import_ssh_public_key.rb | 22 +- .../os_login_service/update_ssh_public_key.rb | 22 +- ..._metadata_google.cloud.oslogin.v1beta.json | 12 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../report_phishing.rb | 22 +- ...ogle.cloud.phishingprotection.v1beta1.json | 2 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../iam_checker/troubleshoot_iam_policy.rb | 22 +- ..._google.cloud.policytroubleshooter.v1.json | 2 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../private_catalog/search_catalogs.rb | 32 +- .../private_catalog/search_products.rb | 32 +- .../private_catalog/search_versions.rb | 32 +- ...a_google.cloud.privatecatalog.v1beta1.json | 6 +- google-cloud-profiler-v2/.rubocop.yml | 3 + google-cloud-profiler-v2/snippets/Gemfile | 4 +- .../create_offline_profile.rb | 22 +- .../profiler_service/create_profile.rb | 22 +- .../profiler_service/update_profile.rb | 22 +- ...data_google.devtools.cloudprofiler.v2.json | 6 +- google-cloud-pubsub-v1/.repo-metadata.json | 2 +- google-cloud-pubsub-v1/.rubocop.yml | 3 + google-cloud-pubsub-v1/snippets/Gemfile | 4 +- .../snippets/publisher/create_topic.rb | 22 +- .../snippets/publisher/delete_topic.rb | 22 +- .../snippets/publisher/detach_subscription.rb | 22 +- .../snippets/publisher/get_topic.rb | 22 +- .../publisher/list_topic_snapshots.rb | 22 +- .../publisher/list_topic_subscriptions.rb | 22 +- .../snippets/publisher/list_topics.rb | 32 +- .../snippets/publisher/publish.rb | 22 +- .../snippets/publisher/update_topic.rb | 22 +- .../snippets/schema_service/create_schema.rb | 22 +- .../snippets/schema_service/delete_schema.rb | 22 +- .../snippets/schema_service/get_schema.rb | 22 +- .../snippets/schema_service/list_schemas.rb | 32 +- .../schema_service/validate_message.rb | 22 +- .../schema_service/validate_schema.rb | 22 +- .../snippet_metadata_google.pubsub.v1.json | 62 +-- .../snippets/subscriber/acknowledge.rb | 22 +- .../snippets/subscriber/create_snapshot.rb | 22 +- .../subscriber/create_subscription.rb | 22 +- .../snippets/subscriber/delete_snapshot.rb | 22 +- .../subscriber/delete_subscription.rb | 22 +- .../snippets/subscriber/get_snapshot.rb | 22 +- .../snippets/subscriber/get_subscription.rb | 22 +- .../snippets/subscriber/list_snapshots.rb | 32 +- .../snippets/subscriber/list_subscriptions.rb | 32 +- .../subscriber/modify_ack_deadline.rb | 22 +- .../snippets/subscriber/modify_push_config.rb | 22 +- .../snippets/subscriber/pull.rb | 22 +- .../snippets/subscriber/seek.rb | 22 +- .../snippets/subscriber/streaming_pull.rb | 44 +- .../snippets/subscriber/update_snapshot.rb | 22 +- .../subscriber/update_subscription.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../annotate_assessment.rb | 22 +- .../create_assessment.rb | 22 +- .../create_key.rb | 22 +- .../delete_key.rb | 22 +- .../recaptcha_enterprise_service/get_key.rb | 22 +- .../get_metrics.rb | 22 +- .../recaptcha_enterprise_service/list_keys.rb | 32 +- .../list_related_account_group_memberships.rb | 32 +- .../list_related_account_groups.rb | 32 +- .../migrate_key.rb | 22 +- .../retrieve_legacy_secret_key.rb | 22 +- ...earch_related_account_group_memberships.rb | 32 +- .../update_key.rb | 22 +- ...a_google.cloud.recaptchaenterprise.v1.json | 26 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../annotate_assessment.rb | 22 +- .../create_assessment.rb | 22 +- ...gle.cloud.recaptchaenterprise.v1beta1.json | 4 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../catalog_service/create_catalog_item.rb | 22 +- .../catalog_service/delete_catalog_item.rb | 22 +- .../catalog_service/get_catalog_item.rb | 22 +- .../catalog_service/import_catalog_items.rb | 34 +- .../catalog_service/list_catalog_items.rb | 32 +- .../catalog_service/update_catalog_item.rb | 22 +- .../create_prediction_api_key_registration.rb | 22 +- .../delete_prediction_api_key_registration.rb | 22 +- .../list_prediction_api_key_registrations.rb | 32 +- .../snippets/prediction_service/predict.rb | 32 +- ...le.cloud.recommendationengine.v1beta1.json | 30 +- .../user_event_service/collect_user_event.rb | 22 +- .../user_event_service/import_user_events.rb | 34 +- .../user_event_service/list_user_events.rb | 32 +- .../user_event_service/purge_user_events.rb | 34 +- .../user_event_service/write_user_event.rb | 22 +- google-cloud-recommender-v1/.rubocop.yml | 3 + google-cloud-recommender-v1/snippets/Gemfile | 4 +- .../snippets/recommender/get_insight.rb | 22 +- .../recommender/get_insight_type_config.rb | 22 +- .../recommender/get_recommendation.rb | 22 +- .../recommender/get_recommender_config.rb | 22 +- .../snippets/recommender/list_insights.rb | 32 +- .../recommender/list_recommendations.rb | 32 +- .../recommender/mark_insight_accepted.rb | 22 +- .../mark_recommendation_claimed.rb | 22 +- .../recommender/mark_recommendation_failed.rb | 22 +- .../mark_recommendation_succeeded.rb | 22 +- .../recommender/update_insight_type_config.rb | 22 +- .../recommender/update_recommender_config.rb | 22 +- ..._metadata_google.cloud.recommender.v1.json | 24 +- google-cloud-redis-v1/.rubocop.yml | 3 + google-cloud-redis-v1/snippets/Gemfile | 4 +- .../snippets/cloud_redis/create_instance.rb | 34 +- .../snippets/cloud_redis/delete_instance.rb | 34 +- .../snippets/cloud_redis/export_instance.rb | 34 +- .../snippets/cloud_redis/failover_instance.rb | 34 +- .../snippets/cloud_redis/get_instance.rb | 22 +- .../cloud_redis/get_instance_auth_string.rb | 22 +- .../snippets/cloud_redis/import_instance.rb | 34 +- .../snippets/cloud_redis/list_instances.rb | 32 +- .../cloud_redis/reschedule_maintenance.rb | 34 +- .../snippets/cloud_redis/update_instance.rb | 34 +- .../snippets/cloud_redis/upgrade_instance.rb | 34 +- ...nippet_metadata_google.cloud.redis.v1.json | 22 +- google-cloud-redis-v1beta1/.rubocop.yml | 3 + google-cloud-redis-v1beta1/snippets/Gemfile | 4 +- .../snippets/cloud_redis/create_instance.rb | 34 +- .../snippets/cloud_redis/delete_instance.rb | 34 +- .../snippets/cloud_redis/export_instance.rb | 34 +- .../snippets/cloud_redis/failover_instance.rb | 34 +- .../snippets/cloud_redis/get_instance.rb | 22 +- .../cloud_redis/get_instance_auth_string.rb | 22 +- .../snippets/cloud_redis/import_instance.rb | 34 +- .../snippets/cloud_redis/list_instances.rb | 32 +- .../cloud_redis/reschedule_maintenance.rb | 34 +- .../snippets/cloud_redis/update_instance.rb | 34 +- .../snippets/cloud_redis/upgrade_instance.rb | 34 +- ...t_metadata_google.cloud.redis.v1beta1.json | 22 +- google-cloud-resource_manager-v3/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/folders/create_folder.rb | 34 +- .../snippets/folders/delete_folder.rb | 34 +- .../snippets/folders/get_folder.rb | 22 +- .../snippets/folders/get_iam_policy.rb | 22 +- .../snippets/folders/list_folders.rb | 32 +- .../snippets/folders/move_folder.rb | 34 +- .../snippets/folders/search_folders.rb | 32 +- .../snippets/folders/set_iam_policy.rb | 22 +- .../snippets/folders/test_iam_permissions.rb | 22 +- .../snippets/folders/undelete_folder.rb | 34 +- .../snippets/folders/update_folder.rb | 34 +- .../snippets/organizations/get_iam_policy.rb | 22 +- .../organizations/get_organization.rb | 22 +- .../organizations/search_organizations.rb | 32 +- .../snippets/organizations/set_iam_policy.rb | 22 +- .../organizations/test_iam_permissions.rb | 22 +- .../snippets/projects/create_project.rb | 34 +- .../snippets/projects/delete_project.rb | 34 +- .../snippets/projects/get_iam_policy.rb | 22 +- .../snippets/projects/get_project.rb | 22 +- .../snippets/projects/list_projects.rb | 32 +- .../snippets/projects/move_project.rb | 34 +- .../snippets/projects/search_projects.rb | 32 +- .../snippets/projects/set_iam_policy.rb | 22 +- .../snippets/projects/test_iam_permissions.rb | 22 +- .../snippets/projects/undelete_project.rb | 34 +- .../snippets/projects/update_project.rb | 34 +- ...adata_google.cloud.resourcemanager.v3.json | 92 ++--- .../tag_bindings/create_tag_binding.rb | 34 +- .../tag_bindings/delete_tag_binding.rb | 34 +- .../tag_bindings/list_tag_bindings.rb | 32 +- .../snippets/tag_keys/create_tag_key.rb | 34 +- .../snippets/tag_keys/delete_tag_key.rb | 34 +- .../snippets/tag_keys/get_iam_policy.rb | 22 +- .../snippets/tag_keys/get_tag_key.rb | 22 +- .../snippets/tag_keys/list_tag_keys.rb | 32 +- .../snippets/tag_keys/set_iam_policy.rb | 22 +- .../snippets/tag_keys/test_iam_permissions.rb | 22 +- .../snippets/tag_keys/update_tag_key.rb | 34 +- .../snippets/tag_values/create_tag_value.rb | 34 +- .../snippets/tag_values/delete_tag_value.rb | 34 +- .../snippets/tag_values/get_iam_policy.rb | 22 +- .../snippets/tag_values/get_tag_value.rb | 22 +- .../snippets/tag_values/list_tag_values.rb | 32 +- .../snippets/tag_values/set_iam_policy.rb | 22 +- .../tag_values/test_iam_permissions.rb | 22 +- .../snippets/tag_values/update_tag_value.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../resource_settings_service/get_setting.rb | 22 +- .../list_settings.rb | 32 +- .../update_setting.rb | 22 +- ...data_google.cloud.resourcesettings.v1.json | 6 +- google-cloud-retail-v2/.rubocop.yml | 3 + google-cloud-retail-v2/snippets/Gemfile | 4 +- .../catalog_service/add_catalog_attribute.rb | 22 +- .../catalog_service/get_attributes_config.rb | 22 +- .../catalog_service/get_completion_config.rb | 22 +- .../catalog_service/get_default_branch.rb | 22 +- .../snippets/catalog_service/list_catalogs.rb | 32 +- .../remove_catalog_attribute.rb | 22 +- .../replace_catalog_attribute.rb | 22 +- .../catalog_service/set_default_branch.rb | 22 +- .../update_attributes_config.rb | 22 +- .../catalog_service/update_catalog.rb | 22 +- .../update_completion_config.rb | 22 +- .../completion_service/complete_query.rb | 22 +- .../import_completion_data.rb | 34 +- .../control_service/create_control.rb | 22 +- .../control_service/delete_control.rb | 22 +- .../snippets/control_service/get_control.rb | 22 +- .../snippets/control_service/list_controls.rb | 32 +- .../control_service/update_control.rb | 22 +- .../snippets/prediction_service/predict.rb | 22 +- .../product_service/add_fulfillment_places.rb | 34 +- .../product_service/add_local_inventories.rb | 34 +- .../product_service/create_product.rb | 22 +- .../product_service/delete_product.rb | 22 +- .../snippets/product_service/get_product.rb | 22 +- .../product_service/import_products.rb | 34 +- .../snippets/product_service/list_products.rb | 32 +- .../remove_fulfillment_places.rb | 34 +- .../remove_local_inventories.rb | 34 +- .../snippets/product_service/set_inventory.rb | 34 +- .../product_service/update_product.rb | 22 +- .../snippets/search_service/search.rb | 32 +- .../serving_config_service/add_control.rb | 22 +- .../create_serving_config.rb | 22 +- .../delete_serving_config.rb | 22 +- .../get_serving_config.rb | 22 +- .../list_serving_configs.rb | 32 +- .../serving_config_service/remove_control.rb | 22 +- .../update_serving_config.rb | 22 +- ...ippet_metadata_google.cloud.retail.v2.json | 86 ++-- .../user_event_service/collect_user_event.rb | 22 +- .../user_event_service/import_user_events.rb | 34 +- .../user_event_service/purge_user_events.rb | 34 +- .../user_event_service/rejoin_user_events.rb | 34 +- .../user_event_service/write_user_event.rb | 22 +- google-cloud-run-v2/.rubocop.yml | 3 + google-cloud-run-v2/snippets/Gemfile | 4 +- .../snippets/revisions/delete_revision.rb | 34 +- .../snippets/revisions/get_revision.rb | 22 +- .../snippets/revisions/list_revisions.rb | 32 +- .../snippets/services/create_service.rb | 34 +- .../snippets/services/delete_service.rb | 34 +- .../snippets/services/get_iam_policy.rb | 22 +- .../snippets/services/get_service.rb | 22 +- .../snippets/services/list_services.rb | 32 +- .../snippets/services/set_iam_policy.rb | 22 +- .../snippets/services/test_iam_permissions.rb | 22 +- .../snippets/services/update_service.rb | 34 +- .../snippet_metadata_google.cloud.run.v2.json | 22 +- google-cloud-scheduler-v1/.rubocop.yml | 3 + google-cloud-scheduler-v1/snippets/Gemfile | 4 +- .../snippets/cloud_scheduler/create_job.rb | 22 +- .../snippets/cloud_scheduler/delete_job.rb | 22 +- .../snippets/cloud_scheduler/get_job.rb | 22 +- .../snippets/cloud_scheduler/list_jobs.rb | 32 +- .../snippets/cloud_scheduler/pause_job.rb | 22 +- .../snippets/cloud_scheduler/resume_job.rb | 22 +- .../snippets/cloud_scheduler/run_job.rb | 22 +- .../snippets/cloud_scheduler/update_job.rb | 22 +- ...et_metadata_google.cloud.scheduler.v1.json | 16 +- google-cloud-scheduler-v1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/cloud_scheduler/create_job.rb | 22 +- .../snippets/cloud_scheduler/delete_job.rb | 22 +- .../snippets/cloud_scheduler/get_job.rb | 22 +- .../snippets/cloud_scheduler/list_jobs.rb | 32 +- .../snippets/cloud_scheduler/pause_job.rb | 22 +- .../snippets/cloud_scheduler/resume_job.rb | 22 +- .../snippets/cloud_scheduler/run_job.rb | 22 +- .../snippets/cloud_scheduler/update_job.rb | 22 +- ...tadata_google.cloud.scheduler.v1beta1.json | 16 +- google-cloud-secret_manager-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../access_secret_version.rb | 22 +- .../add_secret_version.rb | 22 +- .../secret_manager_service/create_secret.rb | 22 +- .../secret_manager_service/delete_secret.rb | 22 +- .../destroy_secret_version.rb | 22 +- .../disable_secret_version.rb | 22 +- .../enable_secret_version.rb | 22 +- .../secret_manager_service/get_iam_policy.rb | 22 +- .../secret_manager_service/get_secret.rb | 22 +- .../get_secret_version.rb | 22 +- .../list_secret_versions.rb | 32 +- .../secret_manager_service/list_secrets.rb | 32 +- .../secret_manager_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../secret_manager_service/update_secret.rb | 22 +- ...etadata_google.cloud.secretmanager.v1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../access_secret_version.rb | 22 +- .../add_secret_version.rb | 22 +- .../secret_manager_service/create_secret.rb | 22 +- .../secret_manager_service/delete_secret.rb | 22 +- .../destroy_secret_version.rb | 22 +- .../disable_secret_version.rb | 22 +- .../enable_secret_version.rb | 22 +- .../secret_manager_service/get_iam_policy.rb | 22 +- .../secret_manager_service/get_secret.rb | 22 +- .../get_secret_version.rb | 22 +- .../list_secret_versions.rb | 32 +- .../secret_manager_service/list_secrets.rb | 32 +- .../secret_manager_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../secret_manager_service/update_secret.rb | 22 +- ...metadata_google.cloud.secrets.v1beta1.json | 30 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../activate_certificate_authority.rb | 34 +- .../create_ca_pool.rb | 34 +- .../create_certificate.rb | 22 +- .../create_certificate_authority.rb | 34 +- .../create_certificate_template.rb | 34 +- .../delete_ca_pool.rb | 34 +- .../delete_certificate_authority.rb | 34 +- .../delete_certificate_template.rb | 34 +- .../disable_certificate_authority.rb | 34 +- .../enable_certificate_authority.rb | 34 +- .../fetch_ca_certs.rb | 22 +- .../fetch_certificate_authority_csr.rb | 22 +- .../get_ca_pool.rb | 22 +- .../get_certificate.rb | 22 +- .../get_certificate_authority.rb | 22 +- .../get_certificate_revocation_list.rb | 22 +- .../get_certificate_template.rb | 22 +- .../list_ca_pools.rb | 32 +- .../list_certificate_authorities.rb | 32 +- .../list_certificate_revocation_lists.rb | 32 +- .../list_certificate_templates.rb | 32 +- .../list_certificates.rb | 32 +- .../revoke_certificate.rb | 22 +- .../undelete_certificate_authority.rb | 34 +- .../update_ca_pool.rb | 34 +- .../update_certificate.rb | 22 +- .../update_certificate_authority.rb | 34 +- .../update_certificate_revocation_list.rb | 34 +- .../update_certificate_template.rb | 34 +- ...ta_google.cloud.security.privateca.v1.json | 58 +-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../activate_certificate_authority.rb | 34 +- .../create_certificate.rb | 22 +- .../create_certificate_authority.rb | 34 +- .../disable_certificate_authority.rb | 34 +- .../enable_certificate_authority.rb | 34 +- .../fetch_certificate_authority_csr.rb | 22 +- .../get_certificate.rb | 22 +- .../get_certificate_authority.rb | 22 +- .../get_certificate_revocation_list.rb | 22 +- .../get_reusable_config.rb | 22 +- .../list_certificate_authorities.rb | 32 +- .../list_certificate_revocation_lists.rb | 32 +- .../list_certificates.rb | 32 +- .../list_reusable_configs.rb | 32 +- .../restore_certificate_authority.rb | 34 +- .../revoke_certificate.rb | 22 +- .../schedule_delete_certificate_authority.rb | 34 +- .../update_certificate.rb | 22 +- .../update_certificate_authority.rb | 34 +- .../update_certificate_revocation_list.rb | 34 +- ...ogle.cloud.security.privateca.v1beta1.json | 40 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../create_external_account_key.rb | 22 +- ...oogle.cloud.security.publicca.v1beta1.json | 2 +- google-cloud-security_center-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../security_center/bulk_mute_findings.rb | 34 +- .../create_big_query_export.rb | 22 +- .../security_center/create_finding.rb | 22 +- .../security_center/create_mute_config.rb | 22 +- .../create_notification_config.rb | 22 +- .../snippets/security_center/create_source.rb | 22 +- .../delete_big_query_export.rb | 22 +- .../security_center/delete_mute_config.rb | 22 +- .../delete_notification_config.rb | 22 +- .../security_center/get_big_query_export.rb | 22 +- .../security_center/get_iam_policy.rb | 22 +- .../security_center/get_mute_config.rb | 22 +- .../get_notification_config.rb | 22 +- .../get_organization_settings.rb | 22 +- .../snippets/security_center/get_source.rb | 22 +- .../snippets/security_center/group_assets.rb | 32 +- .../security_center/group_findings.rb | 32 +- .../snippets/security_center/list_assets.rb | 32 +- .../security_center/list_big_query_exports.rb | 32 +- .../snippets/security_center/list_findings.rb | 32 +- .../security_center/list_mute_configs.rb | 32 +- .../list_notification_configs.rb | 32 +- .../snippets/security_center/list_sources.rb | 32 +- .../security_center/run_asset_discovery.rb | 34 +- .../security_center/set_finding_state.rb | 22 +- .../security_center/set_iam_policy.rb | 22 +- .../snippets/security_center/set_mute.rb | 22 +- .../security_center/test_iam_permissions.rb | 22 +- .../update_big_query_export.rb | 22 +- .../security_center/update_external_system.rb | 22 +- .../security_center/update_finding.rb | 22 +- .../security_center/update_mute_config.rb | 22 +- .../update_notification_config.rb | 22 +- .../update_organization_settings.rb | 22 +- .../security_center/update_security_marks.rb | 22 +- .../snippets/security_center/update_source.rb | 22 +- ...tadata_google.cloud.securitycenter.v1.json | 72 ++-- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../security_center/create_finding.rb | 22 +- .../create_notification_config.rb | 22 +- .../snippets/security_center/create_source.rb | 22 +- .../delete_notification_config.rb | 22 +- .../security_center/get_iam_policy.rb | 22 +- .../get_notification_config.rb | 22 +- .../get_organization_settings.rb | 22 +- .../snippets/security_center/get_source.rb | 22 +- .../snippets/security_center/group_assets.rb | 32 +- .../security_center/group_findings.rb | 32 +- .../snippets/security_center/list_assets.rb | 32 +- .../snippets/security_center/list_findings.rb | 32 +- .../list_notification_configs.rb | 32 +- .../snippets/security_center/list_sources.rb | 32 +- .../security_center/run_asset_discovery.rb | 34 +- .../security_center/set_finding_state.rb | 22 +- .../security_center/set_iam_policy.rb | 22 +- .../security_center/test_iam_permissions.rb | 22 +- .../security_center/update_finding.rb | 22 +- .../update_notification_config.rb | 22 +- .../update_organization_settings.rb | 22 +- .../security_center/update_security_marks.rb | 22 +- .../snippets/security_center/update_source.rb | 22 +- ...google.cloud.securitycenter.v1p1beta1.json | 46 +-- google-cloud-service_control-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../quota_controller/allocate_quota.rb | 22 +- .../snippets/service_controller/check.rb | 22 +- .../snippets/service_controller/report.rb | 22 +- ...metadata_google.api.servicecontrol.v1.json | 6 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../lookup_service/resolve_service.rb | 22 +- .../registration_service/create_endpoint.rb | 22 +- .../registration_service/create_namespace.rb | 22 +- .../registration_service/create_service.rb | 22 +- .../registration_service/delete_endpoint.rb | 22 +- .../registration_service/delete_namespace.rb | 22 +- .../registration_service/delete_service.rb | 22 +- .../registration_service/get_endpoint.rb | 22 +- .../registration_service/get_iam_policy.rb | 22 +- .../registration_service/get_namespace.rb | 22 +- .../registration_service/get_service.rb | 22 +- .../registration_service/list_endpoints.rb | 32 +- .../registration_service/list_namespaces.rb | 32 +- .../registration_service/list_services.rb | 32 +- .../registration_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../registration_service/update_endpoint.rb | 22 +- .../registration_service/update_namespace.rb | 22 +- .../registration_service/update_service.rb | 22 +- ...data_google.cloud.servicedirectory.v1.json | 38 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../lookup_service/resolve_service.rb | 22 +- .../registration_service/create_endpoint.rb | 22 +- .../registration_service/create_namespace.rb | 22 +- .../registration_service/create_service.rb | 22 +- .../registration_service/delete_endpoint.rb | 22 +- .../registration_service/delete_namespace.rb | 22 +- .../registration_service/delete_service.rb | 22 +- .../registration_service/get_endpoint.rb | 22 +- .../registration_service/get_iam_policy.rb | 22 +- .../registration_service/get_namespace.rb | 22 +- .../registration_service/get_service.rb | 22 +- .../registration_service/list_endpoints.rb | 32 +- .../registration_service/list_namespaces.rb | 32 +- .../registration_service/list_services.rb | 32 +- .../registration_service/set_iam_policy.rb | 22 +- .../test_iam_permissions.rb | 22 +- .../registration_service/update_endpoint.rb | 22 +- .../registration_service/update_namespace.rb | 22 +- .../registration_service/update_service.rb | 22 +- ...google.cloud.servicedirectory.v1beta1.json | 38 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../service_manager/create_service.rb | 34 +- .../service_manager/create_service_config.rb | 22 +- .../service_manager/create_service_rollout.rb | 34 +- .../service_manager/delete_service.rb | 34 +- .../service_manager/generate_config_report.rb | 22 +- .../snippets/service_manager/get_service.rb | 22 +- .../service_manager/get_service_config.rb | 22 +- .../service_manager/get_service_rollout.rb | 22 +- .../service_manager/list_service_configs.rb | 32 +- .../service_manager/list_service_rollouts.rb | 32 +- .../snippets/service_manager/list_services.rb | 32 +- .../service_manager/submit_config_source.rb | 34 +- .../service_manager/undelete_service.rb | 34 +- ...adata_google.api.servicemanagement.v1.json | 26 +- google-cloud-service_usage-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../service_usage/batch_enable_services.rb | 34 +- .../service_usage/batch_get_services.rb | 22 +- .../snippets/service_usage/disable_service.rb | 34 +- .../snippets/service_usage/enable_service.rb | 34 +- .../snippets/service_usage/get_service.rb | 22 +- .../snippets/service_usage/list_services.rb | 32 +- ...t_metadata_google.api.serviceusage.v1.json | 12 +- google-cloud-shell-v1/.rubocop.yml | 3 + google-cloud-shell-v1/snippets/Gemfile | 4 +- .../cloud_shell_service/add_public_key.rb | 34 +- .../authorize_environment.rb | 34 +- .../cloud_shell_service/get_environment.rb | 22 +- .../cloud_shell_service/remove_public_key.rb | 34 +- .../cloud_shell_service/start_environment.rb | 34 +- ...nippet_metadata_google.cloud.shell.v1.json | 10 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/database_admin/copy_backup.rb | 34 +- .../snippets/database_admin/create_backup.rb | 34 +- .../database_admin/create_database.rb | 34 +- .../snippets/database_admin/delete_backup.rb | 22 +- .../snippets/database_admin/drop_database.rb | 22 +- .../snippets/database_admin/get_backup.rb | 22 +- .../snippets/database_admin/get_database.rb | 22 +- .../database_admin/get_database_ddl.rb | 22 +- .../snippets/database_admin/get_iam_policy.rb | 22 +- .../database_admin/list_backup_operations.rb | 32 +- .../snippets/database_admin/list_backups.rb | 32 +- .../list_database_operations.rb | 32 +- .../database_admin/list_database_roles.rb | 32 +- .../snippets/database_admin/list_databases.rb | 32 +- .../database_admin/restore_database.rb | 34 +- .../snippets/database_admin/set_iam_policy.rb | 22 +- .../database_admin/test_iam_permissions.rb | 22 +- .../snippets/database_admin/update_backup.rb | 22 +- .../database_admin/update_database_ddl.rb | 34 +- ...data_google.spanner.admin.database.v1.json | 38 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../instance_admin/create_instance.rb | 34 +- .../instance_admin/create_instance_config.rb | 34 +- .../instance_admin/delete_instance.rb | 22 +- .../instance_admin/delete_instance_config.rb | 22 +- .../snippets/instance_admin/get_iam_policy.rb | 22 +- .../snippets/instance_admin/get_instance.rb | 22 +- .../instance_admin/get_instance_config.rb | 22 +- .../list_instance_config_operations.rb | 32 +- .../instance_admin/list_instance_configs.rb | 32 +- .../snippets/instance_admin/list_instances.rb | 32 +- .../snippets/instance_admin/set_iam_policy.rb | 22 +- .../instance_admin/test_iam_permissions.rb | 22 +- .../instance_admin/update_instance.rb | 34 +- .../instance_admin/update_instance_config.rb | 34 +- ...data_google.spanner.admin.instance.v1.json | 28 +- google-cloud-spanner-v1/.rubocop.yml | 3 + google-cloud-spanner-v1/snippets/Gemfile | 4 +- .../snippet_metadata_google.spanner.v1.json | 30 +- .../snippets/spanner/batch_create_sessions.rb | 22 +- .../snippets/spanner/begin_transaction.rb | 22 +- .../snippets/spanner/commit.rb | 22 +- .../snippets/spanner/create_session.rb | 22 +- .../snippets/spanner/delete_session.rb | 22 +- .../snippets/spanner/execute_batch_dml.rb | 22 +- .../snippets/spanner/execute_sql.rb | 22 +- .../snippets/spanner/execute_streaming_sql.rb | 26 +- .../snippets/spanner/get_session.rb | 22 +- .../snippets/spanner/list_sessions.rb | 32 +- .../snippets/spanner/partition_query.rb | 22 +- .../snippets/spanner/partition_read.rb | 22 +- .../snippets/spanner/read.rb | 22 +- .../snippets/spanner/rollback.rb | 22 +- .../snippets/spanner/streaming_read.rb | 26 +- google-cloud-speech-v1/.rubocop.yml | 3 + google-cloud-speech-v1/snippets/Gemfile | 4 +- .../adaptation/create_custom_class.rb | 22 +- .../snippets/adaptation/create_phrase_set.rb | 22 +- .../adaptation/delete_custom_class.rb | 22 +- .../snippets/adaptation/delete_phrase_set.rb | 22 +- .../snippets/adaptation/get_custom_class.rb | 22 +- .../snippets/adaptation/get_phrase_set.rb | 22 +- .../adaptation/list_custom_classes.rb | 32 +- .../snippets/adaptation/list_phrase_set.rb | 32 +- .../adaptation/update_custom_class.rb | 22 +- .../snippets/adaptation/update_phrase_set.rb | 22 +- ...ippet_metadata_google.cloud.speech.v1.json | 26 +- .../snippets/speech/long_running_recognize.rb | 34 +- .../snippets/speech/recognize.rb | 22 +- .../snippets/speech/streaming_recognize.rb | 44 +- google-cloud-speech-v1p1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../adaptation/create_custom_class.rb | 22 +- .../snippets/adaptation/create_phrase_set.rb | 22 +- .../adaptation/delete_custom_class.rb | 22 +- .../snippets/adaptation/delete_phrase_set.rb | 22 +- .../snippets/adaptation/get_custom_class.rb | 22 +- .../snippets/adaptation/get_phrase_set.rb | 22 +- .../adaptation/list_custom_classes.rb | 32 +- .../snippets/adaptation/list_phrase_set.rb | 32 +- .../adaptation/update_custom_class.rb | 22 +- .../snippets/adaptation/update_phrase_set.rb | 22 +- ...etadata_google.cloud.speech.v1p1beta1.json | 26 +- .../snippets/speech/long_running_recognize.rb | 34 +- .../snippets/speech/recognize.rb | 22 +- .../snippets/speech/streaming_recognize.rb | 44 +- google-cloud-speech-v2/.rubocop.yml | 3 + google-cloud-speech-v2/snippets/Gemfile | 4 +- ...ippet_metadata_google.cloud.speech.v2.json | 46 +-- .../snippets/speech/batch_recognize.rb | 34 +- .../snippets/speech/create_custom_class.rb | 34 +- .../snippets/speech/create_phrase_set.rb | 34 +- .../snippets/speech/create_recognizer.rb | 34 +- .../snippets/speech/delete_custom_class.rb | 34 +- .../snippets/speech/delete_phrase_set.rb | 34 +- .../snippets/speech/delete_recognizer.rb | 34 +- .../snippets/speech/get_config.rb | 22 +- .../snippets/speech/get_custom_class.rb | 22 +- .../snippets/speech/get_phrase_set.rb | 22 +- .../snippets/speech/get_recognizer.rb | 22 +- .../snippets/speech/list_custom_classes.rb | 32 +- .../snippets/speech/list_phrase_sets.rb | 32 +- .../snippets/speech/list_recognizers.rb | 32 +- .../snippets/speech/recognize.rb | 22 +- .../snippets/speech/streaming_recognize.rb | 44 +- .../snippets/speech/undelete_custom_class.rb | 34 +- .../snippets/speech/undelete_phrase_set.rb | 34 +- .../snippets/speech/undelete_recognizer.rb | 34 +- .../snippets/speech/update_config.rb | 22 +- .../snippets/speech/update_custom_class.rb | 34 +- .../snippets/speech/update_phrase_set.rb | 34 +- .../snippets/speech/update_recognizer.rb | 34 +- google-cloud-storage_transfer-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...et_metadata_google.storagetransfer.v1.json | 28 +- .../create_agent_pool.rb | 22 +- .../create_transfer_job.rb | 22 +- .../delete_agent_pool.rb | 22 +- .../delete_transfer_job.rb | 22 +- .../get_agent_pool.rb | 22 +- .../get_google_service_account.rb | 22 +- .../get_transfer_job.rb | 22 +- .../list_agent_pools.rb | 32 +- .../list_transfer_jobs.rb | 32 +- .../pause_transfer_operation.rb | 22 +- .../resume_transfer_operation.rb | 22 +- .../run_transfer_job.rb | 34 +- .../update_agent_pool.rb | 22 +- .../update_transfer_job.rb | 22 +- google-cloud-talent-v4/.rubocop.yml | 3 + google-cloud-talent-v4/snippets/Gemfile | 4 +- .../company_service/create_company.rb | 22 +- .../company_service/delete_company.rb | 22 +- .../snippets/company_service/get_company.rb | 22 +- .../company_service/list_companies.rb | 32 +- .../company_service/update_company.rb | 22 +- .../snippets/completion/complete_query.rb | 22 +- .../event_service/create_client_event.rb | 22 +- .../snippets/job_service/batch_create_jobs.rb | 34 +- .../snippets/job_service/batch_delete_jobs.rb | 34 +- .../snippets/job_service/batch_update_jobs.rb | 34 +- .../snippets/job_service/create_job.rb | 22 +- .../snippets/job_service/delete_job.rb | 22 +- .../snippets/job_service/get_job.rb | 22 +- .../snippets/job_service/list_jobs.rb | 32 +- .../snippets/job_service/search_jobs.rb | 22 +- .../job_service/search_jobs_for_alert.rb | 22 +- .../snippets/job_service/update_job.rb | 22 +- ...ippet_metadata_google.cloud.talent.v4.json | 44 +- .../snippets/tenant_service/create_tenant.rb | 22 +- .../snippets/tenant_service/delete_tenant.rb | 22 +- .../snippets/tenant_service/get_tenant.rb | 22 +- .../snippets/tenant_service/list_tenants.rb | 32 +- .../snippets/tenant_service/update_tenant.rb | 22 +- google-cloud-talent-v4beta1/.rubocop.yml | 3 + google-cloud-talent-v4beta1/snippets/Gemfile | 4 +- .../company_service/create_company.rb | 22 +- .../company_service/delete_company.rb | 22 +- .../snippets/company_service/get_company.rb | 22 +- .../company_service/list_companies.rb | 32 +- .../company_service/update_company.rb | 22 +- .../snippets/completion/complete_query.rb | 22 +- .../event_service/create_client_event.rb | 22 +- .../snippets/job_service/batch_create_jobs.rb | 34 +- .../snippets/job_service/batch_delete_jobs.rb | 22 +- .../snippets/job_service/batch_update_jobs.rb | 34 +- .../snippets/job_service/create_job.rb | 22 +- .../snippets/job_service/delete_job.rb | 22 +- .../snippets/job_service/get_job.rb | 22 +- .../snippets/job_service/list_jobs.rb | 32 +- .../snippets/job_service/search_jobs.rb | 22 +- .../job_service/search_jobs_for_alert.rb | 22 +- .../snippets/job_service/update_job.rb | 22 +- ..._metadata_google.cloud.talent.v4beta1.json | 44 +- .../snippets/tenant_service/create_tenant.rb | 22 +- .../snippets/tenant_service/delete_tenant.rb | 22 +- .../snippets/tenant_service/get_tenant.rb | 22 +- .../snippets/tenant_service/list_tenants.rb | 32 +- .../snippets/tenant_service/update_tenant.rb | 22 +- google-cloud-tasks-v2/.rubocop.yml | 3 + google-cloud-tasks-v2/snippets/Gemfile | 4 +- .../snippets/cloud_tasks/create_queue.rb | 22 +- .../snippets/cloud_tasks/create_task.rb | 22 +- .../snippets/cloud_tasks/delete_queue.rb | 22 +- .../snippets/cloud_tasks/delete_task.rb | 22 +- .../snippets/cloud_tasks/get_iam_policy.rb | 22 +- .../snippets/cloud_tasks/get_queue.rb | 22 +- .../snippets/cloud_tasks/get_task.rb | 22 +- .../snippets/cloud_tasks/list_queues.rb | 32 +- .../snippets/cloud_tasks/list_tasks.rb | 32 +- .../snippets/cloud_tasks/pause_queue.rb | 22 +- .../snippets/cloud_tasks/purge_queue.rb | 22 +- .../snippets/cloud_tasks/resume_queue.rb | 22 +- .../snippets/cloud_tasks/run_task.rb | 22 +- .../snippets/cloud_tasks/set_iam_policy.rb | 22 +- .../cloud_tasks/test_iam_permissions.rb | 22 +- .../snippets/cloud_tasks/update_queue.rb | 22 +- ...nippet_metadata_google.cloud.tasks.v2.json | 32 +- google-cloud-tasks-v2beta2/.rubocop.yml | 3 + google-cloud-tasks-v2beta2/snippets/Gemfile | 4 +- .../snippets/cloud_tasks/acknowledge_task.rb | 22 +- .../snippets/cloud_tasks/cancel_lease.rb | 22 +- .../snippets/cloud_tasks/create_queue.rb | 22 +- .../snippets/cloud_tasks/create_task.rb | 22 +- .../snippets/cloud_tasks/delete_queue.rb | 22 +- .../snippets/cloud_tasks/delete_task.rb | 22 +- .../snippets/cloud_tasks/get_iam_policy.rb | 22 +- .../snippets/cloud_tasks/get_queue.rb | 22 +- .../snippets/cloud_tasks/get_task.rb | 22 +- .../snippets/cloud_tasks/lease_tasks.rb | 22 +- .../snippets/cloud_tasks/list_queues.rb | 32 +- .../snippets/cloud_tasks/list_tasks.rb | 32 +- .../snippets/cloud_tasks/pause_queue.rb | 22 +- .../snippets/cloud_tasks/purge_queue.rb | 22 +- .../snippets/cloud_tasks/renew_lease.rb | 22 +- .../snippets/cloud_tasks/resume_queue.rb | 22 +- .../snippets/cloud_tasks/run_task.rb | 22 +- .../snippets/cloud_tasks/set_iam_policy.rb | 22 +- .../cloud_tasks/test_iam_permissions.rb | 22 +- .../snippets/cloud_tasks/update_queue.rb | 22 +- ...t_metadata_google.cloud.tasks.v2beta2.json | 40 +- google-cloud-tasks-v2beta3/.rubocop.yml | 3 + google-cloud-tasks-v2beta3/snippets/Gemfile | 4 +- .../snippets/cloud_tasks/create_queue.rb | 22 +- .../snippets/cloud_tasks/create_task.rb | 22 +- .../snippets/cloud_tasks/delete_queue.rb | 22 +- .../snippets/cloud_tasks/delete_task.rb | 22 +- .../snippets/cloud_tasks/get_iam_policy.rb | 22 +- .../snippets/cloud_tasks/get_queue.rb | 22 +- .../snippets/cloud_tasks/get_task.rb | 22 +- .../snippets/cloud_tasks/list_queues.rb | 32 +- .../snippets/cloud_tasks/list_tasks.rb | 32 +- .../snippets/cloud_tasks/pause_queue.rb | 22 +- .../snippets/cloud_tasks/purge_queue.rb | 22 +- .../snippets/cloud_tasks/resume_queue.rb | 22 +- .../snippets/cloud_tasks/run_task.rb | 22 +- .../snippets/cloud_tasks/set_iam_policy.rb | 22 +- .../cloud_tasks/test_iam_permissions.rb | 22 +- .../snippets/cloud_tasks/update_queue.rb | 22 +- ...t_metadata_google.cloud.tasks.v2beta3.json | 32 +- google-cloud-text_to_speech-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...metadata_google.cloud.texttospeech.v1.json | 4 +- .../snippets/text_to_speech/list_voices.rb | 22 +- .../text_to_speech/synthesize_speech.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...ata_google.cloud.texttospeech.v1beta1.json | 4 +- .../snippets/text_to_speech/list_voices.rb | 22 +- .../text_to_speech/synthesize_speech.rb | 22 +- google-cloud-tpu-v1/.rubocop.yml | 3 + google-cloud-tpu-v1/snippets/Gemfile | 4 +- .../snippet_metadata_google.cloud.tpu.v1.json | 22 +- .../snippets/tpu/create_node.rb | 34 +- .../snippets/tpu/delete_node.rb | 34 +- .../snippets/tpu/get_accelerator_type.rb | 22 +- google-cloud-tpu-v1/snippets/tpu/get_node.rb | 22 +- .../snippets/tpu/get_tensor_flow_version.rb | 22 +- .../snippets/tpu/list_accelerator_types.rb | 32 +- .../snippets/tpu/list_nodes.rb | 32 +- .../snippets/tpu/list_tensor_flow_versions.rb | 32 +- .../snippets/tpu/reimage_node.rb | 34 +- .../snippets/tpu/start_node.rb | 34 +- google-cloud-tpu-v1/snippets/tpu/stop_node.rb | 34 +- google-cloud-trace-v1/.rubocop.yml | 3 + google-cloud-trace-v1/snippets/Gemfile | 4 +- ...etadata_google.devtools.cloudtrace.v1.json | 6 +- .../snippets/trace_service/get_trace.rb | 22 +- .../snippets/trace_service/list_traces.rb | 32 +- .../snippets/trace_service/patch_traces.rb | 22 +- google-cloud-trace-v2/.rubocop.yml | 3 + google-cloud-trace-v2/snippets/Gemfile | 4 +- ...etadata_google.devtools.cloudtrace.v2.json | 4 +- .../trace_service/batch_write_spans.rb | 22 +- .../snippets/trace_service/create_span.rb | 22 +- google-cloud-translate-v3/.rubocop.yml | 3 + google-cloud-translate-v3/snippets/Gemfile | 4 +- ..._metadata_google.cloud.translation.v3.json | 20 +- .../batch_translate_document.rb | 34 +- .../batch_translate_text.rb | 34 +- .../translation_service/create_glossary.rb | 34 +- .../translation_service/delete_glossary.rb | 34 +- .../translation_service/detect_language.rb | 22 +- .../translation_service/get_glossary.rb | 22 +- .../get_supported_languages.rb | 22 +- .../translation_service/list_glossaries.rb | 32 +- .../translation_service/translate_document.rb | 22 +- .../translation_service/translate_text.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../livestream_service/create_channel.rb | 34 +- .../livestream_service/create_event.rb | 22 +- .../livestream_service/create_input.rb | 34 +- .../livestream_service/delete_channel.rb | 34 +- .../livestream_service/delete_event.rb | 22 +- .../livestream_service/delete_input.rb | 34 +- .../livestream_service/get_channel.rb | 22 +- .../snippets/livestream_service/get_event.rb | 22 +- .../snippets/livestream_service/get_input.rb | 22 +- .../livestream_service/list_channels.rb | 32 +- .../livestream_service/list_events.rb | 32 +- .../livestream_service/list_inputs.rb | 32 +- .../livestream_service/start_channel.rb | 34 +- .../livestream_service/stop_channel.rb | 34 +- .../livestream_service/update_channel.rb | 34 +- .../livestream_service/update_input.rb | 34 +- ...data_google.cloud.video.livestream.v1.json | 32 +- google-cloud-video-stitcher-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...tadata_google.cloud.video.stitcher.v1.json | 40 +- .../video_stitcher_service/create_cdn_key.rb | 22 +- .../create_live_session.rb | 22 +- .../video_stitcher_service/create_slate.rb | 22 +- .../create_vod_session.rb | 22 +- .../video_stitcher_service/delete_cdn_key.rb | 22 +- .../video_stitcher_service/delete_slate.rb | 22 +- .../video_stitcher_service/get_cdn_key.rb | 22 +- .../get_live_ad_tag_detail.rb | 22 +- .../get_live_session.rb | 22 +- .../video_stitcher_service/get_slate.rb | 22 +- .../get_vod_ad_tag_detail.rb | 22 +- .../video_stitcher_service/get_vod_session.rb | 22 +- .../get_vod_stitch_detail.rb | 22 +- .../video_stitcher_service/list_cdn_keys.rb | 32 +- .../list_live_ad_tag_details.rb | 32 +- .../video_stitcher_service/list_slates.rb | 32 +- .../list_vod_ad_tag_details.rb | 32 +- .../list_vod_stitch_details.rb | 32 +- .../video_stitcher_service/update_cdn_key.rb | 22 +- .../video_stitcher_service/update_slate.rb | 22 +- google-cloud-video-transcoder-v1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...data_google.cloud.video.transcoder.v1.json | 16 +- .../snippets/transcoder_service/create_job.rb | 22 +- .../transcoder_service/create_job_template.rb | 22 +- .../snippets/transcoder_service/delete_job.rb | 22 +- .../transcoder_service/delete_job_template.rb | 22 +- .../snippets/transcoder_service/get_job.rb | 22 +- .../transcoder_service/get_job_template.rb | 22 +- .../transcoder_service/list_job_templates.rb | 32 +- .../snippets/transcoder_service/list_jobs.rb | 32 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...ata_google.cloud.videointelligence.v1.json | 2 +- .../annotate_video.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...oogle.cloud.videointelligence.v1beta2.json | 2 +- .../annotate_video.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...gle.cloud.videointelligence.v1p1beta1.json | 2 +- .../annotate_video.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...gle.cloud.videointelligence.v1p2beta1.json | 2 +- .../annotate_video.rb | 34 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...gle.cloud.videointelligence.v1p3beta1.json | 4 +- .../streaming_annotate_video.rb | 44 +- .../annotate_video.rb | 34 +- google-cloud-vision-v1/.repo-metadata.json | 2 +- google-cloud-vision-v1/.rubocop.yml | 3 + google-cloud-vision-v1/snippets/Gemfile | 4 +- .../async_batch_annotate_files.rb | 34 +- .../async_batch_annotate_images.rb | 34 +- .../image_annotator/batch_annotate_files.rb | 22 +- .../image_annotator/batch_annotate_images.rb | 22 +- .../add_product_to_product_set.rb | 22 +- .../snippets/product_search/create_product.rb | 22 +- .../product_search/create_product_set.rb | 22 +- .../product_search/create_reference_image.rb | 22 +- .../snippets/product_search/delete_product.rb | 22 +- .../product_search/delete_product_set.rb | 22 +- .../product_search/delete_reference_image.rb | 22 +- .../snippets/product_search/get_product.rb | 22 +- .../product_search/get_product_set.rb | 22 +- .../product_search/get_reference_image.rb | 22 +- .../product_search/import_product_sets.rb | 34 +- .../product_search/list_product_sets.rb | 32 +- .../snippets/product_search/list_products.rb | 32 +- .../list_products_in_product_set.rb | 32 +- .../product_search/list_reference_images.rb | 32 +- .../snippets/product_search/purge_products.rb | 34 +- .../remove_product_from_product_set.rb | 22 +- .../snippets/product_search/update_product.rb | 22 +- .../product_search/update_product_set.rb | 22 +- ...ippet_metadata_google.cloud.vision.v1.json | 46 +-- .../.repo-metadata.json | 2 +- google-cloud-vision-v1p3beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../async_batch_annotate_files.rb | 34 +- .../image_annotator/batch_annotate_images.rb | 22 +- .../add_product_to_product_set.rb | 22 +- .../snippets/product_search/create_product.rb | 22 +- .../product_search/create_product_set.rb | 22 +- .../product_search/create_reference_image.rb | 22 +- .../snippets/product_search/delete_product.rb | 22 +- .../product_search/delete_product_set.rb | 22 +- .../product_search/delete_reference_image.rb | 22 +- .../snippets/product_search/get_product.rb | 22 +- .../product_search/get_product_set.rb | 22 +- .../product_search/get_reference_image.rb | 22 +- .../product_search/import_product_sets.rb | 34 +- .../product_search/list_product_sets.rb | 32 +- .../snippets/product_search/list_products.rb | 32 +- .../list_products_in_product_set.rb | 32 +- .../product_search/list_reference_images.rb | 32 +- .../remove_product_from_product_set.rb | 22 +- .../snippets/product_search/update_product.rb | 22 +- .../product_search/update_product_set.rb | 22 +- ...etadata_google.cloud.vision.v1p3beta1.json | 40 +- .../.repo-metadata.json | 2 +- google-cloud-vision-v1p4beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../async_batch_annotate_files.rb | 34 +- .../async_batch_annotate_images.rb | 34 +- .../image_annotator/batch_annotate_files.rb | 22 +- .../image_annotator/batch_annotate_images.rb | 22 +- .../add_product_to_product_set.rb | 22 +- .../snippets/product_search/create_product.rb | 22 +- .../product_search/create_product_set.rb | 22 +- .../product_search/create_reference_image.rb | 22 +- .../snippets/product_search/delete_product.rb | 22 +- .../product_search/delete_product_set.rb | 22 +- .../product_search/delete_reference_image.rb | 22 +- .../snippets/product_search/get_product.rb | 22 +- .../product_search/get_product_set.rb | 22 +- .../product_search/get_reference_image.rb | 22 +- .../product_search/import_product_sets.rb | 34 +- .../product_search/list_product_sets.rb | 32 +- .../snippets/product_search/list_products.rb | 32 +- .../list_products_in_product_set.rb | 32 +- .../product_search/list_reference_images.rb | 32 +- .../snippets/product_search/purge_products.rb | 34 +- .../remove_product_from_product_set.rb | 22 +- .../snippets/product_search/update_product.rb | 22 +- .../product_search/update_product_set.rb | 22 +- ...etadata_google.cloud.vision.v1p4beta1.json | 46 +-- google-cloud-vm_migration-v1/.rubocop.yml | 3 + google-cloud-vm_migration-v1/snippets/Gemfile | 4 +- ..._metadata_google.cloud.vmmigration.v1.json | 88 ++-- .../vm_migration/add_group_migration.rb | 34 +- .../snippets/vm_migration/cancel_clone_job.rb | 34 +- .../vm_migration/cancel_cutover_job.rb | 34 +- .../snippets/vm_migration/create_clone_job.rb | 34 +- .../vm_migration/create_cutover_job.rb | 34 +- .../create_datacenter_connector.rb | 34 +- .../snippets/vm_migration/create_group.rb | 34 +- .../vm_migration/create_migrating_vm.rb | 34 +- .../snippets/vm_migration/create_source.rb | 34 +- .../vm_migration/create_target_project.rb | 34 +- .../vm_migration/create_utilization_report.rb | 34 +- .../delete_datacenter_connector.rb | 34 +- .../snippets/vm_migration/delete_group.rb | 34 +- .../vm_migration/delete_migrating_vm.rb | 34 +- .../snippets/vm_migration/delete_source.rb | 34 +- .../vm_migration/delete_target_project.rb | 34 +- .../vm_migration/delete_utilization_report.rb | 34 +- .../snippets/vm_migration/fetch_inventory.rb | 22 +- .../vm_migration/finalize_migration.rb | 34 +- .../snippets/vm_migration/get_clone_job.rb | 22 +- .../snippets/vm_migration/get_cutover_job.rb | 22 +- .../vm_migration/get_datacenter_connector.rb | 22 +- .../snippets/vm_migration/get_group.rb | 22 +- .../snippets/vm_migration/get_migrating_vm.rb | 22 +- .../snippets/vm_migration/get_source.rb | 22 +- .../vm_migration/get_target_project.rb | 22 +- .../vm_migration/get_utilization_report.rb | 22 +- .../snippets/vm_migration/list_clone_jobs.rb | 32 +- .../vm_migration/list_cutover_jobs.rb | 32 +- .../list_datacenter_connectors.rb | 32 +- .../snippets/vm_migration/list_groups.rb | 32 +- .../vm_migration/list_migrating_vms.rb | 32 +- .../snippets/vm_migration/list_sources.rb | 32 +- .../vm_migration/list_target_projects.rb | 32 +- .../vm_migration/list_utilization_reports.rb | 32 +- .../snippets/vm_migration/pause_migration.rb | 34 +- .../vm_migration/remove_group_migration.rb | 34 +- .../snippets/vm_migration/resume_migration.rb | 34 +- .../snippets/vm_migration/start_migration.rb | 34 +- .../snippets/vm_migration/update_group.rb | 34 +- .../vm_migration/update_migrating_vm.rb | 34 +- .../snippets/vm_migration/update_source.rb | 34 +- .../vm_migration/update_target_project.rb | 34 +- .../vm_migration/upgrade_appliance.rb | 34 +- google-cloud-vpc_access-v1/.rubocop.yml | 3 + google-cloud-vpc_access-v1/snippets/Gemfile | 4 +- ...et_metadata_google.cloud.vpcaccess.v1.json | 8 +- .../vpc_access_service/create_connector.rb | 34 +- .../vpc_access_service/delete_connector.rb | 34 +- .../vpc_access_service/get_connector.rb | 22 +- .../vpc_access_service/list_connectors.rb | 32 +- google-cloud-web_risk-v1/.rubocop.yml | 3 + google-cloud-web_risk-v1/snippets/Gemfile | 4 +- ...ppet_metadata_google.cloud.webrisk.v1.json | 8 +- .../compute_threat_list_diff.rb | 22 +- .../web_risk_service/create_submission.rb | 22 +- .../web_risk_service/search_hashes.rb | 22 +- .../snippets/web_risk_service/search_uris.rb | 22 +- google-cloud-web_risk-v1beta1/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...metadata_google.cloud.webrisk.v1beta1.json | 6 +- .../compute_threat_list_diff.rb | 22 +- .../web_risk_service/search_hashes.rb | 22 +- .../snippets/web_risk_service/search_uris.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...ta_google.cloud.websecurityscanner.v1.json | 26 +- .../create_scan_config.rb | 22 +- .../delete_scan_config.rb | 22 +- .../web_security_scanner/get_finding.rb | 22 +- .../web_security_scanner/get_scan_config.rb | 22 +- .../web_security_scanner/get_scan_run.rb | 22 +- .../web_security_scanner/list_crawled_urls.rb | 32 +- .../list_finding_type_stats.rb | 22 +- .../web_security_scanner/list_findings.rb | 32 +- .../web_security_scanner/list_scan_configs.rb | 32 +- .../web_security_scanner/list_scan_runs.rb | 32 +- .../web_security_scanner/start_scan_run.rb | 22 +- .../web_security_scanner/stop_scan_run.rb | 22 +- .../update_scan_config.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...oogle.cloud.websecurityscanner.v1beta.json | 26 +- .../create_scan_config.rb | 22 +- .../delete_scan_config.rb | 22 +- .../web_security_scanner/get_finding.rb | 22 +- .../web_security_scanner/get_scan_config.rb | 22 +- .../web_security_scanner/get_scan_run.rb | 22 +- .../web_security_scanner/list_crawled_urls.rb | 32 +- .../list_finding_type_stats.rb | 22 +- .../web_security_scanner/list_findings.rb | 32 +- .../web_security_scanner/list_scan_configs.rb | 32 +- .../web_security_scanner/list_scan_runs.rb | 32 +- .../web_security_scanner/start_scan_run.rb | 22 +- .../web_security_scanner/stop_scan_run.rb | 22 +- .../update_scan_config.rb | 22 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/executions/cancel_execution.rb | 22 +- .../snippets/executions/create_execution.rb | 22 +- .../snippets/executions/get_execution.rb | 22 +- .../snippets/executions/list_executions.rb | 32 +- ..._google.cloud.workflows.executions.v1.json | 8 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../snippets/executions/cancel_execution.rb | 22 +- .../snippets/executions/create_execution.rb | 22 +- .../snippets/executions/get_execution.rb | 22 +- .../snippets/executions/list_executions.rb | 32 +- ...gle.cloud.workflows.executions.v1beta.json | 8 +- google-cloud-workflows-v1/.rubocop.yml | 3 + google-cloud-workflows-v1/snippets/Gemfile | 4 +- ...et_metadata_google.cloud.workflows.v1.json | 10 +- .../snippets/workflows/create_workflow.rb | 34 +- .../snippets/workflows/delete_workflow.rb | 34 +- .../snippets/workflows/get_workflow.rb | 22 +- .../snippets/workflows/list_workflows.rb | 32 +- .../snippets/workflows/update_workflow.rb | 34 +- google-cloud-workflows-v1beta/.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- ...etadata_google.cloud.workflows.v1beta.json | 10 +- .../snippets/workflows/create_workflow.rb | 34 +- .../snippets/workflows/delete_workflow.rb | 34 +- .../snippets/workflows/get_workflow.rb | 22 +- .../snippets/workflows/list_workflows.rb | 32 +- .../snippets/workflows/update_workflow.rb | 34 +- google-iam-credentials-v1/.rubocop.yml | 3 + google-iam-credentials-v1/snippets/Gemfile | 4 +- .../iam_credentials/generate_access_token.rb | 22 +- .../iam_credentials/generate_id_token.rb | 22 +- .../snippets/iam_credentials/sign_blob.rb | 22 +- .../snippets/iam_credentials/sign_jwt.rb | 22 +- ...et_metadata_google.iam.credentials.v1.json | 8 +- google-iam-v1/.rubocop.yml | 3 + google-iam-v1/snippets/Gemfile | 4 +- .../snippets/iam_policy/get_iam_policy.rb | 22 +- .../snippets/iam_policy/set_iam_policy.rb | 22 +- .../iam_policy/test_iam_permissions.rb | 22 +- .../snippet_metadata_google.iam.v1.json | 6 +- google-iam-v1beta/.rubocop.yml | 3 + google-iam-v1beta/snippets/Gemfile | 4 +- .../snippet_metadata_google.iam.v1beta.json | 24 +- .../create_workload_identity_pool.rb | 34 +- .../create_workload_identity_pool_provider.rb | 34 +- .../delete_workload_identity_pool.rb | 34 +- .../delete_workload_identity_pool_provider.rb | 34 +- .../get_workload_identity_pool.rb | 22 +- .../get_workload_identity_pool_provider.rb | 22 +- .../list_workload_identity_pool_providers.rb | 32 +- .../list_workload_identity_pools.rb | 32 +- .../undelete_workload_identity_pool.rb | 34 +- ...ndelete_workload_identity_pool_provider.rb | 34 +- .../update_workload_identity_pool.rb | 34 +- .../update_workload_identity_pool_provider.rb | 34 +- google-iam-v2/.rubocop.yml | 3 + google-iam-v2/snippets/Gemfile | 4 +- .../snippets/policies/create_policy.rb | 34 +- .../snippets/policies/delete_policy.rb | 34 +- google-iam-v2/snippets/policies/get_policy.rb | 22 +- .../snippets/policies/list_policies.rb | 32 +- .../snippets/policies/update_policy.rb | 34 +- .../snippet_metadata_google.iam.v2.json | 10 +- .../.rubocop.yml | 3 + .../snippets/Gemfile | 4 +- .../commit_service_perimeters.rb | 34 +- .../create_access_level.rb | 34 +- .../create_access_policy.rb | 34 +- .../create_gcp_user_access_binding.rb | 34 +- .../create_service_perimeter.rb | 34 +- .../delete_access_level.rb | 34 +- .../delete_access_policy.rb | 34 +- .../delete_gcp_user_access_binding.rb | 34 +- .../delete_service_perimeter.rb | 34 +- .../get_access_level.rb | 22 +- .../get_access_policy.rb | 22 +- .../get_gcp_user_access_binding.rb | 22 +- .../get_service_perimeter.rb | 22 +- .../list_access_levels.rb | 32 +- .../list_access_policies.rb | 32 +- .../list_gcp_user_access_bindings.rb | 32 +- .../list_service_perimeters.rb | 32 +- .../replace_access_levels.rb | 34 +- .../replace_service_perimeters.rb | 34 +- .../update_access_level.rb | 34 +- .../update_access_policy.rb | 34 +- .../update_gcp_user_access_binding.rb | 34 +- .../update_service_perimeter.rb | 34 +- ...ogle.identity.accesscontextmanager.v1.json | 46 +-- grafeas-v1/.rubocop.yml | 3 + grafeas-v1/snippets/Gemfile | 4 +- .../snippets/grafeas/batch_create_notes.rb | 22 +- .../grafeas/batch_create_occurrences.rb | 22 +- grafeas-v1/snippets/grafeas/create_note.rb | 22 +- .../snippets/grafeas/create_occurrence.rb | 22 +- grafeas-v1/snippets/grafeas/delete_note.rb | 22 +- .../snippets/grafeas/delete_occurrence.rb | 22 +- grafeas-v1/snippets/grafeas/get_note.rb | 22 +- grafeas-v1/snippets/grafeas/get_occurrence.rb | 22 +- .../snippets/grafeas/get_occurrence_note.rb | 22 +- .../snippets/grafeas/list_note_occurrences.rb | 32 +- grafeas-v1/snippets/grafeas/list_notes.rb | 32 +- .../snippets/grafeas/list_occurrences.rb | 32 +- grafeas-v1/snippets/grafeas/update_note.rb | 22 +- .../snippets/grafeas/update_occurrence.rb | 22 +- .../snippets/snippet_metadata_grafeas.v1.json | 28 +- 3713 files changed, 55469 insertions(+), 36101 deletions(-) diff --git a/google-analytics-admin-v1alpha/.rubocop.yml b/google-analytics-admin-v1alpha/.rubocop.yml index 37869ab618e1..d63a7b628132 100644 --- a/google-analytics-admin-v1alpha/.rubocop.yml +++ b/google-analytics-admin-v1alpha/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-analytics-admin-v1alpha.rb" diff --git a/google-analytics-admin-v1alpha/snippets/Gemfile b/google-analytics-admin-v1alpha/snippets/Gemfile index b151be392ee8..99702247ff17 100755 --- a/google-analytics-admin-v1alpha/snippets/Gemfile +++ b/google-analytics-admin-v1alpha/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/acknowledge_user_data_collection.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/acknowledge_user_data_collection.rb index 86b1ab187cc7..49f8c8828889 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/acknowledge_user_data_collection.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/acknowledge_user_data_collection.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#acknowledge_user_data_collection +# +def acknowledge_user_data_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::AcknowledgeUserDataCollectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::AcknowledgeUserDataCollectionRequest.new -# Call the acknowledge_user_data_collection method. -result = client.acknowledge_user_data_collection request + # Call the acknowledge_user_data_collection method. + result = client.acknowledge_user_data_collection request -# The returned object is of type Google::Analytics::Admin::V1alpha::AcknowledgeUserDataCollectionResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::AcknowledgeUserDataCollectionResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AcknowledgeUserDataCollection_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/approve_display_video360_advertiser_link_proposal.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/approve_display_video360_advertiser_link_proposal.rb index d10f09cfab4b..80b63d92fd8b 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/approve_display_video360_advertiser_link_proposal.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/approve_display_video360_advertiser_link_proposal.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#approve_display_video360_advertiser_link_proposal +# +def approve_display_video360_advertiser_link_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ApproveDisplayVideo360AdvertiserLinkProposalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ApproveDisplayVideo360AdvertiserLinkProposalRequest.new -# Call the approve_display_video360_advertiser_link_proposal method. -result = client.approve_display_video360_advertiser_link_proposal request + # Call the approve_display_video360_advertiser_link_proposal method. + result = client.approve_display_video360_advertiser_link_proposal request -# The returned object is of type Google::Analytics::Admin::V1alpha::ApproveDisplayVideo360AdvertiserLinkProposalResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::ApproveDisplayVideo360AdvertiserLinkProposalResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ApproveDisplayVideo360AdvertiserLinkProposal_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_audience.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_audience.rb index c1388da4ea9d..36f51588eb7c 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_audience.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_audience.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#archive_audience +# +def archive_audience + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ArchiveAudienceRequest.new -# Call the archive_audience method. -result = client.archive_audience request + # Call the archive_audience method. + result = client.archive_audience request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveAudience_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_dimension.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_dimension.rb index 32b2430d5e57..1bba99b3d1be 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_dimension.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_dimension.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#archive_custom_dimension +# +def archive_custom_dimension + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ArchiveCustomDimensionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ArchiveCustomDimensionRequest.new -# Call the archive_custom_dimension method. -result = client.archive_custom_dimension request + # Call the archive_custom_dimension method. + result = client.archive_custom_dimension request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomDimension_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_metric.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_metric.rb index 4b7a888eb920..0961de623c29 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_metric.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/archive_custom_metric.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#archive_custom_metric +# +def archive_custom_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ArchiveCustomMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ArchiveCustomMetricRequest.new -# Call the archive_custom_metric method. -result = client.archive_custom_metric request + # Call the archive_custom_metric method. + result = client.archive_custom_metric request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ArchiveCustomMetric_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/audit_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/audit_user_links.rb index 499cf9103a6f..e76d060486d3 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/audit_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/audit_user_links.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#audit_user_links +# +def audit_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::AuditUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::AuditUserLinksRequest.new -# Call the audit_user_links method. -result = client.audit_user_links request + # Call the audit_user_links method. + result = client.audit_user_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::AuditUserLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::AuditUserLink. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_AuditUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_create_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_create_user_links.rb index 2bd1d421d465..2d8ecdf3e714 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_create_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_create_user_links.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#batch_create_user_links +# +def batch_create_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::BatchCreateUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::BatchCreateUserLinksRequest.new -# Call the batch_create_user_links method. -result = client.batch_create_user_links request + # Call the batch_create_user_links method. + result = client.batch_create_user_links request -# The returned object is of type Google::Analytics::Admin::V1alpha::BatchCreateUserLinksResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::BatchCreateUserLinksResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchCreateUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_delete_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_delete_user_links.rb index c9c588e2ef67..60a7a2fed488 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_delete_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_delete_user_links.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#batch_delete_user_links +# +def batch_delete_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::BatchDeleteUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::BatchDeleteUserLinksRequest.new -# Call the batch_delete_user_links method. -result = client.batch_delete_user_links request + # Call the batch_delete_user_links method. + result = client.batch_delete_user_links request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchDeleteUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_get_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_get_user_links.rb index 17acb271d031..1de0f0288459 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_get_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_get_user_links.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#batch_get_user_links +# +def batch_get_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::BatchGetUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::BatchGetUserLinksRequest.new -# Call the batch_get_user_links method. -result = client.batch_get_user_links request + # Call the batch_get_user_links method. + result = client.batch_get_user_links request -# The returned object is of type Google::Analytics::Admin::V1alpha::BatchGetUserLinksResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::BatchGetUserLinksResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchGetUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_update_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_update_user_links.rb index 6ac22e124e19..f76e133a70d0 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_update_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/batch_update_user_links.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#batch_update_user_links +# +def batch_update_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::BatchUpdateUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::BatchUpdateUserLinksRequest.new -# Call the batch_update_user_links method. -result = client.batch_update_user_links request + # Call the batch_update_user_links method. + result = client.batch_update_user_links request -# The returned object is of type Google::Analytics::Admin::V1alpha::BatchUpdateUserLinksResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::BatchUpdateUserLinksResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_BatchUpdateUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/cancel_display_video360_advertiser_link_proposal.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/cancel_display_video360_advertiser_link_proposal.rb index 1a3cade00e55..2bf2de3a8cf3 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/cancel_display_video360_advertiser_link_proposal.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/cancel_display_video360_advertiser_link_proposal.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#cancel_display_video360_advertiser_link_proposal +# +def cancel_display_video360_advertiser_link_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CancelDisplayVideo360AdvertiserLinkProposalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CancelDisplayVideo360AdvertiserLinkProposalRequest.new -# Call the cancel_display_video360_advertiser_link_proposal method. -result = client.cancel_display_video360_advertiser_link_proposal request + # Call the cancel_display_video360_advertiser_link_proposal method. + result = client.cancel_display_video360_advertiser_link_proposal request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CancelDisplayVideo360AdvertiserLinkProposal_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_audience.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_audience.rb index b85a015e99fb..1e1261edacc4 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_audience.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_audience.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_audience +# +def create_audience + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateAudienceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateAudienceRequest.new -# Call the create_audience method. -result = client.create_audience request + # Call the create_audience method. + result = client.create_audience request -# The returned object is of type Google::Analytics::Admin::V1alpha::Audience. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Audience. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateAudience_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_conversion_event.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_conversion_event.rb index 978e1ddbb9d8..27c4af897b58 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_conversion_event.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_conversion_event.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_conversion_event +# +def create_conversion_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateConversionEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateConversionEventRequest.new -# Call the create_conversion_event method. -result = client.create_conversion_event request + # Call the create_conversion_event method. + result = client.create_conversion_event request -# The returned object is of type Google::Analytics::Admin::V1alpha::ConversionEvent. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::ConversionEvent. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateConversionEvent_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_dimension.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_dimension.rb index b02a6524f9b6..d7569f59a338 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_dimension.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_dimension.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_custom_dimension +# +def create_custom_dimension + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateCustomDimensionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateCustomDimensionRequest.new -# Call the create_custom_dimension method. -result = client.create_custom_dimension request + # Call the create_custom_dimension method. + result = client.create_custom_dimension request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomDimension_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_metric.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_metric.rb index ec4f95e0339d..22211da0278d 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_metric.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_custom_metric.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_custom_metric +# +def create_custom_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateCustomMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateCustomMetricRequest.new -# Call the create_custom_metric method. -result = client.create_custom_metric request + # Call the create_custom_metric method. + result = client.create_custom_metric request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateCustomMetric_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_data_stream.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_data_stream.rb index 5ae09aeba920..73b0e8062f51 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_data_stream.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_data_stream.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_data_stream +# +def create_data_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateDataStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateDataStreamRequest.new -# Call the create_data_stream method. -result = client.create_data_stream request + # Call the create_data_stream method. + result = client.create_data_stream request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDataStream_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link.rb index f727f18b840d..5b5b898796e4 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_display_video360_advertiser_link +# +def create_display_video360_advertiser_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateDisplayVideo360AdvertiserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateDisplayVideo360AdvertiserLinkRequest.new -# Call the create_display_video360_advertiser_link method. -result = client.create_display_video360_advertiser_link request + # Call the create_display_video360_advertiser_link method. + result = client.create_display_video360_advertiser_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link_proposal.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link_proposal.rb index 11234d899580..5e0cd5069736 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link_proposal.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_display_video360_advertiser_link_proposal.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_display_video360_advertiser_link_proposal +# +def create_display_video360_advertiser_link_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateDisplayVideo360AdvertiserLinkProposalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateDisplayVideo360AdvertiserLinkProposalRequest.new -# Call the create_display_video360_advertiser_link_proposal method. -result = client.create_display_video360_advertiser_link_proposal request + # Call the create_display_video360_advertiser_link_proposal method. + result = client.create_display_video360_advertiser_link_proposal request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateDisplayVideo360AdvertiserLinkProposal_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_firebase_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_firebase_link.rb index 040794091865..edce6a572830 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_firebase_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_firebase_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_firebase_link +# +def create_firebase_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateFirebaseLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateFirebaseLinkRequest.new -# Call the create_firebase_link method. -result = client.create_firebase_link request + # Call the create_firebase_link method. + result = client.create_firebase_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::FirebaseLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::FirebaseLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateFirebaseLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_google_ads_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_google_ads_link.rb index 7eb531ab80b1..e511a8f4a156 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_google_ads_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_google_ads_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_google_ads_link +# +def create_google_ads_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateGoogleAdsLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateGoogleAdsLinkRequest.new -# Call the create_google_ads_link method. -result = client.create_google_ads_link request + # Call the create_google_ads_link method. + result = client.create_google_ads_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::GoogleAdsLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::GoogleAdsLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateGoogleAdsLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_measurement_protocol_secret.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_measurement_protocol_secret.rb index ec2e1cf60a35..af8ecdd1cb62 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_measurement_protocol_secret.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_measurement_protocol_secret.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_measurement_protocol_secret +# +def create_measurement_protocol_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateMeasurementProtocolSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateMeasurementProtocolSecretRequest.new -# Call the create_measurement_protocol_secret method. -result = client.create_measurement_protocol_secret request + # Call the create_measurement_protocol_secret method. + result = client.create_measurement_protocol_secret request -# The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateMeasurementProtocolSecret_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_property.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_property.rb index 67de4b83b7c0..632822829b2e 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_property.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_property.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_property +# +def create_property + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreatePropertyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreatePropertyRequest.new -# Call the create_property method. -result = client.create_property request + # Call the create_property method. + result = client.create_property request -# The returned object is of type Google::Analytics::Admin::V1alpha::Property. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Property. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateProperty_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_user_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_user_link.rb index f2f65a79e5c2..57b455a84a7b 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_user_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/create_user_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#create_user_link +# +def create_user_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::CreateUserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::CreateUserLinkRequest.new -# Call the create_user_link method. -result = client.create_user_link request + # Call the create_user_link method. + result = client.create_user_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_CreateUserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_account.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_account.rb index 516b8d24bfbd..bb5c5630f4d5 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_account.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_account.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_account +# +def delete_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteAccountRequest.new -# Call the delete_account method. -result = client.delete_account request + # Call the delete_account method. + result = client.delete_account request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteAccount_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_conversion_event.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_conversion_event.rb index 1e4b47d24360..58ed51befbc8 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_conversion_event.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_conversion_event.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_conversion_event +# +def delete_conversion_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteConversionEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteConversionEventRequest.new -# Call the delete_conversion_event method. -result = client.delete_conversion_event request + # Call the delete_conversion_event method. + result = client.delete_conversion_event request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteConversionEvent_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_data_stream.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_data_stream.rb index b0006aa205ee..21ea06a7b73c 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_data_stream.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_data_stream.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_data_stream +# +def delete_data_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteDataStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteDataStreamRequest.new -# Call the delete_data_stream method. -result = client.delete_data_stream request + # Call the delete_data_stream method. + result = client.delete_data_stream request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDataStream_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link.rb index 1ce7bbc0bca4..c1daf1f58f73 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_display_video360_advertiser_link +# +def delete_display_video360_advertiser_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteDisplayVideo360AdvertiserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteDisplayVideo360AdvertiserLinkRequest.new -# Call the delete_display_video360_advertiser_link method. -result = client.delete_display_video360_advertiser_link request + # Call the delete_display_video360_advertiser_link method. + result = client.delete_display_video360_advertiser_link request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link_proposal.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link_proposal.rb index 39029ac68f5e..9097e5a81629 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link_proposal.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_display_video360_advertiser_link_proposal.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_display_video360_advertiser_link_proposal +# +def delete_display_video360_advertiser_link_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteDisplayVideo360AdvertiserLinkProposalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteDisplayVideo360AdvertiserLinkProposalRequest.new -# Call the delete_display_video360_advertiser_link_proposal method. -result = client.delete_display_video360_advertiser_link_proposal request + # Call the delete_display_video360_advertiser_link_proposal method. + result = client.delete_display_video360_advertiser_link_proposal request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteDisplayVideo360AdvertiserLinkProposal_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_firebase_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_firebase_link.rb index 841276b67adb..aa5b1bd51ffa 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_firebase_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_firebase_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_firebase_link +# +def delete_firebase_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteFirebaseLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteFirebaseLinkRequest.new -# Call the delete_firebase_link method. -result = client.delete_firebase_link request + # Call the delete_firebase_link method. + result = client.delete_firebase_link request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteFirebaseLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_google_ads_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_google_ads_link.rb index 7e4236dafe8e..2bc1baba6835 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_google_ads_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_google_ads_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_google_ads_link +# +def delete_google_ads_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteGoogleAdsLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteGoogleAdsLinkRequest.new -# Call the delete_google_ads_link method. -result = client.delete_google_ads_link request + # Call the delete_google_ads_link method. + result = client.delete_google_ads_link request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteGoogleAdsLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_measurement_protocol_secret.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_measurement_protocol_secret.rb index bd7932ce1d83..12dadbf82483 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_measurement_protocol_secret.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_measurement_protocol_secret.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_measurement_protocol_secret +# +def delete_measurement_protocol_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteMeasurementProtocolSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteMeasurementProtocolSecretRequest.new -# Call the delete_measurement_protocol_secret method. -result = client.delete_measurement_protocol_secret request + # Call the delete_measurement_protocol_secret method. + result = client.delete_measurement_protocol_secret request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteMeasurementProtocolSecret_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_property.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_property.rb index a6516282d24e..7b72ceb12cb8 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_property.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_property.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_property +# +def delete_property + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeletePropertyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeletePropertyRequest.new -# Call the delete_property method. -result = client.delete_property request + # Call the delete_property method. + result = client.delete_property request -# The returned object is of type Google::Analytics::Admin::V1alpha::Property. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Property. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteProperty_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_user_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_user_link.rb index dcb2f35a6f14..fdded8449d66 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_user_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/delete_user_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#delete_user_link +# +def delete_user_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::DeleteUserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::DeleteUserLinkRequest.new -# Call the delete_user_link method. -result = client.delete_user_link request + # Call the delete_user_link method. + result = client.delete_user_link request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_DeleteUserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_account.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_account.rb index 8e0d97a835ca..d0738e53c880 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_account.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_account.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_account +# +def get_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetAccountRequest.new -# Call the get_account method. -result = client.get_account request + # Call the get_account method. + result = client.get_account request -# The returned object is of type Google::Analytics::Admin::V1alpha::Account. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Account. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAccount_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_attribution_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_attribution_settings.rb index 1b4ddf0fca33..4fb8d04a1332 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_attribution_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_attribution_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_attribution_settings +# +def get_attribution_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetAttributionSettingsRequest.new -# Call the get_attribution_settings method. -result = client.get_attribution_settings request + # Call the get_attribution_settings method. + result = client.get_attribution_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAttributionSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_audience.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_audience.rb index 752ea76af66b..92d76a86fbae 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_audience.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_audience.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_audience +# +def get_audience + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetAudienceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetAudienceRequest.new -# Call the get_audience method. -result = client.get_audience request + # Call the get_audience method. + result = client.get_audience request -# The returned object is of type Google::Analytics::Admin::V1alpha::Audience. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Audience. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetAudience_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_conversion_event.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_conversion_event.rb index 7378dad6e0e0..cb7a931cc2f9 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_conversion_event.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_conversion_event.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_conversion_event +# +def get_conversion_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetConversionEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetConversionEventRequest.new -# Call the get_conversion_event method. -result = client.get_conversion_event request + # Call the get_conversion_event method. + result = client.get_conversion_event request -# The returned object is of type Google::Analytics::Admin::V1alpha::ConversionEvent. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::ConversionEvent. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetConversionEvent_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_dimension.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_dimension.rb index c8b9a4454217..5559719ec5a8 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_dimension.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_dimension.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_custom_dimension +# +def get_custom_dimension + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetCustomDimensionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetCustomDimensionRequest.new -# Call the get_custom_dimension method. -result = client.get_custom_dimension request + # Call the get_custom_dimension method. + result = client.get_custom_dimension request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomDimension_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_metric.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_metric.rb index 0ee47138064e..3d1cf9b6cb0e 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_metric.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_custom_metric.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_custom_metric +# +def get_custom_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetCustomMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetCustomMetricRequest.new -# Call the get_custom_metric method. -result = client.get_custom_metric request + # Call the get_custom_metric method. + result = client.get_custom_metric request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetCustomMetric_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_retention_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_retention_settings.rb index dfbdb2e7db5c..edb4bf48ea7f 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_retention_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_retention_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_data_retention_settings +# +def get_data_retention_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetDataRetentionSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetDataRetentionSettingsRequest.new -# Call the get_data_retention_settings method. -result = client.get_data_retention_settings request + # Call the get_data_retention_settings method. + result = client.get_data_retention_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataRetentionSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataRetentionSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataRetentionSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_sharing_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_sharing_settings.rb index 4b3f7f88bc1a..edeee03bf4b2 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_sharing_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_sharing_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_data_sharing_settings +# +def get_data_sharing_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetDataSharingSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetDataSharingSettingsRequest.new -# Call the get_data_sharing_settings method. -result = client.get_data_sharing_settings request + # Call the get_data_sharing_settings method. + result = client.get_data_sharing_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataSharingSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataSharingSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataSharingSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_stream.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_stream.rb index 985ae151e67e..0adccc06d614 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_stream.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_data_stream.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_data_stream +# +def get_data_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetDataStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetDataStreamRequest.new -# Call the get_data_stream method. -result = client.get_data_stream request + # Call the get_data_stream method. + result = client.get_data_stream request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDataStream_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link.rb index a93216ba81a3..87f1662da563 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_display_video360_advertiser_link +# +def get_display_video360_advertiser_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetDisplayVideo360AdvertiserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetDisplayVideo360AdvertiserLinkRequest.new -# Call the get_display_video360_advertiser_link method. -result = client.get_display_video360_advertiser_link request + # Call the get_display_video360_advertiser_link method. + result = client.get_display_video360_advertiser_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link_proposal.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link_proposal.rb index 098f42e76883..346d72fece8d 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link_proposal.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_display_video360_advertiser_link_proposal.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_display_video360_advertiser_link_proposal +# +def get_display_video360_advertiser_link_proposal + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetDisplayVideo360AdvertiserLinkProposalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetDisplayVideo360AdvertiserLinkProposalRequest.new -# Call the get_display_video360_advertiser_link_proposal method. -result = client.get_display_video360_advertiser_link_proposal request + # Call the get_display_video360_advertiser_link_proposal method. + result = client.get_display_video360_advertiser_link_proposal request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetDisplayVideo360AdvertiserLinkProposal_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_global_site_tag.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_global_site_tag.rb index c09df237ccad..a0c1a9bb9b07 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_global_site_tag.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_global_site_tag.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_global_site_tag +# +def get_global_site_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetGlobalSiteTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetGlobalSiteTagRequest.new -# Call the get_global_site_tag method. -result = client.get_global_site_tag request + # Call the get_global_site_tag method. + result = client.get_global_site_tag request -# The returned object is of type Google::Analytics::Admin::V1alpha::GlobalSiteTag. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::GlobalSiteTag. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGlobalSiteTag_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_google_signals_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_google_signals_settings.rb index 4b1463878518..d07fa076c1ef 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_google_signals_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_google_signals_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_google_signals_settings +# +def get_google_signals_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetGoogleSignalsSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetGoogleSignalsSettingsRequest.new -# Call the get_google_signals_settings method. -result = client.get_google_signals_settings request + # Call the get_google_signals_settings method. + result = client.get_google_signals_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::GoogleSignalsSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::GoogleSignalsSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetGoogleSignalsSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_measurement_protocol_secret.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_measurement_protocol_secret.rb index b3dc8a504c57..e3024615de8c 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_measurement_protocol_secret.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_measurement_protocol_secret.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_measurement_protocol_secret +# +def get_measurement_protocol_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetMeasurementProtocolSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetMeasurementProtocolSecretRequest.new -# Call the get_measurement_protocol_secret method. -result = client.get_measurement_protocol_secret request + # Call the get_measurement_protocol_secret method. + result = client.get_measurement_protocol_secret request -# The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetMeasurementProtocolSecret_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_property.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_property.rb index 783554dfd8d1..f167edc3de6e 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_property.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_property.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_property +# +def get_property + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetPropertyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetPropertyRequest.new -# Call the get_property method. -result = client.get_property request + # Call the get_property method. + result = client.get_property request -# The returned object is of type Google::Analytics::Admin::V1alpha::Property. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Property. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetProperty_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_user_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_user_link.rb index 47b94ac846c1..89031723e421 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_user_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/get_user_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#get_user_link +# +def get_user_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::GetUserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::GetUserLinkRequest.new -# Call the get_user_link method. -result = client.get_user_link request + # Call the get_user_link method. + result = client.get_user_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_GetUserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_account_summaries.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_account_summaries.rb index d25c4fe0f5fd..0e1aeec241e9 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_account_summaries.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_account_summaries.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_account_summaries +# +def list_account_summaries + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListAccountSummariesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListAccountSummariesRequest.new -# Call the list_account_summaries method. -result = client.list_account_summaries request + # Call the list_account_summaries method. + result = client.list_account_summaries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::AccountSummary. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::AccountSummary. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccountSummaries_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_accounts.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_accounts.rb index f2fc7a8cbbb7..8b68dd15da65 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_accounts.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_accounts.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_accounts +# +def list_accounts + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListAccountsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListAccountsRequest.new -# Call the list_accounts method. -result = client.list_accounts request + # Call the list_accounts method. + result = client.list_accounts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::Account. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::Account. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAccounts_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_audiences.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_audiences.rb index 57c86cdb4392..98dcba79d00a 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_audiences.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_audiences.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_audiences +# +def list_audiences + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListAudiencesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListAudiencesRequest.new -# Call the list_audiences method. -result = client.list_audiences request + # Call the list_audiences method. + result = client.list_audiences request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::Audience. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::Audience. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListAudiences_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_conversion_events.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_conversion_events.rb index d90ce714a4d6..19831a338b9b 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_conversion_events.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_conversion_events.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_conversion_events +# +def list_conversion_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListConversionEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListConversionEventsRequest.new -# Call the list_conversion_events method. -result = client.list_conversion_events request + # Call the list_conversion_events method. + result = client.list_conversion_events request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::ConversionEvent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::ConversionEvent. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListConversionEvents_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_dimensions.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_dimensions.rb index 24a256d2b491..43fcd3e7bfb1 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_dimensions.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_dimensions.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_custom_dimensions +# +def list_custom_dimensions + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListCustomDimensionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListCustomDimensionsRequest.new -# Call the list_custom_dimensions method. -result = client.list_custom_dimensions request + # Call the list_custom_dimensions method. + result = client.list_custom_dimensions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::CustomDimension. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::CustomDimension. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomDimensions_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_metrics.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_metrics.rb index a1b5d4983139..cda21482f8f9 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_metrics.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_custom_metrics.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_custom_metrics +# +def list_custom_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListCustomMetricsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListCustomMetricsRequest.new -# Call the list_custom_metrics method. -result = client.list_custom_metrics request + # Call the list_custom_metrics method. + result = client.list_custom_metrics request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::CustomMetric. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::CustomMetric. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListCustomMetrics_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_data_streams.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_data_streams.rb index f2964a760b19..38c0326a7389 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_data_streams.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_data_streams.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_data_streams +# +def list_data_streams + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListDataStreamsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListDataStreamsRequest.new -# Call the list_data_streams method. -result = client.list_data_streams request + # Call the list_data_streams method. + result = client.list_data_streams request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::DataStream. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::DataStream. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDataStreams_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_link_proposals.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_link_proposals.rb index 33da6c5421c7..50b85a2b9106 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_link_proposals.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_link_proposals.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_display_video360_advertiser_link_proposals +# +def list_display_video360_advertiser_link_proposals + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListDisplayVideo360AdvertiserLinkProposalsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListDisplayVideo360AdvertiserLinkProposalsRequest.new -# Call the list_display_video360_advertiser_link_proposals method. -result = client.list_display_video360_advertiser_link_proposals request + # Call the list_display_video360_advertiser_link_proposals method. + result = client.list_display_video360_advertiser_link_proposals request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLinkProposal. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinkProposals_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_links.rb index 7bae80ca7d68..87167de6bf85 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_display_video360_advertiser_links.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_display_video360_advertiser_links +# +def list_display_video360_advertiser_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListDisplayVideo360AdvertiserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListDisplayVideo360AdvertiserLinksRequest.new -# Call the list_display_video360_advertiser_links method. -result = client.list_display_video360_advertiser_links request + # Call the list_display_video360_advertiser_links method. + result = client.list_display_video360_advertiser_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListDisplayVideo360AdvertiserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_firebase_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_firebase_links.rb index 81214a49fe9e..bb3e1951df84 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_firebase_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_firebase_links.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_firebase_links +# +def list_firebase_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListFirebaseLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListFirebaseLinksRequest.new -# Call the list_firebase_links method. -result = client.list_firebase_links request + # Call the list_firebase_links method. + result = client.list_firebase_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::FirebaseLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::FirebaseLink. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListFirebaseLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_google_ads_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_google_ads_links.rb index 8a424d8b295b..f014a0689776 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_google_ads_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_google_ads_links.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_google_ads_links +# +def list_google_ads_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListGoogleAdsLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListGoogleAdsLinksRequest.new -# Call the list_google_ads_links method. -result = client.list_google_ads_links request + # Call the list_google_ads_links method. + result = client.list_google_ads_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::GoogleAdsLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::GoogleAdsLink. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListGoogleAdsLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_measurement_protocol_secrets.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_measurement_protocol_secrets.rb index 30f0316e7b08..f93cdf9e45b1 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_measurement_protocol_secrets.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_measurement_protocol_secrets.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_measurement_protocol_secrets +# +def list_measurement_protocol_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListMeasurementProtocolSecretsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListMeasurementProtocolSecretsRequest.new -# Call the list_measurement_protocol_secrets method. -result = client.list_measurement_protocol_secrets request + # Call the list_measurement_protocol_secrets method. + result = client.list_measurement_protocol_secrets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListMeasurementProtocolSecrets_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_properties.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_properties.rb index a6c5c7171e4a..6b2651b1e9bb 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_properties.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_properties.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_properties +# +def list_properties + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListPropertiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListPropertiesRequest.new -# Call the list_properties method. -result = client.list_properties request + # Call the list_properties method. + result = client.list_properties request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::Property. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::Property. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListProperties_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_user_links.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_user_links.rb index 40e30df8664e..7b6528fcaad5 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_user_links.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/list_user_links.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#list_user_links +# +def list_user_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ListUserLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ListUserLinksRequest.new -# Call the list_user_links method. -result = client.list_user_links request + # Call the list_user_links method. + result = client.list_user_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::UserLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::UserLink. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ListUserLinks_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/provision_account_ticket.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/provision_account_ticket.rb index b39228e7c532..cccb8df17cee 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/provision_account_ticket.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/provision_account_ticket.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#provision_account_ticket +# +def provision_account_ticket + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::ProvisionAccountTicketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::ProvisionAccountTicketRequest.new -# Call the provision_account_ticket method. -result = client.provision_account_ticket request + # Call the provision_account_ticket method. + result = client.provision_account_ticket request -# The returned object is of type Google::Analytics::Admin::V1alpha::ProvisionAccountTicketResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::ProvisionAccountTicketResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_ProvisionAccountTicket_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/run_access_report.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/run_access_report.rb index 77112110890f..06ff5de4e349 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/run_access_report.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/run_access_report.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#run_access_report +# +def run_access_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::RunAccessReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::RunAccessReportRequest.new -# Call the run_access_report method. -result = client.run_access_report request + # Call the run_access_report method. + result = client.run_access_report request -# The returned object is of type Google::Analytics::Admin::V1alpha::RunAccessReportResponse. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::RunAccessReportResponse. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_RunAccessReport_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/search_change_history_events.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/search_change_history_events.rb index 2ae88359dfdc..376f82b9d6f4 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/search_change_history_events.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/search_change_history_events.rb @@ -19,21 +19,27 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#search_change_history_events +# +def search_change_history_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::SearchChangeHistoryEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::SearchChangeHistoryEventsRequest.new -# Call the search_change_history_events method. -result = client.search_change_history_events request + # Call the search_change_history_events method. + result = client.search_change_history_events request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Analytics::Admin::V1alpha::ChangeHistoryEvent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Analytics::Admin::V1alpha::ChangeHistoryEvent. + p response + end end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_SearchChangeHistoryEvents_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_account.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_account.rb index 138722008471..6ea5a001739f 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_account.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_account.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_account +# +def update_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateAccountRequest.new -# Call the update_account method. -result = client.update_account request + # Call the update_account method. + result = client.update_account request -# The returned object is of type Google::Analytics::Admin::V1alpha::Account. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Account. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAccount_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_attribution_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_attribution_settings.rb index c2e2d7f21b30..a78b0c0a0321 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_attribution_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_attribution_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_attribution_settings +# +def update_attribution_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateAttributionSettingsRequest.new -# Call the update_attribution_settings method. -result = client.update_attribution_settings request + # Call the update_attribution_settings method. + result = client.update_attribution_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::AttributionSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAttributionSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_audience.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_audience.rb index dd85e4c07aa9..f9a97cb2ac62 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_audience.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_audience.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_audience +# +def update_audience + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateAudienceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateAudienceRequest.new -# Call the update_audience method. -result = client.update_audience request + # Call the update_audience method. + result = client.update_audience request -# The returned object is of type Google::Analytics::Admin::V1alpha::Audience. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Audience. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateAudience_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_dimension.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_dimension.rb index a6ea1e27dd84..87f435ccc8c2 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_dimension.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_dimension.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_custom_dimension +# +def update_custom_dimension + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateCustomDimensionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateCustomDimensionRequest.new -# Call the update_custom_dimension method. -result = client.update_custom_dimension request + # Call the update_custom_dimension method. + result = client.update_custom_dimension request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomDimension. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomDimension_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_metric.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_metric.rb index b917f3e66cef..e7ee639d1435 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_metric.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_custom_metric.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_custom_metric +# +def update_custom_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateCustomMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateCustomMetricRequest.new -# Call the update_custom_metric method. -result = client.update_custom_metric request + # Call the update_custom_metric method. + result = client.update_custom_metric request -# The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::CustomMetric. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateCustomMetric_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_retention_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_retention_settings.rb index ecdfcabf3536..b0a4cb874b35 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_retention_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_retention_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_data_retention_settings +# +def update_data_retention_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateDataRetentionSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateDataRetentionSettingsRequest.new -# Call the update_data_retention_settings method. -result = client.update_data_retention_settings request + # Call the update_data_retention_settings method. + result = client.update_data_retention_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataRetentionSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataRetentionSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataRetentionSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_stream.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_stream.rb index 040fae53f1f3..d8d01b9444cd 100644 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_stream.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_data_stream.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_data_stream +# +def update_data_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateDataStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateDataStreamRequest.new -# Call the update_data_stream method. -result = client.update_data_stream request + # Call the update_data_stream method. + result = client.update_data_stream request -# The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DataStream. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDataStream_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_display_video360_advertiser_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_display_video360_advertiser_link.rb index d805714163c2..a5b0ee183409 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_display_video360_advertiser_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_display_video360_advertiser_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_display_video360_advertiser_link +# +def update_display_video360_advertiser_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateDisplayVideo360AdvertiserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateDisplayVideo360AdvertiserLinkRequest.new -# Call the update_display_video360_advertiser_link method. -result = client.update_display_video360_advertiser_link request + # Call the update_display_video360_advertiser_link method. + result = client.update_display_video360_advertiser_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::DisplayVideo360AdvertiserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateDisplayVideo360AdvertiserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_ads_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_ads_link.rb index ea064fccec2a..69a44afd3f7b 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_ads_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_ads_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_google_ads_link +# +def update_google_ads_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateGoogleAdsLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateGoogleAdsLinkRequest.new -# Call the update_google_ads_link method. -result = client.update_google_ads_link request + # Call the update_google_ads_link method. + result = client.update_google_ads_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::GoogleAdsLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::GoogleAdsLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleAdsLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_signals_settings.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_signals_settings.rb index 1b3361d56926..7e39b665b333 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_signals_settings.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_google_signals_settings.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_google_signals_settings +# +def update_google_signals_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateGoogleSignalsSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateGoogleSignalsSettingsRequest.new -# Call the update_google_signals_settings method. -result = client.update_google_signals_settings request + # Call the update_google_signals_settings method. + result = client.update_google_signals_settings request -# The returned object is of type Google::Analytics::Admin::V1alpha::GoogleSignalsSettings. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::GoogleSignalsSettings. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateGoogleSignalsSettings_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_measurement_protocol_secret.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_measurement_protocol_secret.rb index 098def8bc722..fa34966fac68 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_measurement_protocol_secret.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_measurement_protocol_secret.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_measurement_protocol_secret +# +def update_measurement_protocol_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateMeasurementProtocolSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateMeasurementProtocolSecretRequest.new -# Call the update_measurement_protocol_secret method. -result = client.update_measurement_protocol_secret request + # Call the update_measurement_protocol_secret method. + result = client.update_measurement_protocol_secret request -# The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::MeasurementProtocolSecret. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateMeasurementProtocolSecret_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_property.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_property.rb index 146cd820ed1f..659e032d64bf 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_property.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_property.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_property +# +def update_property + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdatePropertyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdatePropertyRequest.new -# Call the update_property method. -result = client.update_property request + # Call the update_property method. + result = client.update_property request -# The returned object is of type Google::Analytics::Admin::V1alpha::Property. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::Property. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateProperty_sync] diff --git a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_user_link.rb b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_user_link.rb index c109688e2352..5d8ae603d8aa 100755 --- a/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_user_link.rb +++ b/google-analytics-admin-v1alpha/snippets/analytics_admin_service/update_user_link.rb @@ -19,15 +19,21 @@ # [START analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_sync] require "google/analytics/admin/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client#update_user_link +# +def update_user_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Admin::V1alpha::AnalyticsAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Admin::V1alpha::UpdateUserLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Admin::V1alpha::UpdateUserLinkRequest.new -# Call the update_user_link method. -result = client.update_user_link request + # Call the update_user_link method. + result = client.update_user_link request -# The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. -p result + # The returned object is of type Google::Analytics::Admin::V1alpha::UserLink. + p result +end # [END analyticsadmin_v1alpha_generated_AnalyticsAdminService_UpdateUserLink_sync] diff --git a/google-analytics-admin-v1alpha/snippets/snippet_metadata_google.analytics.admin.v1alpha.json b/google-analytics-admin-v1alpha/snippets/snippet_metadata_google.analytics.admin.v1alpha.json index 31896f112a05..3fd569f4c0bc 100644 --- a/google-analytics-admin-v1alpha/snippets/snippet_metadata_google.analytics.admin.v1alpha.json +++ b/google-analytics-admin-v1alpha/snippets/snippet_metadata_google.analytics.admin.v1alpha.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1966,7 +1966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2006,7 +2006,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2046,7 +2046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2086,7 +2086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2126,7 +2126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2166,7 +2166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2206,7 +2206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2246,7 +2246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2286,7 +2286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2326,7 +2326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2366,7 +2366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2406,7 +2406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2446,7 +2446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2486,7 +2486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2526,7 +2526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2566,7 +2566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2606,7 +2606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2646,7 +2646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2686,7 +2686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2726,7 +2726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2766,7 +2766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2806,7 +2806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2846,7 +2846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2886,7 +2886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2926,7 +2926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2966,7 +2966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3006,7 +3006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3046,7 +3046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3086,7 +3086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3126,7 +3126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3166,7 +3166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-analytics-data-v1beta/.rubocop.yml b/google-analytics-data-v1beta/.rubocop.yml index 3395532cd7e2..944b6d1e4377 100644 --- a/google-analytics-data-v1beta/.rubocop.yml +++ b/google-analytics-data-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-analytics-data-v1beta.rb" diff --git a/google-analytics-data-v1beta/snippets/Gemfile b/google-analytics-data-v1beta/snippets/Gemfile index e509a36fc266..d36dde5aff97 100755 --- a/google-analytics-data-v1beta/snippets/Gemfile +++ b/google-analytics-data-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-analytics-data-v1beta/snippets/analytics_data/batch_run_pivot_reports.rb b/google-analytics-data-v1beta/snippets/analytics_data/batch_run_pivot_reports.rb index 26471772f50f..272bfc1340ba 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/batch_run_pivot_reports.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/batch_run_pivot_reports.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_BatchRunPivotReports_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#batch_run_pivot_reports +# +def batch_run_pivot_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::BatchRunPivotReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::BatchRunPivotReportsRequest.new -# Call the batch_run_pivot_reports method. -result = client.batch_run_pivot_reports request + # Call the batch_run_pivot_reports method. + result = client.batch_run_pivot_reports request -# The returned object is of type Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::BatchRunPivotReportsResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_BatchRunPivotReports_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/batch_run_reports.rb b/google-analytics-data-v1beta/snippets/analytics_data/batch_run_reports.rb index d4f3ab8715f8..7ba151654aa6 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/batch_run_reports.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/batch_run_reports.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_BatchRunReports_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#batch_run_reports +# +def batch_run_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::BatchRunReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::BatchRunReportsRequest.new -# Call the batch_run_reports method. -result = client.batch_run_reports request + # Call the batch_run_reports method. + result = client.batch_run_reports request -# The returned object is of type Google::Analytics::Data::V1beta::BatchRunReportsResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::BatchRunReportsResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_BatchRunReports_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/check_compatibility.rb b/google-analytics-data-v1beta/snippets/analytics_data/check_compatibility.rb index bf14ece8c7da..b18c45c58bd7 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/check_compatibility.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/check_compatibility.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_CheckCompatibility_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#check_compatibility +# +def check_compatibility + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::CheckCompatibilityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::CheckCompatibilityRequest.new -# Call the check_compatibility method. -result = client.check_compatibility request + # Call the check_compatibility method. + result = client.check_compatibility request -# The returned object is of type Google::Analytics::Data::V1beta::CheckCompatibilityResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::CheckCompatibilityResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_CheckCompatibility_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/get_metadata.rb b/google-analytics-data-v1beta/snippets/analytics_data/get_metadata.rb index 24f49ee734db..c30a524a686f 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/get_metadata.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/get_metadata.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_GetMetadata_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#get_metadata +# +def get_metadata + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::GetMetadataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::GetMetadataRequest.new -# Call the get_metadata method. -result = client.get_metadata request + # Call the get_metadata method. + result = client.get_metadata request -# The returned object is of type Google::Analytics::Data::V1beta::Metadata. -p result + # The returned object is of type Google::Analytics::Data::V1beta::Metadata. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_GetMetadata_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/run_pivot_report.rb b/google-analytics-data-v1beta/snippets/analytics_data/run_pivot_report.rb index 4584b7fccf06..95649206265b 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/run_pivot_report.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/run_pivot_report.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_RunPivotReport_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#run_pivot_report +# +def run_pivot_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::RunPivotReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::RunPivotReportRequest.new -# Call the run_pivot_report method. -result = client.run_pivot_report request + # Call the run_pivot_report method. + result = client.run_pivot_report request -# The returned object is of type Google::Analytics::Data::V1beta::RunPivotReportResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::RunPivotReportResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_RunPivotReport_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/run_realtime_report.rb b/google-analytics-data-v1beta/snippets/analytics_data/run_realtime_report.rb index a05dd0e70926..b15ac5e481e4 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/run_realtime_report.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/run_realtime_report.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_RunRealtimeReport_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#run_realtime_report +# +def run_realtime_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::RunRealtimeReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::RunRealtimeReportRequest.new -# Call the run_realtime_report method. -result = client.run_realtime_report request + # Call the run_realtime_report method. + result = client.run_realtime_report request -# The returned object is of type Google::Analytics::Data::V1beta::RunRealtimeReportResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::RunRealtimeReportResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_RunRealtimeReport_sync] diff --git a/google-analytics-data-v1beta/snippets/analytics_data/run_report.rb b/google-analytics-data-v1beta/snippets/analytics_data/run_report.rb index 3738886e05ec..1bc90542b85e 100755 --- a/google-analytics-data-v1beta/snippets/analytics_data/run_report.rb +++ b/google-analytics-data-v1beta/snippets/analytics_data/run_report.rb @@ -19,15 +19,21 @@ # [START analyticsdata_v1beta_generated_AnalyticsData_RunReport_sync] require "google/analytics/data/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new +## +# Example demonstrating basic usage of +# Google::Analytics::Data::V1beta::AnalyticsData::Client#run_report +# +def run_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Analytics::Data::V1beta::AnalyticsData::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Analytics::Data::V1beta::RunReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Analytics::Data::V1beta::RunReportRequest.new -# Call the run_report method. -result = client.run_report request + # Call the run_report method. + result = client.run_report request -# The returned object is of type Google::Analytics::Data::V1beta::RunReportResponse. -p result + # The returned object is of type Google::Analytics::Data::V1beta::RunReportResponse. + p result +end # [END analyticsdata_v1beta_generated_AnalyticsData_RunReport_sync] diff --git a/google-analytics-data-v1beta/snippets/snippet_metadata_google.analytics.data.v1beta.json b/google-analytics-data-v1beta/snippets/snippet_metadata_google.analytics.data.v1beta.json index e86a800f4dfd..5d47015aba3a 100644 --- a/google-analytics-data-v1beta/snippets/snippet_metadata_google.analytics.data.v1beta.json +++ b/google-analytics-data-v1beta/snippets/snippet_metadata_google.analytics.data.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-area120-tables-v1alpha1/.rubocop.yml b/google-area120-tables-v1alpha1/.rubocop.yml index 58e8b2b5cff5..e19a526cbf8c 100644 --- a/google-area120-tables-v1alpha1/.rubocop.yml +++ b/google-area120-tables-v1alpha1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-area120-tables-v1alpha1.rb" diff --git a/google-area120-tables-v1alpha1/snippets/Gemfile b/google-area120-tables-v1alpha1/snippets/Gemfile index 01974e0f4cb9..9f61387908b6 100755 --- a/google-area120-tables-v1alpha1/snippets/Gemfile +++ b/google-area120-tables-v1alpha1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-area120-tables-v1alpha1/snippets/snippet_metadata_google.area120.tables.v1alpha1.json b/google-area120-tables-v1alpha1/snippets/snippet_metadata_google.area120.tables.v1alpha1.json index 9857699e6d1f..80f3a5c1840e 100644 --- a/google-area120-tables-v1alpha1/snippets/snippet_metadata_google.area120.tables.v1alpha1.json +++ b/google-area120-tables-v1alpha1/snippets/snippet_metadata_google.area120.tables.v1alpha1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/batch_create_rows.rb b/google-area120-tables-v1alpha1/snippets/tables_service/batch_create_rows.rb index 1d4f0adc327c..f59a1935541c 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/batch_create_rows.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/batch_create_rows.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_BatchCreateRows_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#batch_create_rows +# +def batch_create_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::BatchCreateRowsRequest.new -# Call the batch_create_rows method. -result = client.batch_create_rows request + # Call the batch_create_rows method. + result = client.batch_create_rows request -# The returned object is of type Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::BatchCreateRowsResponse. + p result +end # [END area120tables_v1alpha1_generated_TablesService_BatchCreateRows_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/batch_delete_rows.rb b/google-area120-tables-v1alpha1/snippets/tables_service/batch_delete_rows.rb index 6ca44fb26250..7934f92c2e4c 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/batch_delete_rows.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/batch_delete_rows.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_BatchDeleteRows_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#batch_delete_rows +# +def batch_delete_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::BatchDeleteRowsRequest.new -# Call the batch_delete_rows method. -result = client.batch_delete_rows request + # Call the batch_delete_rows method. + result = client.batch_delete_rows request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END area120tables_v1alpha1_generated_TablesService_BatchDeleteRows_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/batch_update_rows.rb b/google-area120-tables-v1alpha1/snippets/tables_service/batch_update_rows.rb index 8ad71b757002..1acabdf90ae8 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/batch_update_rows.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/batch_update_rows.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_BatchUpdateRows_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#batch_update_rows +# +def batch_update_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::BatchUpdateRowsRequest.new -# Call the batch_update_rows method. -result = client.batch_update_rows request + # Call the batch_update_rows method. + result = client.batch_update_rows request -# The returned object is of type Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::BatchUpdateRowsResponse. + p result +end # [END area120tables_v1alpha1_generated_TablesService_BatchUpdateRows_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/create_row.rb b/google-area120-tables-v1alpha1/snippets/tables_service/create_row.rb index 8d826b031b5c..847885aa22aa 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/create_row.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/create_row.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_CreateRow_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#create_row +# +def create_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::CreateRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::CreateRowRequest.new -# Call the create_row method. -result = client.create_row request + # Call the create_row method. + result = client.create_row request -# The returned object is of type Google::Area120::Tables::V1alpha1::Row. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::Row. + p result +end # [END area120tables_v1alpha1_generated_TablesService_CreateRow_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/delete_row.rb b/google-area120-tables-v1alpha1/snippets/tables_service/delete_row.rb index 2c2713b67539..5f67549fb3b2 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/delete_row.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/delete_row.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_DeleteRow_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#delete_row +# +def delete_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::DeleteRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::DeleteRowRequest.new -# Call the delete_row method. -result = client.delete_row request + # Call the delete_row method. + result = client.delete_row request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END area120tables_v1alpha1_generated_TablesService_DeleteRow_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/get_row.rb b/google-area120-tables-v1alpha1/snippets/tables_service/get_row.rb index 73ece3d26f28..08c7a5efd526 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/get_row.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/get_row.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_GetRow_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#get_row +# +def get_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::GetRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::GetRowRequest.new -# Call the get_row method. -result = client.get_row request + # Call the get_row method. + result = client.get_row request -# The returned object is of type Google::Area120::Tables::V1alpha1::Row. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::Row. + p result +end # [END area120tables_v1alpha1_generated_TablesService_GetRow_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/get_table.rb b/google-area120-tables-v1alpha1/snippets/tables_service/get_table.rb index 6fb04d1b2ffb..2769dfc3f312 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/get_table.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/get_table.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_GetTable_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#get_table +# +def get_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::GetTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::GetTableRequest.new -# Call the get_table method. -result = client.get_table request + # Call the get_table method. + result = client.get_table request -# The returned object is of type Google::Area120::Tables::V1alpha1::Table. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::Table. + p result +end # [END area120tables_v1alpha1_generated_TablesService_GetTable_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/get_workspace.rb b/google-area120-tables-v1alpha1/snippets/tables_service/get_workspace.rb index 0f65f97a666d..0f8e3af13e74 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/get_workspace.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/get_workspace.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_GetWorkspace_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#get_workspace +# +def get_workspace + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::GetWorkspaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::GetWorkspaceRequest.new -# Call the get_workspace method. -result = client.get_workspace request + # Call the get_workspace method. + result = client.get_workspace request -# The returned object is of type Google::Area120::Tables::V1alpha1::Workspace. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::Workspace. + p result +end # [END area120tables_v1alpha1_generated_TablesService_GetWorkspace_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/list_rows.rb b/google-area120-tables-v1alpha1/snippets/tables_service/list_rows.rb index 90ed0688c6a1..cfbcf61c52e2 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/list_rows.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/list_rows.rb @@ -19,21 +19,27 @@ # [START area120tables_v1alpha1_generated_TablesService_ListRows_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#list_rows +# +def list_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::ListRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::ListRowsRequest.new -# Call the list_rows method. -result = client.list_rows request + # Call the list_rows method. + result = client.list_rows request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Area120::Tables::V1alpha1::Row. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Area120::Tables::V1alpha1::Row. + p response + end end # [END area120tables_v1alpha1_generated_TablesService_ListRows_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/list_tables.rb b/google-area120-tables-v1alpha1/snippets/tables_service/list_tables.rb index b245501a802b..eb9eefe44936 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/list_tables.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/list_tables.rb @@ -19,21 +19,27 @@ # [START area120tables_v1alpha1_generated_TablesService_ListTables_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#list_tables +# +def list_tables + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::ListTablesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::ListTablesRequest.new -# Call the list_tables method. -result = client.list_tables request + # Call the list_tables method. + result = client.list_tables request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Area120::Tables::V1alpha1::Table. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Area120::Tables::V1alpha1::Table. + p response + end end # [END area120tables_v1alpha1_generated_TablesService_ListTables_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/list_workspaces.rb b/google-area120-tables-v1alpha1/snippets/tables_service/list_workspaces.rb index ae70bd0b1bf6..2dab5bd8d1ac 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/list_workspaces.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/list_workspaces.rb @@ -19,21 +19,27 @@ # [START area120tables_v1alpha1_generated_TablesService_ListWorkspaces_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#list_workspaces +# +def list_workspaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::ListWorkspacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::ListWorkspacesRequest.new -# Call the list_workspaces method. -result = client.list_workspaces request + # Call the list_workspaces method. + result = client.list_workspaces request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Area120::Tables::V1alpha1::Workspace. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Area120::Tables::V1alpha1::Workspace. + p response + end end # [END area120tables_v1alpha1_generated_TablesService_ListWorkspaces_sync] diff --git a/google-area120-tables-v1alpha1/snippets/tables_service/update_row.rb b/google-area120-tables-v1alpha1/snippets/tables_service/update_row.rb index 4b48a073f9ab..22e44c37d9c6 100755 --- a/google-area120-tables-v1alpha1/snippets/tables_service/update_row.rb +++ b/google-area120-tables-v1alpha1/snippets/tables_service/update_row.rb @@ -19,15 +19,21 @@ # [START area120tables_v1alpha1_generated_TablesService_UpdateRow_sync] require "google/area120/tables/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Area120::Tables::V1alpha1::TablesService::Client.new +## +# Example demonstrating basic usage of +# Google::Area120::Tables::V1alpha1::TablesService::Client#update_row +# +def update_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Area120::Tables::V1alpha1::TablesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Area120::Tables::V1alpha1::UpdateRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Area120::Tables::V1alpha1::UpdateRowRequest.new -# Call the update_row method. -result = client.update_row request + # Call the update_row method. + result = client.update_row request -# The returned object is of type Google::Area120::Tables::V1alpha1::Row. -p result + # The returned object is of type Google::Area120::Tables::V1alpha1::Row. + p result +end # [END area120tables_v1alpha1_generated_TablesService_UpdateRow_sync] diff --git a/google-cloud-access_approval-v1/.rubocop.yml b/google-cloud-access_approval-v1/.rubocop.yml index b0f5809b3443..a08119b8f11f 100644 --- a/google-cloud-access_approval-v1/.rubocop.yml +++ b/google-cloud-access_approval-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-access_approval-v1.rb" diff --git a/google-cloud-access_approval-v1/snippets/Gemfile b/google-cloud-access_approval-v1/snippets/Gemfile index 0adfabd74df0..aaee2e91261e 100755 --- a/google-cloud-access_approval-v1/snippets/Gemfile +++ b/google-cloud-access_approval-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-access_approval-v1/snippets/access_approval/approve_approval_request.rb b/google-cloud-access_approval-v1/snippets/access_approval/approve_approval_request.rb index fe7f93bed587..e13d757372b8 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/approve_approval_request.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/approve_approval_request.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_ApproveApprovalRequest_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#approve_approval_request +# +def approve_approval_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::ApproveApprovalRequestMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::ApproveApprovalRequestMessage.new -# Call the approve_approval_request method. -result = client.approve_approval_request request + # Call the approve_approval_request method. + result = client.approve_approval_request request -# The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. + p result +end # [END accessapproval_v1_generated_AccessApproval_ApproveApprovalRequest_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/delete_access_approval_settings.rb b/google-cloud-access_approval-v1/snippets/access_approval/delete_access_approval_settings.rb index 688a74b1b80e..ced74666465a 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/delete_access_approval_settings.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/delete_access_approval_settings.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_DeleteAccessApprovalSettings_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#delete_access_approval_settings +# +def delete_access_approval_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::DeleteAccessApprovalSettingsMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::DeleteAccessApprovalSettingsMessage.new -# Call the delete_access_approval_settings method. -result = client.delete_access_approval_settings request + # Call the delete_access_approval_settings method. + result = client.delete_access_approval_settings request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END accessapproval_v1_generated_AccessApproval_DeleteAccessApprovalSettings_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/dismiss_approval_request.rb b/google-cloud-access_approval-v1/snippets/access_approval/dismiss_approval_request.rb index db4b5119adbb..1e4a053e472c 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/dismiss_approval_request.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/dismiss_approval_request.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_DismissApprovalRequest_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#dismiss_approval_request +# +def dismiss_approval_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::DismissApprovalRequestMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::DismissApprovalRequestMessage.new -# Call the dismiss_approval_request method. -result = client.dismiss_approval_request request + # Call the dismiss_approval_request method. + result = client.dismiss_approval_request request -# The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. + p result +end # [END accessapproval_v1_generated_AccessApproval_DismissApprovalRequest_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_service_account.rb b/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_service_account.rb index 8fb85b87eea9..e2fc7fa130fa 100644 --- a/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_service_account.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_service_account.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_GetAccessApprovalServiceAccount_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#get_access_approval_service_account +# +def get_access_approval_service_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::GetAccessApprovalServiceAccountMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::GetAccessApprovalServiceAccountMessage.new -# Call the get_access_approval_service_account method. -result = client.get_access_approval_service_account request + # Call the get_access_approval_service_account method. + result = client.get_access_approval_service_account request -# The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalServiceAccount. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalServiceAccount. + p result +end # [END accessapproval_v1_generated_AccessApproval_GetAccessApprovalServiceAccount_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_settings.rb b/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_settings.rb index 91719aeadf4a..5fb2c72e9067 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_settings.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/get_access_approval_settings.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_GetAccessApprovalSettings_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#get_access_approval_settings +# +def get_access_approval_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::GetAccessApprovalSettingsMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::GetAccessApprovalSettingsMessage.new -# Call the get_access_approval_settings method. -result = client.get_access_approval_settings request + # Call the get_access_approval_settings method. + result = client.get_access_approval_settings request -# The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalSettings. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalSettings. + p result +end # [END accessapproval_v1_generated_AccessApproval_GetAccessApprovalSettings_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/get_approval_request.rb b/google-cloud-access_approval-v1/snippets/access_approval/get_approval_request.rb index c513a38b2237..efd7df7443cf 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/get_approval_request.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/get_approval_request.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_GetApprovalRequest_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#get_approval_request +# +def get_approval_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::GetApprovalRequestMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::GetApprovalRequestMessage.new -# Call the get_approval_request method. -result = client.get_approval_request request + # Call the get_approval_request method. + result = client.get_approval_request request -# The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. + p result +end # [END accessapproval_v1_generated_AccessApproval_GetApprovalRequest_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/invalidate_approval_request.rb b/google-cloud-access_approval-v1/snippets/access_approval/invalidate_approval_request.rb index 9aae155fe221..197878e8516b 100644 --- a/google-cloud-access_approval-v1/snippets/access_approval/invalidate_approval_request.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/invalidate_approval_request.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_InvalidateApprovalRequest_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#invalidate_approval_request +# +def invalidate_approval_request + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::InvalidateApprovalRequestMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::InvalidateApprovalRequestMessage.new -# Call the invalidate_approval_request method. -result = client.invalidate_approval_request request + # Call the invalidate_approval_request method. + result = client.invalidate_approval_request request -# The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::ApprovalRequest. + p result +end # [END accessapproval_v1_generated_AccessApproval_InvalidateApprovalRequest_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/list_approval_requests.rb b/google-cloud-access_approval-v1/snippets/access_approval/list_approval_requests.rb index 66790bbda3de..88c6ee6c3ca8 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/list_approval_requests.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/list_approval_requests.rb @@ -19,21 +19,27 @@ # [START accessapproval_v1_generated_AccessApproval_ListApprovalRequests_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#list_approval_requests +# +def list_approval_requests + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::ListApprovalRequestsMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::ListApprovalRequestsMessage.new -# Call the list_approval_requests method. -result = client.list_approval_requests request + # Call the list_approval_requests method. + result = client.list_approval_requests request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AccessApproval::V1::ApprovalRequest. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AccessApproval::V1::ApprovalRequest. + p response + end end # [END accessapproval_v1_generated_AccessApproval_ListApprovalRequests_sync] diff --git a/google-cloud-access_approval-v1/snippets/access_approval/update_access_approval_settings.rb b/google-cloud-access_approval-v1/snippets/access_approval/update_access_approval_settings.rb index 4cfff2222330..717010fd7ac2 100755 --- a/google-cloud-access_approval-v1/snippets/access_approval/update_access_approval_settings.rb +++ b/google-cloud-access_approval-v1/snippets/access_approval/update_access_approval_settings.rb @@ -19,15 +19,21 @@ # [START accessapproval_v1_generated_AccessApproval_UpdateAccessApprovalSettings_sync] require "google/cloud/access_approval/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AccessApproval::V1::AccessApproval::Client#update_access_approval_settings +# +def update_access_approval_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AccessApproval::V1::AccessApproval::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AccessApproval::V1::UpdateAccessApprovalSettingsMessage.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AccessApproval::V1::UpdateAccessApprovalSettingsMessage.new -# Call the update_access_approval_settings method. -result = client.update_access_approval_settings request + # Call the update_access_approval_settings method. + result = client.update_access_approval_settings request -# The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalSettings. -p result + # The returned object is of type Google::Cloud::AccessApproval::V1::AccessApprovalSettings. + p result +end # [END accessapproval_v1_generated_AccessApproval_UpdateAccessApprovalSettings_sync] diff --git a/google-cloud-access_approval-v1/snippets/snippet_metadata_google.cloud.accessapproval.v1.json b/google-cloud-access_approval-v1/snippets/snippet_metadata_google.cloud.accessapproval.v1.json index fe99ecdb7604..634fb757d9e5 100644 --- a/google-cloud-access_approval-v1/snippets/snippet_metadata_google.cloud.accessapproval.v1.json +++ b/google-cloud-access_approval-v1/snippets/snippet_metadata_google.cloud.accessapproval.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-ai_platform-v1/.rubocop.yml b/google-cloud-ai_platform-v1/.rubocop.yml index 54e3baf89377..437f598002d6 100644 --- a/google-cloud-ai_platform-v1/.rubocop.yml +++ b/google-cloud-ai_platform-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-ai_platform-v1.rb" diff --git a/google-cloud-ai_platform-v1/snippets/Gemfile b/google-cloud-ai_platform-v1/snippets/Gemfile index 6aa03c805d49..80bfab2acdfb 100644 --- a/google-cloud-ai_platform-v1/snippets/Gemfile +++ b/google-cloud-ai_platform-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset.rb index 9848dfbe8aa3..7cfb2ccfa392 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/create_dataset.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_DatasetService_CreateDataset_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#create_dataset +# +def create_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateDatasetRequest.new -# Call the create_dataset method. -result = client.create_dataset request + # Call the create_dataset method. + result = client.create_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_DatasetService_CreateDataset_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset.rb index 3db4d4af62f7..20c098d81ce4 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/delete_dataset.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_DatasetService_DeleteDataset_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#delete_dataset +# +def delete_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteDatasetRequest.new -# Call the delete_dataset method. -result = client.delete_dataset request + # Call the delete_dataset method. + result = client.delete_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_DatasetService_DeleteDataset_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/export_data.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/export_data.rb index 80f0ca7cc5b9..f96c62c99aab 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/export_data.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/export_data.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_DatasetService_ExportData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#export_data +# +def export_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ExportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ExportDataRequest.new -# Call the export_data method. -result = client.export_data request + # Call the export_data method. + result = client.export_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_DatasetService_ExportData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/get_annotation_spec.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/get_annotation_spec.rb index f9da41202e61..6c8501fe8600 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/get_annotation_spec.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/get_annotation_spec.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_DatasetService_GetAnnotationSpec_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#get_annotation_spec +# +def get_annotation_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetAnnotationSpecRequest.new -# Call the get_annotation_spec method. -result = client.get_annotation_spec request + # Call the get_annotation_spec method. + result = client.get_annotation_spec request -# The returned object is of type Google::Cloud::AIPlatform::V1::AnnotationSpec. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::AnnotationSpec. + p result +end # [END aiplatform_v1_generated_DatasetService_GetAnnotationSpec_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset.rb index 91ed5a87b1d9..06a074a45dc0 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/get_dataset.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_DatasetService_GetDataset_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#get_dataset +# +def get_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetDatasetRequest.new -# Call the get_dataset method. -result = client.get_dataset request + # Call the get_dataset method. + result = client.get_dataset request -# The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + p result +end # [END aiplatform_v1_generated_DatasetService_GetDataset_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/import_data.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/import_data.rb index aba88e112b3c..b31621a518d9 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/import_data.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/import_data.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_DatasetService_ImportData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#import_data +# +def import_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ImportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ImportDataRequest.new -# Call the import_data method. -result = client.import_data request + # Call the import_data method. + result = client.import_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_DatasetService_ImportData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/list_annotations.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/list_annotations.rb index 75bd6881b360..72c2b5a8c10f 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/list_annotations.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/list_annotations.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_DatasetService_ListAnnotations_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#list_annotations +# +def list_annotations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListAnnotationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListAnnotationsRequest.new -# Call the list_annotations method. -result = client.list_annotations request + # Call the list_annotations method. + result = client.list_annotations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Annotation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Annotation. + p response + end end # [END aiplatform_v1_generated_DatasetService_ListAnnotations_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/list_data_items.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/list_data_items.rb index 2e966450afed..9e61c9892ee3 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/list_data_items.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/list_data_items.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_DatasetService_ListDataItems_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#list_data_items +# +def list_data_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListDataItemsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListDataItemsRequest.new -# Call the list_data_items method. -result = client.list_data_items request + # Call the list_data_items method. + result = client.list_data_items request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::DataItem. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::DataItem. + p response + end end # [END aiplatform_v1_generated_DatasetService_ListDataItems_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/list_datasets.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/list_datasets.rb index 1ff6fa2dcf72..267df7e3704b 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/list_datasets.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/list_datasets.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_DatasetService_ListDatasets_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#list_datasets +# +def list_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListDatasetsRequest.new -# Call the list_datasets method. -result = client.list_datasets request + # Call the list_datasets method. + result = client.list_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Dataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Dataset. + p response + end end # [END aiplatform_v1_generated_DatasetService_ListDatasets_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/list_saved_queries.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/list_saved_queries.rb index 3b22fedd0f85..a024a6e6a564 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/list_saved_queries.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/list_saved_queries.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_DatasetService_ListSavedQueries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#list_saved_queries +# +def list_saved_queries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListSavedQueriesRequest.new -# Call the list_saved_queries method. -result = client.list_saved_queries request + # Call the list_saved_queries method. + result = client.list_saved_queries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::SavedQuery. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::SavedQuery. + p response + end end # [END aiplatform_v1_generated_DatasetService_ListSavedQueries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset.rb b/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset.rb index 770ea1af5763..95aeeacb171a 100644 --- a/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset.rb +++ b/google-cloud-ai_platform-v1/snippets/dataset_service/update_dataset.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_DatasetService_UpdateDataset_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::DatasetService::Client#update_dataset +# +def update_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::DatasetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateDatasetRequest.new -# Call the update_dataset method. -result = client.update_dataset request + # Call the update_dataset method. + result = client.update_dataset request -# The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Dataset. + p result +end # [END aiplatform_v1_generated_DatasetService_UpdateDataset_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/create_endpoint.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/create_endpoint.rb index 32aaa7e74cc5..2a1c83902a12 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/create_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/create_endpoint.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_EndpointService_CreateEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#create_endpoint +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateEndpointRequest.new -# Call the create_endpoint method. -result = client.create_endpoint request + # Call the create_endpoint method. + result = client.create_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_EndpointService_CreateEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/delete_endpoint.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/delete_endpoint.rb index 78400b1ff50e..8f8e6d669a8f 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/delete_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/delete_endpoint.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_EndpointService_DeleteEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#delete_endpoint +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteEndpointRequest.new -# Call the delete_endpoint method. -result = client.delete_endpoint request + # Call the delete_endpoint method. + result = client.delete_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_EndpointService_DeleteEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/deploy_model.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/deploy_model.rb index 0c9162f91275..07d8379e5bc3 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/deploy_model.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/deploy_model.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_EndpointService_DeployModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#deploy_model +# +def deploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeployModelRequest.new -# Call the deploy_model method. -result = client.deploy_model request + # Call the deploy_model method. + result = client.deploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_EndpointService_DeployModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/get_endpoint.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/get_endpoint.rb index f8e3cc6acd8d..b889ba06a5ad 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/get_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/get_endpoint.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_EndpointService_GetEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#get_endpoint +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetEndpointRequest.new -# Call the get_endpoint method. -result = client.get_endpoint request + # Call the get_endpoint method. + result = client.get_endpoint request -# The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + p result +end # [END aiplatform_v1_generated_EndpointService_GetEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/list_endpoints.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/list_endpoints.rb index 577844ef67ae..2488d7759a4c 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/list_endpoints.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/list_endpoints.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_EndpointService_ListEndpoints_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#list_endpoints +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListEndpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListEndpointsRequest.new -# Call the list_endpoints method. -result = client.list_endpoints request + # Call the list_endpoints method. + result = client.list_endpoints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Endpoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Endpoint. + p response + end end # [END aiplatform_v1_generated_EndpointService_ListEndpoints_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/undeploy_model.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/undeploy_model.rb index b8dc3e70b95f..d0bf39ef7d69 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/undeploy_model.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/undeploy_model.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_EndpointService_UndeployModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#undeploy_model +# +def undeploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UndeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UndeployModelRequest.new -# Call the undeploy_model method. -result = client.undeploy_model request + # Call the undeploy_model method. + result = client.undeploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_EndpointService_UndeployModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint.rb b/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint.rb index 571bb9a71fa1..a970d358635e 100644 --- a/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/endpoint_service/update_endpoint.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_EndpointService_UpdateEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::EndpointService::Client#update_endpoint +# +def update_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::EndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateEndpointRequest.new -# Call the update_endpoint method. -result = client.update_endpoint request + # Call the update_endpoint method. + result = client.update_endpoint request -# The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Endpoint. + p result +end # [END aiplatform_v1_generated_EndpointService_UpdateEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/read_feature_values.rb b/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/read_feature_values.rb index c1e0f6b7016a..247877e24998 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/read_feature_values.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/read_feature_values.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#read_feature_values +# +def read_feature_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ReadFeatureValuesRequest.new -# Call the read_feature_values method. -result = client.read_feature_values request + # Call the read_feature_values method. + result = client.read_feature_values request -# The returned object is of type Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. + p result +end # [END aiplatform_v1_generated_FeaturestoreOnlineServingService_ReadFeatureValues_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/streaming_read_feature_values.rb b/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/streaming_read_feature_values.rb index decc832e67e6..2f07606ebb42 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/streaming_read_feature_values.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_online_serving_service/streaming_read_feature_values.rb @@ -19,18 +19,24 @@ # [START aiplatform_v1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client#streaming_read_feature_values +# +def streaming_read_feature_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreOnlineServingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::StreamingReadFeatureValuesRequest.new -# Call the streaming_read_feature_values method. -result = client.streaming_read_feature_values request + # Call the streaming_read_feature_values method. + result = client.streaming_read_feature_values request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::AIPlatform::V1::ReadFeatureValuesResponse. + result.each do |response| + p response + end end # [END aiplatform_v1_generated_FeaturestoreOnlineServingService_StreamingReadFeatureValues_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_create_features.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_create_features.rb index d73bb715b983..14c80199f6a3 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_create_features.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_create_features.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_create_features +# +def batch_create_features + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchCreateFeaturesRequest.new -# Call the batch_create_features method. -result = client.batch_create_features request + # Call the batch_create_features method. + result = client.batch_create_features request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_BatchCreateFeatures_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_read_feature_values.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_read_feature_values.rb index 5584cb561860..1a07769d7b74 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_read_feature_values.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/batch_read_feature_values.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#batch_read_feature_values +# +def batch_read_feature_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new -# Call the batch_read_feature_values method. -result = client.batch_read_feature_values request + # Call the batch_read_feature_values method. + result = client.batch_read_feature_values request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_BatchReadFeatureValues_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_entity_type.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_entity_type.rb index 1f49ba447dab..c937bd220e1e 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_entity_type.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_entity_type.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_CreateEntityType_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_entity_type +# +def create_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateEntityTypeRequest.new -# Call the create_entity_type method. -result = client.create_entity_type request + # Call the create_entity_type method. + result = client.create_entity_type request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_CreateEntityType_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_feature.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_feature.rb index 450d3859a00a..08c38e15674c 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_feature.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_feature.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_CreateFeature_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_feature +# +def create_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateFeatureRequest.new -# Call the create_feature method. -result = client.create_feature request + # Call the create_feature method. + result = client.create_feature request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_CreateFeature_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_featurestore.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_featurestore.rb index dc50ce6262ed..98352a71fad4 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/create_featurestore.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/create_featurestore.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#create_featurestore +# +def create_featurestore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateFeaturestoreRequest.new -# Call the create_featurestore method. -result = client.create_featurestore request + # Call the create_featurestore method. + result = client.create_featurestore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_CreateFeaturestore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_entity_type.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_entity_type.rb index 628baf3ea9e9..1c889a29728b 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_entity_type.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_entity_type.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_entity_type +# +def delete_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteEntityTypeRequest.new -# Call the delete_entity_type method. -result = client.delete_entity_type request + # Call the delete_entity_type method. + result = client.delete_entity_type request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_DeleteEntityType_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature.rb index 8253a8df724a..470f1c83053d 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_feature.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_DeleteFeature_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_feature +# +def delete_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteFeatureRequest.new -# Call the delete_feature method. -result = client.delete_feature request + # Call the delete_feature method. + result = client.delete_feature request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_DeleteFeature_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_featurestore.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_featurestore.rb index 18bf7982405e..7c95f2a2cf96 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_featurestore.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/delete_featurestore.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#delete_featurestore +# +def delete_featurestore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteFeaturestoreRequest.new -# Call the delete_featurestore method. -result = client.delete_featurestore request + # Call the delete_featurestore method. + result = client.delete_featurestore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_DeleteFeaturestore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/export_feature_values.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/export_feature_values.rb index 1a36a2e3d102..baa05368fc83 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/export_feature_values.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/export_feature_values.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#export_feature_values +# +def export_feature_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ExportFeatureValuesRequest.new -# Call the export_feature_values method. -result = client.export_feature_values request + # Call the export_feature_values method. + result = client.export_feature_values request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_ExportFeatureValues_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_entity_type.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_entity_type.rb index 9f7262faadf5..6c96c8ebbc81 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_entity_type.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_entity_type.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreService_GetEntityType_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_entity_type +# +def get_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetEntityTypeRequest.new -# Call the get_entity_type method. -result = client.get_entity_type request + # Call the get_entity_type method. + result = client.get_entity_type request -# The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + p result +end # [END aiplatform_v1_generated_FeaturestoreService_GetEntityType_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_feature.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_feature.rb index 34c419666ba6..8ebd3dd97e66 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_feature.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_feature.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreService_GetFeature_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_feature +# +def get_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetFeatureRequest.new -# Call the get_feature method. -result = client.get_feature request + # Call the get_feature method. + result = client.get_feature request -# The returned object is of type Google::Cloud::AIPlatform::V1::Feature. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + p result +end # [END aiplatform_v1_generated_FeaturestoreService_GetFeature_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_featurestore.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_featurestore.rb index 189dc801fb32..605424f5e51a 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/get_featurestore.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/get_featurestore.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreService_GetFeaturestore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#get_featurestore +# +def get_featurestore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetFeaturestoreRequest.new -# Call the get_featurestore method. -result = client.get_featurestore request + # Call the get_featurestore method. + result = client.get_featurestore request -# The returned object is of type Google::Cloud::AIPlatform::V1::Featurestore. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Featurestore. + p result +end # [END aiplatform_v1_generated_FeaturestoreService_GetFeaturestore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/import_feature_values.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/import_feature_values.rb index a6a82433ae02..74c2be8cd64f 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/import_feature_values.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/import_feature_values.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#import_feature_values +# +def import_feature_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ImportFeatureValuesRequest.new -# Call the import_feature_values method. -result = client.import_feature_values request + # Call the import_feature_values method. + result = client.import_feature_values request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_ImportFeatureValues_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_entity_types.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_entity_types.rb index 7b708dae4c57..175f9cb63d7c 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_entity_types.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_entity_types.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_FeaturestoreService_ListEntityTypes_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_entity_types +# +def list_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListEntityTypesRequest.new -# Call the list_entity_types method. -result = client.list_entity_types request + # Call the list_entity_types method. + result = client.list_entity_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::EntityType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::EntityType. + p response + end end # [END aiplatform_v1_generated_FeaturestoreService_ListEntityTypes_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_features.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_features.rb index 7af23f7090c9..1a40054484b1 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_features.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_features.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_FeaturestoreService_ListFeatures_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_features +# +def list_features + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListFeaturesRequest.new -# Call the list_features method. -result = client.list_features request + # Call the list_features method. + result = client.list_features request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Feature. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Feature. + p response + end end # [END aiplatform_v1_generated_FeaturestoreService_ListFeatures_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_featurestores.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_featurestores.rb index ed7157e49474..0464a99077e7 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/list_featurestores.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/list_featurestores.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_FeaturestoreService_ListFeaturestores_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#list_featurestores +# +def list_featurestores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListFeaturestoresRequest.new -# Call the list_featurestores method. -result = client.list_featurestores request + # Call the list_featurestores method. + result = client.list_featurestores request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Featurestore. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Featurestore. + p response + end end # [END aiplatform_v1_generated_FeaturestoreService_ListFeaturestores_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/search_features.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/search_features.rb index 77023a77496f..b8b9242d21c2 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/search_features.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/search_features.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_FeaturestoreService_SearchFeatures_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#search_features +# +def search_features + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::SearchFeaturesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::SearchFeaturesRequest.new -# Call the search_features method. -result = client.search_features request + # Call the search_features method. + result = client.search_features request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Feature. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Feature. + p response + end end # [END aiplatform_v1_generated_FeaturestoreService_SearchFeatures_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_entity_type.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_entity_type.rb index c4a51c2a301c..31ebfb55333e 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_entity_type.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_entity_type.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreService_UpdateEntityType_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_entity_type +# +def update_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateEntityTypeRequest.new -# Call the update_entity_type method. -result = client.update_entity_type request + # Call the update_entity_type method. + result = client.update_entity_type request -# The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::EntityType. + p result +end # [END aiplatform_v1_generated_FeaturestoreService_UpdateEntityType_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_feature.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_feature.rb index 1e069e7a2f4f..0bbc566bc729 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_feature.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_feature.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_FeaturestoreService_UpdateFeature_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_feature +# +def update_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateFeatureRequest.new -# Call the update_feature method. -result = client.update_feature request + # Call the update_feature method. + result = client.update_feature request -# The returned object is of type Google::Cloud::AIPlatform::V1::Feature. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Feature. + p result +end # [END aiplatform_v1_generated_FeaturestoreService_UpdateFeature_sync] diff --git a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_featurestore.rb b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_featurestore.rb index 8190408619bf..91bec22f3eb5 100644 --- a/google-cloud-ai_platform-v1/snippets/featurestore_service/update_featurestore.rb +++ b/google-cloud-ai_platform-v1/snippets/featurestore_service/update_featurestore.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::FeaturestoreService::Client#update_featurestore +# +def update_featurestore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::FeaturestoreService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateFeaturestoreRequest.new -# Call the update_featurestore method. -result = client.update_featurestore request + # Call the update_featurestore method. + result = client.update_featurestore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_FeaturestoreService_UpdateFeaturestore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/create_index_endpoint.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/create_index_endpoint.rb index ef41e0df964d..8ebeb47ac628 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/create_index_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/create_index_endpoint.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#create_index_endpoint +# +def create_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateIndexEndpointRequest.new -# Call the create_index_endpoint method. -result = client.create_index_endpoint request + # Call the create_index_endpoint method. + result = client.create_index_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexEndpointService_CreateIndexEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/delete_index_endpoint.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/delete_index_endpoint.rb index 18ea8a78fa13..1528ffbbec54 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/delete_index_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/delete_index_endpoint.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#delete_index_endpoint +# +def delete_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteIndexEndpointRequest.new -# Call the delete_index_endpoint method. -result = client.delete_index_endpoint request + # Call the delete_index_endpoint method. + result = client.delete_index_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexEndpointService_DeleteIndexEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/deploy_index.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/deploy_index.rb index 67ace0a749e3..8befd97e339b 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/deploy_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/deploy_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexEndpointService_DeployIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#deploy_index +# +def deploy_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeployIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeployIndexRequest.new -# Call the deploy_index method. -result = client.deploy_index request + # Call the deploy_index method. + result = client.deploy_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexEndpointService_DeployIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/get_index_endpoint.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/get_index_endpoint.rb index 571fdd9fc8c2..951758327ff3 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/get_index_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/get_index_endpoint.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_IndexEndpointService_GetIndexEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#get_index_endpoint +# +def get_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetIndexEndpointRequest.new -# Call the get_index_endpoint method. -result = client.get_index_endpoint request + # Call the get_index_endpoint method. + result = client.get_index_endpoint request -# The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + p result +end # [END aiplatform_v1_generated_IndexEndpointService_GetIndexEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/list_index_endpoints.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/list_index_endpoints.rb index 0e37277c9a5f..2a962f649947 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/list_index_endpoints.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/list_index_endpoints.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#list_index_endpoints +# +def list_index_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListIndexEndpointsRequest.new -# Call the list_index_endpoints method. -result = client.list_index_endpoints request + # Call the list_index_endpoints method. + result = client.list_index_endpoints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::IndexEndpoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::IndexEndpoint. + p response + end end # [END aiplatform_v1_generated_IndexEndpointService_ListIndexEndpoints_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/mutate_deployed_index.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/mutate_deployed_index.rb index b9791d5046e4..48b430885846 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/mutate_deployed_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/mutate_deployed_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#mutate_deployed_index +# +def mutate_deployed_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::MutateDeployedIndexRequest.new -# Call the mutate_deployed_index method. -result = client.mutate_deployed_index request + # Call the mutate_deployed_index method. + result = client.mutate_deployed_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexEndpointService_MutateDeployedIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/undeploy_index.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/undeploy_index.rb index 5ecea05fe2de..5c084fbfb1b5 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/undeploy_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/undeploy_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexEndpointService_UndeployIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#undeploy_index +# +def undeploy_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UndeployIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UndeployIndexRequest.new -# Call the undeploy_index method. -result = client.undeploy_index request + # Call the undeploy_index method. + result = client.undeploy_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexEndpointService_UndeployIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/update_index_endpoint.rb b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/update_index_endpoint.rb index c7849998a0c8..56061c1b546a 100644 --- a/google-cloud-ai_platform-v1/snippets/index_endpoint_service/update_index_endpoint.rb +++ b/google-cloud-ai_platform-v1/snippets/index_endpoint_service/update_index_endpoint.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_IndexEndpointService_UpdateIndexEndpoint_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexEndpointService::Client#update_index_endpoint +# +def update_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexEndpointService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateIndexEndpointRequest.new -# Call the update_index_endpoint method. -result = client.update_index_endpoint request + # Call the update_index_endpoint method. + result = client.update_index_endpoint request -# The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::IndexEndpoint. + p result +end # [END aiplatform_v1_generated_IndexEndpointService_UpdateIndexEndpoint_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/create_index.rb b/google-cloud-ai_platform-v1/snippets/index_service/create_index.rb index 59807f8c42e8..c9f517ccab60 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/create_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/create_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexService_CreateIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#create_index +# +def create_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateIndexRequest.new -# Call the create_index method. -result = client.create_index request + # Call the create_index method. + result = client.create_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexService_CreateIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/delete_index.rb b/google-cloud-ai_platform-v1/snippets/index_service/delete_index.rb index b39bfd0fc5e0..3bee551409f7 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/delete_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/delete_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexService_DeleteIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#delete_index +# +def delete_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteIndexRequest.new -# Call the delete_index method. -result = client.delete_index request + # Call the delete_index method. + result = client.delete_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexService_DeleteIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/get_index.rb b/google-cloud-ai_platform-v1/snippets/index_service/get_index.rb index 80f1ccb1ca91..c3034073768e 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/get_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/get_index.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_IndexService_GetIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#get_index +# +def get_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetIndexRequest.new -# Call the get_index method. -result = client.get_index request + # Call the get_index method. + result = client.get_index request -# The returned object is of type Google::Cloud::AIPlatform::V1::Index. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Index. + p result +end # [END aiplatform_v1_generated_IndexService_GetIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/list_indexes.rb b/google-cloud-ai_platform-v1/snippets/index_service/list_indexes.rb index f6023717d302..6626f6e02487 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/list_indexes.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/list_indexes.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_IndexService_ListIndexes_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#list_indexes +# +def list_indexes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListIndexesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListIndexesRequest.new -# Call the list_indexes method. -result = client.list_indexes request + # Call the list_indexes method. + result = client.list_indexes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Index. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Index. + p response + end end # [END aiplatform_v1_generated_IndexService_ListIndexes_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/remove_datapoints.rb b/google-cloud-ai_platform-v1/snippets/index_service/remove_datapoints.rb index 7e83b97c6aba..d04f694a7c3b 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/remove_datapoints.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/remove_datapoints.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_IndexService_RemoveDatapoints_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#remove_datapoints +# +def remove_datapoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::RemoveDatapointsRequest.new -# Call the remove_datapoints method. -result = client.remove_datapoints request + # Call the remove_datapoints method. + result = client.remove_datapoints request -# The returned object is of type Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveDatapointsResponse. + p result +end # [END aiplatform_v1_generated_IndexService_RemoveDatapoints_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/update_index.rb b/google-cloud-ai_platform-v1/snippets/index_service/update_index.rb index 9e174b0b4dd7..0d08fe04ae43 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/update_index.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/update_index.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_IndexService_UpdateIndex_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#update_index +# +def update_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateIndexRequest.new -# Call the update_index method. -result = client.update_index request + # Call the update_index method. + result = client.update_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_IndexService_UpdateIndex_sync] diff --git a/google-cloud-ai_platform-v1/snippets/index_service/upsert_datapoints.rb b/google-cloud-ai_platform-v1/snippets/index_service/upsert_datapoints.rb index 58da0e27a61d..8086e338af58 100644 --- a/google-cloud-ai_platform-v1/snippets/index_service/upsert_datapoints.rb +++ b/google-cloud-ai_platform-v1/snippets/index_service/upsert_datapoints.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_IndexService_UpsertDatapoints_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::IndexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::IndexService::Client#upsert_datapoints +# +def upsert_datapoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::IndexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpsertDatapointsRequest.new -# Call the upsert_datapoints method. -result = client.upsert_datapoints request + # Call the upsert_datapoints method. + result = client.upsert_datapoints request -# The returned object is of type Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::UpsertDatapointsResponse. + p result +end # [END aiplatform_v1_generated_IndexService_UpsertDatapoints_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/cancel_batch_prediction_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/cancel_batch_prediction_job.rb index 7f9165c02b13..ecf74af348f3 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/cancel_batch_prediction_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/cancel_batch_prediction_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CancelBatchPredictionJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#cancel_batch_prediction_job +# +def cancel_batch_prediction_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelBatchPredictionJobRequest.new -# Call the cancel_batch_prediction_job method. -result = client.cancel_batch_prediction_job request + # Call the cancel_batch_prediction_job method. + result = client.cancel_batch_prediction_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_CancelBatchPredictionJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/cancel_custom_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/cancel_custom_job.rb index 919c49addd27..a6bd34227271 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/cancel_custom_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/cancel_custom_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CancelCustomJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#cancel_custom_job +# +def cancel_custom_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelCustomJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelCustomJobRequest.new -# Call the cancel_custom_job method. -result = client.cancel_custom_job request + # Call the cancel_custom_job method. + result = client.cancel_custom_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_CancelCustomJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/cancel_data_labeling_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/cancel_data_labeling_job.rb index 4ede76affcdb..c8f508f6c4d3 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/cancel_data_labeling_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/cancel_data_labeling_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CancelDataLabelingJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#cancel_data_labeling_job +# +def cancel_data_labeling_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelDataLabelingJobRequest.new -# Call the cancel_data_labeling_job method. -result = client.cancel_data_labeling_job request + # Call the cancel_data_labeling_job method. + result = client.cancel_data_labeling_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_CancelDataLabelingJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/cancel_hyperparameter_tuning_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/cancel_hyperparameter_tuning_job.rb index 6719172bd0dc..46e51aaa7170 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/cancel_hyperparameter_tuning_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/cancel_hyperparameter_tuning_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CancelHyperparameterTuningJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#cancel_hyperparameter_tuning_job +# +def cancel_hyperparameter_tuning_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelHyperparameterTuningJobRequest.new -# Call the cancel_hyperparameter_tuning_job method. -result = client.cancel_hyperparameter_tuning_job request + # Call the cancel_hyperparameter_tuning_job method. + result = client.cancel_hyperparameter_tuning_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_CancelHyperparameterTuningJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/create_batch_prediction_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/create_batch_prediction_job.rb index e63746d6be8a..911e38226b4f 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/create_batch_prediction_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/create_batch_prediction_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CreateBatchPredictionJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#create_batch_prediction_job +# +def create_batch_prediction_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateBatchPredictionJobRequest.new -# Call the create_batch_prediction_job method. -result = client.create_batch_prediction_job request + # Call the create_batch_prediction_job method. + result = client.create_batch_prediction_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + p result +end # [END aiplatform_v1_generated_JobService_CreateBatchPredictionJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/create_custom_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/create_custom_job.rb index 0df16a2b7349..3bdd206f271d 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/create_custom_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/create_custom_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CreateCustomJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#create_custom_job +# +def create_custom_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateCustomJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateCustomJobRequest.new -# Call the create_custom_job method. -result = client.create_custom_job request + # Call the create_custom_job method. + result = client.create_custom_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + p result +end # [END aiplatform_v1_generated_JobService_CreateCustomJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/create_data_labeling_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/create_data_labeling_job.rb index 4c25259e076e..401a630d046c 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/create_data_labeling_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/create_data_labeling_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CreateDataLabelingJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#create_data_labeling_job +# +def create_data_labeling_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateDataLabelingJobRequest.new -# Call the create_data_labeling_job method. -result = client.create_data_labeling_job request + # Call the create_data_labeling_job method. + result = client.create_data_labeling_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + p result +end # [END aiplatform_v1_generated_JobService_CreateDataLabelingJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/create_hyperparameter_tuning_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/create_hyperparameter_tuning_job.rb index 8b799b510ffb..3f16b8401dda 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/create_hyperparameter_tuning_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/create_hyperparameter_tuning_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CreateHyperparameterTuningJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#create_hyperparameter_tuning_job +# +def create_hyperparameter_tuning_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateHyperparameterTuningJobRequest.new -# Call the create_hyperparameter_tuning_job method. -result = client.create_hyperparameter_tuning_job request + # Call the create_hyperparameter_tuning_job method. + result = client.create_hyperparameter_tuning_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + p result +end # [END aiplatform_v1_generated_JobService_CreateHyperparameterTuningJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/create_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/create_model_deployment_monitoring_job.rb index c86db898c472..f2f37909a33c 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/create_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/create_model_deployment_monitoring_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_CreateModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#create_model_deployment_monitoring_job +# +def create_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateModelDeploymentMonitoringJobRequest.new -# Call the create_model_deployment_monitoring_job method. -result = client.create_model_deployment_monitoring_job request + # Call the create_model_deployment_monitoring_job method. + result = client.create_model_deployment_monitoring_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + p result +end # [END aiplatform_v1_generated_JobService_CreateModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/delete_batch_prediction_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/delete_batch_prediction_job.rb index 23da13f11d98..7c35defb3061 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/delete_batch_prediction_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/delete_batch_prediction_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#delete_batch_prediction_job +# +def delete_batch_prediction_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteBatchPredictionJobRequest.new -# Call the delete_batch_prediction_job method. -result = client.delete_batch_prediction_job request + # Call the delete_batch_prediction_job method. + result = client.delete_batch_prediction_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_DeleteBatchPredictionJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/delete_custom_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/delete_custom_job.rb index 9cad388b4b04..c48241ee78fa 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/delete_custom_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/delete_custom_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_DeleteCustomJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#delete_custom_job +# +def delete_custom_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteCustomJobRequest.new -# Call the delete_custom_job method. -result = client.delete_custom_job request + # Call the delete_custom_job method. + result = client.delete_custom_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_DeleteCustomJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/delete_data_labeling_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/delete_data_labeling_job.rb index dea40a65e0bf..7a3ea9f0e8a9 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/delete_data_labeling_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/delete_data_labeling_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_DeleteDataLabelingJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#delete_data_labeling_job +# +def delete_data_labeling_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteDataLabelingJobRequest.new -# Call the delete_data_labeling_job method. -result = client.delete_data_labeling_job request + # Call the delete_data_labeling_job method. + result = client.delete_data_labeling_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_DeleteDataLabelingJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/delete_hyperparameter_tuning_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/delete_hyperparameter_tuning_job.rb index 3ee5f0527e60..c3c8b85e6c06 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/delete_hyperparameter_tuning_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/delete_hyperparameter_tuning_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#delete_hyperparameter_tuning_job +# +def delete_hyperparameter_tuning_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteHyperparameterTuningJobRequest.new -# Call the delete_hyperparameter_tuning_job method. -result = client.delete_hyperparameter_tuning_job request + # Call the delete_hyperparameter_tuning_job method. + result = client.delete_hyperparameter_tuning_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_DeleteHyperparameterTuningJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/delete_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/delete_model_deployment_monitoring_job.rb index 377bc9eb9d16..fb6a1d898ccb 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/delete_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/delete_model_deployment_monitoring_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#delete_model_deployment_monitoring_job +# +def delete_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteModelDeploymentMonitoringJobRequest.new -# Call the delete_model_deployment_monitoring_job method. -result = client.delete_model_deployment_monitoring_job request + # Call the delete_model_deployment_monitoring_job method. + result = client.delete_model_deployment_monitoring_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_DeleteModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/get_batch_prediction_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/get_batch_prediction_job.rb index 138be0214fb6..b849f03b21c0 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/get_batch_prediction_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/get_batch_prediction_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_GetBatchPredictionJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#get_batch_prediction_job +# +def get_batch_prediction_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetBatchPredictionJobRequest.new -# Call the get_batch_prediction_job method. -result = client.get_batch_prediction_job request + # Call the get_batch_prediction_job method. + result = client.get_batch_prediction_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchPredictionJob. + p result +end # [END aiplatform_v1_generated_JobService_GetBatchPredictionJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/get_custom_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/get_custom_job.rb index d051e35e285a..bf17135aae8b 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/get_custom_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/get_custom_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_GetCustomJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#get_custom_job +# +def get_custom_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetCustomJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetCustomJobRequest.new -# Call the get_custom_job method. -result = client.get_custom_job request + # Call the get_custom_job method. + result = client.get_custom_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::CustomJob. + p result +end # [END aiplatform_v1_generated_JobService_GetCustomJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/get_data_labeling_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/get_data_labeling_job.rb index 4ad936229131..d35739449f97 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/get_data_labeling_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/get_data_labeling_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_GetDataLabelingJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#get_data_labeling_job +# +def get_data_labeling_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetDataLabelingJobRequest.new -# Call the get_data_labeling_job method. -result = client.get_data_labeling_job request + # Call the get_data_labeling_job method. + result = client.get_data_labeling_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::DataLabelingJob. + p result +end # [END aiplatform_v1_generated_JobService_GetDataLabelingJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/get_hyperparameter_tuning_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/get_hyperparameter_tuning_job.rb index 08e70a965943..95dd4d155c64 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/get_hyperparameter_tuning_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/get_hyperparameter_tuning_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_GetHyperparameterTuningJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#get_hyperparameter_tuning_job +# +def get_hyperparameter_tuning_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetHyperparameterTuningJobRequest.new -# Call the get_hyperparameter_tuning_job method. -result = client.get_hyperparameter_tuning_job request + # Call the get_hyperparameter_tuning_job method. + result = client.get_hyperparameter_tuning_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + p result +end # [END aiplatform_v1_generated_JobService_GetHyperparameterTuningJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/get_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/get_model_deployment_monitoring_job.rb index e4fb66840eff..cb08c273a7d8 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/get_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/get_model_deployment_monitoring_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_GetModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#get_model_deployment_monitoring_job +# +def get_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetModelDeploymentMonitoringJobRequest.new -# Call the get_model_deployment_monitoring_job method. -result = client.get_model_deployment_monitoring_job request + # Call the get_model_deployment_monitoring_job method. + result = client.get_model_deployment_monitoring_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + p result +end # [END aiplatform_v1_generated_JobService_GetModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/list_batch_prediction_jobs.rb b/google-cloud-ai_platform-v1/snippets/job_service/list_batch_prediction_jobs.rb index 24b221278c70..9750c17dbac2 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/list_batch_prediction_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/list_batch_prediction_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_ListBatchPredictionJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#list_batch_prediction_jobs +# +def list_batch_prediction_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListBatchPredictionJobsRequest.new -# Call the list_batch_prediction_jobs method. -result = client.list_batch_prediction_jobs request + # Call the list_batch_prediction_jobs method. + result = client.list_batch_prediction_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::BatchPredictionJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::BatchPredictionJob. + p response + end end # [END aiplatform_v1_generated_JobService_ListBatchPredictionJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/list_custom_jobs.rb b/google-cloud-ai_platform-v1/snippets/job_service/list_custom_jobs.rb index 36e68d85bc98..57f952f862e0 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/list_custom_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/list_custom_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_ListCustomJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#list_custom_jobs +# +def list_custom_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListCustomJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListCustomJobsRequest.new -# Call the list_custom_jobs method. -result = client.list_custom_jobs request + # Call the list_custom_jobs method. + result = client.list_custom_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::CustomJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::CustomJob. + p response + end end # [END aiplatform_v1_generated_JobService_ListCustomJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/list_data_labeling_jobs.rb b/google-cloud-ai_platform-v1/snippets/job_service/list_data_labeling_jobs.rb index ae9ac685e186..c435cbae5283 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/list_data_labeling_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/list_data_labeling_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_ListDataLabelingJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#list_data_labeling_jobs +# +def list_data_labeling_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListDataLabelingJobsRequest.new -# Call the list_data_labeling_jobs method. -result = client.list_data_labeling_jobs request + # Call the list_data_labeling_jobs method. + result = client.list_data_labeling_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::DataLabelingJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::DataLabelingJob. + p response + end end # [END aiplatform_v1_generated_JobService_ListDataLabelingJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/list_hyperparameter_tuning_jobs.rb b/google-cloud-ai_platform-v1/snippets/job_service/list_hyperparameter_tuning_jobs.rb index a9bf1c67e924..3da015e52813 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/list_hyperparameter_tuning_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/list_hyperparameter_tuning_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_ListHyperparameterTuningJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#list_hyperparameter_tuning_jobs +# +def list_hyperparameter_tuning_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListHyperparameterTuningJobsRequest.new -# Call the list_hyperparameter_tuning_jobs method. -result = client.list_hyperparameter_tuning_jobs request + # Call the list_hyperparameter_tuning_jobs method. + result = client.list_hyperparameter_tuning_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::HyperparameterTuningJob. + p response + end end # [END aiplatform_v1_generated_JobService_ListHyperparameterTuningJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/list_model_deployment_monitoring_jobs.rb b/google-cloud-ai_platform-v1/snippets/job_service/list_model_deployment_monitoring_jobs.rb index 4af33078fe4d..3af8c7975516 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/list_model_deployment_monitoring_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/list_model_deployment_monitoring_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_ListModelDeploymentMonitoringJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#list_model_deployment_monitoring_jobs +# +def list_model_deployment_monitoring_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListModelDeploymentMonitoringJobsRequest.new -# Call the list_model_deployment_monitoring_jobs method. -result = client.list_model_deployment_monitoring_jobs request + # Call the list_model_deployment_monitoring_jobs method. + result = client.list_model_deployment_monitoring_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelDeploymentMonitoringJob. + p response + end end # [END aiplatform_v1_generated_JobService_ListModelDeploymentMonitoringJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/pause_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/pause_model_deployment_monitoring_job.rb index 77436e017e97..c5910216686a 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/pause_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/pause_model_deployment_monitoring_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_PauseModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#pause_model_deployment_monitoring_job +# +def pause_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::PauseModelDeploymentMonitoringJobRequest.new -# Call the pause_model_deployment_monitoring_job method. -result = client.pause_model_deployment_monitoring_job request + # Call the pause_model_deployment_monitoring_job method. + result = client.pause_model_deployment_monitoring_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_PauseModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/resume_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/resume_model_deployment_monitoring_job.rb index 65f40a7bebdb..fff90d9692e2 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/resume_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/resume_model_deployment_monitoring_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_JobService_ResumeModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#resume_model_deployment_monitoring_job +# +def resume_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ResumeModelDeploymentMonitoringJobRequest.new -# Call the resume_model_deployment_monitoring_job method. -result = client.resume_model_deployment_monitoring_job request + # Call the resume_model_deployment_monitoring_job method. + result = client.resume_model_deployment_monitoring_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_JobService_ResumeModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/search_model_deployment_monitoring_stats_anomalies.rb b/google-cloud-ai_platform-v1/snippets/job_service/search_model_deployment_monitoring_stats_anomalies.rb index 68fdf5158c3b..d7ee3113af40 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/search_model_deployment_monitoring_stats_anomalies.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/search_model_deployment_monitoring_stats_anomalies.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#search_model_deployment_monitoring_stats_anomalies +# +def search_model_deployment_monitoring_stats_anomalies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::SearchModelDeploymentMonitoringStatsAnomaliesRequest.new -# Call the search_model_deployment_monitoring_stats_anomalies method. -result = client.search_model_deployment_monitoring_stats_anomalies request + # Call the search_model_deployment_monitoring_stats_anomalies method. + result = client.search_model_deployment_monitoring_stats_anomalies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelMonitoringStatsAnomalies. + p response + end end # [END aiplatform_v1_generated_JobService_SearchModelDeploymentMonitoringStatsAnomalies_sync] diff --git a/google-cloud-ai_platform-v1/snippets/job_service/update_model_deployment_monitoring_job.rb b/google-cloud-ai_platform-v1/snippets/job_service/update_model_deployment_monitoring_job.rb index fe5b46cfd4f2..d94a4f376a7d 100644 --- a/google-cloud-ai_platform-v1/snippets/job_service/update_model_deployment_monitoring_job.rb +++ b/google-cloud-ai_platform-v1/snippets/job_service/update_model_deployment_monitoring_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::JobService::Client#update_model_deployment_monitoring_job +# +def update_model_deployment_monitoring_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateModelDeploymentMonitoringJobRequest.new -# Call the update_model_deployment_monitoring_job method. -result = client.update_model_deployment_monitoring_job request + # Call the update_model_deployment_monitoring_job method. + result = client.update_model_deployment_monitoring_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_JobService_UpdateModelDeploymentMonitoringJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_artifacts_and_executions.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_artifacts_and_executions.rb index 5ff0b4fecaa7..6bef8d4b1d51 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_artifacts_and_executions.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_artifacts_and_executions.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_AddContextArtifactsAndExecutions_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_artifacts_and_executions +# +def add_context_artifacts_and_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsRequest.new -# Call the add_context_artifacts_and_executions method. -result = client.add_context_artifacts_and_executions request + # Call the add_context_artifacts_and_executions method. + result = client.add_context_artifacts_and_executions request -# The returned object is of type Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextArtifactsAndExecutionsResponse. + p result +end # [END aiplatform_v1_generated_MetadataService_AddContextArtifactsAndExecutions_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_children.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_children.rb index 56ff4a8f35ae..41f347a8d7bd 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_children.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/add_context_children.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_AddContextChildren_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#add_context_children +# +def add_context_children + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::AddContextChildrenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::AddContextChildrenRequest.new -# Call the add_context_children method. -result = client.add_context_children request + # Call the add_context_children method. + result = client.add_context_children request -# The returned object is of type Google::Cloud::AIPlatform::V1::AddContextChildrenResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::AddContextChildrenResponse. + p result +end # [END aiplatform_v1_generated_MetadataService_AddContextChildren_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/add_execution_events.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/add_execution_events.rb index acb3dd09af37..b77d390dc714 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/add_execution_events.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/add_execution_events.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_AddExecutionEvents_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#add_execution_events +# +def add_execution_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::AddExecutionEventsRequest.new -# Call the add_execution_events method. -result = client.add_execution_events request + # Call the add_execution_events method. + result = client.add_execution_events request -# The returned object is of type Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::AddExecutionEventsResponse. + p result +end # [END aiplatform_v1_generated_MetadataService_AddExecutionEvents_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/create_artifact.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/create_artifact.rb index 25ad74be3074..6b9e0054290e 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/create_artifact.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/create_artifact.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_CreateArtifact_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#create_artifact +# +def create_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateArtifactRequest.new -# Call the create_artifact method. -result = client.create_artifact request + # Call the create_artifact method. + result = client.create_artifact request -# The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + p result +end # [END aiplatform_v1_generated_MetadataService_CreateArtifact_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/create_context.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/create_context.rb index d7b6e1f97284..ffc878b72a80 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/create_context.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/create_context.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_CreateContext_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#create_context +# +def create_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateContextRequest.new -# Call the create_context method. -result = client.create_context request + # Call the create_context method. + result = client.create_context request -# The returned object is of type Google::Cloud::AIPlatform::V1::Context. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + p result +end # [END aiplatform_v1_generated_MetadataService_CreateContext_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/create_execution.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/create_execution.rb index c788d251bcbe..009100c011be 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/create_execution.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/create_execution.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_CreateExecution_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#create_execution +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateExecutionRequest.new -# Call the create_execution method. -result = client.create_execution request + # Call the create_execution method. + result = client.create_execution request -# The returned object is of type Google::Cloud::AIPlatform::V1::Execution. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + p result +end # [END aiplatform_v1_generated_MetadataService_CreateExecution_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_schema.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_schema.rb index 9f310ab27d87..9dff4be409e1 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_schema.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_schema.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_CreateMetadataSchema_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#create_metadata_schema +# +def create_metadata_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateMetadataSchemaRequest.new -# Call the create_metadata_schema method. -result = client.create_metadata_schema request + # Call the create_metadata_schema method. + result = client.create_metadata_schema request -# The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + p result +end # [END aiplatform_v1_generated_MetadataService_CreateMetadataSchema_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_store.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_store.rb index 44071d3ca2b8..fe726890c00f 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_store.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/create_metadata_store.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_CreateMetadataStore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#create_metadata_store +# +def create_metadata_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateMetadataStoreRequest.new -# Call the create_metadata_store method. -result = client.create_metadata_store request + # Call the create_metadata_store method. + result = client.create_metadata_store request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_CreateMetadataStore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_artifact.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_artifact.rb index 9fbb8e7d8913..80e9edfddf6b 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_artifact.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_artifact.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_DeleteArtifact_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_artifact +# +def delete_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteArtifactRequest.new -# Call the delete_artifact method. -result = client.delete_artifact request + # Call the delete_artifact method. + result = client.delete_artifact request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_DeleteArtifact_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_context.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_context.rb index e48b4a5c1659..64f73edc7341 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_context.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_context.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_DeleteContext_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_context +# +def delete_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteContextRequest.new -# Call the delete_context method. -result = client.delete_context request + # Call the delete_context method. + result = client.delete_context request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_DeleteContext_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_execution.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_execution.rb index eaf6d8fa8ff6..0a51dd3b6e10 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_execution.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_execution.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_DeleteExecution_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_execution +# +def delete_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteExecutionRequest.new -# Call the delete_execution method. -result = client.delete_execution request + # Call the delete_execution method. + result = client.delete_execution request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_DeleteExecution_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_metadata_store.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_metadata_store.rb index edd4cd0863fe..c71e4e8aa5a8 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/delete_metadata_store.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/delete_metadata_store.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_DeleteMetadataStore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#delete_metadata_store +# +def delete_metadata_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteMetadataStoreRequest.new -# Call the delete_metadata_store method. -result = client.delete_metadata_store request + # Call the delete_metadata_store method. + result = client.delete_metadata_store request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_DeleteMetadataStore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/get_artifact.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/get_artifact.rb index bc25a3383051..add17bfb8c16 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/get_artifact.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/get_artifact.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_GetArtifact_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#get_artifact +# +def get_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetArtifactRequest.new -# Call the get_artifact method. -result = client.get_artifact request + # Call the get_artifact method. + result = client.get_artifact request -# The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + p result +end # [END aiplatform_v1_generated_MetadataService_GetArtifact_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/get_context.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/get_context.rb index c25bd223e93c..eea29f26fe66 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/get_context.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/get_context.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_GetContext_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#get_context +# +def get_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetContextRequest.new -# Call the get_context method. -result = client.get_context request + # Call the get_context method. + result = client.get_context request -# The returned object is of type Google::Cloud::AIPlatform::V1::Context. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + p result +end # [END aiplatform_v1_generated_MetadataService_GetContext_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/get_execution.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/get_execution.rb index 313246ae21b0..1fbf247cecb7 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/get_execution.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/get_execution.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_GetExecution_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#get_execution +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetExecutionRequest.new -# Call the get_execution method. -result = client.get_execution request + # Call the get_execution method. + result = client.get_execution request -# The returned object is of type Google::Cloud::AIPlatform::V1::Execution. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + p result +end # [END aiplatform_v1_generated_MetadataService_GetExecution_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_schema.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_schema.rb index 75785f040e71..b013d03b39b7 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_schema.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_schema.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_GetMetadataSchema_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#get_metadata_schema +# +def get_metadata_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetMetadataSchemaRequest.new -# Call the get_metadata_schema method. -result = client.get_metadata_schema request + # Call the get_metadata_schema method. + result = client.get_metadata_schema request -# The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataSchema. + p result +end # [END aiplatform_v1_generated_MetadataService_GetMetadataSchema_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_store.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_store.rb index cfbc528582fb..b1ed19b45fe7 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_store.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/get_metadata_store.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_GetMetadataStore_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#get_metadata_store +# +def get_metadata_store + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetMetadataStoreRequest.new -# Call the get_metadata_store method. -result = client.get_metadata_store request + # Call the get_metadata_store method. + result = client.get_metadata_store request -# The returned object is of type Google::Cloud::AIPlatform::V1::MetadataStore. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::MetadataStore. + p result +end # [END aiplatform_v1_generated_MetadataService_GetMetadataStore_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/list_artifacts.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/list_artifacts.rb index acf9d2c20cb6..4f7d0c72057c 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/list_artifacts.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/list_artifacts.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MetadataService_ListArtifacts_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#list_artifacts +# +def list_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListArtifactsRequest.new -# Call the list_artifacts method. -result = client.list_artifacts request + # Call the list_artifacts method. + result = client.list_artifacts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Artifact. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Artifact. + p response + end end # [END aiplatform_v1_generated_MetadataService_ListArtifacts_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/list_contexts.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/list_contexts.rb index c6d984573773..35a16a972461 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/list_contexts.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/list_contexts.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MetadataService_ListContexts_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#list_contexts +# +def list_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListContextsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListContextsRequest.new -# Call the list_contexts method. -result = client.list_contexts request + # Call the list_contexts method. + result = client.list_contexts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Context. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Context. + p response + end end # [END aiplatform_v1_generated_MetadataService_ListContexts_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/list_executions.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/list_executions.rb index e2e4ebc1ec8a..6b21bfe24201 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/list_executions.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/list_executions.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MetadataService_ListExecutions_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#list_executions +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListExecutionsRequest.new -# Call the list_executions method. -result = client.list_executions request + # Call the list_executions method. + result = client.list_executions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Execution. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Execution. + p response + end end # [END aiplatform_v1_generated_MetadataService_ListExecutions_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_schemas.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_schemas.rb index 6d1fa3f79e96..b41b6f547871 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_schemas.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_schemas.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MetadataService_ListMetadataSchemas_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_schemas +# +def list_metadata_schemas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListMetadataSchemasRequest.new -# Call the list_metadata_schemas method. -result = client.list_metadata_schemas request + # Call the list_metadata_schemas method. + result = client.list_metadata_schemas request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::MetadataSchema. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::MetadataSchema. + p response + end end # [END aiplatform_v1_generated_MetadataService_ListMetadataSchemas_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_stores.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_stores.rb index c1899b266469..01e6096cc0ac 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_stores.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/list_metadata_stores.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MetadataService_ListMetadataStores_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#list_metadata_stores +# +def list_metadata_stores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListMetadataStoresRequest.new -# Call the list_metadata_stores method. -result = client.list_metadata_stores request + # Call the list_metadata_stores method. + result = client.list_metadata_stores request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::MetadataStore. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::MetadataStore. + p response + end end # [END aiplatform_v1_generated_MetadataService_ListMetadataStores_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_artifacts.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_artifacts.rb index e02b0cd729b9..513e39f373af 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_artifacts.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_artifacts.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_PurgeArtifacts_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_artifacts +# +def purge_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::PurgeArtifactsRequest.new -# Call the purge_artifacts method. -result = client.purge_artifacts request + # Call the purge_artifacts method. + result = client.purge_artifacts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_PurgeArtifacts_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_contexts.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_contexts.rb index 8da208dd7ad9..323d1dfcc15a 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_contexts.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_contexts.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_PurgeContexts_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_contexts +# +def purge_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::PurgeContextsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::PurgeContextsRequest.new -# Call the purge_contexts method. -result = client.purge_contexts request + # Call the purge_contexts method. + result = client.purge_contexts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_PurgeContexts_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_executions.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_executions.rb index 6eff5f770eba..951526dadc5f 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/purge_executions.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/purge_executions.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MetadataService_PurgeExecutions_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#purge_executions +# +def purge_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::PurgeExecutionsRequest.new -# Call the purge_executions method. -result = client.purge_executions request + # Call the purge_executions method. + result = client.purge_executions request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MetadataService_PurgeExecutions_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/query_artifact_lineage_subgraph.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/query_artifact_lineage_subgraph.rb index 03e1cf58f204..83f1328b1c20 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/query_artifact_lineage_subgraph.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/query_artifact_lineage_subgraph.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_QueryArtifactLineageSubgraph_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#query_artifact_lineage_subgraph +# +def query_artifact_lineage_subgraph + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::QueryArtifactLineageSubgraphRequest.new -# Call the query_artifact_lineage_subgraph method. -result = client.query_artifact_lineage_subgraph request + # Call the query_artifact_lineage_subgraph method. + result = client.query_artifact_lineage_subgraph request -# The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + p result +end # [END aiplatform_v1_generated_MetadataService_QueryArtifactLineageSubgraph_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/query_context_lineage_subgraph.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/query_context_lineage_subgraph.rb index a55c00202fa2..7386e462707c 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/query_context_lineage_subgraph.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/query_context_lineage_subgraph.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_QueryContextLineageSubgraph_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#query_context_lineage_subgraph +# +def query_context_lineage_subgraph + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::QueryContextLineageSubgraphRequest.new -# Call the query_context_lineage_subgraph method. -result = client.query_context_lineage_subgraph request + # Call the query_context_lineage_subgraph method. + result = client.query_context_lineage_subgraph request -# The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + p result +end # [END aiplatform_v1_generated_MetadataService_QueryContextLineageSubgraph_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/query_execution_inputs_and_outputs.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/query_execution_inputs_and_outputs.rb index 8b2f7a27ac8e..a035d88092ea 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/query_execution_inputs_and_outputs.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/query_execution_inputs_and_outputs.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_QueryExecutionInputsAndOutputs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#query_execution_inputs_and_outputs +# +def query_execution_inputs_and_outputs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::QueryExecutionInputsAndOutputsRequest.new -# Call the query_execution_inputs_and_outputs method. -result = client.query_execution_inputs_and_outputs request + # Call the query_execution_inputs_and_outputs method. + result = client.query_execution_inputs_and_outputs request -# The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::LineageSubgraph. + p result +end # [END aiplatform_v1_generated_MetadataService_QueryExecutionInputsAndOutputs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/remove_context_children.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/remove_context_children.rb index 37afb70673fe..2de0853f7d8a 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/remove_context_children.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/remove_context_children.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_RemoveContextChildren_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#remove_context_children +# +def remove_context_children + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::RemoveContextChildrenRequest.new -# Call the remove_context_children method. -result = client.remove_context_children request + # Call the remove_context_children method. + result = client.remove_context_children request -# The returned object is of type Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::RemoveContextChildrenResponse. + p result +end # [END aiplatform_v1_generated_MetadataService_RemoveContextChildren_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/update_artifact.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/update_artifact.rb index 181d62faec34..750a352e07d9 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/update_artifact.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/update_artifact.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_UpdateArtifact_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#update_artifact +# +def update_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateArtifactRequest.new -# Call the update_artifact method. -result = client.update_artifact request + # Call the update_artifact method. + result = client.update_artifact request -# The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Artifact. + p result +end # [END aiplatform_v1_generated_MetadataService_UpdateArtifact_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/update_context.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/update_context.rb index 63e4a329d468..a1957884161a 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/update_context.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/update_context.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_UpdateContext_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#update_context +# +def update_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateContextRequest.new -# Call the update_context method. -result = client.update_context request + # Call the update_context method. + result = client.update_context request -# The returned object is of type Google::Cloud::AIPlatform::V1::Context. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Context. + p result +end # [END aiplatform_v1_generated_MetadataService_UpdateContext_sync] diff --git a/google-cloud-ai_platform-v1/snippets/metadata_service/update_execution.rb b/google-cloud-ai_platform-v1/snippets/metadata_service/update_execution.rb index b826718cf5bd..9ceb9970f4c4 100644 --- a/google-cloud-ai_platform-v1/snippets/metadata_service/update_execution.rb +++ b/google-cloud-ai_platform-v1/snippets/metadata_service/update_execution.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_MetadataService_UpdateExecution_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MetadataService::Client#update_execution +# +def update_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateExecutionRequest.new -# Call the update_execution method. -result = client.update_execution request + # Call the update_execution method. + result = client.update_execution request -# The returned object is of type Google::Cloud::AIPlatform::V1::Execution. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Execution. + p result +end # [END aiplatform_v1_generated_MetadataService_UpdateExecution_sync] diff --git a/google-cloud-ai_platform-v1/snippets/migration_service/batch_migrate_resources.rb b/google-cloud-ai_platform-v1/snippets/migration_service/batch_migrate_resources.rb index e115dc91de3f..fa81a461739b 100644 --- a/google-cloud-ai_platform-v1/snippets/migration_service/batch_migrate_resources.rb +++ b/google-cloud-ai_platform-v1/snippets/migration_service/batch_migrate_resources.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_MigrationService_BatchMigrateResources_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MigrationService::Client#batch_migrate_resources +# +def batch_migrate_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchMigrateResourcesRequest.new -# Call the batch_migrate_resources method. -result = client.batch_migrate_resources request + # Call the batch_migrate_resources method. + result = client.batch_migrate_resources request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_MigrationService_BatchMigrateResources_sync] diff --git a/google-cloud-ai_platform-v1/snippets/migration_service/search_migratable_resources.rb b/google-cloud-ai_platform-v1/snippets/migration_service/search_migratable_resources.rb index 3280ed18a7ee..8ad069d82d76 100644 --- a/google-cloud-ai_platform-v1/snippets/migration_service/search_migratable_resources.rb +++ b/google-cloud-ai_platform-v1/snippets/migration_service/search_migratable_resources.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_MigrationService_SearchMigratableResources_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::MigrationService::Client#search_migratable_resources +# +def search_migratable_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::SearchMigratableResourcesRequest.new -# Call the search_migratable_resources method. -result = client.search_migratable_resources request + # Call the search_migratable_resources method. + result = client.search_migratable_resources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::MigratableResource. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::MigratableResource. + p response + end end # [END aiplatform_v1_generated_MigrationService_SearchMigratableResources_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/batch_import_model_evaluation_slices.rb b/google-cloud-ai_platform-v1/snippets/model_service/batch_import_model_evaluation_slices.rb index 92a9cdccc59e..e227bf2e2113 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/batch_import_model_evaluation_slices.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/batch_import_model_evaluation_slices.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_BatchImportModelEvaluationSlices_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#batch_import_model_evaluation_slices +# +def batch_import_model_evaluation_slices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesRequest.new -# Call the batch_import_model_evaluation_slices method. -result = client.batch_import_model_evaluation_slices request + # Call the batch_import_model_evaluation_slices method. + result = client.batch_import_model_evaluation_slices request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchImportModelEvaluationSlicesResponse. + p result +end # [END aiplatform_v1_generated_ModelService_BatchImportModelEvaluationSlices_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/delete_model.rb b/google-cloud-ai_platform-v1/snippets/model_service/delete_model.rb index d1554f39b75d..06a76458232d 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/delete_model.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/delete_model.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_ModelService_DeleteModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model +# +def delete_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteModelRequest.new -# Call the delete_model method. -result = client.delete_model request + # Call the delete_model method. + result = client.delete_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_ModelService_DeleteModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/delete_model_version.rb b/google-cloud-ai_platform-v1/snippets/model_service/delete_model_version.rb index 813cc1895434..90a50fd26651 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/delete_model_version.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/delete_model_version.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_ModelService_DeleteModelVersion_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#delete_model_version +# +def delete_model_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteModelVersionRequest.new -# Call the delete_model_version method. -result = client.delete_model_version request + # Call the delete_model_version method. + result = client.delete_model_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_ModelService_DeleteModelVersion_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/export_model.rb b/google-cloud-ai_platform-v1/snippets/model_service/export_model.rb index 411ee78bf4c4..c1a9e599129c 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/export_model.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/export_model.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_ModelService_ExportModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#export_model +# +def export_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ExportModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ExportModelRequest.new -# Call the export_model method. -result = client.export_model request + # Call the export_model method. + result = client.export_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_ModelService_ExportModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/get_model.rb b/google-cloud-ai_platform-v1/snippets/model_service/get_model.rb index 1d5e0239ea2b..c24d58732d77 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/get_model.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/get_model.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_GetModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#get_model +# +def get_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetModelRequest.new -# Call the get_model method. -result = client.get_model request + # Call the get_model method. + result = client.get_model request -# The returned object is of type Google::Cloud::AIPlatform::V1::Model. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + p result +end # [END aiplatform_v1_generated_ModelService_GetModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation.rb b/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation.rb index 3d4d1bbcc85c..d69fbbb45cb3 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_GetModelEvaluation_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#get_model_evaluation +# +def get_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetModelEvaluationRequest.new -# Call the get_model_evaluation method. -result = client.get_model_evaluation request + # Call the get_model_evaluation method. + result = client.get_model_evaluation request -# The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + p result +end # [END aiplatform_v1_generated_ModelService_GetModelEvaluation_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation_slice.rb b/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation_slice.rb index 4a9733e76319..6f549d57fe28 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation_slice.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/get_model_evaluation_slice.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_GetModelEvaluationSlice_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#get_model_evaluation_slice +# +def get_model_evaluation_slice + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetModelEvaluationSliceRequest.new -# Call the get_model_evaluation_slice method. -result = client.get_model_evaluation_slice request + # Call the get_model_evaluation_slice method. + result = client.get_model_evaluation_slice request -# The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. + p result +end # [END aiplatform_v1_generated_ModelService_GetModelEvaluationSlice_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/import_model_evaluation.rb b/google-cloud-ai_platform-v1/snippets/model_service/import_model_evaluation.rb index 3777b940a0d4..552809c89ad3 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/import_model_evaluation.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/import_model_evaluation.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_ImportModelEvaluation_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#import_model_evaluation +# +def import_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ImportModelEvaluationRequest.new -# Call the import_model_evaluation method. -result = client.import_model_evaluation request + # Call the import_model_evaluation method. + result = client.import_model_evaluation request -# The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ModelEvaluation. + p result +end # [END aiplatform_v1_generated_ModelService_ImportModelEvaluation_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluation_slices.rb b/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluation_slices.rb index fbe783d87f33..5c8466a11b80 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluation_slices.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluation_slices.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_ModelService_ListModelEvaluationSlices_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluation_slices +# +def list_model_evaluation_slices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListModelEvaluationSlicesRequest.new -# Call the list_model_evaluation_slices method. -result = client.list_model_evaluation_slices request + # Call the list_model_evaluation_slices method. + result = client.list_model_evaluation_slices request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluationSlice. + p response + end end # [END aiplatform_v1_generated_ModelService_ListModelEvaluationSlices_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluations.rb b/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluations.rb index def4ce80d523..570f5709da7a 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluations.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/list_model_evaluations.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_ModelService_ListModelEvaluations_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_evaluations +# +def list_model_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListModelEvaluationsRequest.new -# Call the list_model_evaluations method. -result = client.list_model_evaluations request + # Call the list_model_evaluations method. + result = client.list_model_evaluations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::ModelEvaluation. + p response + end end # [END aiplatform_v1_generated_ModelService_ListModelEvaluations_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/list_model_versions.rb b/google-cloud-ai_platform-v1/snippets/model_service/list_model_versions.rb index 5c0e7a022c7f..074d8995b157 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/list_model_versions.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/list_model_versions.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_ModelService_ListModelVersions_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#list_model_versions +# +def list_model_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListModelVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListModelVersionsRequest.new -# Call the list_model_versions method. -result = client.list_model_versions request + # Call the list_model_versions method. + result = client.list_model_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Model. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Model. + p response + end end # [END aiplatform_v1_generated_ModelService_ListModelVersions_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/list_models.rb b/google-cloud-ai_platform-v1/snippets/model_service/list_models.rb index 148feebbd932..6914d39a1a53 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/list_models.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/list_models.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_ModelService_ListModels_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#list_models +# +def list_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListModelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListModelsRequest.new -# Call the list_models method. -result = client.list_models request + # Call the list_models method. + result = client.list_models request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Model. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Model. + p response + end end # [END aiplatform_v1_generated_ModelService_ListModels_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/merge_version_aliases.rb b/google-cloud-ai_platform-v1/snippets/model_service/merge_version_aliases.rb index a7e9d716f1b8..5bb4da9fa069 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/merge_version_aliases.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/merge_version_aliases.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_MergeVersionAliases_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#merge_version_aliases +# +def merge_version_aliases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::MergeVersionAliasesRequest.new -# Call the merge_version_aliases method. -result = client.merge_version_aliases request + # Call the merge_version_aliases method. + result = client.merge_version_aliases request -# The returned object is of type Google::Cloud::AIPlatform::V1::Model. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + p result +end # [END aiplatform_v1_generated_ModelService_MergeVersionAliases_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/update_model.rb b/google-cloud-ai_platform-v1/snippets/model_service/update_model.rb index 51426ba3b5fd..8690c2469977 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/update_model.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/update_model.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_ModelService_UpdateModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#update_model +# +def update_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateModelRequest.new -# Call the update_model method. -result = client.update_model request + # Call the update_model method. + result = client.update_model request -# The returned object is of type Google::Cloud::AIPlatform::V1::Model. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Model. + p result +end # [END aiplatform_v1_generated_ModelService_UpdateModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/model_service/upload_model.rb b/google-cloud-ai_platform-v1/snippets/model_service/upload_model.rb index 422b1927b682..1f19680d58a1 100644 --- a/google-cloud-ai_platform-v1/snippets/model_service/upload_model.rb +++ b/google-cloud-ai_platform-v1/snippets/model_service/upload_model.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_ModelService_UploadModel_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::ModelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::ModelService::Client#upload_model +# +def upload_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::ModelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UploadModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UploadModelRequest.new -# Call the upload_model method. -result = client.upload_model request + # Call the upload_model method. + result = client.upload_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_ModelService_UploadModel_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_pipeline_job.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_pipeline_job.rb index 96a4806ffb8f..57f4f03a9186 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_pipeline_job.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_pipeline_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_CancelPipelineJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#cancel_pipeline_job +# +def cancel_pipeline_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelPipelineJobRequest.new -# Call the cancel_pipeline_job method. -result = client.cancel_pipeline_job request + # Call the cancel_pipeline_job method. + result = client.cancel_pipeline_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_PipelineService_CancelPipelineJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_training_pipeline.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_training_pipeline.rb index aa618a79607c..1396c461fad9 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_training_pipeline.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/cancel_training_pipeline.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#cancel_training_pipeline +# +def cancel_training_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CancelTrainingPipelineRequest.new -# Call the cancel_training_pipeline method. -result = client.cancel_training_pipeline request + # Call the cancel_training_pipeline method. + result = client.cancel_training_pipeline request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_PipelineService_CancelTrainingPipeline_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/create_pipeline_job.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/create_pipeline_job.rb index 0d09ad972fa6..3cf32050d462 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/create_pipeline_job.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/create_pipeline_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_CreatePipelineJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#create_pipeline_job +# +def create_pipeline_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreatePipelineJobRequest.new -# Call the create_pipeline_job method. -result = client.create_pipeline_job request + # Call the create_pipeline_job method. + result = client.create_pipeline_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + p result +end # [END aiplatform_v1_generated_PipelineService_CreatePipelineJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/create_training_pipeline.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/create_training_pipeline.rb index f4664f8ac064..cf5a3ee76ef9 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/create_training_pipeline.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/create_training_pipeline.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#create_training_pipeline +# +def create_training_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTrainingPipelineRequest.new -# Call the create_training_pipeline method. -result = client.create_training_pipeline request + # Call the create_training_pipeline method. + result = client.create_training_pipeline request -# The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + p result +end # [END aiplatform_v1_generated_PipelineService_CreateTrainingPipeline_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_pipeline_job.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_pipeline_job.rb index 50c5364e29fe..68bcb75752cb 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_pipeline_job.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_pipeline_job.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_PipelineService_DeletePipelineJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#delete_pipeline_job +# +def delete_pipeline_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeletePipelineJobRequest.new -# Call the delete_pipeline_job method. -result = client.delete_pipeline_job request + # Call the delete_pipeline_job method. + result = client.delete_pipeline_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_PipelineService_DeletePipelineJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_training_pipeline.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_training_pipeline.rb index 5402ab55ddce..5f4e966c3db1 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_training_pipeline.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/delete_training_pipeline.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#delete_training_pipeline +# +def delete_training_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTrainingPipelineRequest.new -# Call the delete_training_pipeline method. -result = client.delete_training_pipeline request + # Call the delete_training_pipeline method. + result = client.delete_training_pipeline request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_PipelineService_DeleteTrainingPipeline_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/get_pipeline_job.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/get_pipeline_job.rb index a70d7d430dbb..239ece772a2e 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/get_pipeline_job.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/get_pipeline_job.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_GetPipelineJob_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#get_pipeline_job +# +def get_pipeline_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetPipelineJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetPipelineJobRequest.new -# Call the get_pipeline_job method. -result = client.get_pipeline_job request + # Call the get_pipeline_job method. + result = client.get_pipeline_job request -# The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::PipelineJob. + p result +end # [END aiplatform_v1_generated_PipelineService_GetPipelineJob_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/get_training_pipeline.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/get_training_pipeline.rb index b512962ed1b5..6c832ef2d2a4 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/get_training_pipeline.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/get_training_pipeline.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PipelineService_GetTrainingPipeline_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#get_training_pipeline +# +def get_training_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTrainingPipelineRequest.new -# Call the get_training_pipeline method. -result = client.get_training_pipeline request + # Call the get_training_pipeline method. + result = client.get_training_pipeline request -# The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TrainingPipeline. + p result +end # [END aiplatform_v1_generated_PipelineService_GetTrainingPipeline_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/list_pipeline_jobs.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/list_pipeline_jobs.rb index ddada7de1bb7..da811cef7307 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/list_pipeline_jobs.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/list_pipeline_jobs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_PipelineService_ListPipelineJobs_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#list_pipeline_jobs +# +def list_pipeline_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListPipelineJobsRequest.new -# Call the list_pipeline_jobs method. -result = client.list_pipeline_jobs request + # Call the list_pipeline_jobs method. + result = client.list_pipeline_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::PipelineJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::PipelineJob. + p response + end end # [END aiplatform_v1_generated_PipelineService_ListPipelineJobs_sync] diff --git a/google-cloud-ai_platform-v1/snippets/pipeline_service/list_training_pipelines.rb b/google-cloud-ai_platform-v1/snippets/pipeline_service/list_training_pipelines.rb index 14f262ba99ab..2f1cb3ac0a54 100644 --- a/google-cloud-ai_platform-v1/snippets/pipeline_service/list_training_pipelines.rb +++ b/google-cloud-ai_platform-v1/snippets/pipeline_service/list_training_pipelines.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_PipelineService_ListTrainingPipelines_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PipelineService::Client#list_training_pipelines +# +def list_training_pipelines + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PipelineService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTrainingPipelinesRequest.new -# Call the list_training_pipelines method. -result = client.list_training_pipelines request + # Call the list_training_pipelines method. + result = client.list_training_pipelines request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::TrainingPipeline. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::TrainingPipeline. + p response + end end # [END aiplatform_v1_generated_PipelineService_ListTrainingPipelines_sync] diff --git a/google-cloud-ai_platform-v1/snippets/prediction_service/explain.rb b/google-cloud-ai_platform-v1/snippets/prediction_service/explain.rb index 8b17394cc1dd..998452743cc6 100644 --- a/google-cloud-ai_platform-v1/snippets/prediction_service/explain.rb +++ b/google-cloud-ai_platform-v1/snippets/prediction_service/explain.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PredictionService_Explain_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PredictionService::Client#explain +# +def explain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ExplainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ExplainRequest.new -# Call the explain method. -result = client.explain request + # Call the explain method. + result = client.explain request -# The returned object is of type Google::Cloud::AIPlatform::V1::ExplainResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ExplainResponse. + p result +end # [END aiplatform_v1_generated_PredictionService_Explain_sync] diff --git a/google-cloud-ai_platform-v1/snippets/prediction_service/predict.rb b/google-cloud-ai_platform-v1/snippets/prediction_service/predict.rb index 0bdd033672ad..698070d6e19c 100644 --- a/google-cloud-ai_platform-v1/snippets/prediction_service/predict.rb +++ b/google-cloud-ai_platform-v1/snippets/prediction_service/predict.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PredictionService_Predict_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PredictionService::Client#predict +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::PredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::PredictRequest.new -# Call the predict method. -result = client.predict request + # Call the predict method. + result = client.predict request -# The returned object is of type Google::Cloud::AIPlatform::V1::PredictResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::PredictResponse. + p result +end # [END aiplatform_v1_generated_PredictionService_Predict_sync] diff --git a/google-cloud-ai_platform-v1/snippets/prediction_service/raw_predict.rb b/google-cloud-ai_platform-v1/snippets/prediction_service/raw_predict.rb index 80ca2ff74119..6c48a2c4bea5 100644 --- a/google-cloud-ai_platform-v1/snippets/prediction_service/raw_predict.rb +++ b/google-cloud-ai_platform-v1/snippets/prediction_service/raw_predict.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_PredictionService_RawPredict_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::PredictionService::Client#raw_predict +# +def raw_predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::RawPredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::RawPredictRequest.new -# Call the raw_predict method. -result = client.raw_predict request + # Call the raw_predict method. + result = client.raw_predict request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END aiplatform_v1_generated_PredictionService_RawPredict_sync] diff --git a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json index b4e5068d81d1..a7c105791c9f 100644 --- a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1966,7 +1966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2006,7 +2006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2046,7 +2046,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2086,7 +2086,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2126,7 +2126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2166,7 +2166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2206,7 +2206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2246,7 +2246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2286,7 +2286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2326,7 +2326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2366,7 +2366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2406,7 +2406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2446,7 +2446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2486,7 +2486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2526,7 +2526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2566,7 +2566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2606,7 +2606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2646,7 +2646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2686,7 +2686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2726,7 +2726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2766,7 +2766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2806,7 +2806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2846,7 +2846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2886,7 +2886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2926,7 +2926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2966,7 +2966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3006,7 +3006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3046,7 +3046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3086,7 +3086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3126,7 +3126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3166,7 +3166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3206,7 +3206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3246,7 +3246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3286,7 +3286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3326,7 +3326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3366,7 +3366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3406,7 +3406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3446,7 +3446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3486,7 +3486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3526,7 +3526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3566,7 +3566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3606,7 +3606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3646,7 +3646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3686,7 +3686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3726,7 +3726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3766,7 +3766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3806,7 +3806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3846,7 +3846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3886,7 +3886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3926,7 +3926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3966,7 +3966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4006,7 +4006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4046,7 +4046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4086,7 +4086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4126,7 +4126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4166,7 +4166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4206,7 +4206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4246,7 +4246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -4286,7 +4286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4326,7 +4326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4366,7 +4366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4406,7 +4406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4446,7 +4446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4486,7 +4486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4526,7 +4526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4566,7 +4566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -4606,7 +4606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4646,7 +4646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -4686,7 +4686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4726,7 +4726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4766,7 +4766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4806,7 +4806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -4846,7 +4846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -4886,7 +4886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4926,7 +4926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -4966,7 +4966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -5006,7 +5006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5046,7 +5046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -5086,7 +5086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5126,7 +5126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5166,7 +5166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5206,7 +5206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -5246,7 +5246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5286,7 +5286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -5326,7 +5326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5366,7 +5366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5406,7 +5406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -5446,7 +5446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -5486,7 +5486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5526,7 +5526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5566,7 +5566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5606,7 +5606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -5646,7 +5646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -5686,7 +5686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5726,7 +5726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5766,7 +5766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5806,7 +5806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5846,7 +5846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -5886,7 +5886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -5926,7 +5926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -5966,7 +5966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6006,7 +6006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6046,7 +6046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6086,7 +6086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6126,7 +6126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6166,7 +6166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -6206,7 +6206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6246,7 +6246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6286,7 +6286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6326,7 +6326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6366,7 +6366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -6406,7 +6406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6446,7 +6446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6486,7 +6486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6526,7 +6526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6566,7 +6566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6606,7 +6606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -6646,7 +6646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6686,7 +6686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6726,7 +6726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6766,7 +6766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6806,7 +6806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6846,7 +6846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -6886,7 +6886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -6926,7 +6926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -6966,7 +6966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7006,7 +7006,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -7046,7 +7046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7086,7 +7086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7126,7 +7126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -7166,7 +7166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7206,7 +7206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7246,7 +7246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -7286,7 +7286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7326,7 +7326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7366,7 +7366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -7406,7 +7406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7446,7 +7446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7486,7 +7486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -7526,7 +7526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7566,7 +7566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7606,7 +7606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7646,7 +7646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -7686,7 +7686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -7726,7 +7726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/create_specialist_pool.rb b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/create_specialist_pool.rb index 25314d2564da..f300490c6544 100644 --- a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/create_specialist_pool.rb +++ b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/create_specialist_pool.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#create_specialist_pool +# +def create_specialist_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateSpecialistPoolRequest.new -# Call the create_specialist_pool method. -result = client.create_specialist_pool request + # Call the create_specialist_pool method. + result = client.create_specialist_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_SpecialistPoolService_CreateSpecialistPool_sync] diff --git a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/delete_specialist_pool.rb b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/delete_specialist_pool.rb index 6dfd72ef414b..64996f88005c 100644 --- a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/delete_specialist_pool.rb +++ b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/delete_specialist_pool.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#delete_specialist_pool +# +def delete_specialist_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteSpecialistPoolRequest.new -# Call the delete_specialist_pool method. -result = client.delete_specialist_pool request + # Call the delete_specialist_pool method. + result = client.delete_specialist_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_SpecialistPoolService_DeleteSpecialistPool_sync] diff --git a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/get_specialist_pool.rb b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/get_specialist_pool.rb index a0df71adfdc8..6cb1929f785f 100644 --- a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/get_specialist_pool.rb +++ b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/get_specialist_pool.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_SpecialistPoolService_GetSpecialistPool_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#get_specialist_pool +# +def get_specialist_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetSpecialistPoolRequest.new -# Call the get_specialist_pool method. -result = client.get_specialist_pool request + # Call the get_specialist_pool method. + result = client.get_specialist_pool request -# The returned object is of type Google::Cloud::AIPlatform::V1::SpecialistPool. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::SpecialistPool. + p result +end # [END aiplatform_v1_generated_SpecialistPoolService_GetSpecialistPool_sync] diff --git a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/list_specialist_pools.rb b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/list_specialist_pools.rb index f83aad515f5b..fffa45873688 100644 --- a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/list_specialist_pools.rb +++ b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/list_specialist_pools.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_SpecialistPoolService_ListSpecialistPools_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#list_specialist_pools +# +def list_specialist_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListSpecialistPoolsRequest.new -# Call the list_specialist_pools method. -result = client.list_specialist_pools request + # Call the list_specialist_pools method. + result = client.list_specialist_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::SpecialistPool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::SpecialistPool. + p response + end end # [END aiplatform_v1_generated_SpecialistPoolService_ListSpecialistPools_sync] diff --git a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/update_specialist_pool.rb b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/update_specialist_pool.rb index b8b335793c67..3b04432e1535 100644 --- a/google-cloud-ai_platform-v1/snippets/specialist_pool_service/update_specialist_pool.rb +++ b/google-cloud-ai_platform-v1/snippets/specialist_pool_service/update_specialist_pool.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client#update_specialist_pool +# +def update_specialist_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::SpecialistPoolService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateSpecialistPoolRequest.new -# Call the update_specialist_pool method. -result = client.update_specialist_pool request + # Call the update_specialist_pool method. + result = client.update_specialist_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_SpecialistPoolService_UpdateSpecialistPool_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_runs.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_runs.rb index 322a2d7596b2..087d49f903a6 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_runs.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_runs.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_runs +# +def batch_create_tensorboard_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsRequest.new -# Call the batch_create_tensorboard_runs method. -result = client.batch_create_tensorboard_runs request + # Call the batch_create_tensorboard_runs method. + result = client.batch_create_tensorboard_runs request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardRunsResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardRuns_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_time_series.rb index 83e21827876c..d6316574342e 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_create_tensorboard_time_series.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_create_tensorboard_time_series +# +def batch_create_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesRequest.new -# Call the batch_create_tensorboard_time_series method. -result = client.batch_create_tensorboard_time_series request + # Call the batch_create_tensorboard_time_series method. + result = client.batch_create_tensorboard_time_series request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchCreateTensorboardTimeSeriesResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_BatchCreateTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_read_tensorboard_time_series_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_read_tensorboard_time_series_data.rb index 6e5e6f444408..0ec4437a4add 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_read_tensorboard_time_series_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/batch_read_tensorboard_time_series_data.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#batch_read_tensorboard_time_series_data +# +def batch_read_tensorboard_time_series_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataRequest.new -# Call the batch_read_tensorboard_time_series_data method. -result = client.batch_read_tensorboard_time_series_data request + # Call the batch_read_tensorboard_time_series_data method. + result = client.batch_read_tensorboard_time_series_data request -# The returned object is of type Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::BatchReadTensorboardTimeSeriesDataResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_BatchReadTensorboardTimeSeriesData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard.rb index 228a728be855..bb1234d59836 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_CreateTensorboard_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard +# +def create_tensorboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTensorboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTensorboardRequest.new -# Call the create_tensorboard method. -result = client.create_tensorboard request + # Call the create_tensorboard method. + result = client.create_tensorboard request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_CreateTensorboard_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_experiment.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_experiment.rb index 12420eae0e76..2a8579d7a01c 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_experiment.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_experiment.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_CreateTensorboardExperiment_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_experiment +# +def create_tensorboard_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTensorboardExperimentRequest.new -# Call the create_tensorboard_experiment method. -result = client.create_tensorboard_experiment request + # Call the create_tensorboard_experiment method. + result = client.create_tensorboard_experiment request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + p result +end # [END aiplatform_v1_generated_TensorboardService_CreateTensorboardExperiment_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_run.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_run.rb index f2f11e0707c8..0c33d222d42d 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_run.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_run.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_CreateTensorboardRun_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_run +# +def create_tensorboard_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTensorboardRunRequest.new -# Call the create_tensorboard_run method. -result = client.create_tensorboard_run request + # Call the create_tensorboard_run method. + result = client.create_tensorboard_run request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + p result +end # [END aiplatform_v1_generated_TensorboardService_CreateTensorboardRun_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_time_series.rb index aaacb6e430ac..f156e1f3b738 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/create_tensorboard_time_series.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_CreateTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#create_tensorboard_time_series +# +def create_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTensorboardTimeSeriesRequest.new -# Call the create_tensorboard_time_series method. -result = client.create_tensorboard_time_series request + # Call the create_tensorboard_time_series method. + result = client.create_tensorboard_time_series request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + p result +end # [END aiplatform_v1_generated_TensorboardService_CreateTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard.rb index 5397947fa107..d9e31e91dcd6 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_DeleteTensorboard_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard +# +def delete_tensorboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRequest.new -# Call the delete_tensorboard method. -result = client.delete_tensorboard request + # Call the delete_tensorboard method. + result = client.delete_tensorboard request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_DeleteTensorboard_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_experiment.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_experiment.rb index 37b18a4aeb7f..2c649cef2d14 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_experiment.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_experiment.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_experiment +# +def delete_tensorboard_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTensorboardExperimentRequest.new -# Call the delete_tensorboard_experiment method. -result = client.delete_tensorboard_experiment request + # Call the delete_tensorboard_experiment method. + result = client.delete_tensorboard_experiment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_DeleteTensorboardExperiment_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_run.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_run.rb index 5d8ac0655c5f..a0761dc2eca0 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_run.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_run.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_run +# +def delete_tensorboard_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTensorboardRunRequest.new -# Call the delete_tensorboard_run method. -result = client.delete_tensorboard_run request + # Call the delete_tensorboard_run method. + result = client.delete_tensorboard_run request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_DeleteTensorboardRun_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_time_series.rb index 9be103f1b4a9..28ac49d50712 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/delete_tensorboard_time_series.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#delete_tensorboard_time_series +# +def delete_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTensorboardTimeSeriesRequest.new -# Call the delete_tensorboard_time_series method. -result = client.delete_tensorboard_time_series request + # Call the delete_tensorboard_time_series method. + result = client.delete_tensorboard_time_series request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_DeleteTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/export_tensorboard_time_series_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/export_tensorboard_time_series_data.rb index b0e9fcaecb44..b0e50cb07563 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/export_tensorboard_time_series_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/export_tensorboard_time_series_data.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_TensorboardService_ExportTensorboardTimeSeriesData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#export_tensorboard_time_series_data +# +def export_tensorboard_time_series_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ExportTensorboardTimeSeriesDataRequest.new -# Call the export_tensorboard_time_series_data method. -result = client.export_tensorboard_time_series_data request + # Call the export_tensorboard_time_series_data method. + result = client.export_tensorboard_time_series_data request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::TimeSeriesDataPoint. + p response + end end # [END aiplatform_v1_generated_TensorboardService_ExportTensorboardTimeSeriesData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard.rb index 131ffe09f67f..f9d69ae65244 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_GetTensorboard_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard +# +def get_tensorboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTensorboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTensorboardRequest.new -# Call the get_tensorboard method. -result = client.get_tensorboard request + # Call the get_tensorboard method. + result = client.get_tensorboard request -# The returned object is of type Google::Cloud::AIPlatform::V1::Tensorboard. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Tensorboard. + p result +end # [END aiplatform_v1_generated_TensorboardService_GetTensorboard_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_experiment.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_experiment.rb index dcd136d71f93..5279becff517 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_experiment.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_experiment.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_GetTensorboardExperiment_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_experiment +# +def get_tensorboard_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTensorboardExperimentRequest.new -# Call the get_tensorboard_experiment method. -result = client.get_tensorboard_experiment request + # Call the get_tensorboard_experiment method. + result = client.get_tensorboard_experiment request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + p result +end # [END aiplatform_v1_generated_TensorboardService_GetTensorboardExperiment_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_run.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_run.rb index de495884d7f8..13b7898d9724 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_run.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_run.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_GetTensorboardRun_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_run +# +def get_tensorboard_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTensorboardRunRequest.new -# Call the get_tensorboard_run method. -result = client.get_tensorboard_run request + # Call the get_tensorboard_run method. + result = client.get_tensorboard_run request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + p result +end # [END aiplatform_v1_generated_TensorboardService_GetTensorboardRun_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_time_series.rb index d9bb10fc08db..576cd85cea38 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/get_tensorboard_time_series.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_GetTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#get_tensorboard_time_series +# +def get_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTensorboardTimeSeriesRequest.new -# Call the get_tensorboard_time_series method. -result = client.get_tensorboard_time_series request + # Call the get_tensorboard_time_series method. + result = client.get_tensorboard_time_series request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + p result +end # [END aiplatform_v1_generated_TensorboardService_GetTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_experiments.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_experiments.rb index f9b7f437b893..6da3889a8ebe 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_experiments.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_experiments.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_TensorboardService_ListTensorboardExperiments_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_experiments +# +def list_tensorboard_experiments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTensorboardExperimentsRequest.new -# Call the list_tensorboard_experiments method. -result = client.list_tensorboard_experiments request + # Call the list_tensorboard_experiments method. + result = client.list_tensorboard_experiments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardExperiment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardExperiment. + p response + end end # [END aiplatform_v1_generated_TensorboardService_ListTensorboardExperiments_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_runs.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_runs.rb index 9e66fa3901d6..ef4614ebc60e 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_runs.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_runs.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_TensorboardService_ListTensorboardRuns_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_runs +# +def list_tensorboard_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTensorboardRunsRequest.new -# Call the list_tensorboard_runs method. -result = client.list_tensorboard_runs request + # Call the list_tensorboard_runs method. + result = client.list_tensorboard_runs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardRun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardRun. + p response + end end # [END aiplatform_v1_generated_TensorboardService_ListTensorboardRuns_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_time_series.rb index e9d0860e4cb2..36b5b24496f3 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboard_time_series.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_TensorboardService_ListTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboard_time_series +# +def list_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTensorboardTimeSeriesRequest.new -# Call the list_tensorboard_time_series method. -result = client.list_tensorboard_time_series request + # Call the list_tensorboard_time_series method. + result = client.list_tensorboard_time_series request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + p response + end end # [END aiplatform_v1_generated_TensorboardService_ListTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboards.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboards.rb index 6eba61d12ec0..def82c5341ef 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboards.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/list_tensorboards.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_TensorboardService_ListTensorboards_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#list_tensorboards +# +def list_tensorboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTensorboardsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTensorboardsRequest.new -# Call the list_tensorboards method. -result = client.list_tensorboards request + # Call the list_tensorboards method. + result = client.list_tensorboards request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Tensorboard. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Tensorboard. + p response + end end # [END aiplatform_v1_generated_TensorboardService_ListTensorboards_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_blob_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_blob_data.rb index 08c518a801f0..3f640c6939a6 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_blob_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_blob_data.rb @@ -19,18 +19,24 @@ # [START aiplatform_v1_generated_TensorboardService_ReadTensorboardBlobData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_blob_data +# +def read_tensorboard_blob_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataRequest.new -# Call the read_tensorboard_blob_data method. -result = client.read_tensorboard_blob_data request + # Call the read_tensorboard_blob_data method. + result = client.read_tensorboard_blob_data request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::AIPlatform::V1::ReadTensorboardBlobDataResponse. + result.each do |response| + p response + end end # [END aiplatform_v1_generated_TensorboardService_ReadTensorboardBlobData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_time_series_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_time_series_data.rb index a86d5ac38807..f47a5c18308f 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_time_series_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/read_tensorboard_time_series_data.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_ReadTensorboardTimeSeriesData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#read_tensorboard_time_series_data +# +def read_tensorboard_time_series_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataRequest.new -# Call the read_tensorboard_time_series_data method. -result = client.read_tensorboard_time_series_data request + # Call the read_tensorboard_time_series_data method. + result = client.read_tensorboard_time_series_data request -# The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ReadTensorboardTimeSeriesDataResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_ReadTensorboardTimeSeriesData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard.rb index fdab1be33933..f3f55703140f 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_TensorboardService_UpdateTensorboard_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard +# +def update_tensorboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRequest.new -# Call the update_tensorboard method. -result = client.update_tensorboard request + # Call the update_tensorboard method. + result = client.update_tensorboard request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_TensorboardService_UpdateTensorboard_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_experiment.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_experiment.rb index 65d2222387d5..b59a25fb34dc 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_experiment.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_experiment.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_UpdateTensorboardExperiment_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_experiment +# +def update_tensorboard_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateTensorboardExperimentRequest.new -# Call the update_tensorboard_experiment method. -result = client.update_tensorboard_experiment request + # Call the update_tensorboard_experiment method. + result = client.update_tensorboard_experiment request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardExperiment. + p result +end # [END aiplatform_v1_generated_TensorboardService_UpdateTensorboardExperiment_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_run.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_run.rb index 8c88c22564f3..aff68c851779 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_run.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_run.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_UpdateTensorboardRun_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_run +# +def update_tensorboard_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateTensorboardRunRequest.new -# Call the update_tensorboard_run method. -result = client.update_tensorboard_run request + # Call the update_tensorboard_run method. + result = client.update_tensorboard_run request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardRun. + p result +end # [END aiplatform_v1_generated_TensorboardService_UpdateTensorboardRun_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_time_series.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_time_series.rb index cdc7bc16932f..cce41ae33cbd 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_time_series.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/update_tensorboard_time_series.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_UpdateTensorboardTimeSeries_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#update_tensorboard_time_series +# +def update_tensorboard_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::UpdateTensorboardTimeSeriesRequest.new -# Call the update_tensorboard_time_series method. -result = client.update_tensorboard_time_series request + # Call the update_tensorboard_time_series method. + result = client.update_tensorboard_time_series request -# The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::TensorboardTimeSeries. + p result +end # [END aiplatform_v1_generated_TensorboardService_UpdateTensorboardTimeSeries_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_experiment_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_experiment_data.rb index c3998d8b47b1..9ac24b281f83 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_experiment_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_experiment_data.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_WriteTensorboardExperimentData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_experiment_data +# +def write_tensorboard_experiment_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataRequest.new -# Call the write_tensorboard_experiment_data method. -result = client.write_tensorboard_experiment_data request + # Call the write_tensorboard_experiment_data method. + result = client.write_tensorboard_experiment_data request -# The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardExperimentDataResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_WriteTensorboardExperimentData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_run_data.rb b/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_run_data.rb index ff1fac2c30fb..91279641d0cc 100644 --- a/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_run_data.rb +++ b/google-cloud-ai_platform-v1/snippets/tensorboard_service/write_tensorboard_run_data.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_TensorboardService_WriteTensorboardRunData_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::TensorboardService::Client#write_tensorboard_run_data +# +def write_tensorboard_run_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::TensorboardService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataRequest.new -# Call the write_tensorboard_run_data method. -result = client.write_tensorboard_run_data request + # Call the write_tensorboard_run_data method. + result = client.write_tensorboard_run_data request -# The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::WriteTensorboardRunDataResponse. + p result +end # [END aiplatform_v1_generated_TensorboardService_WriteTensorboardRunData_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/add_trial_measurement.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/add_trial_measurement.rb index 0417b0dbddef..79f3fe426d2f 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/add_trial_measurement.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/add_trial_measurement.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_AddTrialMeasurement_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#add_trial_measurement +# +def add_trial_measurement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::AddTrialMeasurementRequest.new -# Call the add_trial_measurement method. -result = client.add_trial_measurement request + # Call the add_trial_measurement method. + result = client.add_trial_measurement request -# The returned object is of type Google::Cloud::AIPlatform::V1::Trial. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + p result +end # [END aiplatform_v1_generated_VizierService_AddTrialMeasurement_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/check_trial_early_stopping_state.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/check_trial_early_stopping_state.rb index a9c1f71472b2..24705af678b8 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/check_trial_early_stopping_state.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/check_trial_early_stopping_state.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#check_trial_early_stopping_state +# +def check_trial_early_stopping_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CheckTrialEarlyStoppingStateRequest.new -# Call the check_trial_early_stopping_state method. -result = client.check_trial_early_stopping_state request + # Call the check_trial_early_stopping_state method. + result = client.check_trial_early_stopping_state request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_VizierService_CheckTrialEarlyStoppingState_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/complete_trial.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/complete_trial.rb index 5e026efbe4ac..9be8a079818d 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/complete_trial.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/complete_trial.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_CompleteTrial_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#complete_trial +# +def complete_trial + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CompleteTrialRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CompleteTrialRequest.new -# Call the complete_trial method. -result = client.complete_trial request + # Call the complete_trial method. + result = client.complete_trial request -# The returned object is of type Google::Cloud::AIPlatform::V1::Trial. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + p result +end # [END aiplatform_v1_generated_VizierService_CompleteTrial_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/create_study.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/create_study.rb index e4f0c764a5b2..1e04e63a2933 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/create_study.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/create_study.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_CreateStudy_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#create_study +# +def create_study + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateStudyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateStudyRequest.new -# Call the create_study method. -result = client.create_study request + # Call the create_study method. + result = client.create_study request -# The returned object is of type Google::Cloud::AIPlatform::V1::Study. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + p result +end # [END aiplatform_v1_generated_VizierService_CreateStudy_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/create_trial.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/create_trial.rb index 0bff2d51d3ba..c6ec274248d0 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/create_trial.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/create_trial.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_CreateTrial_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#create_trial +# +def create_trial + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::CreateTrialRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::CreateTrialRequest.new -# Call the create_trial method. -result = client.create_trial request + # Call the create_trial method. + result = client.create_trial request -# The returned object is of type Google::Cloud::AIPlatform::V1::Trial. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + p result +end # [END aiplatform_v1_generated_VizierService_CreateTrial_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/delete_study.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/delete_study.rb index 85bdb6f2d689..ad77c2b018ca 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/delete_study.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/delete_study.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_DeleteStudy_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#delete_study +# +def delete_study + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteStudyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteStudyRequest.new -# Call the delete_study method. -result = client.delete_study request + # Call the delete_study method. + result = client.delete_study request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_VizierService_DeleteStudy_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/delete_trial.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/delete_trial.rb index dfc3eb073cc6..451100e8287b 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/delete_trial.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/delete_trial.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_DeleteTrial_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#delete_trial +# +def delete_trial + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::DeleteTrialRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::DeleteTrialRequest.new -# Call the delete_trial method. -result = client.delete_trial request + # Call the delete_trial method. + result = client.delete_trial request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END aiplatform_v1_generated_VizierService_DeleteTrial_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/get_study.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/get_study.rb index cec218b6e698..7cb0b3ffd300 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/get_study.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/get_study.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_GetStudy_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#get_study +# +def get_study + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetStudyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetStudyRequest.new -# Call the get_study method. -result = client.get_study request + # Call the get_study method. + result = client.get_study request -# The returned object is of type Google::Cloud::AIPlatform::V1::Study. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + p result +end # [END aiplatform_v1_generated_VizierService_GetStudy_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/get_trial.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/get_trial.rb index e23d40d1a7c7..86010a489653 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/get_trial.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/get_trial.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_GetTrial_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#get_trial +# +def get_trial + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::GetTrialRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::GetTrialRequest.new -# Call the get_trial method. -result = client.get_trial request + # Call the get_trial method. + result = client.get_trial request -# The returned object is of type Google::Cloud::AIPlatform::V1::Trial. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + p result +end # [END aiplatform_v1_generated_VizierService_GetTrial_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/list_optimal_trials.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/list_optimal_trials.rb index 6a709d3b757e..5228a09bbf28 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/list_optimal_trials.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/list_optimal_trials.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_ListOptimalTrials_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#list_optimal_trials +# +def list_optimal_trials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListOptimalTrialsRequest.new -# Call the list_optimal_trials method. -result = client.list_optimal_trials request + # Call the list_optimal_trials method. + result = client.list_optimal_trials request -# The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::ListOptimalTrialsResponse. + p result +end # [END aiplatform_v1_generated_VizierService_ListOptimalTrials_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/list_studies.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/list_studies.rb index 6dc66798bedd..1794c12fada6 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/list_studies.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/list_studies.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_VizierService_ListStudies_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#list_studies +# +def list_studies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListStudiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListStudiesRequest.new -# Call the list_studies method. -result = client.list_studies request + # Call the list_studies method. + result = client.list_studies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Study. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Study. + p response + end end # [END aiplatform_v1_generated_VizierService_ListStudies_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/list_trials.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/list_trials.rb index c8e6217570d1..0fecbb9d9380 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/list_trials.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/list_trials.rb @@ -19,21 +19,27 @@ # [START aiplatform_v1_generated_VizierService_ListTrials_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#list_trials +# +def list_trials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::ListTrialsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::ListTrialsRequest.new -# Call the list_trials method. -result = client.list_trials request + # Call the list_trials method. + result = client.list_trials request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AIPlatform::V1::Trial. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AIPlatform::V1::Trial. + p response + end end # [END aiplatform_v1_generated_VizierService_ListTrials_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/lookup_study.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/lookup_study.rb index 37cf4d3cf46e..6669136b332e 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/lookup_study.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/lookup_study.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_LookupStudy_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#lookup_study +# +def lookup_study + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::LookupStudyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::LookupStudyRequest.new -# Call the lookup_study method. -result = client.lookup_study request + # Call the lookup_study method. + result = client.lookup_study request -# The returned object is of type Google::Cloud::AIPlatform::V1::Study. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Study. + p result +end # [END aiplatform_v1_generated_VizierService_LookupStudy_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/stop_trial.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/stop_trial.rb index 12904056544a..6ff975dcbf4b 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/stop_trial.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/stop_trial.rb @@ -19,15 +19,21 @@ # [START aiplatform_v1_generated_VizierService_StopTrial_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#stop_trial +# +def stop_trial + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::StopTrialRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::StopTrialRequest.new -# Call the stop_trial method. -result = client.stop_trial request + # Call the stop_trial method. + result = client.stop_trial request -# The returned object is of type Google::Cloud::AIPlatform::V1::Trial. -p result + # The returned object is of type Google::Cloud::AIPlatform::V1::Trial. + p result +end # [END aiplatform_v1_generated_VizierService_StopTrial_sync] diff --git a/google-cloud-ai_platform-v1/snippets/vizier_service/suggest_trials.rb b/google-cloud-ai_platform-v1/snippets/vizier_service/suggest_trials.rb index 811dc6e6aee8..a72f81c75079 100644 --- a/google-cloud-ai_platform-v1/snippets/vizier_service/suggest_trials.rb +++ b/google-cloud-ai_platform-v1/snippets/vizier_service/suggest_trials.rb @@ -19,22 +19,28 @@ # [START aiplatform_v1_generated_VizierService_SuggestTrials_sync] require "google/cloud/ai_platform/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AIPlatform::V1::VizierService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AIPlatform::V1::VizierService::Client#suggest_trials +# +def suggest_trials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AIPlatform::V1::VizierService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AIPlatform::V1::SuggestTrialsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AIPlatform::V1::SuggestTrialsRequest.new -# Call the suggest_trials method. -result = client.suggest_trials request + # Call the suggest_trials method. + result = client.suggest_trials request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END aiplatform_v1_generated_VizierService_SuggestTrials_sync] diff --git a/google-cloud-api_gateway-v1/.rubocop.yml b/google-cloud-api_gateway-v1/.rubocop.yml index 1c8d3b16b4f7..04979afab160 100644 --- a/google-cloud-api_gateway-v1/.rubocop.yml +++ b/google-cloud-api_gateway-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-api_gateway-v1.rb" diff --git a/google-cloud-api_gateway-v1/snippets/Gemfile b/google-cloud-api_gateway-v1/snippets/Gemfile index a17fbd9bf800..707ef40b592e 100755 --- a/google-cloud-api_gateway-v1/snippets/Gemfile +++ b/google-cloud-api_gateway-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api.rb index b41ac468c81d..b2271df4df6c 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_CreateApi_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#create_api +# +def create_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::CreateApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::CreateApiRequest.new -# Call the create_api method. -result = client.create_api request + # Call the create_api method. + result = client.create_api request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_CreateApi_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api_config.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api_config.rb index 2340ad1d8d21..fd796585f8b7 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api_config.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_api_config.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_CreateApiConfig_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#create_api_config +# +def create_api_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::CreateApiConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::CreateApiConfigRequest.new -# Call the create_api_config method. -result = client.create_api_config request + # Call the create_api_config method. + result = client.create_api_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_CreateApiConfig_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_gateway.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_gateway.rb index 790269085d62..347ba7675935 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_gateway.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/create_gateway.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_CreateGateway_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#create_gateway +# +def create_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::CreateGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::CreateGatewayRequest.new -# Call the create_gateway method. -result = client.create_gateway request + # Call the create_gateway method. + result = client.create_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_CreateGateway_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api.rb index 92e101977d17..cebe4647f61c 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_DeleteApi_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#delete_api +# +def delete_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::DeleteApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::DeleteApiRequest.new -# Call the delete_api method. -result = client.delete_api request + # Call the delete_api method. + result = client.delete_api request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_DeleteApi_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api_config.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api_config.rb index d5d6234ef867..2ad0de3f4936 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api_config.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_api_config.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#delete_api_config +# +def delete_api_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::DeleteApiConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::DeleteApiConfigRequest.new -# Call the delete_api_config method. -result = client.delete_api_config request + # Call the delete_api_config method. + result = client.delete_api_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_DeleteApiConfig_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_gateway.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_gateway.rb index 548898181ed6..5aba80a2aa0b 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_gateway.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/delete_gateway.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_DeleteGateway_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#delete_gateway +# +def delete_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::DeleteGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::DeleteGatewayRequest.new -# Call the delete_gateway method. -result = client.delete_gateway request + # Call the delete_gateway method. + result = client.delete_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_DeleteGateway_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api.rb index 504e73f06a75..14a198ccb685 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api.rb @@ -19,15 +19,21 @@ # [START apigateway_v1_generated_ApiGatewayService_GetApi_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#get_api +# +def get_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::GetApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::GetApiRequest.new -# Call the get_api method. -result = client.get_api request + # Call the get_api method. + result = client.get_api request -# The returned object is of type Google::Cloud::ApiGateway::V1::Api. -p result + # The returned object is of type Google::Cloud::ApiGateway::V1::Api. + p result +end # [END apigateway_v1_generated_ApiGatewayService_GetApi_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api_config.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api_config.rb index 9a108a1ab9eb..775c6287a604 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api_config.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_api_config.rb @@ -19,15 +19,21 @@ # [START apigateway_v1_generated_ApiGatewayService_GetApiConfig_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#get_api_config +# +def get_api_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::GetApiConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::GetApiConfigRequest.new -# Call the get_api_config method. -result = client.get_api_config request + # Call the get_api_config method. + result = client.get_api_config request -# The returned object is of type Google::Cloud::ApiGateway::V1::ApiConfig. -p result + # The returned object is of type Google::Cloud::ApiGateway::V1::ApiConfig. + p result +end # [END apigateway_v1_generated_ApiGatewayService_GetApiConfig_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_gateway.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_gateway.rb index daaebcd8b9a4..5e525e500c3e 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_gateway.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/get_gateway.rb @@ -19,15 +19,21 @@ # [START apigateway_v1_generated_ApiGatewayService_GetGateway_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#get_gateway +# +def get_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::GetGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::GetGatewayRequest.new -# Call the get_gateway method. -result = client.get_gateway request + # Call the get_gateway method. + result = client.get_gateway request -# The returned object is of type Google::Cloud::ApiGateway::V1::Gateway. -p result + # The returned object is of type Google::Cloud::ApiGateway::V1::Gateway. + p result +end # [END apigateway_v1_generated_ApiGatewayService_GetGateway_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_api_configs.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_api_configs.rb index f5c662ce8be6..e71bd30d2a07 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_api_configs.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_api_configs.rb @@ -19,21 +19,27 @@ # [START apigateway_v1_generated_ApiGatewayService_ListApiConfigs_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#list_api_configs +# +def list_api_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::ListApiConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::ListApiConfigsRequest.new -# Call the list_api_configs method. -result = client.list_api_configs request + # Call the list_api_configs method. + result = client.list_api_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApiGateway::V1::ApiConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApiGateway::V1::ApiConfig. + p response + end end # [END apigateway_v1_generated_ApiGatewayService_ListApiConfigs_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_apis.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_apis.rb index 792251153b7c..aad18a5b1b31 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_apis.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_apis.rb @@ -19,21 +19,27 @@ # [START apigateway_v1_generated_ApiGatewayService_ListApis_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#list_apis +# +def list_apis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::ListApisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::ListApisRequest.new -# Call the list_apis method. -result = client.list_apis request + # Call the list_apis method. + result = client.list_apis request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApiGateway::V1::Api. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApiGateway::V1::Api. + p response + end end # [END apigateway_v1_generated_ApiGatewayService_ListApis_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_gateways.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_gateways.rb index 8359912fc3f3..a04046049b3f 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_gateways.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/list_gateways.rb @@ -19,21 +19,27 @@ # [START apigateway_v1_generated_ApiGatewayService_ListGateways_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#list_gateways +# +def list_gateways + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::ListGatewaysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::ListGatewaysRequest.new -# Call the list_gateways method. -result = client.list_gateways request + # Call the list_gateways method. + result = client.list_gateways request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApiGateway::V1::Gateway. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApiGateway::V1::Gateway. + p response + end end # [END apigateway_v1_generated_ApiGatewayService_ListGateways_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api.rb index e90d23c0f08f..cf2915e7ec90 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_UpdateApi_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#update_api +# +def update_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::UpdateApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::UpdateApiRequest.new -# Call the update_api method. -result = client.update_api request + # Call the update_api method. + result = client.update_api request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_UpdateApi_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api_config.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api_config.rb index bb54277347f4..af8dc78d65d3 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api_config.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_api_config.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_UpdateApiConfig_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#update_api_config +# +def update_api_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::UpdateApiConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::UpdateApiConfigRequest.new -# Call the update_api_config method. -result = client.update_api_config request + # Call the update_api_config method. + result = client.update_api_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_UpdateApiConfig_sync] diff --git a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_gateway.rb b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_gateway.rb index bab79a239b2f..0decd7949041 100755 --- a/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_gateway.rb +++ b/google-cloud-api_gateway-v1/snippets/api_gateway_service/update_gateway.rb @@ -19,22 +19,28 @@ # [START apigateway_v1_generated_ApiGatewayService_UpdateGateway_sync] require "google/cloud/api_gateway/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiGateway::V1::ApiGatewayService::Client#update_gateway +# +def update_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiGateway::V1::ApiGatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiGateway::V1::UpdateGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiGateway::V1::UpdateGatewayRequest.new -# Call the update_gateway method. -result = client.update_gateway request + # Call the update_gateway method. + result = client.update_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigateway_v1_generated_ApiGatewayService_UpdateGateway_sync] diff --git a/google-cloud-api_gateway-v1/snippets/snippet_metadata_google.cloud.apigateway.v1.json b/google-cloud-api_gateway-v1/snippets/snippet_metadata_google.cloud.apigateway.v1.json index 32ab6423cf6e..78b8a69a1b61 100644 --- a/google-cloud-api_gateway-v1/snippets/snippet_metadata_google.cloud.apigateway.v1.json +++ b/google-cloud-api_gateway-v1/snippets/snippet_metadata_google.cloud.apigateway.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-api_keys-v2/.rubocop.yml b/google-cloud-api_keys-v2/.rubocop.yml index 1014cd5066da..5c992952efc7 100644 --- a/google-cloud-api_keys-v2/.rubocop.yml +++ b/google-cloud-api_keys-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-api_keys-v2.rb" diff --git a/google-cloud-api_keys-v2/snippets/Gemfile b/google-cloud-api_keys-v2/snippets/Gemfile index 9a2af0c6307b..20f97bb9c8bb 100644 --- a/google-cloud-api_keys-v2/snippets/Gemfile +++ b/google-cloud-api_keys-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-api_keys-v2/snippets/api_keys/create_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/create_key.rb index 8ada5b91083a..b276ab85dc8e 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/create_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/create_key.rb @@ -19,22 +19,28 @@ # [START apikeys_v2_generated_ApiKeys_CreateKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#create_key +# +def create_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::CreateKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::CreateKeyRequest.new -# Call the create_key method. -result = client.create_key request + # Call the create_key method. + result = client.create_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apikeys_v2_generated_ApiKeys_CreateKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/delete_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/delete_key.rb index 3547432eb796..4af5e790b4b2 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/delete_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/delete_key.rb @@ -19,22 +19,28 @@ # [START apikeys_v2_generated_ApiKeys_DeleteKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#delete_key +# +def delete_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::DeleteKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::DeleteKeyRequest.new -# Call the delete_key method. -result = client.delete_key request + # Call the delete_key method. + result = client.delete_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apikeys_v2_generated_ApiKeys_DeleteKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/get_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/get_key.rb index e7f0e5bcc0a3..ddf6602a884a 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/get_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/get_key.rb @@ -19,15 +19,21 @@ # [START apikeys_v2_generated_ApiKeys_GetKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#get_key +# +def get_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::GetKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::GetKeyRequest.new -# Call the get_key method. -result = client.get_key request + # Call the get_key method. + result = client.get_key request -# The returned object is of type Google::Cloud::ApiKeys::V2::Key. -p result + # The returned object is of type Google::Cloud::ApiKeys::V2::Key. + p result +end # [END apikeys_v2_generated_ApiKeys_GetKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/get_key_string.rb b/google-cloud-api_keys-v2/snippets/api_keys/get_key_string.rb index 1fe4176d51b0..8b6b40f98f16 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/get_key_string.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/get_key_string.rb @@ -19,15 +19,21 @@ # [START apikeys_v2_generated_ApiKeys_GetKeyString_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#get_key_string +# +def get_key_string + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::GetKeyStringRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::GetKeyStringRequest.new -# Call the get_key_string method. -result = client.get_key_string request + # Call the get_key_string method. + result = client.get_key_string request -# The returned object is of type Google::Cloud::ApiKeys::V2::GetKeyStringResponse. -p result + # The returned object is of type Google::Cloud::ApiKeys::V2::GetKeyStringResponse. + p result +end # [END apikeys_v2_generated_ApiKeys_GetKeyString_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/list_keys.rb b/google-cloud-api_keys-v2/snippets/api_keys/list_keys.rb index 0be01fc1895a..b5c37bb2efd2 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/list_keys.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/list_keys.rb @@ -19,21 +19,27 @@ # [START apikeys_v2_generated_ApiKeys_ListKeys_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#list_keys +# +def list_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::ListKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::ListKeysRequest.new -# Call the list_keys method. -result = client.list_keys request + # Call the list_keys method. + result = client.list_keys request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApiKeys::V2::Key. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApiKeys::V2::Key. + p response + end end # [END apikeys_v2_generated_ApiKeys_ListKeys_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/lookup_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/lookup_key.rb index 051836086456..a914d87c8052 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/lookup_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/lookup_key.rb @@ -19,15 +19,21 @@ # [START apikeys_v2_generated_ApiKeys_LookupKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#lookup_key +# +def lookup_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::LookupKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::LookupKeyRequest.new -# Call the lookup_key method. -result = client.lookup_key request + # Call the lookup_key method. + result = client.lookup_key request -# The returned object is of type Google::Cloud::ApiKeys::V2::LookupKeyResponse. -p result + # The returned object is of type Google::Cloud::ApiKeys::V2::LookupKeyResponse. + p result +end # [END apikeys_v2_generated_ApiKeys_LookupKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/undelete_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/undelete_key.rb index bc7ef1eb065f..d004a1c3b79c 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/undelete_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/undelete_key.rb @@ -19,22 +19,28 @@ # [START apikeys_v2_generated_ApiKeys_UndeleteKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#undelete_key +# +def undelete_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::UndeleteKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::UndeleteKeyRequest.new -# Call the undelete_key method. -result = client.undelete_key request + # Call the undelete_key method. + result = client.undelete_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apikeys_v2_generated_ApiKeys_UndeleteKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/api_keys/update_key.rb b/google-cloud-api_keys-v2/snippets/api_keys/update_key.rb index 729dbd5cf801..00a01ca33816 100644 --- a/google-cloud-api_keys-v2/snippets/api_keys/update_key.rb +++ b/google-cloud-api_keys-v2/snippets/api_keys/update_key.rb @@ -19,22 +19,28 @@ # [START apikeys_v2_generated_ApiKeys_UpdateKey_sync] require "google/cloud/api_keys/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApiKeys::V2::ApiKeys::Client#update_key +# +def update_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApiKeys::V2::ApiKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApiKeys::V2::UpdateKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApiKeys::V2::UpdateKeyRequest.new -# Call the update_key method. -result = client.update_key request + # Call the update_key method. + result = client.update_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apikeys_v2_generated_ApiKeys_UpdateKey_sync] diff --git a/google-cloud-api_keys-v2/snippets/snippet_metadata_google.api.apikeys.v2.json b/google-cloud-api_keys-v2/snippets/snippet_metadata_google.api.apikeys.v2.json index aef290ec24ee..5cb60ed6e450 100644 --- a/google-cloud-api_keys-v2/snippets/snippet_metadata_google.api.apikeys.v2.json +++ b/google-cloud-api_keys-v2/snippets/snippet_metadata_google.api.apikeys.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-apigee_connect-v1/.rubocop.yml b/google-cloud-apigee_connect-v1/.rubocop.yml index 8790b9511368..fc7c16a5d866 100644 --- a/google-cloud-apigee_connect-v1/.rubocop.yml +++ b/google-cloud-apigee_connect-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-apigee_connect-v1.rb" diff --git a/google-cloud-apigee_connect-v1/snippets/Gemfile b/google-cloud-apigee_connect-v1/snippets/Gemfile index 4c197f6ebdd1..ab1944c142ad 100755 --- a/google-cloud-apigee_connect-v1/snippets/Gemfile +++ b/google-cloud-apigee_connect-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-apigee_connect-v1/snippets/connection_service/list_connections.rb b/google-cloud-apigee_connect-v1/snippets/connection_service/list_connections.rb index db77f3c19549..0f9fc9f72e78 100755 --- a/google-cloud-apigee_connect-v1/snippets/connection_service/list_connections.rb +++ b/google-cloud-apigee_connect-v1/snippets/connection_service/list_connections.rb @@ -19,21 +19,27 @@ # [START apigeeconnect_v1_generated_ConnectionService_ListConnections_sync] require "google/cloud/apigee_connect/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeConnect::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeConnect::V1::ConnectionService::Client#list_connections +# +def list_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeConnect::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeConnect::V1::ListConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeConnect::V1::ListConnectionsRequest.new -# Call the list_connections method. -result = client.list_connections request + # Call the list_connections method. + result = client.list_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeConnect::V1::Connection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeConnect::V1::Connection. + p response + end end # [END apigeeconnect_v1_generated_ConnectionService_ListConnections_sync] diff --git a/google-cloud-apigee_connect-v1/snippets/snippet_metadata_google.cloud.apigeeconnect.v1.json b/google-cloud-apigee_connect-v1/snippets/snippet_metadata_google.cloud.apigeeconnect.v1.json index 47d7386aa016..63f6f23b2e4f 100644 --- a/google-cloud-apigee_connect-v1/snippets/snippet_metadata_google.cloud.apigeeconnect.v1.json +++ b/google-cloud-apigee_connect-v1/snippets/snippet_metadata_google.cloud.apigeeconnect.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] diff --git a/google-cloud-apigee_connect-v1/snippets/tether/egress.rb b/google-cloud-apigee_connect-v1/snippets/tether/egress.rb index f3f4a74c40c1..f90d6baac17a 100755 --- a/google-cloud-apigee_connect-v1/snippets/tether/egress.rb +++ b/google-cloud-apigee_connect-v1/snippets/tether/egress.rb @@ -19,24 +19,30 @@ # [START apigeeconnect_v1_generated_Tether_Egress_sync] require "google/cloud/apigee_connect/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeConnect::V1::Tether::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the egress method to start streaming. -output = client.egress input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::ApigeeConnect::V1::EgressResponse.new -input << Google::Cloud::ApigeeConnect::V1::EgressResponse.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::ApigeeConnect::V1::EgressRequest. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeConnect::V1::Tether::Client#egress +# +def egress + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeConnect::V1::Tether::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the egress method to start streaming. + output = client.egress input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::ApigeeConnect::V1::EgressResponse.new + input << Google::Cloud::ApigeeConnect::V1::EgressResponse.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::ApigeeConnect::V1::EgressRequest. + output.each do |response| + p response + end end # [END apigeeconnect_v1_generated_Tether_Egress_sync] diff --git a/google-cloud-apigee_registry-v1/.rubocop.yml b/google-cloud-apigee_registry-v1/.rubocop.yml index 75d2616b2555..5d59c0e0425a 100644 --- a/google-cloud-apigee_registry-v1/.rubocop.yml +++ b/google-cloud-apigee_registry-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-apigee_registry-v1.rb" diff --git a/google-cloud-apigee_registry-v1/snippets/Gemfile b/google-cloud-apigee_registry-v1/snippets/Gemfile index 0a3d5a4ec044..3558e3b8f638 100644 --- a/google-cloud-apigee_registry-v1/snippets/Gemfile +++ b/google-cloud-apigee_registry-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-apigee_registry-v1/snippets/provisioning/create_instance.rb b/google-cloud-apigee_registry-v1/snippets/provisioning/create_instance.rb index 52f5ea8af225..8e158309850a 100644 --- a/google-cloud-apigee_registry-v1/snippets/provisioning/create_instance.rb +++ b/google-cloud-apigee_registry-v1/snippets/provisioning/create_instance.rb @@ -19,22 +19,28 @@ # [START apigeeregistry_v1_generated_Provisioning_CreateInstance_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Provisioning::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigeeregistry_v1_generated_Provisioning_CreateInstance_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/provisioning/delete_instance.rb b/google-cloud-apigee_registry-v1/snippets/provisioning/delete_instance.rb index 9d5e92e215e6..9e8dab1296e8 100644 --- a/google-cloud-apigee_registry-v1/snippets/provisioning/delete_instance.rb +++ b/google-cloud-apigee_registry-v1/snippets/provisioning/delete_instance.rb @@ -19,22 +19,28 @@ # [START apigeeregistry_v1_generated_Provisioning_DeleteInstance_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Provisioning::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END apigeeregistry_v1_generated_Provisioning_DeleteInstance_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/provisioning/get_instance.rb b/google-cloud-apigee_registry-v1/snippets/provisioning/get_instance.rb index 8d7a08160d5f..0f246ab2b01f 100644 --- a/google-cloud-apigee_registry-v1/snippets/provisioning/get_instance.rb +++ b/google-cloud-apigee_registry-v1/snippets/provisioning/get_instance.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Provisioning_GetInstance_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Provisioning::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Provisioning::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Instance. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Instance. + p result +end # [END apigeeregistry_v1_generated_Provisioning_GetInstance_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/create_api.rb b/google-cloud-apigee_registry-v1/snippets/registry/create_api.rb index 4af81cbea629..f88c628fa61e 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/create_api.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/create_api.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_CreateApi_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#create_api +# +def create_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateApiRequest.new -# Call the create_api method. -result = client.create_api request + # Call the create_api method. + result = client.create_api request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. + p result +end # [END apigeeregistry_v1_generated_Registry_CreateApi_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/create_api_deployment.rb b/google-cloud-apigee_registry-v1/snippets/registry/create_api_deployment.rb index 751b680d2af2..8669e469892c 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/create_api_deployment.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/create_api_deployment.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_CreateApiDeployment_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#create_api_deployment +# +def create_api_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateApiDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateApiDeploymentRequest.new -# Call the create_api_deployment method. -result = client.create_api_deployment request + # Call the create_api_deployment method. + result = client.create_api_deployment request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_CreateApiDeployment_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/create_api_spec.rb b/google-cloud-apigee_registry-v1/snippets/registry/create_api_spec.rb index 4646f9d38c3b..e6a3d96eef18 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/create_api_spec.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/create_api_spec.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_CreateApiSpec_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#create_api_spec +# +def create_api_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateApiSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateApiSpecRequest.new -# Call the create_api_spec method. -result = client.create_api_spec request + # Call the create_api_spec method. + result = client.create_api_spec request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_CreateApiSpec_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/create_api_version.rb b/google-cloud-apigee_registry-v1/snippets/registry/create_api_version.rb index f908feede3af..1beef84851f0 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/create_api_version.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/create_api_version.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_CreateApiVersion_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#create_api_version +# +def create_api_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateApiVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateApiVersionRequest.new -# Call the create_api_version method. -result = client.create_api_version request + # Call the create_api_version method. + result = client.create_api_version request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. + p result +end # [END apigeeregistry_v1_generated_Registry_CreateApiVersion_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/create_artifact.rb b/google-cloud-apigee_registry-v1/snippets/registry/create_artifact.rb index 5088ccfef881..e78e412d386b 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/create_artifact.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/create_artifact.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_CreateArtifact_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#create_artifact +# +def create_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::CreateArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::CreateArtifactRequest.new -# Call the create_artifact method. -result = client.create_artifact request + # Call the create_artifact method. + result = client.create_artifact request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. + p result +end # [END apigeeregistry_v1_generated_Registry_CreateArtifact_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api.rb index 90e20bbb273c..829b1cc550c3 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApi_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api +# +def delete_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiRequest.new -# Call the delete_api method. -result = client.delete_api request + # Call the delete_api method. + result = client.delete_api request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApi_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment.rb index dd2458cf52e4..4b9cefb9095a 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApiDeployment_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api_deployment +# +def delete_api_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRequest.new -# Call the delete_api_deployment method. -result = client.delete_api_deployment request + # Call the delete_api_deployment method. + result = client.delete_api_deployment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApiDeployment_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment_revision.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment_revision.rb index 1999cfc55cde..9abcdb37ccbc 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment_revision.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_deployment_revision.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api_deployment_revision +# +def delete_api_deployment_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiDeploymentRevisionRequest.new -# Call the delete_api_deployment_revision method. -result = client.delete_api_deployment_revision request + # Call the delete_api_deployment_revision method. + result = client.delete_api_deployment_revision request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApiDeploymentRevision_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec.rb index 016f1fda545c..0b98f24a06ad 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApiSpec_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api_spec +# +def delete_api_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRequest.new -# Call the delete_api_spec method. -result = client.delete_api_spec request + # Call the delete_api_spec method. + result = client.delete_api_spec request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApiSpec_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec_revision.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec_revision.rb index 2502fbb3e705..f498750ad0da 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec_revision.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_spec_revision.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api_spec_revision +# +def delete_api_spec_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiSpecRevisionRequest.new -# Call the delete_api_spec_revision method. -result = client.delete_api_spec_revision request + # Call the delete_api_spec_revision method. + result = client.delete_api_spec_revision request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApiSpecRevision_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_version.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_version.rb index 274e3aa10702..7e9ef33c6066 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_api_version.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_api_version.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteApiVersion_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_api_version +# +def delete_api_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteApiVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteApiVersionRequest.new -# Call the delete_api_version method. -result = client.delete_api_version request + # Call the delete_api_version method. + result = client.delete_api_version request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteApiVersion_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/delete_artifact.rb b/google-cloud-apigee_registry-v1/snippets/registry/delete_artifact.rb index bc5d522d6b85..ce0b328622d0 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/delete_artifact.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/delete_artifact.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_DeleteArtifact_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#delete_artifact +# +def delete_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::DeleteArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::DeleteArtifactRequest.new -# Call the delete_artifact method. -result = client.delete_artifact request + # Call the delete_artifact method. + result = client.delete_artifact request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END apigeeregistry_v1_generated_Registry_DeleteArtifact_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_api.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_api.rb index 182b460dc17c..8a35b4b74c84 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_api.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_api.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetApi_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_api +# +def get_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetApiRequest.new -# Call the get_api method. -result = client.get_api request + # Call the get_api method. + result = client.get_api request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. + p result +end # [END apigeeregistry_v1_generated_Registry_GetApi_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_api_deployment.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_api_deployment.rb index 6ede27cae996..fc49110b77b1 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_api_deployment.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_api_deployment.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetApiDeployment_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_api_deployment +# +def get_api_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetApiDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetApiDeploymentRequest.new -# Call the get_api_deployment method. -result = client.get_api_deployment request + # Call the get_api_deployment method. + result = client.get_api_deployment request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_GetApiDeployment_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec.rb index 41af2da4b9c1..c3ae6332d562 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetApiSpec_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_api_spec +# +def get_api_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetApiSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetApiSpecRequest.new -# Call the get_api_spec method. -result = client.get_api_spec request + # Call the get_api_spec method. + result = client.get_api_spec request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_GetApiSpec_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec_contents.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec_contents.rb index f54515cb6117..17fc90bf9123 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec_contents.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_api_spec_contents.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetApiSpecContents_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_api_spec_contents +# +def get_api_spec_contents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetApiSpecContentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetApiSpecContentsRequest.new -# Call the get_api_spec_contents method. -result = client.get_api_spec_contents request + # Call the get_api_spec_contents method. + result = client.get_api_spec_contents request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END apigeeregistry_v1_generated_Registry_GetApiSpecContents_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_api_version.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_api_version.rb index 494584caaabe..07b41e90775a 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_api_version.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_api_version.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetApiVersion_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_api_version +# +def get_api_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetApiVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetApiVersionRequest.new -# Call the get_api_version method. -result = client.get_api_version request + # Call the get_api_version method. + result = client.get_api_version request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. + p result +end # [END apigeeregistry_v1_generated_Registry_GetApiVersion_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_artifact.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_artifact.rb index 62807faf3f68..3070355b9919 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_artifact.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_artifact.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetArtifact_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_artifact +# +def get_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetArtifactRequest.new -# Call the get_artifact method. -result = client.get_artifact request + # Call the get_artifact method. + result = client.get_artifact request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. + p result +end # [END apigeeregistry_v1_generated_Registry_GetArtifact_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/get_artifact_contents.rb b/google-cloud-apigee_registry-v1/snippets/registry/get_artifact_contents.rb index 98a133739264..3ba0831d55f1 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/get_artifact_contents.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/get_artifact_contents.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_GetArtifactContents_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#get_artifact_contents +# +def get_artifact_contents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::GetArtifactContentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::GetArtifactContentsRequest.new -# Call the get_artifact_contents method. -result = client.get_artifact_contents request + # Call the get_artifact_contents method. + result = client.get_artifact_contents request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END apigeeregistry_v1_generated_Registry_GetArtifactContents_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployment_revisions.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployment_revisions.rb index 8336be050d8b..7ce2f26a2959 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployment_revisions.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployment_revisions.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_api_deployment_revisions +# +def list_api_deployment_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentRevisionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentRevisionsRequest.new -# Call the list_api_deployment_revisions method. -result = client.list_api_deployment_revisions request + # Call the list_api_deployment_revisions method. + result = client.list_api_deployment_revisions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiDeployment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApiDeploymentRevisions_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployments.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployments.rb index adf3140cceea..459cffcabc6e 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployments.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_api_deployments.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApiDeployments_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_api_deployments +# +def list_api_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApiDeploymentsRequest.new -# Call the list_api_deployments method. -result = client.list_api_deployments request + # Call the list_api_deployments method. + result = client.list_api_deployments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiDeployment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApiDeployments_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_api_spec_revisions.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_api_spec_revisions.rb index 8977723893f3..71d2c3598c59 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_api_spec_revisions.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_api_spec_revisions.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_api_spec_revisions +# +def list_api_spec_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApiSpecRevisionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApiSpecRevisionsRequest.new -# Call the list_api_spec_revisions method. -result = client.list_api_spec_revisions request + # Call the list_api_spec_revisions method. + result = client.list_api_spec_revisions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiSpec. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApiSpecRevisions_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_api_specs.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_api_specs.rb index 44c86f3f10bd..c40858867c77 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_api_specs.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_api_specs.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApiSpecs_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_api_specs +# +def list_api_specs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApiSpecsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApiSpecsRequest.new -# Call the list_api_specs method. -result = client.list_api_specs request + # Call the list_api_specs method. + result = client.list_api_specs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiSpec. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApiSpecs_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_api_versions.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_api_versions.rb index 28e5dfcfe3a8..7a45b8b85725 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_api_versions.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_api_versions.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApiVersions_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_api_versions +# +def list_api_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApiVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApiVersionsRequest.new -# Call the list_api_versions method. -result = client.list_api_versions request + # Call the list_api_versions method. + result = client.list_api_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::ApiVersion. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApiVersions_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_apis.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_apis.rb index 0cc0a84989ee..f70b23c22d7c 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_apis.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_apis.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListApis_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_apis +# +def list_apis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListApisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListApisRequest.new -# Call the list_apis method. -result = client.list_apis request + # Call the list_apis method. + result = client.list_apis request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::Api. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::Api. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListApis_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/list_artifacts.rb b/google-cloud-apigee_registry-v1/snippets/registry/list_artifacts.rb index 796459f759ee..41cb9fc22df3 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/list_artifacts.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/list_artifacts.rb @@ -19,21 +19,27 @@ # [START apigeeregistry_v1_generated_Registry_ListArtifacts_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#list_artifacts +# +def list_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ListArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ListArtifactsRequest.new -# Call the list_artifacts method. -result = client.list_artifacts request + # Call the list_artifacts method. + result = client.list_artifacts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::Artifact. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ApigeeRegistry::V1::Artifact. + p response + end end # [END apigeeregistry_v1_generated_Registry_ListArtifacts_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/replace_artifact.rb b/google-cloud-apigee_registry-v1/snippets/registry/replace_artifact.rb index 8ecfd7f86b52..bd6ac3614ecf 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/replace_artifact.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/replace_artifact.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_ReplaceArtifact_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#replace_artifact +# +def replace_artifact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::ReplaceArtifactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::ReplaceArtifactRequest.new -# Call the replace_artifact method. -result = client.replace_artifact request + # Call the replace_artifact method. + result = client.replace_artifact request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Artifact. + p result +end # [END apigeeregistry_v1_generated_Registry_ReplaceArtifact_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_deployment.rb b/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_deployment.rb index 6985439a722f..ae19b5b3238e 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_deployment.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_deployment.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_RollbackApiDeployment_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#rollback_api_deployment +# +def rollback_api_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::RollbackApiDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::RollbackApiDeploymentRequest.new -# Call the rollback_api_deployment method. -result = client.rollback_api_deployment request + # Call the rollback_api_deployment method. + result = client.rollback_api_deployment request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_RollbackApiDeployment_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_spec.rb b/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_spec.rb index 6156fe486b27..6be3ef2b5545 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_spec.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/rollback_api_spec.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_RollbackApiSpec_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#rollback_api_spec +# +def rollback_api_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::RollbackApiSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::RollbackApiSpecRequest.new -# Call the rollback_api_spec method. -result = client.rollback_api_spec request + # Call the rollback_api_spec method. + result = client.rollback_api_spec request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_RollbackApiSpec_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/tag_api_deployment_revision.rb b/google-cloud-apigee_registry-v1/snippets/registry/tag_api_deployment_revision.rb index ffb35e9d6046..fc735c3e6661 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/tag_api_deployment_revision.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/tag_api_deployment_revision.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#tag_api_deployment_revision +# +def tag_api_deployment_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::TagApiDeploymentRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::TagApiDeploymentRevisionRequest.new -# Call the tag_api_deployment_revision method. -result = client.tag_api_deployment_revision request + # Call the tag_api_deployment_revision method. + result = client.tag_api_deployment_revision request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_TagApiDeploymentRevision_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/tag_api_spec_revision.rb b/google-cloud-apigee_registry-v1/snippets/registry/tag_api_spec_revision.rb index 41ac7f5d2960..6df8903fe7f2 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/tag_api_spec_revision.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/tag_api_spec_revision.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_TagApiSpecRevision_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#tag_api_spec_revision +# +def tag_api_spec_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::TagApiSpecRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::TagApiSpecRevisionRequest.new -# Call the tag_api_spec_revision method. -result = client.tag_api_spec_revision request + # Call the tag_api_spec_revision method. + result = client.tag_api_spec_revision request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_TagApiSpecRevision_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/update_api.rb b/google-cloud-apigee_registry-v1/snippets/registry/update_api.rb index 3263982bc67b..842f9e394997 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/update_api.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/update_api.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_UpdateApi_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#update_api +# +def update_api + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::UpdateApiRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::UpdateApiRequest.new -# Call the update_api method. -result = client.update_api request + # Call the update_api method. + result = client.update_api request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::Api. + p result +end # [END apigeeregistry_v1_generated_Registry_UpdateApi_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/update_api_deployment.rb b/google-cloud-apigee_registry-v1/snippets/registry/update_api_deployment.rb index 0704ed42e201..4b5dc9eb54ca 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/update_api_deployment.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/update_api_deployment.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_UpdateApiDeployment_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#update_api_deployment +# +def update_api_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::UpdateApiDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::UpdateApiDeploymentRequest.new -# Call the update_api_deployment method. -result = client.update_api_deployment request + # Call the update_api_deployment method. + result = client.update_api_deployment request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiDeployment. + p result +end # [END apigeeregistry_v1_generated_Registry_UpdateApiDeployment_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/update_api_spec.rb b/google-cloud-apigee_registry-v1/snippets/registry/update_api_spec.rb index e014c35ee70a..5eb85c362577 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/update_api_spec.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/update_api_spec.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_UpdateApiSpec_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#update_api_spec +# +def update_api_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::UpdateApiSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::UpdateApiSpecRequest.new -# Call the update_api_spec method. -result = client.update_api_spec request + # Call the update_api_spec method. + result = client.update_api_spec request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiSpec. + p result +end # [END apigeeregistry_v1_generated_Registry_UpdateApiSpec_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/registry/update_api_version.rb b/google-cloud-apigee_registry-v1/snippets/registry/update_api_version.rb index 6206e10cd690..ba784b9ccfbb 100644 --- a/google-cloud-apigee_registry-v1/snippets/registry/update_api_version.rb +++ b/google-cloud-apigee_registry-v1/snippets/registry/update_api_version.rb @@ -19,15 +19,21 @@ # [START apigeeregistry_v1_generated_Registry_UpdateApiVersion_sync] require "google/cloud/apigee_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ApigeeRegistry::V1::Registry::Client#update_api_version +# +def update_api_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ApigeeRegistry::V1::Registry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ApigeeRegistry::V1::UpdateApiVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ApigeeRegistry::V1::UpdateApiVersionRequest.new -# Call the update_api_version method. -result = client.update_api_version request + # Call the update_api_version method. + result = client.update_api_version request -# The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. -p result + # The returned object is of type Google::Cloud::ApigeeRegistry::V1::ApiVersion. + p result +end # [END apigeeregistry_v1_generated_Registry_UpdateApiVersion_sync] diff --git a/google-cloud-apigee_registry-v1/snippets/snippet_metadata_google.cloud.apigeeregistry.v1.json b/google-cloud-apigee_registry-v1/snippets/snippet_metadata_google.cloud.apigeeregistry.v1.json index fe6bc8cc8dcd..fef58fad5248 100644 --- a/google-cloud-apigee_registry-v1/snippets/snippet_metadata_google.cloud.apigeeregistry.v1.json +++ b/google-cloud-apigee_registry-v1/snippets/snippet_metadata_google.cloud.apigeeregistry.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-app_engine-v1/.rubocop.yml b/google-cloud-app_engine-v1/.rubocop.yml index 59418c88689d..720182a7512b 100644 --- a/google-cloud-app_engine-v1/.rubocop.yml +++ b/google-cloud-app_engine-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-app_engine-v1.rb" diff --git a/google-cloud-app_engine-v1/snippets/Gemfile b/google-cloud-app_engine-v1/snippets/Gemfile index fc49020b89f4..1ed15a47a28a 100755 --- a/google-cloud-app_engine-v1/snippets/Gemfile +++ b/google-cloud-app_engine-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-app_engine-v1/snippets/applications/create_application.rb b/google-cloud-app_engine-v1/snippets/applications/create_application.rb index 8f0535778e90..23fb4b28dd75 100755 --- a/google-cloud-app_engine-v1/snippets/applications/create_application.rb +++ b/google-cloud-app_engine-v1/snippets/applications/create_application.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Applications_CreateApplication_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Applications::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Applications::Client#create_application +# +def create_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Applications::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::CreateApplicationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::CreateApplicationRequest.new -# Call the create_application method. -result = client.create_application request + # Call the create_application method. + result = client.create_application request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Applications_CreateApplication_sync] diff --git a/google-cloud-app_engine-v1/snippets/applications/get_application.rb b/google-cloud-app_engine-v1/snippets/applications/get_application.rb index 4da83e7f97e9..b0e16c626c96 100755 --- a/google-cloud-app_engine-v1/snippets/applications/get_application.rb +++ b/google-cloud-app_engine-v1/snippets/applications/get_application.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Applications_GetApplication_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Applications::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Applications::Client#get_application +# +def get_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Applications::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetApplicationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetApplicationRequest.new -# Call the get_application method. -result = client.get_application request + # Call the get_application method. + result = client.get_application request -# The returned object is of type Google::Cloud::AppEngine::V1::Application. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::Application. + p result +end # [END appengine_v1_generated_Applications_GetApplication_sync] diff --git a/google-cloud-app_engine-v1/snippets/applications/repair_application.rb b/google-cloud-app_engine-v1/snippets/applications/repair_application.rb index fb3216c46fb0..558d54c5766f 100755 --- a/google-cloud-app_engine-v1/snippets/applications/repair_application.rb +++ b/google-cloud-app_engine-v1/snippets/applications/repair_application.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Applications_RepairApplication_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Applications::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Applications::Client#repair_application +# +def repair_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Applications::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::RepairApplicationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::RepairApplicationRequest.new -# Call the repair_application method. -result = client.repair_application request + # Call the repair_application method. + result = client.repair_application request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Applications_RepairApplication_sync] diff --git a/google-cloud-app_engine-v1/snippets/applications/update_application.rb b/google-cloud-app_engine-v1/snippets/applications/update_application.rb index 977ba471579c..5c82e5c87a78 100755 --- a/google-cloud-app_engine-v1/snippets/applications/update_application.rb +++ b/google-cloud-app_engine-v1/snippets/applications/update_application.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Applications_UpdateApplication_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Applications::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Applications::Client#update_application +# +def update_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Applications::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateApplicationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateApplicationRequest.new -# Call the update_application method. -result = client.update_application request + # Call the update_application method. + result = client.update_application request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Applications_UpdateApplication_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_certificates/create_authorized_certificate.rb b/google-cloud-app_engine-v1/snippets/authorized_certificates/create_authorized_certificate.rb index d3bfe3c092fd..8de979d3457e 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_certificates/create_authorized_certificate.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_certificates/create_authorized_certificate.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client#create_authorized_certificate +# +def create_authorized_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::CreateAuthorizedCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::CreateAuthorizedCertificateRequest.new -# Call the create_authorized_certificate method. -result = client.create_authorized_certificate request + # Call the create_authorized_certificate method. + result = client.create_authorized_certificate request -# The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. + p result +end # [END appengine_v1_generated_AuthorizedCertificates_CreateAuthorizedCertificate_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_certificates/delete_authorized_certificate.rb b/google-cloud-app_engine-v1/snippets/authorized_certificates/delete_authorized_certificate.rb index 5d4b077e0f24..1dcec779a483 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_certificates/delete_authorized_certificate.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_certificates/delete_authorized_certificate.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client#delete_authorized_certificate +# +def delete_authorized_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteAuthorizedCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteAuthorizedCertificateRequest.new -# Call the delete_authorized_certificate method. -result = client.delete_authorized_certificate request + # Call the delete_authorized_certificate method. + result = client.delete_authorized_certificate request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END appengine_v1_generated_AuthorizedCertificates_DeleteAuthorizedCertificate_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_certificates/get_authorized_certificate.rb b/google-cloud-app_engine-v1/snippets/authorized_certificates/get_authorized_certificate.rb index 7771eefd4715..3943c49c1386 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_certificates/get_authorized_certificate.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_certificates/get_authorized_certificate.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client#get_authorized_certificate +# +def get_authorized_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetAuthorizedCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetAuthorizedCertificateRequest.new -# Call the get_authorized_certificate method. -result = client.get_authorized_certificate request + # Call the get_authorized_certificate method. + result = client.get_authorized_certificate request -# The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. + p result +end # [END appengine_v1_generated_AuthorizedCertificates_GetAuthorizedCertificate_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_certificates/list_authorized_certificates.rb b/google-cloud-app_engine-v1/snippets/authorized_certificates/list_authorized_certificates.rb index 928328d014a1..725d91be30dc 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_certificates/list_authorized_certificates.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_certificates/list_authorized_certificates.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client#list_authorized_certificates +# +def list_authorized_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListAuthorizedCertificatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListAuthorizedCertificatesRequest.new -# Call the list_authorized_certificates method. -result = client.list_authorized_certificates request + # Call the list_authorized_certificates method. + result = client.list_authorized_certificates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedCertificate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedCertificate. + p response + end end # [END appengine_v1_generated_AuthorizedCertificates_ListAuthorizedCertificates_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_certificates/update_authorized_certificate.rb b/google-cloud-app_engine-v1/snippets/authorized_certificates/update_authorized_certificate.rb index 6854893b6052..8610f5cdce3a 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_certificates/update_authorized_certificate.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_certificates/update_authorized_certificate.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client#update_authorized_certificate +# +def update_authorized_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedCertificates::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateAuthorizedCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateAuthorizedCertificateRequest.new -# Call the update_authorized_certificate method. -result = client.update_authorized_certificate request + # Call the update_authorized_certificate method. + result = client.update_authorized_certificate request -# The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::AuthorizedCertificate. + p result +end # [END appengine_v1_generated_AuthorizedCertificates_UpdateAuthorizedCertificate_sync] diff --git a/google-cloud-app_engine-v1/snippets/authorized_domains/list_authorized_domains.rb b/google-cloud-app_engine-v1/snippets/authorized_domains/list_authorized_domains.rb index 05b6584c140f..bd2730241a3c 100755 --- a/google-cloud-app_engine-v1/snippets/authorized_domains/list_authorized_domains.rb +++ b/google-cloud-app_engine-v1/snippets/authorized_domains/list_authorized_domains.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::AuthorizedDomains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::AuthorizedDomains::Client#list_authorized_domains +# +def list_authorized_domains + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::AuthorizedDomains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListAuthorizedDomainsRequest.new -# Call the list_authorized_domains method. -result = client.list_authorized_domains request + # Call the list_authorized_domains method. + result = client.list_authorized_domains request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedDomain. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::AuthorizedDomain. + p response + end end # [END appengine_v1_generated_AuthorizedDomains_ListAuthorizedDomains_sync] diff --git a/google-cloud-app_engine-v1/snippets/domain_mappings/create_domain_mapping.rb b/google-cloud-app_engine-v1/snippets/domain_mappings/create_domain_mapping.rb index f67805618c89..7dcfc3c8a3ec 100755 --- a/google-cloud-app_engine-v1/snippets/domain_mappings/create_domain_mapping.rb +++ b/google-cloud-app_engine-v1/snippets/domain_mappings/create_domain_mapping.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_DomainMappings_CreateDomainMapping_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::DomainMappings::Client#create_domain_mapping +# +def create_domain_mapping + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::CreateDomainMappingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::CreateDomainMappingRequest.new -# Call the create_domain_mapping method. -result = client.create_domain_mapping request + # Call the create_domain_mapping method. + result = client.create_domain_mapping request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_DomainMappings_CreateDomainMapping_sync] diff --git a/google-cloud-app_engine-v1/snippets/domain_mappings/delete_domain_mapping.rb b/google-cloud-app_engine-v1/snippets/domain_mappings/delete_domain_mapping.rb index 78a491ba6780..444e405f322b 100755 --- a/google-cloud-app_engine-v1/snippets/domain_mappings/delete_domain_mapping.rb +++ b/google-cloud-app_engine-v1/snippets/domain_mappings/delete_domain_mapping.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_DomainMappings_DeleteDomainMapping_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::DomainMappings::Client#delete_domain_mapping +# +def delete_domain_mapping + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteDomainMappingRequest.new -# Call the delete_domain_mapping method. -result = client.delete_domain_mapping request + # Call the delete_domain_mapping method. + result = client.delete_domain_mapping request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_DomainMappings_DeleteDomainMapping_sync] diff --git a/google-cloud-app_engine-v1/snippets/domain_mappings/get_domain_mapping.rb b/google-cloud-app_engine-v1/snippets/domain_mappings/get_domain_mapping.rb index 021812143faa..3cf29dd1d199 100755 --- a/google-cloud-app_engine-v1/snippets/domain_mappings/get_domain_mapping.rb +++ b/google-cloud-app_engine-v1/snippets/domain_mappings/get_domain_mapping.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_DomainMappings_GetDomainMapping_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::DomainMappings::Client#get_domain_mapping +# +def get_domain_mapping + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetDomainMappingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetDomainMappingRequest.new -# Call the get_domain_mapping method. -result = client.get_domain_mapping request + # Call the get_domain_mapping method. + result = client.get_domain_mapping request -# The returned object is of type Google::Cloud::AppEngine::V1::DomainMapping. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::DomainMapping. + p result +end # [END appengine_v1_generated_DomainMappings_GetDomainMapping_sync] diff --git a/google-cloud-app_engine-v1/snippets/domain_mappings/list_domain_mappings.rb b/google-cloud-app_engine-v1/snippets/domain_mappings/list_domain_mappings.rb index dfb7b9d5dee0..6402323e1a6a 100755 --- a/google-cloud-app_engine-v1/snippets/domain_mappings/list_domain_mappings.rb +++ b/google-cloud-app_engine-v1/snippets/domain_mappings/list_domain_mappings.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_DomainMappings_ListDomainMappings_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::DomainMappings::Client#list_domain_mappings +# +def list_domain_mappings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListDomainMappingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListDomainMappingsRequest.new -# Call the list_domain_mappings method. -result = client.list_domain_mappings request + # Call the list_domain_mappings method. + result = client.list_domain_mappings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::DomainMapping. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::DomainMapping. + p response + end end # [END appengine_v1_generated_DomainMappings_ListDomainMappings_sync] diff --git a/google-cloud-app_engine-v1/snippets/domain_mappings/update_domain_mapping.rb b/google-cloud-app_engine-v1/snippets/domain_mappings/update_domain_mapping.rb index 51c737f632f2..1d35f9ac39fc 100755 --- a/google-cloud-app_engine-v1/snippets/domain_mappings/update_domain_mapping.rb +++ b/google-cloud-app_engine-v1/snippets/domain_mappings/update_domain_mapping.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_DomainMappings_UpdateDomainMapping_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::DomainMappings::Client#update_domain_mapping +# +def update_domain_mapping + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::DomainMappings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateDomainMappingRequest.new -# Call the update_domain_mapping method. -result = client.update_domain_mapping request + # Call the update_domain_mapping method. + result = client.update_domain_mapping request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_DomainMappings_UpdateDomainMapping_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/batch_update_ingress_rules.rb b/google-cloud-app_engine-v1/snippets/firewall/batch_update_ingress_rules.rb index 3b5e2e985465..1f3496e74403 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/batch_update_ingress_rules.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/batch_update_ingress_rules.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Firewall_BatchUpdateIngressRules_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#batch_update_ingress_rules +# +def batch_update_ingress_rules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesRequest.new -# Call the batch_update_ingress_rules method. -result = client.batch_update_ingress_rules request + # Call the batch_update_ingress_rules method. + result = client.batch_update_ingress_rules request -# The returned object is of type Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::BatchUpdateIngressRulesResponse. + p result +end # [END appengine_v1_generated_Firewall_BatchUpdateIngressRules_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/create_ingress_rule.rb b/google-cloud-app_engine-v1/snippets/firewall/create_ingress_rule.rb index ee258be193fc..632ae34cd734 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/create_ingress_rule.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/create_ingress_rule.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Firewall_CreateIngressRule_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#create_ingress_rule +# +def create_ingress_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::CreateIngressRuleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::CreateIngressRuleRequest.new -# Call the create_ingress_rule method. -result = client.create_ingress_rule request + # Call the create_ingress_rule method. + result = client.create_ingress_rule request -# The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + p result +end # [END appengine_v1_generated_Firewall_CreateIngressRule_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/delete_ingress_rule.rb b/google-cloud-app_engine-v1/snippets/firewall/delete_ingress_rule.rb index 933b4cb971bb..2ebe08f97ff0 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/delete_ingress_rule.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/delete_ingress_rule.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Firewall_DeleteIngressRule_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#delete_ingress_rule +# +def delete_ingress_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteIngressRuleRequest.new -# Call the delete_ingress_rule method. -result = client.delete_ingress_rule request + # Call the delete_ingress_rule method. + result = client.delete_ingress_rule request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END appengine_v1_generated_Firewall_DeleteIngressRule_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/get_ingress_rule.rb b/google-cloud-app_engine-v1/snippets/firewall/get_ingress_rule.rb index 9e0d21a84d9b..30963c4d9e5a 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/get_ingress_rule.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/get_ingress_rule.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Firewall_GetIngressRule_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#get_ingress_rule +# +def get_ingress_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetIngressRuleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetIngressRuleRequest.new -# Call the get_ingress_rule method. -result = client.get_ingress_rule request + # Call the get_ingress_rule method. + result = client.get_ingress_rule request -# The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + p result +end # [END appengine_v1_generated_Firewall_GetIngressRule_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/list_ingress_rules.rb b/google-cloud-app_engine-v1/snippets/firewall/list_ingress_rules.rb index e80506a8dc82..3eeff05b9420 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/list_ingress_rules.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/list_ingress_rules.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_Firewall_ListIngressRules_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#list_ingress_rules +# +def list_ingress_rules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListIngressRulesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListIngressRulesRequest.new -# Call the list_ingress_rules method. -result = client.list_ingress_rules request + # Call the list_ingress_rules method. + result = client.list_ingress_rules request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::FirewallRule. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::FirewallRule. + p response + end end # [END appengine_v1_generated_Firewall_ListIngressRules_sync] diff --git a/google-cloud-app_engine-v1/snippets/firewall/update_ingress_rule.rb b/google-cloud-app_engine-v1/snippets/firewall/update_ingress_rule.rb index 571f15e15108..85e6af6e238e 100755 --- a/google-cloud-app_engine-v1/snippets/firewall/update_ingress_rule.rb +++ b/google-cloud-app_engine-v1/snippets/firewall/update_ingress_rule.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Firewall_UpdateIngressRule_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Firewall::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Firewall::Client#update_ingress_rule +# +def update_ingress_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Firewall::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateIngressRuleRequest.new -# Call the update_ingress_rule method. -result = client.update_ingress_rule request + # Call the update_ingress_rule method. + result = client.update_ingress_rule request -# The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::FirewallRule. + p result +end # [END appengine_v1_generated_Firewall_UpdateIngressRule_sync] diff --git a/google-cloud-app_engine-v1/snippets/instances/debug_instance.rb b/google-cloud-app_engine-v1/snippets/instances/debug_instance.rb index 337eda6f316e..4c9f884af5ef 100755 --- a/google-cloud-app_engine-v1/snippets/instances/debug_instance.rb +++ b/google-cloud-app_engine-v1/snippets/instances/debug_instance.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Instances_DebugInstance_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Instances::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Instances::Client#debug_instance +# +def debug_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Instances::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DebugInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DebugInstanceRequest.new -# Call the debug_instance method. -result = client.debug_instance request + # Call the debug_instance method. + result = client.debug_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Instances_DebugInstance_sync] diff --git a/google-cloud-app_engine-v1/snippets/instances/delete_instance.rb b/google-cloud-app_engine-v1/snippets/instances/delete_instance.rb index 4b1a5af4fcd7..eac651c7bc1b 100755 --- a/google-cloud-app_engine-v1/snippets/instances/delete_instance.rb +++ b/google-cloud-app_engine-v1/snippets/instances/delete_instance.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Instances_DeleteInstance_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Instances::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Instances::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Instances::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Instances_DeleteInstance_sync] diff --git a/google-cloud-app_engine-v1/snippets/instances/get_instance.rb b/google-cloud-app_engine-v1/snippets/instances/get_instance.rb index ec713065023b..0ab07cfedfa9 100755 --- a/google-cloud-app_engine-v1/snippets/instances/get_instance.rb +++ b/google-cloud-app_engine-v1/snippets/instances/get_instance.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Instances_GetInstance_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Instances::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Instances::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Instances::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::AppEngine::V1::Instance. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::Instance. + p result +end # [END appengine_v1_generated_Instances_GetInstance_sync] diff --git a/google-cloud-app_engine-v1/snippets/instances/list_instances.rb b/google-cloud-app_engine-v1/snippets/instances/list_instances.rb index a75f917534f5..5f81a941669f 100755 --- a/google-cloud-app_engine-v1/snippets/instances/list_instances.rb +++ b/google-cloud-app_engine-v1/snippets/instances/list_instances.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_Instances_ListInstances_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Instances::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Instances::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Instances::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::Instance. + p response + end end # [END appengine_v1_generated_Instances_ListInstances_sync] diff --git a/google-cloud-app_engine-v1/snippets/services/delete_service.rb b/google-cloud-app_engine-v1/snippets/services/delete_service.rb index 0997e5585a89..97c6e8691039 100755 --- a/google-cloud-app_engine-v1/snippets/services/delete_service.rb +++ b/google-cloud-app_engine-v1/snippets/services/delete_service.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Services_DeleteService_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Services::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Services_DeleteService_sync] diff --git a/google-cloud-app_engine-v1/snippets/services/get_service.rb b/google-cloud-app_engine-v1/snippets/services/get_service.rb index 4da21d1960f0..b07b052ba953 100755 --- a/google-cloud-app_engine-v1/snippets/services/get_service.rb +++ b/google-cloud-app_engine-v1/snippets/services/get_service.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Services_GetService_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Services::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::AppEngine::V1::Service. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::Service. + p result +end # [END appengine_v1_generated_Services_GetService_sync] diff --git a/google-cloud-app_engine-v1/snippets/services/list_services.rb b/google-cloud-app_engine-v1/snippets/services/list_services.rb index e55cdce171d6..db3dbba16de5 100755 --- a/google-cloud-app_engine-v1/snippets/services/list_services.rb +++ b/google-cloud-app_engine-v1/snippets/services/list_services.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_Services_ListServices_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Services::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::Service. + p response + end end # [END appengine_v1_generated_Services_ListServices_sync] diff --git a/google-cloud-app_engine-v1/snippets/services/update_service.rb b/google-cloud-app_engine-v1/snippets/services/update_service.rb index b16b667f8669..b25cf7f031ad 100755 --- a/google-cloud-app_engine-v1/snippets/services/update_service.rb +++ b/google-cloud-app_engine-v1/snippets/services/update_service.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Services_UpdateService_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Services::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Services_UpdateService_sync] diff --git a/google-cloud-app_engine-v1/snippets/snippet_metadata_google.appengine.v1.json b/google-cloud-app_engine-v1/snippets/snippet_metadata_google.appengine.v1.json index 430bfc68d309..82d119717059 100644 --- a/google-cloud-app_engine-v1/snippets/snippet_metadata_google.appengine.v1.json +++ b/google-cloud-app_engine-v1/snippets/snippet_metadata_google.appengine.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-app_engine-v1/snippets/versions/create_version.rb b/google-cloud-app_engine-v1/snippets/versions/create_version.rb index df7700e3fa51..4079ad4f69a3 100755 --- a/google-cloud-app_engine-v1/snippets/versions/create_version.rb +++ b/google-cloud-app_engine-v1/snippets/versions/create_version.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Versions_CreateVersion_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Versions::Client#create_version +# +def create_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::CreateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::CreateVersionRequest.new -# Call the create_version method. -result = client.create_version request + # Call the create_version method. + result = client.create_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Versions_CreateVersion_sync] diff --git a/google-cloud-app_engine-v1/snippets/versions/delete_version.rb b/google-cloud-app_engine-v1/snippets/versions/delete_version.rb index d60d26af7425..9f11ec30fc11 100755 --- a/google-cloud-app_engine-v1/snippets/versions/delete_version.rb +++ b/google-cloud-app_engine-v1/snippets/versions/delete_version.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Versions_DeleteVersion_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Versions::Client#delete_version +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::DeleteVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::DeleteVersionRequest.new -# Call the delete_version method. -result = client.delete_version request + # Call the delete_version method. + result = client.delete_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Versions_DeleteVersion_sync] diff --git a/google-cloud-app_engine-v1/snippets/versions/get_version.rb b/google-cloud-app_engine-v1/snippets/versions/get_version.rb index 9e35bc52a05c..f336f3723f4f 100755 --- a/google-cloud-app_engine-v1/snippets/versions/get_version.rb +++ b/google-cloud-app_engine-v1/snippets/versions/get_version.rb @@ -19,15 +19,21 @@ # [START appengine_v1_generated_Versions_GetVersion_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Versions::Client#get_version +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::GetVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::GetVersionRequest.new -# Call the get_version method. -result = client.get_version request + # Call the get_version method. + result = client.get_version request -# The returned object is of type Google::Cloud::AppEngine::V1::Version. -p result + # The returned object is of type Google::Cloud::AppEngine::V1::Version. + p result +end # [END appengine_v1_generated_Versions_GetVersion_sync] diff --git a/google-cloud-app_engine-v1/snippets/versions/list_versions.rb b/google-cloud-app_engine-v1/snippets/versions/list_versions.rb index bcf2183306d9..aedb4fdf9551 100755 --- a/google-cloud-app_engine-v1/snippets/versions/list_versions.rb +++ b/google-cloud-app_engine-v1/snippets/versions/list_versions.rb @@ -19,21 +19,27 @@ # [START appengine_v1_generated_Versions_ListVersions_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Versions::Client#list_versions +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::ListVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::ListVersionsRequest.new -# Call the list_versions method. -result = client.list_versions request + # Call the list_versions method. + result = client.list_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AppEngine::V1::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AppEngine::V1::Version. + p response + end end # [END appengine_v1_generated_Versions_ListVersions_sync] diff --git a/google-cloud-app_engine-v1/snippets/versions/update_version.rb b/google-cloud-app_engine-v1/snippets/versions/update_version.rb index 073385e0edba..4ad9a3b24d97 100755 --- a/google-cloud-app_engine-v1/snippets/versions/update_version.rb +++ b/google-cloud-app_engine-v1/snippets/versions/update_version.rb @@ -19,22 +19,28 @@ # [START appengine_v1_generated_Versions_UpdateVersion_sync] require "google/cloud/app_engine/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AppEngine::V1::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AppEngine::V1::Versions::Client#update_version +# +def update_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AppEngine::V1::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AppEngine::V1::UpdateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AppEngine::V1::UpdateVersionRequest.new -# Call the update_version method. -result = client.update_version request + # Call the update_version method. + result = client.update_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END appengine_v1_generated_Versions_UpdateVersion_sync] diff --git a/google-cloud-artifact_registry-v1/.rubocop.yml b/google-cloud-artifact_registry-v1/.rubocop.yml index 71d7705ca29b..de96e2618870 100644 --- a/google-cloud-artifact_registry-v1/.rubocop.yml +++ b/google-cloud-artifact_registry-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-artifact_registry-v1.rb" diff --git a/google-cloud-artifact_registry-v1/snippets/Gemfile b/google-cloud-artifact_registry-v1/snippets/Gemfile index 2012716abd12..16de8325a6f7 100755 --- a/google-cloud-artifact_registry-v1/snippets/Gemfile +++ b/google-cloud-artifact_registry-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_repository.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_repository.rb index 702e65995b71..f4e219dd6613 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_repository.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_repository.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#create_repository +# +def create_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::CreateRepositoryRequest.new -# Call the create_repository method. -result = client.create_repository request + # Call the create_repository method. + result = client.create_repository request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_CreateRepository_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_tag.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_tag.rb index ac50e289ec1c..0e8652691db2 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_tag.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/create_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_CreateTag_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#create_tag +# +def create_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::CreateTagRequest.new -# Call the create_tag method. -result = client.create_tag request + # Call the create_tag method. + result = client.create_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_CreateTag_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_package.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_package.rb index b9adb8c93e00..4dd5afb4bed2 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_package.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_package.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#delete_package +# +def delete_package + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::DeletePackageRequest.new -# Call the delete_package method. -result = client.delete_package request + # Call the delete_package method. + result = client.delete_package request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_DeletePackage_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_repository.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_repository.rb index 9a2a07272daf..e762523cdf73 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_repository.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_repository.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#delete_repository +# +def delete_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::DeleteRepositoryRequest.new -# Call the delete_repository method. -result = client.delete_repository request + # Call the delete_repository method. + result = client.delete_repository request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_DeleteRepository_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_tag.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_tag.rb index 84037ad71d4d..f6aaddbf232e 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_tag.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_DeleteTag_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#delete_tag +# +def delete_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::DeleteTagRequest.new -# Call the delete_tag method. -result = client.delete_tag request + # Call the delete_tag method. + result = client.delete_tag request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_DeleteTag_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_version.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_version.rb index 2649bbb3be86..1788883941e2 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_version.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/delete_version.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#delete_version +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::DeleteVersionRequest.new -# Call the delete_version method. -result = client.delete_version request + # Call the delete_version method. + result = client.delete_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_DeleteVersion_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_docker_image.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_docker_image.rb index 0e6a9a6e1959..8d3c63a32e68 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_docker_image.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_docker_image.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetDockerImage_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_docker_image +# +def get_docker_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetDockerImageRequest.new -# Call the get_docker_image method. -result = client.get_docker_image request + # Call the get_docker_image method. + result = client.get_docker_image request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::DockerImage. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetDockerImage_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_file.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_file.rb index e87563c1061b..688cc5b8cef4 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_file.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_file.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetFile_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_file +# +def get_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetFileRequest.new -# Call the get_file method. -result = client.get_file request + # Call the get_file method. + result = client.get_file request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::File. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::File. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetFile_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_iam_policy.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_iam_policy.rb index 62193a5eedf1..bd1bc68c85d9 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_iam_policy.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetIamPolicy_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetIamPolicy_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_package.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_package.rb index c9517469c41a..638931850ef5 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_package.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_package.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetPackage_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_package +# +def get_package + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetPackageRequest.new -# Call the get_package method. -result = client.get_package request + # Call the get_package method. + result = client.get_package request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Package. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetPackage_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_project_settings.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_project_settings.rb index e5e55b5764fc..e7bf7ab8a953 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_project_settings.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_project_settings.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetProjectSettings_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_project_settings +# +def get_project_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetProjectSettingsRequest.new -# Call the get_project_settings method. -result = client.get_project_settings request + # Call the get_project_settings method. + result = client.get_project_settings request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetProjectSettings_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_repository.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_repository.rb index 2f9893ea192b..3dcb8bcd2bbc 100755 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_repository.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_repository.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetRepository_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_repository +# +def get_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetRepositoryRequest.new -# Call the get_repository method. -result = client.get_repository request + # Call the get_repository method. + result = client.get_repository request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetRepository_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_tag.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_tag.rb index 751027275b4a..4cc53e96ca72 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_tag.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetTag_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_tag +# +def get_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetTagRequest.new -# Call the get_tag method. -result = client.get_tag request + # Call the get_tag method. + result = client.get_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetTag_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_version.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_version.rb index 105c5bd3edc4..4d2bbba962c4 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_version.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/get_version.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_GetVersion_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#get_version +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::GetVersionRequest.new -# Call the get_version method. -result = client.get_version request + # Call the get_version method. + result = client.get_version request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Version. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_GetVersion_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_apt_artifacts.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_apt_artifacts.rb index 0c48fa4b91cb..1e61ca2d9426 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_apt_artifacts.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_apt_artifacts.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#import_apt_artifacts +# +def import_apt_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ImportAptArtifactsRequest.new -# Call the import_apt_artifacts method. -result = client.import_apt_artifacts request + # Call the import_apt_artifacts method. + result = client.import_apt_artifacts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ImportAptArtifacts_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_yum_artifacts.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_yum_artifacts.rb index fdf0968d4190..0fae8236b147 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_yum_artifacts.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/import_yum_artifacts.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#import_yum_artifacts +# +def import_yum_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ImportYumArtifactsRequest.new -# Call the import_yum_artifacts method. -result = client.import_yum_artifacts request + # Call the import_yum_artifacts method. + result = client.import_yum_artifacts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ImportYumArtifacts_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_docker_images.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_docker_images.rb index 65291b2a32e8..d8451d5be059 100755 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_docker_images.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_docker_images.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_docker_images +# +def list_docker_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListDockerImagesRequest.new -# Call the list_docker_images method. -result = client.list_docker_images request + # Call the list_docker_images method. + result = client.list_docker_images request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::DockerImage. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListDockerImages_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_files.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_files.rb index 4521329c7021..d97c4aab6d7d 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_files.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_files.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListFiles_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_files +# +def list_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListFilesRequest.new -# Call the list_files method. -result = client.list_files request + # Call the list_files method. + result = client.list_files request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::File. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListFiles_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_packages.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_packages.rb index 18772ea6d36d..df225854cae0 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_packages.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_packages.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListPackages_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_packages +# +def list_packages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListPackagesRequest.new -# Call the list_packages method. -result = client.list_packages request + # Call the list_packages method. + result = client.list_packages request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Package. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListPackages_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_repositories.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_repositories.rb index f7c7d4f4c0d8..1d4f5f80ea29 100755 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_repositories.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_repositories.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_repositories +# +def list_repositories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListRepositoriesRequest.new -# Call the list_repositories method. -result = client.list_repositories request + # Call the list_repositories method. + result = client.list_repositories request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Repository. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListRepositories_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_tags.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_tags.rb index 7bf075e8cd73..6152ac6de612 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_tags.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_tags.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListTags_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_tags +# +def list_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListTagsRequest.new -# Call the list_tags method. -result = client.list_tags request + # Call the list_tags method. + result = client.list_tags request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Tag. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListTags_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_versions.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_versions.rb index 966f9e9cc375..2385ab42028b 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_versions.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/list_versions.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_ListVersions_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#list_versions +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::ListVersionsRequest.new -# Call the list_versions method. -result = client.list_versions request + # Call the list_versions method. + result = client.list_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1::Version. + p response + end end # [END artifactregistry_v1_generated_ArtifactRegistry_ListVersions_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/set_iam_policy.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/set_iam_policy.rb index 937a86b69ded..07f4b35084e9 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/set_iam_policy.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_SetIamPolicy_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_SetIamPolicy_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/test_iam_permissions.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/test_iam_permissions.rb index 5056c321a492..dbc8eb34d2f1 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/test_iam_permissions.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_TestIamPermissions_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_TestIamPermissions_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_project_settings.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_project_settings.rb index 09e08535b434..68a19c66ce1e 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_project_settings.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_project_settings.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_UpdateProjectSettings_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#update_project_settings +# +def update_project_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::UpdateProjectSettingsRequest.new -# Call the update_project_settings method. -result = client.update_project_settings request + # Call the update_project_settings method. + result = client.update_project_settings request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::ProjectSettings. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_UpdateProjectSettings_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_repository.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_repository.rb index 0664547db305..270ad34ec5ec 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_repository.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_repository.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_UpdateRepository_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#update_repository +# +def update_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::UpdateRepositoryRequest.new -# Call the update_repository method. -result = client.update_repository request + # Call the update_repository method. + result = client.update_repository request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Repository. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_UpdateRepository_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_tag.rb b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_tag.rb index 26cbb4c92747..a80b0c9fab3a 100644 --- a/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_tag.rb +++ b/google-cloud-artifact_registry-v1/snippets/artifact_registry/update_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1_generated_ArtifactRegistry_UpdateTag_sync] require "google/cloud/artifact_registry/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client#update_tag +# +def update_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1::UpdateTagRequest.new -# Call the update_tag method. -result = client.update_tag request + # Call the update_tag method. + result = client.update_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1::Tag. + p result +end # [END artifactregistry_v1_generated_ArtifactRegistry_UpdateTag_sync] diff --git a/google-cloud-artifact_registry-v1/snippets/snippet_metadata_google.devtools.artifactregistry.v1.json b/google-cloud-artifact_registry-v1/snippets/snippet_metadata_google.devtools.artifactregistry.v1.json index c4a29e0f4c17..3878e9fad66c 100644 --- a/google-cloud-artifact_registry-v1/snippets/snippet_metadata_google.devtools.artifactregistry.v1.json +++ b/google-cloud-artifact_registry-v1/snippets/snippet_metadata_google.devtools.artifactregistry.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-artifact_registry-v1beta2/.rubocop.yml b/google-cloud-artifact_registry-v1beta2/.rubocop.yml index 880434f6c3cb..6d12e8a99a67 100644 --- a/google-cloud-artifact_registry-v1beta2/.rubocop.yml +++ b/google-cloud-artifact_registry-v1beta2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-artifact_registry-v1beta2.rb" diff --git a/google-cloud-artifact_registry-v1beta2/snippets/Gemfile b/google-cloud-artifact_registry-v1beta2/snippets/Gemfile index 879eb5ce46da..d1bbb880b275 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/Gemfile +++ b/google-cloud-artifact_registry-v1beta2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_repository.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_repository.rb index 260c7ef8680f..5d10045b4a0c 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_repository.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_repository.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_CreateRepository_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#create_repository +# +def create_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::CreateRepositoryRequest.new -# Call the create_repository method. -result = client.create_repository request + # Call the create_repository method. + result = client.create_repository request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_CreateRepository_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_tag.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_tag.rb index 8da6588bcbd1..892b13480157 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_tag.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/create_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_CreateTag_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#create_tag +# +def create_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::CreateTagRequest.new -# Call the create_tag method. -result = client.create_tag request + # Call the create_tag method. + result = client.create_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_CreateTag_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_package.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_package.rb index 8faf58db6246..d30c48618cb8 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_package.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_package.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_DeletePackage_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#delete_package +# +def delete_package + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::DeletePackageRequest.new -# Call the delete_package method. -result = client.delete_package request + # Call the delete_package method. + result = client.delete_package request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_DeletePackage_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_repository.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_repository.rb index bc2d8b47c24d..5dec2cce3691 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_repository.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_repository.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteRepository_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#delete_repository +# +def delete_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteRepositoryRequest.new -# Call the delete_repository method. -result = client.delete_repository request + # Call the delete_repository method. + result = client.delete_repository request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteRepository_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_tag.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_tag.rb index c5fb4463fec1..08c5f7407b27 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_tag.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteTag_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#delete_tag +# +def delete_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteTagRequest.new -# Call the delete_tag method. -result = client.delete_tag request + # Call the delete_tag method. + result = client.delete_tag request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteTag_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_version.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_version.rb index df5278cdf8ef..3f5a3535dcad 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_version.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/delete_version.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteVersion_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#delete_version +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::DeleteVersionRequest.new -# Call the delete_version method. -result = client.delete_version request + # Call the delete_version method. + result = client.delete_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_DeleteVersion_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_file.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_file.rb index 672848bf1576..7da72c651aed 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_file.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_file.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetFile_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_file +# +def get_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetFileRequest.new -# Call the get_file method. -result = client.get_file request + # Call the get_file method. + result = client.get_file request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::File. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::File. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetFile_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_iam_policy.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_iam_policy.rb index 2ac02b04ca70..9dc1fb595201 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_iam_policy.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetIamPolicy_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetIamPolicy_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_package.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_package.rb index 29166c66e626..2cd2fb0399ff 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_package.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_package.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetPackage_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_package +# +def get_package + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetPackageRequest.new -# Call the get_package method. -result = client.get_package request + # Call the get_package method. + result = client.get_package request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Package. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Package. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetPackage_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_project_settings.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_project_settings.rb index d8196d442c22..319128a6c457 100644 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_project_settings.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_project_settings.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetProjectSettings_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_project_settings +# +def get_project_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetProjectSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetProjectSettingsRequest.new -# Call the get_project_settings method. -result = client.get_project_settings request + # Call the get_project_settings method. + result = client.get_project_settings request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetProjectSettings_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_repository.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_repository.rb index 5e1c06ea677b..cbbc50a570eb 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_repository.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_repository.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetRepository_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_repository +# +def get_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetRepositoryRequest.new -# Call the get_repository method. -result = client.get_repository request + # Call the get_repository method. + result = client.get_repository request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetRepository_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_tag.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_tag.rb index 42f5dcc51e97..0813290e7fde 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_tag.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetTag_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_tag +# +def get_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetTagRequest.new -# Call the get_tag method. -result = client.get_tag request + # Call the get_tag method. + result = client.get_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetTag_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_version.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_version.rb index c8c52252bd8b..aaf894ed3c3a 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_version.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/get_version.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_GetVersion_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#get_version +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::GetVersionRequest.new -# Call the get_version method. -result = client.get_version request + # Call the get_version method. + result = client.get_version request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Version. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Version. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_GetVersion_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_apt_artifacts.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_apt_artifacts.rb index 1808d6771e71..744a7f38fd61 100644 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_apt_artifacts.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_apt_artifacts.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ImportAptArtifacts_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#import_apt_artifacts +# +def import_apt_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ImportAptArtifactsRequest.new -# Call the import_apt_artifacts method. -result = client.import_apt_artifacts request + # Call the import_apt_artifacts method. + result = client.import_apt_artifacts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ImportAptArtifacts_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_yum_artifacts.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_yum_artifacts.rb index 41c99402e529..fee7a698ab49 100644 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_yum_artifacts.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/import_yum_artifacts.rb @@ -19,22 +19,28 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ImportYumArtifacts_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#import_yum_artifacts +# +def import_yum_artifacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ImportYumArtifactsRequest.new -# Call the import_yum_artifacts method. -result = client.import_yum_artifacts request + # Call the import_yum_artifacts method. + result = client.import_yum_artifacts request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ImportYumArtifacts_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_files.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_files.rb index 89b1894c83cd..c461a8d022e5 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_files.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_files.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ListFiles_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#list_files +# +def list_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ListFilesRequest.new -# Call the list_files method. -result = client.list_files request + # Call the list_files method. + result = client.list_files request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::File. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::File. + p response + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ListFiles_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_packages.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_packages.rb index 336bc9df4b43..18de4b43b8d4 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_packages.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_packages.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ListPackages_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#list_packages +# +def list_packages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ListPackagesRequest.new -# Call the list_packages method. -result = client.list_packages request + # Call the list_packages method. + result = client.list_packages request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Package. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Package. + p response + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ListPackages_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_repositories.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_repositories.rb index 2c968a34e596..5aeba991270d 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_repositories.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_repositories.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ListRepositories_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#list_repositories +# +def list_repositories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ListRepositoriesRequest.new -# Call the list_repositories method. -result = client.list_repositories request + # Call the list_repositories method. + result = client.list_repositories request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Repository. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Repository. + p response + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ListRepositories_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_tags.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_tags.rb index 9ecd4de8a4aa..68612a22cd42 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_tags.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_tags.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ListTags_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#list_tags +# +def list_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ListTagsRequest.new -# Call the list_tags method. -result = client.list_tags request + # Call the list_tags method. + result = client.list_tags request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Tag. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Tag. + p response + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ListTags_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_versions.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_versions.rb index b6c029c51118..81b35f0d2b53 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_versions.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/list_versions.rb @@ -19,21 +19,27 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_ListVersions_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#list_versions +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::ListVersionsRequest.new -# Call the list_versions method. -result = client.list_versions request + # Call the list_versions method. + result = client.list_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ArtifactRegistry::V1beta2::Version. + p response + end end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_ListVersions_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/set_iam_policy.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/set_iam_policy.rb index 04115b6b962b..2242325d59f2 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/set_iam_policy.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_SetIamPolicy_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_SetIamPolicy_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/test_iam_permissions.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/test_iam_permissions.rb index 1d07b8a7cc84..535d17fdd8b9 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/test_iam_permissions.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_TestIamPermissions_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_TestIamPermissions_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_project_settings.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_project_settings.rb index 54f784ee93aa..0e71938cb9f8 100644 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_project_settings.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_project_settings.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateProjectSettings_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#update_project_settings +# +def update_project_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateProjectSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateProjectSettingsRequest.new -# Call the update_project_settings method. -result = client.update_project_settings request + # Call the update_project_settings method. + result = client.update_project_settings request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::ProjectSettings. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateProjectSettings_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_repository.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_repository.rb index 266d13316b6b..f0987c100fef 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_repository.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_repository.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateRepository_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#update_repository +# +def update_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateRepositoryRequest.new -# Call the update_repository method. -result = client.update_repository request + # Call the update_repository method. + result = client.update_repository request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Repository. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateRepository_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_tag.rb b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_tag.rb index 8504cf71bab0..24016ef1bb9b 100755 --- a/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_tag.rb +++ b/google-cloud-artifact_registry-v1beta2/snippets/artifact_registry/update_tag.rb @@ -19,15 +19,21 @@ # [START artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateTag_sync] require "google/cloud/artifact_registry/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client#update_tag +# +def update_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ArtifactRegistry::V1beta2::ArtifactRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ArtifactRegistry::V1beta2::UpdateTagRequest.new -# Call the update_tag method. -result = client.update_tag request + # Call the update_tag method. + result = client.update_tag request -# The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. -p result + # The returned object is of type Google::Cloud::ArtifactRegistry::V1beta2::Tag. + p result +end # [END artifactregistry_v1beta2_generated_ArtifactRegistry_UpdateTag_sync] diff --git a/google-cloud-artifact_registry-v1beta2/snippets/snippet_metadata_google.devtools.artifactregistry.v1beta2.json b/google-cloud-artifact_registry-v1beta2/snippets/snippet_metadata_google.devtools.artifactregistry.v1beta2.json index ed46f073ea8a..074ad4a716c5 100644 --- a/google-cloud-artifact_registry-v1beta2/snippets/snippet_metadata_google.devtools.artifactregistry.v1beta2.json +++ b/google-cloud-artifact_registry-v1beta2/snippets/snippet_metadata_google.devtools.artifactregistry.v1beta2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-asset-v1/.repo-metadata.json b/google-cloud-asset-v1/.repo-metadata.json index 4c3a92aec3e4..4095a08bf944 100644 --- a/google-cloud-asset-v1/.repo-metadata.json +++ b/google-cloud-asset-v1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "A metadata inventory service that allows you to view, monitor, and analyze all your GCP and Anthos assets across projects and services. Note that google-cloud-asset-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-asset instead. See the readme for more details.", "ruby-cloud-env-prefix": "ASSET", "ruby-cloud-product-url": "https://cloud.google.com/asset-inventory/", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-asset-v1/.rubocop.yml b/google-cloud-asset-v1/.rubocop.yml index 80db9c9b7cfe..bc19046e2ec5 100644 --- a/google-cloud-asset-v1/.rubocop.yml +++ b/google-cloud-asset-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-asset-v1.rb" diff --git a/google-cloud-asset-v1/snippets/Gemfile b/google-cloud-asset-v1/snippets/Gemfile index b971bf06bded..24a7683a8e25 100755 --- a/google-cloud-asset-v1/snippets/Gemfile +++ b/google-cloud-asset-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy.rb b/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy.rb index 43a5ba10545c..e872cb1715d0 100755 --- a/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy.rb +++ b/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy +# +def analyze_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::AnalyzeIamPolicyRequest.new -# Call the analyze_iam_policy method. -result = client.analyze_iam_policy request + # Call the analyze_iam_policy method. + result = client.analyze_iam_policy request -# The returned object is of type Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::AnalyzeIamPolicyResponse. + p result +end # [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicy_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy_longrunning.rb b/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy_longrunning.rb index b6f22790d4b2..015a67a4fd40 100755 --- a/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy_longrunning.rb +++ b/google-cloud-asset-v1/snippets/asset_service/analyze_iam_policy_longrunning.rb @@ -19,22 +19,28 @@ # [START cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#analyze_iam_policy_longrunning +# +def analyze_iam_policy_longrunning + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::AnalyzeIamPolicyLongrunningRequest.new -# Call the analyze_iam_policy_longrunning method. -result = client.analyze_iam_policy_longrunning request + # Call the analyze_iam_policy_longrunning method. + result = client.analyze_iam_policy_longrunning request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudasset_v1_generated_AssetService_AnalyzeIamPolicyLongrunning_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/analyze_move.rb b/google-cloud-asset-v1/snippets/asset_service/analyze_move.rb index 1fe0235ba649..315c22c0e7e7 100755 --- a/google-cloud-asset-v1/snippets/asset_service/analyze_move.rb +++ b/google-cloud-asset-v1/snippets/asset_service/analyze_move.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_AnalyzeMove_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#analyze_move +# +def analyze_move + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::AnalyzeMoveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::AnalyzeMoveRequest.new -# Call the analyze_move method. -result = client.analyze_move request + # Call the analyze_move method. + result = client.analyze_move request -# The returned object is of type Google::Cloud::Asset::V1::AnalyzeMoveResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::AnalyzeMoveResponse. + p result +end # [END cloudasset_v1_generated_AssetService_AnalyzeMove_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/batch_get_assets_history.rb b/google-cloud-asset-v1/snippets/asset_service/batch_get_assets_history.rb index 618685fab139..8ab851ce9cf8 100755 --- a/google-cloud-asset-v1/snippets/asset_service/batch_get_assets_history.rb +++ b/google-cloud-asset-v1/snippets/asset_service/batch_get_assets_history.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#batch_get_assets_history +# +def batch_get_assets_history + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::BatchGetAssetsHistoryRequest.new -# Call the batch_get_assets_history method. -result = client.batch_get_assets_history request + # Call the batch_get_assets_history method. + result = client.batch_get_assets_history request -# The returned object is of type Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::BatchGetAssetsHistoryResponse. + p result +end # [END cloudasset_v1_generated_AssetService_BatchGetAssetsHistory_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/batch_get_effective_iam_policies.rb b/google-cloud-asset-v1/snippets/asset_service/batch_get_effective_iam_policies.rb index 4e15527f076b..b4e2774fecee 100644 --- a/google-cloud-asset-v1/snippets/asset_service/batch_get_effective_iam_policies.rb +++ b/google-cloud-asset-v1/snippets/asset_service/batch_get_effective_iam_policies.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#batch_get_effective_iam_policies +# +def batch_get_effective_iam_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesRequest.new -# Call the batch_get_effective_iam_policies method. -result = client.batch_get_effective_iam_policies request + # Call the batch_get_effective_iam_policies method. + result = client.batch_get_effective_iam_policies request -# The returned object is of type Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::BatchGetEffectiveIamPoliciesResponse. + p result +end # [END cloudasset_v1_generated_AssetService_BatchGetEffectiveIamPolicies_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/create_feed.rb b/google-cloud-asset-v1/snippets/asset_service/create_feed.rb index b719a93f7a00..e08de8730130 100755 --- a/google-cloud-asset-v1/snippets/asset_service/create_feed.rb +++ b/google-cloud-asset-v1/snippets/asset_service/create_feed.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_CreateFeed_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#create_feed +# +def create_feed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::CreateFeedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::CreateFeedRequest.new -# Call the create_feed method. -result = client.create_feed request + # Call the create_feed method. + result = client.create_feed request -# The returned object is of type Google::Cloud::Asset::V1::Feed. -p result + # The returned object is of type Google::Cloud::Asset::V1::Feed. + p result +end # [END cloudasset_v1_generated_AssetService_CreateFeed_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/create_saved_query.rb b/google-cloud-asset-v1/snippets/asset_service/create_saved_query.rb index 5d33b459a6d0..8e022c4c41f4 100644 --- a/google-cloud-asset-v1/snippets/asset_service/create_saved_query.rb +++ b/google-cloud-asset-v1/snippets/asset_service/create_saved_query.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#create_saved_query +# +def create_saved_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::CreateSavedQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::CreateSavedQueryRequest.new -# Call the create_saved_query method. -result = client.create_saved_query request + # Call the create_saved_query method. + result = client.create_saved_query request -# The returned object is of type Google::Cloud::Asset::V1::SavedQuery. -p result + # The returned object is of type Google::Cloud::Asset::V1::SavedQuery. + p result +end # [END cloudasset_v1_generated_AssetService_CreateSavedQuery_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/delete_feed.rb b/google-cloud-asset-v1/snippets/asset_service/delete_feed.rb index 99e7840287b1..3524749f0277 100755 --- a/google-cloud-asset-v1/snippets/asset_service/delete_feed.rb +++ b/google-cloud-asset-v1/snippets/asset_service/delete_feed.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_DeleteFeed_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#delete_feed +# +def delete_feed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::DeleteFeedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::DeleteFeedRequest.new -# Call the delete_feed method. -result = client.delete_feed request + # Call the delete_feed method. + result = client.delete_feed request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudasset_v1_generated_AssetService_DeleteFeed_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/delete_saved_query.rb b/google-cloud-asset-v1/snippets/asset_service/delete_saved_query.rb index 0e08894978f3..8826018a4983 100644 --- a/google-cloud-asset-v1/snippets/asset_service/delete_saved_query.rb +++ b/google-cloud-asset-v1/snippets/asset_service/delete_saved_query.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#delete_saved_query +# +def delete_saved_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::DeleteSavedQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::DeleteSavedQueryRequest.new -# Call the delete_saved_query method. -result = client.delete_saved_query request + # Call the delete_saved_query method. + result = client.delete_saved_query request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudasset_v1_generated_AssetService_DeleteSavedQuery_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/export_assets.rb b/google-cloud-asset-v1/snippets/asset_service/export_assets.rb index cd495ed63a3a..6b62886df80b 100755 --- a/google-cloud-asset-v1/snippets/asset_service/export_assets.rb +++ b/google-cloud-asset-v1/snippets/asset_service/export_assets.rb @@ -19,22 +19,28 @@ # [START cloudasset_v1_generated_AssetService_ExportAssets_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#export_assets +# +def export_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::ExportAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::ExportAssetsRequest.new -# Call the export_assets method. -result = client.export_assets request + # Call the export_assets method. + result = client.export_assets request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudasset_v1_generated_AssetService_ExportAssets_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/get_feed.rb b/google-cloud-asset-v1/snippets/asset_service/get_feed.rb index cb3627b7fcc3..33d81c899e59 100755 --- a/google-cloud-asset-v1/snippets/asset_service/get_feed.rb +++ b/google-cloud-asset-v1/snippets/asset_service/get_feed.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_GetFeed_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#get_feed +# +def get_feed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::GetFeedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::GetFeedRequest.new -# Call the get_feed method. -result = client.get_feed request + # Call the get_feed method. + result = client.get_feed request -# The returned object is of type Google::Cloud::Asset::V1::Feed. -p result + # The returned object is of type Google::Cloud::Asset::V1::Feed. + p result +end # [END cloudasset_v1_generated_AssetService_GetFeed_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/get_saved_query.rb b/google-cloud-asset-v1/snippets/asset_service/get_saved_query.rb index 799b16474d8c..48f6235ded2f 100644 --- a/google-cloud-asset-v1/snippets/asset_service/get_saved_query.rb +++ b/google-cloud-asset-v1/snippets/asset_service/get_saved_query.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_GetSavedQuery_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#get_saved_query +# +def get_saved_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::GetSavedQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::GetSavedQueryRequest.new -# Call the get_saved_query method. -result = client.get_saved_query request + # Call the get_saved_query method. + result = client.get_saved_query request -# The returned object is of type Google::Cloud::Asset::V1::SavedQuery. -p result + # The returned object is of type Google::Cloud::Asset::V1::SavedQuery. + p result +end # [END cloudasset_v1_generated_AssetService_GetSavedQuery_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/list_assets.rb b/google-cloud-asset-v1/snippets/asset_service/list_assets.rb index 59d9b443aa5b..92df41a48897 100755 --- a/google-cloud-asset-v1/snippets/asset_service/list_assets.rb +++ b/google-cloud-asset-v1/snippets/asset_service/list_assets.rb @@ -19,21 +19,27 @@ # [START cloudasset_v1_generated_AssetService_ListAssets_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#list_assets +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::ListAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::ListAssetsRequest.new -# Call the list_assets method. -result = client.list_assets request + # Call the list_assets method. + result = client.list_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Asset::V1::Asset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Asset::V1::Asset. + p response + end end # [END cloudasset_v1_generated_AssetService_ListAssets_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/list_feeds.rb b/google-cloud-asset-v1/snippets/asset_service/list_feeds.rb index 333113b4701e..60f6be865329 100755 --- a/google-cloud-asset-v1/snippets/asset_service/list_feeds.rb +++ b/google-cloud-asset-v1/snippets/asset_service/list_feeds.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_ListFeeds_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#list_feeds +# +def list_feeds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::ListFeedsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::ListFeedsRequest.new -# Call the list_feeds method. -result = client.list_feeds request + # Call the list_feeds method. + result = client.list_feeds request -# The returned object is of type Google::Cloud::Asset::V1::ListFeedsResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::ListFeedsResponse. + p result +end # [END cloudasset_v1_generated_AssetService_ListFeeds_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/list_saved_queries.rb b/google-cloud-asset-v1/snippets/asset_service/list_saved_queries.rb index 6b79c91b2963..62e6e74df1ce 100644 --- a/google-cloud-asset-v1/snippets/asset_service/list_saved_queries.rb +++ b/google-cloud-asset-v1/snippets/asset_service/list_saved_queries.rb @@ -19,21 +19,27 @@ # [START cloudasset_v1_generated_AssetService_ListSavedQueries_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#list_saved_queries +# +def list_saved_queries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::ListSavedQueriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::ListSavedQueriesRequest.new -# Call the list_saved_queries method. -result = client.list_saved_queries request + # Call the list_saved_queries method. + result = client.list_saved_queries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Asset::V1::SavedQuery. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Asset::V1::SavedQuery. + p response + end end # [END cloudasset_v1_generated_AssetService_ListSavedQueries_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/query_assets.rb b/google-cloud-asset-v1/snippets/asset_service/query_assets.rb index effd13649b1d..f51ae19ad953 100644 --- a/google-cloud-asset-v1/snippets/asset_service/query_assets.rb +++ b/google-cloud-asset-v1/snippets/asset_service/query_assets.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_QueryAssets_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#query_assets +# +def query_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::QueryAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::QueryAssetsRequest.new -# Call the query_assets method. -result = client.query_assets request + # Call the query_assets method. + result = client.query_assets request -# The returned object is of type Google::Cloud::Asset::V1::QueryAssetsResponse. -p result + # The returned object is of type Google::Cloud::Asset::V1::QueryAssetsResponse. + p result +end # [END cloudasset_v1_generated_AssetService_QueryAssets_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/search_all_iam_policies.rb b/google-cloud-asset-v1/snippets/asset_service/search_all_iam_policies.rb index 1323d439c478..976dab631dea 100755 --- a/google-cloud-asset-v1/snippets/asset_service/search_all_iam_policies.rb +++ b/google-cloud-asset-v1/snippets/asset_service/search_all_iam_policies.rb @@ -19,21 +19,27 @@ # [START cloudasset_v1_generated_AssetService_SearchAllIamPolicies_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#search_all_iam_policies +# +def search_all_iam_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::SearchAllIamPoliciesRequest.new -# Call the search_all_iam_policies method. -result = client.search_all_iam_policies request + # Call the search_all_iam_policies method. + result = client.search_all_iam_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Asset::V1::IamPolicySearchResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Asset::V1::IamPolicySearchResult. + p response + end end # [END cloudasset_v1_generated_AssetService_SearchAllIamPolicies_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/search_all_resources.rb b/google-cloud-asset-v1/snippets/asset_service/search_all_resources.rb index beca714aebef..f3056d85f098 100755 --- a/google-cloud-asset-v1/snippets/asset_service/search_all_resources.rb +++ b/google-cloud-asset-v1/snippets/asset_service/search_all_resources.rb @@ -19,21 +19,27 @@ # [START cloudasset_v1_generated_AssetService_SearchAllResources_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#search_all_resources +# +def search_all_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::SearchAllResourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::SearchAllResourcesRequest.new -# Call the search_all_resources method. -result = client.search_all_resources request + # Call the search_all_resources method. + result = client.search_all_resources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Asset::V1::ResourceSearchResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Asset::V1::ResourceSearchResult. + p response + end end # [END cloudasset_v1_generated_AssetService_SearchAllResources_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/update_feed.rb b/google-cloud-asset-v1/snippets/asset_service/update_feed.rb index 026e34458742..4807efed9bfe 100755 --- a/google-cloud-asset-v1/snippets/asset_service/update_feed.rb +++ b/google-cloud-asset-v1/snippets/asset_service/update_feed.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_UpdateFeed_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#update_feed +# +def update_feed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::UpdateFeedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::UpdateFeedRequest.new -# Call the update_feed method. -result = client.update_feed request + # Call the update_feed method. + result = client.update_feed request -# The returned object is of type Google::Cloud::Asset::V1::Feed. -p result + # The returned object is of type Google::Cloud::Asset::V1::Feed. + p result +end # [END cloudasset_v1_generated_AssetService_UpdateFeed_sync] diff --git a/google-cloud-asset-v1/snippets/asset_service/update_saved_query.rb b/google-cloud-asset-v1/snippets/asset_service/update_saved_query.rb index 5bd8df6cd678..ea056e6a7077 100644 --- a/google-cloud-asset-v1/snippets/asset_service/update_saved_query.rb +++ b/google-cloud-asset-v1/snippets/asset_service/update_saved_query.rb @@ -19,15 +19,21 @@ # [START cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] require "google/cloud/asset/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Asset::V1::AssetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Asset::V1::AssetService::Client#update_saved_query +# +def update_saved_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Asset::V1::AssetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Asset::V1::UpdateSavedQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Asset::V1::UpdateSavedQueryRequest.new -# Call the update_saved_query method. -result = client.update_saved_query request + # Call the update_saved_query method. + result = client.update_saved_query request -# The returned object is of type Google::Cloud::Asset::V1::SavedQuery. -p result + # The returned object is of type Google::Cloud::Asset::V1::SavedQuery. + p result +end # [END cloudasset_v1_generated_AssetService_UpdateSavedQuery_sync] diff --git a/google-cloud-asset-v1/snippets/snippet_metadata_google.cloud.asset.v1.json b/google-cloud-asset-v1/snippets/snippet_metadata_google.cloud.asset.v1.json index 1a29c40b08d1..5b3b87291923 100644 --- a/google-cloud-asset-v1/snippets/snippet_metadata_google.cloud.asset.v1.json +++ b/google-cloud-asset-v1/snippets/snippet_metadata_google.cloud.asset.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-assured_workloads-v1/.rubocop.yml b/google-cloud-assured_workloads-v1/.rubocop.yml index e9787b1f8a12..1a84e3a85a74 100644 --- a/google-cloud-assured_workloads-v1/.rubocop.yml +++ b/google-cloud-assured_workloads-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-assured_workloads-v1.rb" diff --git a/google-cloud-assured_workloads-v1/snippets/Gemfile b/google-cloud-assured_workloads-v1/snippets/Gemfile index e2c5db51041e..778256f79afb 100755 --- a/google-cloud-assured_workloads-v1/snippets/Gemfile +++ b/google-cloud-assured_workloads-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/acknowledge_violation.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/acknowledge_violation.rb index 3d1a788c386f..a4ce8ea4651a 100644 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/acknowledge_violation.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/acknowledge_violation.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#acknowledge_violation +# +def acknowledge_violation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::AcknowledgeViolationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::AcknowledgeViolationRequest.new -# Call the acknowledge_violation method. -result = client.acknowledge_violation request + # Call the acknowledge_violation method. + result = client.acknowledge_violation request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1::AcknowledgeViolationResponse. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1::AcknowledgeViolationResponse. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_AcknowledgeViolation_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/create_workload.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/create_workload.rb index 120fe9fd98bc..61d2ae17b763 100755 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/create_workload.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/create_workload.rb @@ -19,22 +19,28 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#create_workload +# +def create_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::CreateWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::CreateWorkloadRequest.new -# Call the create_workload method. -result = client.create_workload request + # Call the create_workload method. + result = client.create_workload request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_CreateWorkload_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/delete_workload.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/delete_workload.rb index 3b45c819a0f2..e892e3ca5eef 100755 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/delete_workload.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/delete_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#delete_workload +# +def delete_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::DeleteWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::DeleteWorkloadRequest.new -# Call the delete_workload method. -result = client.delete_workload request + # Call the delete_workload method. + result = client.delete_workload request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_DeleteWorkload_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_violation.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_violation.rb index a6601062c032..247c1851544a 100644 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_violation.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_violation.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#get_violation +# +def get_violation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::GetViolationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::GetViolationRequest.new -# Call the get_violation method. -result = client.get_violation request + # Call the get_violation method. + result = client.get_violation request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1::Violation. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1::Violation. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetViolation_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_workload.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_workload.rb index f733bc543eac..f223a656b38f 100755 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_workload.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/get_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#get_workload +# +def get_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::GetWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::GetWorkloadRequest.new -# Call the get_workload method. -result = client.get_workload request + # Call the get_workload method. + result = client.get_workload request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_GetWorkload_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_violations.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_violations.rb index e0be9591cf20..449a5a1218fb 100644 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_violations.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_violations.rb @@ -19,21 +19,27 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#list_violations +# +def list_violations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::ListViolationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::ListViolationsRequest.new -# Call the list_violations method. -result = client.list_violations request + # Call the list_violations method. + result = client.list_violations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AssuredWorkloads::V1::Violation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AssuredWorkloads::V1::Violation. + p response + end end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListViolations_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_workloads.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_workloads.rb index a89eea1cbec4..e27ff2909168 100755 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_workloads.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/list_workloads.rb @@ -19,21 +19,27 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#list_workloads +# +def list_workloads + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::ListWorkloadsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::ListWorkloadsRequest.new -# Call the list_workloads method. -result = client.list_workloads request + # Call the list_workloads method. + result = client.list_workloads request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AssuredWorkloads::V1::Workload. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AssuredWorkloads::V1::Workload. + p response + end end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_ListWorkloads_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/restrict_allowed_resources.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/restrict_allowed_resources.rb index c48bf56f4b9b..24160c794430 100644 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/restrict_allowed_resources.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/restrict_allowed_resources.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#restrict_allowed_resources +# +def restrict_allowed_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::RestrictAllowedResourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::RestrictAllowedResourcesRequest.new -# Call the restrict_allowed_resources method. -result = client.restrict_allowed_resources request + # Call the restrict_allowed_resources method. + result = client.restrict_allowed_resources request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1::RestrictAllowedResourcesResponse. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1::RestrictAllowedResourcesResponse. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/update_workload.rb b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/update_workload.rb index 5271661111b9..22fbac9276f6 100755 --- a/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/update_workload.rb +++ b/google-cloud-assured_workloads-v1/snippets/assured_workloads_service/update_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_sync] require "google/cloud/assured_workloads/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client#update_workload +# +def update_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1::UpdateWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1::UpdateWorkloadRequest.new -# Call the update_workload method. -result = client.update_workload request + # Call the update_workload method. + result = client.update_workload request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1::Workload. + p result +end # [END assuredworkloads_v1_generated_AssuredWorkloadsService_UpdateWorkload_sync] diff --git a/google-cloud-assured_workloads-v1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1.json b/google-cloud-assured_workloads-v1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1.json index aadec331bedb..a96bcbc86b71 100644 --- a/google-cloud-assured_workloads-v1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1.json +++ b/google-cloud-assured_workloads-v1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-assured_workloads-v1beta1/.rubocop.yml b/google-cloud-assured_workloads-v1beta1/.rubocop.yml index cb2600795b47..81a9ba91c667 100644 --- a/google-cloud-assured_workloads-v1beta1/.rubocop.yml +++ b/google-cloud-assured_workloads-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-assured_workloads-v1beta1.rb" diff --git a/google-cloud-assured_workloads-v1beta1/snippets/Gemfile b/google-cloud-assured_workloads-v1beta1/snippets/Gemfile index 20123d152fe5..2558b61256b6 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/Gemfile +++ b/google-cloud-assured_workloads-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/analyze_workload_move.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/analyze_workload_move.rb index 834c27bd98c8..55dd9fe01db3 100644 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/analyze_workload_move.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/analyze_workload_move.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#analyze_workload_move +# +def analyze_workload_move + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::AnalyzeWorkloadMoveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::AnalyzeWorkloadMoveRequest.new -# Call the analyze_workload_move method. -result = client.analyze_workload_move request + # Call the analyze_workload_move method. + result = client.analyze_workload_move request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::AnalyzeWorkloadMoveResponse. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::AnalyzeWorkloadMoveResponse. + p result +end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_AnalyzeWorkloadMove_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/create_workload.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/create_workload.rb index 87a9ae850a9e..83b4f0f824f6 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/create_workload.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/create_workload.rb @@ -19,22 +19,28 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#create_workload +# +def create_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::CreateWorkloadRequest.new -# Call the create_workload method. -result = client.create_workload request + # Call the create_workload method. + result = client.create_workload request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_CreateWorkload_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/delete_workload.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/delete_workload.rb index 580dd9ac7004..77dd95dcb6a4 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/delete_workload.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/delete_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#delete_workload +# +def delete_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::DeleteWorkloadRequest.new -# Call the delete_workload method. -result = client.delete_workload request + # Call the delete_workload method. + result = client.delete_workload request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_DeleteWorkload_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/get_workload.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/get_workload.rb index 462e4fdde8e9..49acd8df8ef6 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/get_workload.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/get_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#get_workload +# +def get_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::GetWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::GetWorkloadRequest.new -# Call the get_workload method. -result = client.get_workload request + # Call the get_workload method. + result = client.get_workload request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload. + p result +end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_GetWorkload_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/list_workloads.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/list_workloads.rb index 61f4d97b9991..704a9227bd40 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/list_workloads.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/list_workloads.rb @@ -19,21 +19,27 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#list_workloads +# +def list_workloads + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::ListWorkloadsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::ListWorkloadsRequest.new -# Call the list_workloads method. -result = client.list_workloads request + # Call the list_workloads method. + result = client.list_workloads request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AssuredWorkloads::V1beta1::Workload. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AssuredWorkloads::V1beta1::Workload. + p response + end end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_ListWorkloads_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/restrict_allowed_resources.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/restrict_allowed_resources.rb index 0f5c20523f6d..9a55cba9c87b 100644 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/restrict_allowed_resources.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/restrict_allowed_resources.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#restrict_allowed_resources +# +def restrict_allowed_resources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesRequest.new -# Call the restrict_allowed_resources method. -result = client.restrict_allowed_resources request + # Call the restrict_allowed_resources method. + result = client.restrict_allowed_resources request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesResponse. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::RestrictAllowedResourcesResponse. + p result +end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_RestrictAllowedResources_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/update_workload.rb b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/update_workload.rb index c26dcdf53846..b4676a7032bb 100755 --- a/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/update_workload.rb +++ b/google-cloud-assured_workloads-v1beta1/snippets/assured_workloads_service/update_workload.rb @@ -19,15 +19,21 @@ # [START assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_sync] require "google/cloud/assured_workloads/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client#update_workload +# +def update_workload + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AssuredWorkloads::V1beta1::AssuredWorkloadsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AssuredWorkloads::V1beta1::UpdateWorkloadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AssuredWorkloads::V1beta1::UpdateWorkloadRequest.new -# Call the update_workload method. -result = client.update_workload request + # Call the update_workload method. + result = client.update_workload request -# The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload. -p result + # The returned object is of type Google::Cloud::AssuredWorkloads::V1beta1::Workload. + p result +end # [END assuredworkloads_v1beta1_generated_AssuredWorkloadsService_UpdateWorkload_sync] diff --git a/google-cloud-assured_workloads-v1beta1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json b/google-cloud-assured_workloads-v1beta1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json index 3225ed529750..9dade80e451a 100644 --- a/google-cloud-assured_workloads-v1beta1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json +++ b/google-cloud-assured_workloads-v1beta1/snippets/snippet_metadata_google.cloud.assuredworkloads.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-automl-v1/.repo-metadata.json b/google-cloud-automl-v1/.repo-metadata.json index b95be3760168..fa5c4e17439e 100644 --- a/google-cloud-automl-v1/.repo-metadata.json +++ b/google-cloud-automl-v1/.repo-metadata.json @@ -16,5 +16,5 @@ "ruby-cloud-product-url": "https://cloud.google.com/automl", "ruby-cloud-path-override": "auto_ml=automl", "ruby-cloud-namespace-override": "AutoMl=AutoML;Automl=AutoML", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-automl-v1/.rubocop.yml b/google-cloud-automl-v1/.rubocop.yml index 58338ed1fa6e..622056ff5619 100644 --- a/google-cloud-automl-v1/.rubocop.yml +++ b/google-cloud-automl-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-automl-v1.rb" diff --git a/google-cloud-automl-v1/snippets/Gemfile b/google-cloud-automl-v1/snippets/Gemfile index a1950750cc0f..c84461c17b0f 100755 --- a/google-cloud-automl-v1/snippets/Gemfile +++ b/google-cloud-automl-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-automl-v1/snippets/automl/create_dataset.rb b/google-cloud-automl-v1/snippets/automl/create_dataset.rb index d21b271118f0..e13d0d083804 100755 --- a/google-cloud-automl-v1/snippets/automl/create_dataset.rb +++ b/google-cloud-automl-v1/snippets/automl/create_dataset.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_CreateDataset_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#create_dataset +# +def create_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::CreateDatasetRequest.new -# Call the create_dataset method. -result = client.create_dataset request + # Call the create_dataset method. + result = client.create_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_CreateDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/create_model.rb b/google-cloud-automl-v1/snippets/automl/create_model.rb index 996f16dff233..6c12d3fec5e9 100755 --- a/google-cloud-automl-v1/snippets/automl/create_model.rb +++ b/google-cloud-automl-v1/snippets/automl/create_model.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_CreateModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#create_model +# +def create_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::CreateModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::CreateModelRequest.new -# Call the create_model method. -result = client.create_model request + # Call the create_model method. + result = client.create_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_CreateModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/delete_dataset.rb b/google-cloud-automl-v1/snippets/automl/delete_dataset.rb index 77b32a031805..0c40d072d2c9 100755 --- a/google-cloud-automl-v1/snippets/automl/delete_dataset.rb +++ b/google-cloud-automl-v1/snippets/automl/delete_dataset.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_DeleteDataset_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#delete_dataset +# +def delete_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::DeleteDatasetRequest.new -# Call the delete_dataset method. -result = client.delete_dataset request + # Call the delete_dataset method. + result = client.delete_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_DeleteDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/delete_model.rb b/google-cloud-automl-v1/snippets/automl/delete_model.rb index 416443f509dd..f757e84bec40 100755 --- a/google-cloud-automl-v1/snippets/automl/delete_model.rb +++ b/google-cloud-automl-v1/snippets/automl/delete_model.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_DeleteModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#delete_model +# +def delete_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::DeleteModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::DeleteModelRequest.new -# Call the delete_model method. -result = client.delete_model request + # Call the delete_model method. + result = client.delete_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_DeleteModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/deploy_model.rb b/google-cloud-automl-v1/snippets/automl/deploy_model.rb index 15abc85f38ec..d54b64990256 100755 --- a/google-cloud-automl-v1/snippets/automl/deploy_model.rb +++ b/google-cloud-automl-v1/snippets/automl/deploy_model.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_DeployModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#deploy_model +# +def deploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::DeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::DeployModelRequest.new -# Call the deploy_model method. -result = client.deploy_model request + # Call the deploy_model method. + result = client.deploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_DeployModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/export_data.rb b/google-cloud-automl-v1/snippets/automl/export_data.rb index 56f9dbfb674a..ba177fd90ad0 100755 --- a/google-cloud-automl-v1/snippets/automl/export_data.rb +++ b/google-cloud-automl-v1/snippets/automl/export_data.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_ExportData_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#export_data +# +def export_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ExportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ExportDataRequest.new -# Call the export_data method. -result = client.export_data request + # Call the export_data method. + result = client.export_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_ExportData_sync] diff --git a/google-cloud-automl-v1/snippets/automl/export_model.rb b/google-cloud-automl-v1/snippets/automl/export_model.rb index 76fea8f8b9c4..6491991b15f1 100755 --- a/google-cloud-automl-v1/snippets/automl/export_model.rb +++ b/google-cloud-automl-v1/snippets/automl/export_model.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_ExportModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#export_model +# +def export_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ExportModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ExportModelRequest.new -# Call the export_model method. -result = client.export_model request + # Call the export_model method. + result = client.export_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_ExportModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb b/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb index e874b23edb83..a354d363c487 100755 --- a/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb +++ b/google-cloud-automl-v1/snippets/automl/get_annotation_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_GetAnnotationSpec_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#get_annotation_spec +# +def get_annotation_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::GetAnnotationSpecRequest.new -# Call the get_annotation_spec method. -result = client.get_annotation_spec request + # Call the get_annotation_spec method. + result = client.get_annotation_spec request -# The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1::AnnotationSpec. + p result +end # [END automl_v1_generated_AutoML_GetAnnotationSpec_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_dataset.rb b/google-cloud-automl-v1/snippets/automl/get_dataset.rb index 30afc66747a9..d17bf2ace7be 100755 --- a/google-cloud-automl-v1/snippets/automl/get_dataset.rb +++ b/google-cloud-automl-v1/snippets/automl/get_dataset.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_GetDataset_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#get_dataset +# +def get_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::GetDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::GetDatasetRequest.new -# Call the get_dataset method. -result = client.get_dataset request + # Call the get_dataset method. + result = client.get_dataset request -# The returned object is of type Google::Cloud::AutoML::V1::Dataset. -p result + # The returned object is of type Google::Cloud::AutoML::V1::Dataset. + p result +end # [END automl_v1_generated_AutoML_GetDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_model.rb b/google-cloud-automl-v1/snippets/automl/get_model.rb index c58548b00fd1..2e5c99f667ef 100755 --- a/google-cloud-automl-v1/snippets/automl/get_model.rb +++ b/google-cloud-automl-v1/snippets/automl/get_model.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_GetModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#get_model +# +def get_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::GetModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::GetModelRequest.new -# Call the get_model method. -result = client.get_model request + # Call the get_model method. + result = client.get_model request -# The returned object is of type Google::Cloud::AutoML::V1::Model. -p result + # The returned object is of type Google::Cloud::AutoML::V1::Model. + p result +end # [END automl_v1_generated_AutoML_GetModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb b/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb index 57493662c267..1cffb4d04215 100755 --- a/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb +++ b/google-cloud-automl-v1/snippets/automl/get_model_evaluation.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_GetModelEvaluation_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#get_model_evaluation +# +def get_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::GetModelEvaluationRequest.new -# Call the get_model_evaluation method. -result = client.get_model_evaluation request + # Call the get_model_evaluation method. + result = client.get_model_evaluation request -# The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation. -p result + # The returned object is of type Google::Cloud::AutoML::V1::ModelEvaluation. + p result +end # [END automl_v1_generated_AutoML_GetModelEvaluation_sync] diff --git a/google-cloud-automl-v1/snippets/automl/import_data.rb b/google-cloud-automl-v1/snippets/automl/import_data.rb index 92746d4967ad..f9e373a95292 100755 --- a/google-cloud-automl-v1/snippets/automl/import_data.rb +++ b/google-cloud-automl-v1/snippets/automl/import_data.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_ImportData_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#import_data +# +def import_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ImportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ImportDataRequest.new -# Call the import_data method. -result = client.import_data request + # Call the import_data method. + result = client.import_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_ImportData_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_datasets.rb b/google-cloud-automl-v1/snippets/automl/list_datasets.rb index 3773f90456ce..c8d0b45aad34 100755 --- a/google-cloud-automl-v1/snippets/automl/list_datasets.rb +++ b/google-cloud-automl-v1/snippets/automl/list_datasets.rb @@ -19,21 +19,27 @@ # [START automl_v1_generated_AutoML_ListDatasets_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#list_datasets +# +def list_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ListDatasetsRequest.new -# Call the list_datasets method. -result = client.list_datasets request + # Call the list_datasets method. + result = client.list_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1::Dataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1::Dataset. + p response + end end # [END automl_v1_generated_AutoML_ListDatasets_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb b/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb index 67a0c6f5a717..ef07e7c41f7c 100755 --- a/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb +++ b/google-cloud-automl-v1/snippets/automl/list_model_evaluations.rb @@ -19,21 +19,27 @@ # [START automl_v1_generated_AutoML_ListModelEvaluations_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#list_model_evaluations +# +def list_model_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ListModelEvaluationsRequest.new -# Call the list_model_evaluations method. -result = client.list_model_evaluations request + # Call the list_model_evaluations method. + result = client.list_model_evaluations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1::ModelEvaluation. + p response + end end # [END automl_v1_generated_AutoML_ListModelEvaluations_sync] diff --git a/google-cloud-automl-v1/snippets/automl/list_models.rb b/google-cloud-automl-v1/snippets/automl/list_models.rb index a4ae96855118..9beebe93cf3c 100755 --- a/google-cloud-automl-v1/snippets/automl/list_models.rb +++ b/google-cloud-automl-v1/snippets/automl/list_models.rb @@ -19,21 +19,27 @@ # [START automl_v1_generated_AutoML_ListModels_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#list_models +# +def list_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::ListModelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::ListModelsRequest.new -# Call the list_models method. -result = client.list_models request + # Call the list_models method. + result = client.list_models request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1::Model. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1::Model. + p response + end end # [END automl_v1_generated_AutoML_ListModels_sync] diff --git a/google-cloud-automl-v1/snippets/automl/undeploy_model.rb b/google-cloud-automl-v1/snippets/automl/undeploy_model.rb index 5f468e96ffe6..510004bab412 100755 --- a/google-cloud-automl-v1/snippets/automl/undeploy_model.rb +++ b/google-cloud-automl-v1/snippets/automl/undeploy_model.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_AutoML_UndeployModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#undeploy_model +# +def undeploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::UndeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::UndeployModelRequest.new -# Call the undeploy_model method. -result = client.undeploy_model request + # Call the undeploy_model method. + result = client.undeploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_AutoML_UndeployModel_sync] diff --git a/google-cloud-automl-v1/snippets/automl/update_dataset.rb b/google-cloud-automl-v1/snippets/automl/update_dataset.rb index 512bffc5b980..9ca6fd68a97c 100755 --- a/google-cloud-automl-v1/snippets/automl/update_dataset.rb +++ b/google-cloud-automl-v1/snippets/automl/update_dataset.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_UpdateDataset_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#update_dataset +# +def update_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::UpdateDatasetRequest.new -# Call the update_dataset method. -result = client.update_dataset request + # Call the update_dataset method. + result = client.update_dataset request -# The returned object is of type Google::Cloud::AutoML::V1::Dataset. -p result + # The returned object is of type Google::Cloud::AutoML::V1::Dataset. + p result +end # [END automl_v1_generated_AutoML_UpdateDataset_sync] diff --git a/google-cloud-automl-v1/snippets/automl/update_model.rb b/google-cloud-automl-v1/snippets/automl/update_model.rb index b8bc84056ec5..99ac0a810811 100755 --- a/google-cloud-automl-v1/snippets/automl/update_model.rb +++ b/google-cloud-automl-v1/snippets/automl/update_model.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_AutoML_UpdateModel_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::AutoML::Client#update_model +# +def update_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::UpdateModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::UpdateModelRequest.new -# Call the update_model method. -result = client.update_model request + # Call the update_model method. + result = client.update_model request -# The returned object is of type Google::Cloud::AutoML::V1::Model. -p result + # The returned object is of type Google::Cloud::AutoML::V1::Model. + p result +end # [END automl_v1_generated_AutoML_UpdateModel_sync] diff --git a/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb b/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb index b8a7ac603ddb..9e62a2060c74 100755 --- a/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb +++ b/google-cloud-automl-v1/snippets/prediction_service/batch_predict.rb @@ -19,22 +19,28 @@ # [START automl_v1_generated_PredictionService_BatchPredict_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::PredictionService::Client#batch_predict +# +def batch_predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::BatchPredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::BatchPredictRequest.new -# Call the batch_predict method. -result = client.batch_predict request + # Call the batch_predict method. + result = client.batch_predict request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1_generated_PredictionService_BatchPredict_sync] diff --git a/google-cloud-automl-v1/snippets/prediction_service/predict.rb b/google-cloud-automl-v1/snippets/prediction_service/predict.rb index 631da293af76..81258062c205 100755 --- a/google-cloud-automl-v1/snippets/prediction_service/predict.rb +++ b/google-cloud-automl-v1/snippets/prediction_service/predict.rb @@ -19,15 +19,21 @@ # [START automl_v1_generated_PredictionService_Predict_sync] require "google/cloud/automl/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1::PredictionService::Client#predict +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1::PredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1::PredictRequest.new -# Call the predict method. -result = client.predict request + # Call the predict method. + result = client.predict request -# The returned object is of type Google::Cloud::AutoML::V1::PredictResponse. -p result + # The returned object is of type Google::Cloud::AutoML::V1::PredictResponse. + p result +end # [END automl_v1_generated_PredictionService_Predict_sync] diff --git a/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json b/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json index 7ffa0bbde7fe..d509a09b4e37 100644 --- a/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json +++ b/google-cloud-automl-v1/snippets/snippet_metadata_google.cloud.automl.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-automl-v1beta1/.repo-metadata.json b/google-cloud-automl-v1beta1/.repo-metadata.json index 88400d5df81a..c54ad874f00c 100644 --- a/google-cloud-automl-v1beta1/.repo-metadata.json +++ b/google-cloud-automl-v1beta1/.repo-metadata.json @@ -16,5 +16,5 @@ "ruby-cloud-product-url": "https://cloud.google.com/automl", "ruby-cloud-path-override": "auto_ml=automl", "ruby-cloud-namespace-override": "AutoMl=AutoML;Automl=AutoML", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-automl-v1beta1/.rubocop.yml b/google-cloud-automl-v1beta1/.rubocop.yml index 5cd8d88c61c2..bf48a3e31581 100644 --- a/google-cloud-automl-v1beta1/.rubocop.yml +++ b/google-cloud-automl-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-automl-v1beta1.rb" diff --git a/google-cloud-automl-v1beta1/snippets/Gemfile b/google-cloud-automl-v1beta1/snippets/Gemfile index 57a4bdc1dbdb..6440d7d8410d 100755 --- a/google-cloud-automl-v1beta1/snippets/Gemfile +++ b/google-cloud-automl-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-automl-v1beta1/snippets/automl/create_dataset.rb b/google-cloud-automl-v1beta1/snippets/automl/create_dataset.rb index 88a0b28066ce..1b911c5c5440 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/create_dataset.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/create_dataset.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_CreateDataset_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#create_dataset +# +def create_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::CreateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::CreateDatasetRequest.new -# Call the create_dataset method. -result = client.create_dataset request + # Call the create_dataset method. + result = client.create_dataset request -# The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. + p result +end # [END automl_v1beta1_generated_AutoML_CreateDataset_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/create_model.rb b/google-cloud-automl-v1beta1/snippets/automl/create_model.rb index 05f693c3f25e..b6e01532a2cb 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/create_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/create_model.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_CreateModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#create_model +# +def create_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::CreateModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::CreateModelRequest.new -# Call the create_model method. -result = client.create_model request + # Call the create_model method. + result = client.create_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_CreateModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/delete_dataset.rb b/google-cloud-automl-v1beta1/snippets/automl/delete_dataset.rb index 745601dd72f7..73adfca34885 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/delete_dataset.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/delete_dataset.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_DeleteDataset_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#delete_dataset +# +def delete_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::DeleteDatasetRequest.new -# Call the delete_dataset method. -result = client.delete_dataset request + # Call the delete_dataset method. + result = client.delete_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_DeleteDataset_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/delete_model.rb b/google-cloud-automl-v1beta1/snippets/automl/delete_model.rb index 239c9deed8a0..4be32c84f8f5 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/delete_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/delete_model.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_DeleteModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#delete_model +# +def delete_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::DeleteModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::DeleteModelRequest.new -# Call the delete_model method. -result = client.delete_model request + # Call the delete_model method. + result = client.delete_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_DeleteModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/deploy_model.rb b/google-cloud-automl-v1beta1/snippets/automl/deploy_model.rb index 16d5fee40a0e..9f4fa133c4c6 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/deploy_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/deploy_model.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_DeployModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#deploy_model +# +def deploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::DeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::DeployModelRequest.new -# Call the deploy_model method. -result = client.deploy_model request + # Call the deploy_model method. + result = client.deploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_DeployModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/export_data.rb b/google-cloud-automl-v1beta1/snippets/automl/export_data.rb index 8499922dbd34..84bbd771bf66 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/export_data.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/export_data.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_ExportData_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#export_data +# +def export_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ExportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ExportDataRequest.new -# Call the export_data method. -result = client.export_data request + # Call the export_data method. + result = client.export_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_ExportData_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/export_evaluated_examples.rb b/google-cloud-automl-v1beta1/snippets/automl/export_evaluated_examples.rb index 96aab4afb037..6167cf95c4f0 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/export_evaluated_examples.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/export_evaluated_examples.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_ExportEvaluatedExamples_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#export_evaluated_examples +# +def export_evaluated_examples + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ExportEvaluatedExamplesRequest.new -# Call the export_evaluated_examples method. -result = client.export_evaluated_examples request + # Call the export_evaluated_examples method. + result = client.export_evaluated_examples request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_ExportEvaluatedExamples_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/export_model.rb b/google-cloud-automl-v1beta1/snippets/automl/export_model.rb index 3ee320e39586..462924a6913b 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/export_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/export_model.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_ExportModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#export_model +# +def export_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ExportModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ExportModelRequest.new -# Call the export_model method. -result = client.export_model request + # Call the export_model method. + result = client.export_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_ExportModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_annotation_spec.rb b/google-cloud-automl-v1beta1/snippets/automl/get_annotation_spec.rb index ec9f22c0ec58..4f2294ba5f66 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_annotation_spec.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_annotation_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetAnnotationSpec_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_annotation_spec +# +def get_annotation_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetAnnotationSpecRequest.new -# Call the get_annotation_spec method. -result = client.get_annotation_spec request + # Call the get_annotation_spec method. + result = client.get_annotation_spec request -# The returned object is of type Google::Cloud::AutoML::V1beta1::AnnotationSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::AnnotationSpec. + p result +end # [END automl_v1beta1_generated_AutoML_GetAnnotationSpec_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_column_spec.rb b/google-cloud-automl-v1beta1/snippets/automl/get_column_spec.rb index 93777a0d89e1..d8b0d5ae13e0 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_column_spec.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_column_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetColumnSpec_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_column_spec +# +def get_column_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetColumnSpecRequest.new -# Call the get_column_spec method. -result = client.get_column_spec request + # Call the get_column_spec method. + result = client.get_column_spec request -# The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec. + p result +end # [END automl_v1beta1_generated_AutoML_GetColumnSpec_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_dataset.rb b/google-cloud-automl-v1beta1/snippets/automl/get_dataset.rb index 8c3c9f3fd728..67126cbaac4a 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_dataset.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_dataset.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetDataset_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_dataset +# +def get_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetDatasetRequest.new -# Call the get_dataset method. -result = client.get_dataset request + # Call the get_dataset method. + result = client.get_dataset request -# The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. + p result +end # [END automl_v1beta1_generated_AutoML_GetDataset_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_model.rb b/google-cloud-automl-v1beta1/snippets/automl/get_model.rb index 496a616fd5f5..9cfabaacd7f7 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_model.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_model +# +def get_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetModelRequest.new -# Call the get_model method. -result = client.get_model request + # Call the get_model method. + result = client.get_model request -# The returned object is of type Google::Cloud::AutoML::V1beta1::Model. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::Model. + p result +end # [END automl_v1beta1_generated_AutoML_GetModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_model_evaluation.rb b/google-cloud-automl-v1beta1/snippets/automl/get_model_evaluation.rb index b76c5cca5414..765f7f200109 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_model_evaluation.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_model_evaluation.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetModelEvaluation_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_model_evaluation +# +def get_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetModelEvaluationRequest.new -# Call the get_model_evaluation method. -result = client.get_model_evaluation request + # Call the get_model_evaluation method. + result = client.get_model_evaluation request -# The returned object is of type Google::Cloud::AutoML::V1beta1::ModelEvaluation. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::ModelEvaluation. + p result +end # [END automl_v1beta1_generated_AutoML_GetModelEvaluation_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/get_table_spec.rb b/google-cloud-automl-v1beta1/snippets/automl/get_table_spec.rb index ef629df4ad00..a3ec5afb65e5 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/get_table_spec.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/get_table_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_GetTableSpec_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#get_table_spec +# +def get_table_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::GetTableSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::GetTableSpecRequest.new -# Call the get_table_spec method. -result = client.get_table_spec request + # Call the get_table_spec method. + result = client.get_table_spec request -# The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec. + p result +end # [END automl_v1beta1_generated_AutoML_GetTableSpec_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/import_data.rb b/google-cloud-automl-v1beta1/snippets/automl/import_data.rb index 53336e443485..1d0b46a1c6fb 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/import_data.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/import_data.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_ImportData_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#import_data +# +def import_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ImportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ImportDataRequest.new -# Call the import_data method. -result = client.import_data request + # Call the import_data method. + result = client.import_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_ImportData_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/list_column_specs.rb b/google-cloud-automl-v1beta1/snippets/automl/list_column_specs.rb index 0dc94da5ef83..3448ed03d37a 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/list_column_specs.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/list_column_specs.rb @@ -19,21 +19,27 @@ # [START automl_v1beta1_generated_AutoML_ListColumnSpecs_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#list_column_specs +# +def list_column_specs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ListColumnSpecsRequest.new -# Call the list_column_specs method. -result = client.list_column_specs request + # Call the list_column_specs method. + result = client.list_column_specs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1beta1::ColumnSpec. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1beta1::ColumnSpec. + p response + end end # [END automl_v1beta1_generated_AutoML_ListColumnSpecs_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/list_datasets.rb b/google-cloud-automl-v1beta1/snippets/automl/list_datasets.rb index b3a8d3b82b7f..028e84999fd4 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/list_datasets.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/list_datasets.rb @@ -19,21 +19,27 @@ # [START automl_v1beta1_generated_AutoML_ListDatasets_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#list_datasets +# +def list_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ListDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ListDatasetsRequest.new -# Call the list_datasets method. -result = client.list_datasets request + # Call the list_datasets method. + result = client.list_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1beta1::Dataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1beta1::Dataset. + p response + end end # [END automl_v1beta1_generated_AutoML_ListDatasets_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/list_model_evaluations.rb b/google-cloud-automl-v1beta1/snippets/automl/list_model_evaluations.rb index f202c24c8696..9a21d860e2f0 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/list_model_evaluations.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/list_model_evaluations.rb @@ -19,21 +19,27 @@ # [START automl_v1beta1_generated_AutoML_ListModelEvaluations_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#list_model_evaluations +# +def list_model_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ListModelEvaluationsRequest.new -# Call the list_model_evaluations method. -result = client.list_model_evaluations request + # Call the list_model_evaluations method. + result = client.list_model_evaluations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1beta1::ModelEvaluation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1beta1::ModelEvaluation. + p response + end end # [END automl_v1beta1_generated_AutoML_ListModelEvaluations_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/list_models.rb b/google-cloud-automl-v1beta1/snippets/automl/list_models.rb index 9f1308f80eaf..5890540c163b 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/list_models.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/list_models.rb @@ -19,21 +19,27 @@ # [START automl_v1beta1_generated_AutoML_ListModels_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#list_models +# +def list_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ListModelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ListModelsRequest.new -# Call the list_models method. -result = client.list_models request + # Call the list_models method. + result = client.list_models request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1beta1::Model. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1beta1::Model. + p response + end end # [END automl_v1beta1_generated_AutoML_ListModels_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/list_table_specs.rb b/google-cloud-automl-v1beta1/snippets/automl/list_table_specs.rb index ebca73353bee..dae5d4f56a36 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/list_table_specs.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/list_table_specs.rb @@ -19,21 +19,27 @@ # [START automl_v1beta1_generated_AutoML_ListTableSpecs_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#list_table_specs +# +def list_table_specs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::ListTableSpecsRequest.new -# Call the list_table_specs method. -result = client.list_table_specs request + # Call the list_table_specs method. + result = client.list_table_specs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::AutoML::V1beta1::TableSpec. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::AutoML::V1beta1::TableSpec. + p response + end end # [END automl_v1beta1_generated_AutoML_ListTableSpecs_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/undeploy_model.rb b/google-cloud-automl-v1beta1/snippets/automl/undeploy_model.rb index a623fd916ed1..9f4fd1794edf 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/undeploy_model.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/undeploy_model.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_AutoML_UndeployModel_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#undeploy_model +# +def undeploy_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::UndeployModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::UndeployModelRequest.new -# Call the undeploy_model method. -result = client.undeploy_model request + # Call the undeploy_model method. + result = client.undeploy_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_AutoML_UndeployModel_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/update_column_spec.rb b/google-cloud-automl-v1beta1/snippets/automl/update_column_spec.rb index a90d14397a1e..83c3587b01ef 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/update_column_spec.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/update_column_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_UpdateColumnSpec_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#update_column_spec +# +def update_column_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::UpdateColumnSpecRequest.new -# Call the update_column_spec method. -result = client.update_column_spec request + # Call the update_column_spec method. + result = client.update_column_spec request -# The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::ColumnSpec. + p result +end # [END automl_v1beta1_generated_AutoML_UpdateColumnSpec_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/update_dataset.rb b/google-cloud-automl-v1beta1/snippets/automl/update_dataset.rb index 19ecdf01e185..92a3c64b50e2 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/update_dataset.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/update_dataset.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_UpdateDataset_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#update_dataset +# +def update_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::UpdateDatasetRequest.new -# Call the update_dataset method. -result = client.update_dataset request + # Call the update_dataset method. + result = client.update_dataset request -# The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::Dataset. + p result +end # [END automl_v1beta1_generated_AutoML_UpdateDataset_sync] diff --git a/google-cloud-automl-v1beta1/snippets/automl/update_table_spec.rb b/google-cloud-automl-v1beta1/snippets/automl/update_table_spec.rb index 7661deddb41f..082dfe7cd5e8 100755 --- a/google-cloud-automl-v1beta1/snippets/automl/update_table_spec.rb +++ b/google-cloud-automl-v1beta1/snippets/automl/update_table_spec.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_AutoML_UpdateTableSpec_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::AutoML::Client#update_table_spec +# +def update_table_spec + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::AutoML::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::UpdateTableSpecRequest.new -# Call the update_table_spec method. -result = client.update_table_spec request + # Call the update_table_spec method. + result = client.update_table_spec request -# The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::TableSpec. + p result +end # [END automl_v1beta1_generated_AutoML_UpdateTableSpec_sync] diff --git a/google-cloud-automl-v1beta1/snippets/prediction_service/batch_predict.rb b/google-cloud-automl-v1beta1/snippets/prediction_service/batch_predict.rb index 0bb90d657248..d3add438d174 100755 --- a/google-cloud-automl-v1beta1/snippets/prediction_service/batch_predict.rb +++ b/google-cloud-automl-v1beta1/snippets/prediction_service/batch_predict.rb @@ -19,22 +19,28 @@ # [START automl_v1beta1_generated_PredictionService_BatchPredict_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::PredictionService::Client#batch_predict +# +def batch_predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::BatchPredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::BatchPredictRequest.new -# Call the batch_predict method. -result = client.batch_predict request + # Call the batch_predict method. + result = client.batch_predict request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END automl_v1beta1_generated_PredictionService_BatchPredict_sync] diff --git a/google-cloud-automl-v1beta1/snippets/prediction_service/predict.rb b/google-cloud-automl-v1beta1/snippets/prediction_service/predict.rb index d529e4734b77..c0473921caaa 100755 --- a/google-cloud-automl-v1beta1/snippets/prediction_service/predict.rb +++ b/google-cloud-automl-v1beta1/snippets/prediction_service/predict.rb @@ -19,15 +19,21 @@ # [START automl_v1beta1_generated_PredictionService_Predict_sync] require "google/cloud/automl/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::AutoML::V1beta1::PredictionService::Client#predict +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::AutoML::V1beta1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::AutoML::V1beta1::PredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::AutoML::V1beta1::PredictRequest.new -# Call the predict method. -result = client.predict request + # Call the predict method. + result = client.predict request -# The returned object is of type Google::Cloud::AutoML::V1beta1::PredictResponse. -p result + # The returned object is of type Google::Cloud::AutoML::V1beta1::PredictResponse. + p result +end # [END automl_v1beta1_generated_PredictionService_Predict_sync] diff --git a/google-cloud-automl-v1beta1/snippets/snippet_metadata_google.cloud.automl.v1beta1.json b/google-cloud-automl-v1beta1/snippets/snippet_metadata_google.cloud.automl.v1beta1.json index 3370f2135dd8..baef514af8e2 100644 --- a/google-cloud-automl-v1beta1/snippets/snippet_metadata_google.cloud.automl.v1beta1.json +++ b/google-cloud-automl-v1beta1/snippets/snippet_metadata_google.cloud.automl.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-bare_metal_solution-v2/.rubocop.yml b/google-cloud-bare_metal_solution-v2/.rubocop.yml index 2079b721f99c..1d57d709ce5b 100644 --- a/google-cloud-bare_metal_solution-v2/.rubocop.yml +++ b/google-cloud-bare_metal_solution-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bare_metal_solution-v2.rb" diff --git a/google-cloud-bare_metal_solution-v2/snippets/Gemfile b/google-cloud-bare_metal_solution-v2/snippets/Gemfile index ab2049579774..735b2ae51454 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/Gemfile +++ b/google-cloud-bare_metal_solution-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/detach_lun.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/detach_lun.rb index 0d19e597d5e4..af28c2c4d33c 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/detach_lun.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/detach_lun.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_DetachLun_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#detach_lun +# +def detach_lun + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::DetachLunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::DetachLunRequest.new -# Call the detach_lun method. -result = client.detach_lun request + # Call the detach_lun method. + result = client.detach_lun request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_DetachLun_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_instance.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_instance.rb index 06d6c43254c0..68d98cae9a03 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_instance.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_instance.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_GetInstance_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::Instance. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::Instance. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_GetInstance_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_lun.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_lun.rb index b18467a4d937..22942ab0ecd1 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_lun.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_lun.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_GetLun_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#get_lun +# +def get_lun + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::GetLunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::GetLunRequest.new -# Call the get_lun method. -result = client.get_lun request + # Call the get_lun method. + result = client.get_lun request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::Lun. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::Lun. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_GetLun_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_network.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_network.rb index df042f4474d5..15dd81cf9f04 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_network.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_network.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#get_network +# +def get_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::GetNetworkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::GetNetworkRequest.new -# Call the get_network method. -result = client.get_network request + # Call the get_network method. + result = client.get_network request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::Network. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::Network. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_GetNetwork_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_nfs_share.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_nfs_share.rb index 6f9ee95b568b..d2019a2904ab 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_nfs_share.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_nfs_share.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_GetNfsShare_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#get_nfs_share +# +def get_nfs_share + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::GetNfsShareRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::GetNfsShareRequest.new -# Call the get_nfs_share method. -result = client.get_nfs_share request + # Call the get_nfs_share method. + result = client.get_nfs_share request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::NfsShare. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::NfsShare. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_GetNfsShare_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_volume.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_volume.rb index 8adc1f847931..568400f0a8bf 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_volume.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/get_volume.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_GetVolume_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#get_volume +# +def get_volume + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::GetVolumeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::GetVolumeRequest.new -# Call the get_volume method. -result = client.get_volume request + # Call the get_volume method. + result = client.get_volume request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::Volume. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::Volume. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_GetVolume_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_instances.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_instances.rb index a43fbdc50107..3b58bf541f15 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_instances.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_instances.rb @@ -19,21 +19,27 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListInstances_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Instance. + p response + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ListInstances_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_luns.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_luns.rb index d08480a1f5a6..b149cbdef13c 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_luns.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_luns.rb @@ -19,21 +19,27 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListLuns_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_luns +# +def list_luns + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListLunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListLunsRequest.new -# Call the list_luns method. -result = client.list_luns request + # Call the list_luns method. + result = client.list_luns request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Lun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Lun. + p response + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ListLuns_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_network_usage.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_network_usage.rb index e791cfaa51f6..aad8484ff107 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_network_usage.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_network_usage.rb @@ -19,15 +19,21 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListNetworkUsage_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_network_usage +# +def list_network_usage + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListNetworkUsageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListNetworkUsageRequest.new -# Call the list_network_usage method. -result = client.list_network_usage request + # Call the list_network_usage method. + result = client.list_network_usage request -# The returned object is of type Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse. -p result + # The returned object is of type Google::Cloud::BareMetalSolution::V2::ListNetworkUsageResponse. + p result +end # [END baremetalsolution_v2_generated_BareMetalSolution_ListNetworkUsage_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_networks.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_networks.rb index 1fe508aeb8f5..784234003655 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_networks.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_networks.rb @@ -19,21 +19,27 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListNetworks_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_networks +# +def list_networks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListNetworksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListNetworksRequest.new -# Call the list_networks method. -result = client.list_networks request + # Call the list_networks method. + result = client.list_networks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Network. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Network. + p response + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ListNetworks_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_nfs_shares.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_nfs_shares.rb index 8e6dbd7906c6..43cd38290ab0 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_nfs_shares.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_nfs_shares.rb @@ -19,21 +19,27 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListNfsShares_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_nfs_shares +# +def list_nfs_shares + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListNfsSharesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListNfsSharesRequest.new -# Call the list_nfs_shares method. -result = client.list_nfs_shares request + # Call the list_nfs_shares method. + result = client.list_nfs_shares request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BareMetalSolution::V2::NfsShare. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BareMetalSolution::V2::NfsShare. + p response + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ListNfsShares_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_volumes.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_volumes.rb index a3cf289193ba..468b4a1973c4 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_volumes.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/list_volumes.rb @@ -19,21 +19,27 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ListVolumes_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#list_volumes +# +def list_volumes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ListVolumesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ListVolumesRequest.new -# Call the list_volumes method. -result = client.list_volumes request + # Call the list_volumes method. + result = client.list_volumes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Volume. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BareMetalSolution::V2::Volume. + p response + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ListVolumes_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/reset_instance.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/reset_instance.rb index 60f15c17e409..8c5a0e4d1c53 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/reset_instance.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/reset_instance.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ResetInstance_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#reset_instance +# +def reset_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ResetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ResetInstanceRequest.new -# Call the reset_instance method. -result = client.reset_instance request + # Call the reset_instance method. + result = client.reset_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ResetInstance_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/resize_volume.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/resize_volume.rb index 8c04c914e2ab..d2f0d6342349 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/resize_volume.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/resize_volume.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_ResizeVolume_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#resize_volume +# +def resize_volume + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::ResizeVolumeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::ResizeVolumeRequest.new -# Call the resize_volume method. -result = client.resize_volume request + # Call the resize_volume method. + result = client.resize_volume request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_ResizeVolume_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/start_instance.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/start_instance.rb index d392775b1dce..b27ac25316ec 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/start_instance.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/start_instance.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_StartInstance_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#start_instance +# +def start_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::StartInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::StartInstanceRequest.new -# Call the start_instance method. -result = client.start_instance request + # Call the start_instance method. + result = client.start_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_StartInstance_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/stop_instance.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/stop_instance.rb index 120371e2b7ec..68d9dc94055e 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/stop_instance.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/stop_instance.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_StopInstance_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#stop_instance +# +def stop_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::StopInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::StopInstanceRequest.new -# Call the stop_instance method. -result = client.stop_instance request + # Call the stop_instance method. + result = client.stop_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_StopInstance_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_instance.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_instance.rb index a548c7bff7e2..992bdcb8d107 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_instance.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_instance.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_UpdateInstance_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_UpdateInstance_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_network.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_network.rb index 100450b0373f..2143159ba481 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_network.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_network.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_UpdateNetwork_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#update_network +# +def update_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::UpdateNetworkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::UpdateNetworkRequest.new -# Call the update_network method. -result = client.update_network request + # Call the update_network method. + result = client.update_network request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_UpdateNetwork_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_nfs_share.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_nfs_share.rb index e3aa6662fcbf..00598b2cbd19 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_nfs_share.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_nfs_share.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_UpdateNfsShare_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#update_nfs_share +# +def update_nfs_share + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::UpdateNfsShareRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::UpdateNfsShareRequest.new -# Call the update_nfs_share method. -result = client.update_nfs_share request + # Call the update_nfs_share method. + result = client.update_nfs_share request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_UpdateNfsShare_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_volume.rb b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_volume.rb index ac2720b8237d..232744b70686 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_volume.rb +++ b/google-cloud-bare_metal_solution-v2/snippets/bare_metal_solution/update_volume.rb @@ -19,22 +19,28 @@ # [START baremetalsolution_v2_generated_BareMetalSolution_UpdateVolume_sync] require "google/cloud/bare_metal_solution/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client#update_volume +# +def update_volume + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BareMetalSolution::V2::BareMetalSolution::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BareMetalSolution::V2::UpdateVolumeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BareMetalSolution::V2::UpdateVolumeRequest.new -# Call the update_volume method. -result = client.update_volume request + # Call the update_volume method. + result = client.update_volume request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END baremetalsolution_v2_generated_BareMetalSolution_UpdateVolume_sync] diff --git a/google-cloud-bare_metal_solution-v2/snippets/snippet_metadata_google.cloud.baremetalsolution.v2.json b/google-cloud-bare_metal_solution-v2/snippets/snippet_metadata_google.cloud.baremetalsolution.v2.json index c1d07dc1465c..e39cbbd6a2e2 100644 --- a/google-cloud-bare_metal_solution-v2/snippets/snippet_metadata_google.cloud.baremetalsolution.v2.json +++ b/google-cloud-bare_metal_solution-v2/snippets/snippet_metadata_google.cloud.baremetalsolution.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-batch-v1/.rubocop.yml b/google-cloud-batch-v1/.rubocop.yml index 7ce9332b03ca..dfe88aff925c 100644 --- a/google-cloud-batch-v1/.rubocop.yml +++ b/google-cloud-batch-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-batch-v1.rb" diff --git a/google-cloud-batch-v1/snippets/Gemfile b/google-cloud-batch-v1/snippets/Gemfile index 5efe5bfdcd3d..968f33b258b5 100644 --- a/google-cloud-batch-v1/snippets/Gemfile +++ b/google-cloud-batch-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-batch-v1/snippets/batch_service/create_job.rb b/google-cloud-batch-v1/snippets/batch_service/create_job.rb index ce7128ab82e8..734f9229caab 100644 --- a/google-cloud-batch-v1/snippets/batch_service/create_job.rb +++ b/google-cloud-batch-v1/snippets/batch_service/create_job.rb @@ -19,15 +19,21 @@ # [START batch_v1_generated_BatchService_CreateJob_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Batch::V1::Job. -p result + # The returned object is of type Google::Cloud::Batch::V1::Job. + p result +end # [END batch_v1_generated_BatchService_CreateJob_sync] diff --git a/google-cloud-batch-v1/snippets/batch_service/delete_job.rb b/google-cloud-batch-v1/snippets/batch_service/delete_job.rb index 3ffabf83b39b..962df3197140 100644 --- a/google-cloud-batch-v1/snippets/batch_service/delete_job.rb +++ b/google-cloud-batch-v1/snippets/batch_service/delete_job.rb @@ -19,22 +19,28 @@ # [START batch_v1_generated_BatchService_DeleteJob_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END batch_v1_generated_BatchService_DeleteJob_sync] diff --git a/google-cloud-batch-v1/snippets/batch_service/get_job.rb b/google-cloud-batch-v1/snippets/batch_service/get_job.rb index dd9d411b4c1c..09d704343b9b 100644 --- a/google-cloud-batch-v1/snippets/batch_service/get_job.rb +++ b/google-cloud-batch-v1/snippets/batch_service/get_job.rb @@ -19,15 +19,21 @@ # [START batch_v1_generated_BatchService_GetJob_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Batch::V1::Job. -p result + # The returned object is of type Google::Cloud::Batch::V1::Job. + p result +end # [END batch_v1_generated_BatchService_GetJob_sync] diff --git a/google-cloud-batch-v1/snippets/batch_service/get_task.rb b/google-cloud-batch-v1/snippets/batch_service/get_task.rb index 1ed5d22df160..44787e12d001 100644 --- a/google-cloud-batch-v1/snippets/batch_service/get_task.rb +++ b/google-cloud-batch-v1/snippets/batch_service/get_task.rb @@ -19,15 +19,21 @@ # [START batch_v1_generated_BatchService_GetTask_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::GetTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::GetTaskRequest.new -# Call the get_task method. -result = client.get_task request + # Call the get_task method. + result = client.get_task request -# The returned object is of type Google::Cloud::Batch::V1::Task. -p result + # The returned object is of type Google::Cloud::Batch::V1::Task. + p result +end # [END batch_v1_generated_BatchService_GetTask_sync] diff --git a/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb b/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb index 493bddb5cb39..f8b40d1d78c0 100644 --- a/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb +++ b/google-cloud-batch-v1/snippets/batch_service/list_jobs.rb @@ -19,21 +19,27 @@ # [START batch_v1_generated_BatchService_ListJobs_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Batch::V1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Batch::V1::Job. + p response + end end # [END batch_v1_generated_BatchService_ListJobs_sync] diff --git a/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb b/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb index 1a1e3f570c3a..df91fe0279c6 100644 --- a/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb +++ b/google-cloud-batch-v1/snippets/batch_service/list_tasks.rb @@ -19,21 +19,27 @@ # [START batch_v1_generated_BatchService_ListTasks_sync] require "google/cloud/batch/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Batch::V1::BatchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Batch::V1::BatchService::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Batch::V1::BatchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Batch::V1::ListTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Batch::V1::ListTasksRequest.new -# Call the list_tasks method. -result = client.list_tasks request + # Call the list_tasks method. + result = client.list_tasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Batch::V1::Task. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Batch::V1::Task. + p response + end end # [END batch_v1_generated_BatchService_ListTasks_sync] diff --git a/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json b/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json index e9a17e14ce6b..e130780b804d 100644 --- a/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json +++ b/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-beyond_corp-app_connections-v1/.rubocop.yml b/google-cloud-beyond_corp-app_connections-v1/.rubocop.yml index c7046d10105e..9a0f1608e53e 100644 --- a/google-cloud-beyond_corp-app_connections-v1/.rubocop.yml +++ b/google-cloud-beyond_corp-app_connections-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-beyond_corp-app_connections-v1.rb" diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/Gemfile b/google-cloud-beyond_corp-app_connections-v1/snippets/Gemfile index 0d4409113fc8..e9b3dc1f9a0b 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/Gemfile +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/create_app_connection.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/create_app_connection.rb index fb5fe520ddb8..4f0bbb70cc11 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/create_app_connection.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/create_app_connection.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectionsService_CreateAppConnection_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#create_app_connection +# +def create_app_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::CreateAppConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::CreateAppConnectionRequest.new -# Call the create_app_connection method. -result = client.create_app_connection request + # Call the create_app_connection method. + result = client.create_app_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectionsService_CreateAppConnection_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/delete_app_connection.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/delete_app_connection.rb index d35363e2925a..be9685887d4a 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/delete_app_connection.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/delete_app_connection.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectionsService_DeleteAppConnection_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#delete_app_connection +# +def delete_app_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::DeleteAppConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::DeleteAppConnectionRequest.new -# Call the delete_app_connection method. -result = client.delete_app_connection request + # Call the delete_app_connection method. + result = client.delete_app_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectionsService_DeleteAppConnection_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/get_app_connection.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/get_app_connection.rb index 965ab36dd3dd..5b1ffbbf069b 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/get_app_connection.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/get_app_connection.rb @@ -19,15 +19,21 @@ # [START beyondcorp_v1_generated_AppConnectionsService_GetAppConnection_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#get_app_connection +# +def get_app_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::GetAppConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::GetAppConnectionRequest.new -# Call the get_app_connection method. -result = client.get_app_connection request + # Call the get_app_connection method. + result = client.get_app_connection request -# The returned object is of type Google::Cloud::BeyondCorp::AppConnections::V1::AppConnection. -p result + # The returned object is of type Google::Cloud::BeyondCorp::AppConnections::V1::AppConnection. + p result +end # [END beyondcorp_v1_generated_AppConnectionsService_GetAppConnection_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/list_app_connections.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/list_app_connections.rb index 375b503bc68f..3c59f7364478 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/list_app_connections.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/list_app_connections.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_AppConnectionsService_ListAppConnections_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#list_app_connections +# +def list_app_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::ListAppConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::ListAppConnectionsRequest.new -# Call the list_app_connections method. -result = client.list_app_connections request + # Call the list_app_connections method. + result = client.list_app_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::AppConnections::V1::AppConnection. + p response + end end # [END beyondcorp_v1_generated_AppConnectionsService_ListAppConnections_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/resolve_app_connections.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/resolve_app_connections.rb index 9fe46f42c8ff..fb4945b3ed06 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/resolve_app_connections.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/resolve_app_connections.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_AppConnectionsService_ResolveAppConnections_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#resolve_app_connections +# +def resolve_app_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::ResolveAppConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::ResolveAppConnectionsRequest.new -# Call the resolve_app_connections method. -result = client.resolve_app_connections request + # Call the resolve_app_connections method. + result = client.resolve_app_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::AppConnections::V1::ResolveAppConnectionsResponse::AppConnectionDetails. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::AppConnections::V1::ResolveAppConnectionsResponse::AppConnectionDetails. + p response + end end # [END beyondcorp_v1_generated_AppConnectionsService_ResolveAppConnections_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/update_app_connection.rb b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/update_app_connection.rb index 991bff910d11..0f08460c4ed1 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/update_app_connection.rb +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/app_connections_service/update_app_connection.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectionsService_UpdateAppConnection_sync] require "google/cloud/beyond_corp/app_connections/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client#update_app_connection +# +def update_app_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnections::V1::AppConnectionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnections::V1::UpdateAppConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnections::V1::UpdateAppConnectionRequest.new -# Call the update_app_connection method. -result = client.update_app_connection request + # Call the update_app_connection method. + result = client.update_app_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectionsService_UpdateAppConnection_sync] diff --git a/google-cloud-beyond_corp-app_connections-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json b/google-cloud-beyond_corp-app_connections-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json index 81b653a179e6..09f0dad72770 100644 --- a/google-cloud-beyond_corp-app_connections-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json +++ b/google-cloud-beyond_corp-app_connections-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnections.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-beyond_corp-app_connectors-v1/.rubocop.yml b/google-cloud-beyond_corp-app_connectors-v1/.rubocop.yml index 44aacd2e5822..7c746abab61f 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/.rubocop.yml +++ b/google-cloud-beyond_corp-app_connectors-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-beyond_corp-app_connectors-v1.rb" diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/Gemfile b/google-cloud-beyond_corp-app_connectors-v1/snippets/Gemfile index d6abbf6a8004..3a7bc18eac83 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/Gemfile +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/create_app_connector.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/create_app_connector.rb index e90c096d6c7e..b23e316368ea 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/create_app_connector.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/create_app_connector.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectorsService_CreateAppConnector_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#create_app_connector +# +def create_app_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::CreateAppConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::CreateAppConnectorRequest.new -# Call the create_app_connector method. -result = client.create_app_connector request + # Call the create_app_connector method. + result = client.create_app_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectorsService_CreateAppConnector_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/delete_app_connector.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/delete_app_connector.rb index 99ffe9c75b2b..44510929a1ce 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/delete_app_connector.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/delete_app_connector.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectorsService_DeleteAppConnector_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#delete_app_connector +# +def delete_app_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::DeleteAppConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::DeleteAppConnectorRequest.new -# Call the delete_app_connector method. -result = client.delete_app_connector request + # Call the delete_app_connector method. + result = client.delete_app_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectorsService_DeleteAppConnector_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/get_app_connector.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/get_app_connector.rb index 1c8466b6e446..e7c8b475ed16 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/get_app_connector.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/get_app_connector.rb @@ -19,15 +19,21 @@ # [START beyondcorp_v1_generated_AppConnectorsService_GetAppConnector_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#get_app_connector +# +def get_app_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::GetAppConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::GetAppConnectorRequest.new -# Call the get_app_connector method. -result = client.get_app_connector request + # Call the get_app_connector method. + result = client.get_app_connector request -# The returned object is of type Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnector. -p result + # The returned object is of type Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnector. + p result +end # [END beyondcorp_v1_generated_AppConnectorsService_GetAppConnector_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/list_app_connectors.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/list_app_connectors.rb index 971cf2aefdcf..60c973679037 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/list_app_connectors.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/list_app_connectors.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_AppConnectorsService_ListAppConnectors_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#list_app_connectors +# +def list_app_connectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::ListAppConnectorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::ListAppConnectorsRequest.new -# Call the list_app_connectors method. -result = client.list_app_connectors request + # Call the list_app_connectors method. + result = client.list_app_connectors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnector. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnector. + p response + end end # [END beyondcorp_v1_generated_AppConnectorsService_ListAppConnectors_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/report_status.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/report_status.rb index ed71291992ab..135ac031ae40 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/report_status.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/report_status.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectorsService_ReportStatus_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#report_status +# +def report_status + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::ReportStatusRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::ReportStatusRequest.new -# Call the report_status method. -result = client.report_status request + # Call the report_status method. + result = client.report_status request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectorsService_ReportStatus_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/update_app_connector.rb b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/update_app_connector.rb index f641c05269d2..69a8ad6ab31e 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/update_app_connector.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/app_connectors_service/update_app_connector.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppConnectorsService_UpdateAppConnector_sync] require "google/cloud/beyond_corp/app_connectors/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client#update_app_connector +# +def update_app_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppConnectors::V1::AppConnectorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppConnectors::V1::UpdateAppConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppConnectors::V1::UpdateAppConnectorRequest.new -# Call the update_app_connector method. -result = client.update_app_connector request + # Call the update_app_connector method. + result = client.update_app_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppConnectorsService_UpdateAppConnector_sync] diff --git a/google-cloud-beyond_corp-app_connectors-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json b/google-cloud-beyond_corp-app_connectors-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json index 7bdb5035ad59..16fb7cc9c980 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json +++ b/google-cloud-beyond_corp-app_connectors-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appconnectors.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-beyond_corp-app_gateways-v1/.rubocop.yml b/google-cloud-beyond_corp-app_gateways-v1/.rubocop.yml index e48885669658..3c939b74dcc9 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/.rubocop.yml +++ b/google-cloud-beyond_corp-app_gateways-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-beyond_corp-app_gateways-v1.rb" diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/Gemfile b/google-cloud-beyond_corp-app_gateways-v1/snippets/Gemfile index 47750ddf7900..e17aad9171fd 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/Gemfile +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/create_app_gateway.rb b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/create_app_gateway.rb index 11d9533e85d6..337bef5d37e0 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/create_app_gateway.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/create_app_gateway.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppGatewaysService_CreateAppGateway_sync] require "google/cloud/beyond_corp/app_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client#create_app_gateway +# +def create_app_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppGateways::V1::CreateAppGatewayRequest.new -# Call the create_app_gateway method. -result = client.create_app_gateway request + # Call the create_app_gateway method. + result = client.create_app_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppGatewaysService_CreateAppGateway_sync] diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/delete_app_gateway.rb b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/delete_app_gateway.rb index 29b95b5af49f..8646f20573ee 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/delete_app_gateway.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/delete_app_gateway.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_AppGatewaysService_DeleteAppGateway_sync] require "google/cloud/beyond_corp/app_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client#delete_app_gateway +# +def delete_app_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppGateways::V1::DeleteAppGatewayRequest.new -# Call the delete_app_gateway method. -result = client.delete_app_gateway request + # Call the delete_app_gateway method. + result = client.delete_app_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_AppGatewaysService_DeleteAppGateway_sync] diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/get_app_gateway.rb b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/get_app_gateway.rb index 1d1c917e1513..121fdba22ad8 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/get_app_gateway.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/get_app_gateway.rb @@ -19,15 +19,21 @@ # [START beyondcorp_v1_generated_AppGatewaysService_GetAppGateway_sync] require "google/cloud/beyond_corp/app_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client#get_app_gateway +# +def get_app_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppGateways::V1::GetAppGatewayRequest.new -# Call the get_app_gateway method. -result = client.get_app_gateway request + # Call the get_app_gateway method. + result = client.get_app_gateway request -# The returned object is of type Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway. -p result + # The returned object is of type Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway. + p result +end # [END beyondcorp_v1_generated_AppGatewaysService_GetAppGateway_sync] diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/list_app_gateways.rb b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/list_app_gateways.rb index 4c43461521f7..039bebdc65c1 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/list_app_gateways.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/app_gateways_service/list_app_gateways.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_AppGatewaysService_ListAppGateways_sync] require "google/cloud/beyond_corp/app_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client#list_app_gateways +# +def list_app_gateways + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::AppGateways::V1::AppGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::AppGateways::V1::ListAppGatewaysRequest.new -# Call the list_app_gateways method. -result = client.list_app_gateways request + # Call the list_app_gateways method. + result = client.list_app_gateways request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::AppGateways::V1::AppGateway. + p response + end end # [END beyondcorp_v1_generated_AppGatewaysService_ListAppGateways_sync] diff --git a/google-cloud-beyond_corp-app_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json b/google-cloud-beyond_corp-app_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json index 50490a9a1fb5..30fb3926b156 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json +++ b/google-cloud-beyond_corp-app_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.appgateways.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/.rubocop.yml b/google-cloud-beyond_corp-client_connector_services-v1/.rubocop.yml index 0e684c70d59e..f379edbc1b0e 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/.rubocop.yml +++ b/google-cloud-beyond_corp-client_connector_services-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-beyond_corp-client_connector_services-v1.rb" diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/Gemfile b/google-cloud-beyond_corp-client_connector_services-v1/snippets/Gemfile index 2994231d74a5..2ac3186550b4 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/Gemfile +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/create_client_connector_service.rb b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/create_client_connector_service.rb index ef9d969c0f96..9952e2cba2d0 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/create_client_connector_service.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/create_client_connector_service.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_ClientConnectorServicesService_CreateClientConnectorService_sync] require "google/cloud/beyond_corp/client_connector_services/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client#create_client_connector_service +# +def create_client_connector_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::CreateClientConnectorServiceRequest.new -# Call the create_client_connector_service method. -result = client.create_client_connector_service request + # Call the create_client_connector_service method. + result = client.create_client_connector_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_ClientConnectorServicesService_CreateClientConnectorService_sync] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/delete_client_connector_service.rb b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/delete_client_connector_service.rb index 70d12b00fb09..a8317f4fdfc6 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/delete_client_connector_service.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/delete_client_connector_service.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_ClientConnectorServicesService_DeleteClientConnectorService_sync] require "google/cloud/beyond_corp/client_connector_services/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client#delete_client_connector_service +# +def delete_client_connector_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::DeleteClientConnectorServiceRequest.new -# Call the delete_client_connector_service method. -result = client.delete_client_connector_service request + # Call the delete_client_connector_service method. + result = client.delete_client_connector_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_ClientConnectorServicesService_DeleteClientConnectorService_sync] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/get_client_connector_service.rb b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/get_client_connector_service.rb index 6445a59795ae..37c1e73af131 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/get_client_connector_service.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/get_client_connector_service.rb @@ -19,15 +19,21 @@ # [START beyondcorp_v1_generated_ClientConnectorServicesService_GetClientConnectorService_sync] require "google/cloud/beyond_corp/client_connector_services/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client#get_client_connector_service +# +def get_client_connector_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::GetClientConnectorServiceRequest.new -# Call the get_client_connector_service method. -result = client.get_client_connector_service request + # Call the get_client_connector_service method. + result = client.get_client_connector_service request -# The returned object is of type Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService. -p result + # The returned object is of type Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService. + p result +end # [END beyondcorp_v1_generated_ClientConnectorServicesService_GetClientConnectorService_sync] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/list_client_connector_services.rb b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/list_client_connector_services.rb index b63b89f10764..1411386aa356 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/list_client_connector_services.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/list_client_connector_services.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_ClientConnectorServicesService_ListClientConnectorServices_sync] require "google/cloud/beyond_corp/client_connector_services/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client#list_client_connector_services +# +def list_client_connector_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ListClientConnectorServicesRequest.new -# Call the list_client_connector_services method. -result = client.list_client_connector_services request + # Call the list_client_connector_services method. + result = client.list_client_connector_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorService. + p response + end end # [END beyondcorp_v1_generated_ClientConnectorServicesService_ListClientConnectorServices_sync] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/update_client_connector_service.rb b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/update_client_connector_service.rb index 3090acb28334..a625eabe569b 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/update_client_connector_service.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/client_connector_services_service/update_client_connector_service.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_ClientConnectorServicesService_UpdateClientConnectorService_sync] require "google/cloud/beyond_corp/client_connector_services/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client#update_client_connector_service +# +def update_client_connector_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::ClientConnectorServicesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientConnectorServices::V1::UpdateClientConnectorServiceRequest.new -# Call the update_client_connector_service method. -result = client.update_client_connector_service request + # Call the update_client_connector_service method. + result = client.update_client_connector_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_ClientConnectorServicesService_UpdateClientConnectorService_sync] diff --git a/google-cloud-beyond_corp-client_connector_services-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json b/google-cloud-beyond_corp-client_connector_services-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json index 9d71075830fd..03166d4de84e 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json +++ b/google-cloud-beyond_corp-client_connector_services-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientconnectorservices.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-beyond_corp-client_gateways-v1/.rubocop.yml b/google-cloud-beyond_corp-client_gateways-v1/.rubocop.yml index f1143cfd0ac0..2d6e3497728d 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/.rubocop.yml +++ b/google-cloud-beyond_corp-client_gateways-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-beyond_corp-client_gateways-v1.rb" diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/Gemfile b/google-cloud-beyond_corp-client_gateways-v1/snippets/Gemfile index efb19e1674af..287afb389211 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/Gemfile +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/create_client_gateway.rb b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/create_client_gateway.rb index c82af9087c8b..6d46dfb3322d 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/create_client_gateway.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/create_client_gateway.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_ClientGatewaysService_CreateClientGateway_sync] require "google/cloud/beyond_corp/client_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client#create_client_gateway +# +def create_client_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientGateways::V1::CreateClientGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientGateways::V1::CreateClientGatewayRequest.new -# Call the create_client_gateway method. -result = client.create_client_gateway request + # Call the create_client_gateway method. + result = client.create_client_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_ClientGatewaysService_CreateClientGateway_sync] diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/delete_client_gateway.rb b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/delete_client_gateway.rb index 89a069577611..a19a6af0101a 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/delete_client_gateway.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/delete_client_gateway.rb @@ -19,22 +19,28 @@ # [START beyondcorp_v1_generated_ClientGatewaysService_DeleteClientGateway_sync] require "google/cloud/beyond_corp/client_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client#delete_client_gateway +# +def delete_client_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientGateways::V1::DeleteClientGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientGateways::V1::DeleteClientGatewayRequest.new -# Call the delete_client_gateway method. -result = client.delete_client_gateway request + # Call the delete_client_gateway method. + result = client.delete_client_gateway request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END beyondcorp_v1_generated_ClientGatewaysService_DeleteClientGateway_sync] diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/get_client_gateway.rb b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/get_client_gateway.rb index c8c2f92f7443..4ec877a559d7 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/get_client_gateway.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/get_client_gateway.rb @@ -19,15 +19,21 @@ # [START beyondcorp_v1_generated_ClientGatewaysService_GetClientGateway_sync] require "google/cloud/beyond_corp/client_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client#get_client_gateway +# +def get_client_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientGateways::V1::GetClientGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientGateways::V1::GetClientGatewayRequest.new -# Call the get_client_gateway method. -result = client.get_client_gateway request + # Call the get_client_gateway method. + result = client.get_client_gateway request -# The returned object is of type Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway. -p result + # The returned object is of type Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway. + p result +end # [END beyondcorp_v1_generated_ClientGatewaysService_GetClientGateway_sync] diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/list_client_gateways.rb b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/list_client_gateways.rb index ae5e8a510232..7915d6c95d2a 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/list_client_gateways.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/client_gateways_service/list_client_gateways.rb @@ -19,21 +19,27 @@ # [START beyondcorp_v1_generated_ClientGatewaysService_ListClientGateways_sync] require "google/cloud/beyond_corp/client_gateways/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client#list_client_gateways +# +def list_client_gateways + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGatewaysService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BeyondCorp::ClientGateways::V1::ListClientGatewaysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BeyondCorp::ClientGateways::V1::ListClientGatewaysRequest.new -# Call the list_client_gateways method. -result = client.list_client_gateways request + # Call the list_client_gateways method. + result = client.list_client_gateways request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BeyondCorp::ClientGateways::V1::ClientGateway. + p response + end end # [END beyondcorp_v1_generated_ClientGatewaysService_ListClientGateways_sync] diff --git a/google-cloud-beyond_corp-client_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json b/google-cloud-beyond_corp-client_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json index cc01b0be2d10..237a4443f6f8 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json +++ b/google-cloud-beyond_corp-client_gateways-v1/snippets/snippet_metadata_google.cloud.beyondcorp.clientgateways.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-bigquery-analytics_hub-v1/.rubocop.yml b/google-cloud-bigquery-analytics_hub-v1/.rubocop.yml index 56cf51090d82..2f4c3e44583c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/.rubocop.yml +++ b/google-cloud-bigquery-analytics_hub-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-analytics_hub-v1.rb" diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/Gemfile b/google-cloud-bigquery-analytics_hub-v1/snippets/Gemfile index 91c2c4ec7a2f..c9671292e703 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/Gemfile +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_data_exchange.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_data_exchange.rb index ec6d50cbb4a1..1b273d521d5c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_data_exchange.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_CreateDataExchange_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#create_data_exchange +# +def create_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateDataExchangeRequest.new -# Call the create_data_exchange method. -result = client.create_data_exchange request + # Call the create_data_exchange method. + result = client.create_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_CreateDataExchange_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_listing.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_listing.rb index abe897ac5a47..937f1a2c8314 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_listing.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/create_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_CreateListing_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#create_listing +# +def create_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::CreateListingRequest.new -# Call the create_listing method. -result = client.create_listing request + # Call the create_listing method. + result = client.create_listing request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_CreateListing_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_data_exchange.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_data_exchange.rb index 958dfc7ecc73..ed14eb947cf3 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_data_exchange.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_DeleteDataExchange_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#delete_data_exchange +# +def delete_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteDataExchangeRequest.new -# Call the delete_data_exchange method. -result = client.delete_data_exchange request + # Call the delete_data_exchange method. + result = client.delete_data_exchange request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_DeleteDataExchange_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_listing.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_listing.rb index b4de810c0216..185663ba5396 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_listing.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/delete_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_DeleteListing_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#delete_listing +# +def delete_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::DeleteListingRequest.new -# Call the delete_listing method. -result = client.delete_listing request + # Call the delete_listing method. + result = client.delete_listing request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_DeleteListing_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_data_exchange.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_data_exchange.rb index eb39b85f5a79..645d800fc423 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_data_exchange.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_GetDataExchange_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#get_data_exchange +# +def get_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetDataExchangeRequest.new -# Call the get_data_exchange method. -result = client.get_data_exchange request + # Call the get_data_exchange method. + result = client.get_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_GetDataExchange_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_iam_policy.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_iam_policy.rb index fc55d0833e99..fafca119720a 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_iam_policy.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_GetIamPolicy_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_GetIamPolicy_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_listing.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_listing.rb index fba52bd55f30..045ce771dc63 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_listing.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/get_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_GetListing_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#get_listing +# +def get_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::GetListingRequest.new -# Call the get_listing method. -result = client.get_listing request + # Call the get_listing method. + result = client.get_listing request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_GetListing_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_data_exchanges.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_data_exchanges.rb index 6f19607bb138..f1d6725e764c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_data_exchanges.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_data_exchanges.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1_generated_AnalyticsHubService_ListDataExchanges_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#list_data_exchanges +# +def list_data_exchanges + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListDataExchangesRequest.new -# Call the list_data_exchanges method. -result = client.list_data_exchanges request + # Call the list_data_exchanges method. + result = client.list_data_exchanges request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. + p response + end end # [END analyticshub_v1_generated_AnalyticsHubService_ListDataExchanges_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_listings.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_listings.rb index bcbaf7dab397..80fd6f7ff21b 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_listings.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_listings.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1_generated_AnalyticsHubService_ListListings_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#list_listings +# +def list_listings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListListingsRequest.new -# Call the list_listings method. -result = client.list_listings request + # Call the list_listings method. + result = client.list_listings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. + p response + end end # [END analyticshub_v1_generated_AnalyticsHubService_ListListings_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_org_data_exchanges.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_org_data_exchanges.rb index 6c0f527bf3fe..9cd77131cd4e 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_org_data_exchanges.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/list_org_data_exchanges.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#list_org_data_exchanges +# +def list_org_data_exchanges + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::ListOrgDataExchangesRequest.new -# Call the list_org_data_exchanges method. -result = client.list_org_data_exchanges request + # Call the list_org_data_exchanges method. + result = client.list_org_data_exchanges request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. + p response + end end # [END analyticshub_v1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/set_iam_policy.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/set_iam_policy.rb index e08a77406192..ab7810f44bb0 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/set_iam_policy.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_SetIamPolicy_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_SetIamPolicy_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/subscribe_listing.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/subscribe_listing.rb index b89a7c05a00e..c5215c0d344c 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/subscribe_listing.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/subscribe_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_SubscribeListing_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#subscribe_listing +# +def subscribe_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingRequest.new -# Call the subscribe_listing method. -result = client.subscribe_listing request + # Call the subscribe_listing method. + result = client.subscribe_listing request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::SubscribeListingResponse. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_SubscribeListing_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/test_iam_permissions.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/test_iam_permissions.rb index 9befd74adaf5..0ea6a27531e4 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/test_iam_permissions.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_TestIamPermissions_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_TestIamPermissions_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_data_exchange.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_data_exchange.rb index 7b94c15b3d54..040e34f2f7fd 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_data_exchange.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_UpdateDataExchange_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#update_data_exchange +# +def update_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateDataExchangeRequest.new -# Call the update_data_exchange method. -result = client.update_data_exchange request + # Call the update_data_exchange method. + result = client.update_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::DataExchange. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_UpdateDataExchange_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_listing.rb b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_listing.rb index 33a0a99ec100..ec21c0749bae 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_listing.rb +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/analytics_hub_service/update_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1_generated_AnalyticsHubService_UpdateListing_sync] require "google/cloud/bigquery/analytics_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client#update_listing +# +def update_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::AnalyticsHub::V1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::AnalyticsHub::V1::UpdateListingRequest.new -# Call the update_listing method. -result = client.update_listing request + # Call the update_listing method. + result = client.update_listing request -# The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::AnalyticsHub::V1::Listing. + p result +end # [END analyticshub_v1_generated_AnalyticsHubService_UpdateListing_sync] diff --git a/google-cloud-bigquery-analytics_hub-v1/snippets/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json b/google-cloud-bigquery-analytics_hub-v1/snippets/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json index 9ae8f926a31b..5caf4bd1decc 100644 --- a/google-cloud-bigquery-analytics_hub-v1/snippets/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json +++ b/google-cloud-bigquery-analytics_hub-v1/snippets/snippet_metadata_google.cloud.bigquery.analyticshub.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-connection-v1/.rubocop.yml b/google-cloud-bigquery-connection-v1/.rubocop.yml index 45c3c6fc55af..96bdb8ab4f80 100644 --- a/google-cloud-bigquery-connection-v1/.rubocop.yml +++ b/google-cloud-bigquery-connection-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-connection-v1.rb" diff --git a/google-cloud-bigquery-connection-v1/snippets/Gemfile b/google-cloud-bigquery-connection-v1/snippets/Gemfile index 23927b5c9f44..68608710d0e8 100755 --- a/google-cloud-bigquery-connection-v1/snippets/Gemfile +++ b/google-cloud-bigquery-connection-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/create_connection.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/create_connection.rb index 1f54ee64c11b..b1b72e3dcf79 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/create_connection.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/create_connection.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_CreateConnection_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#create_connection +# +def create_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Connection::V1::CreateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Connection::V1::CreateConnectionRequest.new -# Call the create_connection method. -result = client.create_connection request + # Call the create_connection method. + result = client.create_connection request -# The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. -p result + # The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_CreateConnection_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/delete_connection.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/delete_connection.rb index b91ca9ebc1ea..6e50e08474e3 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/delete_connection.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/delete_connection.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_DeleteConnection_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#delete_connection +# +def delete_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Connection::V1::DeleteConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Connection::V1::DeleteConnectionRequest.new -# Call the delete_connection method. -result = client.delete_connection request + # Call the delete_connection method. + result = client.delete_connection request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_DeleteConnection_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/get_connection.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/get_connection.rb index c45ca5d5109c..7cb17a9c1a72 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/get_connection.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/get_connection.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_GetConnection_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#get_connection +# +def get_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Connection::V1::GetConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Connection::V1::GetConnectionRequest.new -# Call the get_connection method. -result = client.get_connection request + # Call the get_connection method. + result = client.get_connection request -# The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. -p result + # The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_GetConnection_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/get_iam_policy.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/get_iam_policy.rb index 586820773089..458d42a2f31c 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/get_iam_policy.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_GetIamPolicy_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_GetIamPolicy_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/list_connections.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/list_connections.rb index 8fc490070875..aa220c8d9ab2 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/list_connections.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/list_connections.rb @@ -19,21 +19,27 @@ # [START bigqueryconnection_v1_generated_ConnectionService_ListConnections_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#list_connections +# +def list_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Connection::V1::ListConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Connection::V1::ListConnectionsRequest.new -# Call the list_connections method. -result = client.list_connections request + # Call the list_connections method. + result = client.list_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Connection::V1::Connection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Connection::V1::Connection. + p response + end end # [END bigqueryconnection_v1_generated_ConnectionService_ListConnections_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/set_iam_policy.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/set_iam_policy.rb index da4dda6a84c1..e5c762ecc649 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/set_iam_policy.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_SetIamPolicy_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_SetIamPolicy_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/test_iam_permissions.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/test_iam_permissions.rb index c940a5578f84..f0698c057511 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/test_iam_permissions.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_TestIamPermissions_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_TestIamPermissions_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/connection_service/update_connection.rb b/google-cloud-bigquery-connection-v1/snippets/connection_service/update_connection.rb index 8e7204a2acfb..c16aaa041404 100755 --- a/google-cloud-bigquery-connection-v1/snippets/connection_service/update_connection.rb +++ b/google-cloud-bigquery-connection-v1/snippets/connection_service/update_connection.rb @@ -19,15 +19,21 @@ # [START bigqueryconnection_v1_generated_ConnectionService_UpdateConnection_sync] require "google/cloud/bigquery/connection/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client#update_connection +# +def update_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Connection::V1::ConnectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Connection::V1::UpdateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Connection::V1::UpdateConnectionRequest.new -# Call the update_connection method. -result = client.update_connection request + # Call the update_connection method. + result = client.update_connection request -# The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. -p result + # The returned object is of type Google::Cloud::Bigquery::Connection::V1::Connection. + p result +end # [END bigqueryconnection_v1_generated_ConnectionService_UpdateConnection_sync] diff --git a/google-cloud-bigquery-connection-v1/snippets/snippet_metadata_google.cloud.bigquery.connection.v1.json b/google-cloud-bigquery-connection-v1/snippets/snippet_metadata_google.cloud.bigquery.connection.v1.json index 7e4577ca20e8..96a274396914 100644 --- a/google-cloud-bigquery-connection-v1/snippets/snippet_metadata_google.cloud.bigquery.connection.v1.json +++ b/google-cloud-bigquery-connection-v1/snippets/snippet_metadata_google.cloud.bigquery.connection.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/.rubocop.yml b/google-cloud-bigquery-data_exchange-v1beta1/.rubocop.yml index ead73c7d0d60..2d3faf077487 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/.rubocop.yml +++ b/google-cloud-bigquery-data_exchange-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-data_exchange-v1beta1.rb" diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/Gemfile b/google-cloud-bigquery-data_exchange-v1beta1/snippets/Gemfile index 68170109dc79..61bc83dc2bce 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/Gemfile +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_data_exchange.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_data_exchange.rb index fb62ec50d66a..cd257f13f070 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_data_exchange.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#create_data_exchange +# +def create_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::CreateDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::CreateDataExchangeRequest.new -# Call the create_data_exchange method. -result = client.create_data_exchange request + # Call the create_data_exchange method. + result = client.create_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateDataExchange_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_listing.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_listing.rb index e97382ee42b5..a65b1f7708cd 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_listing.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/create_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#create_listing +# +def create_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::CreateListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::CreateListingRequest.new -# Call the create_listing method. -result = client.create_listing request + # Call the create_listing method. + result = client.create_listing request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_CreateListing_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_data_exchange.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_data_exchange.rb index 375cc5b7086e..a1a8a3207a6d 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_data_exchange.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#delete_data_exchange +# +def delete_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::DeleteDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::DeleteDataExchangeRequest.new -# Call the delete_data_exchange method. -result = client.delete_data_exchange request + # Call the delete_data_exchange method. + result = client.delete_data_exchange request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteDataExchange_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_listing.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_listing.rb index 4c4038f426ef..be32a656df94 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_listing.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/delete_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#delete_listing +# +def delete_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::DeleteListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::DeleteListingRequest.new -# Call the delete_listing method. -result = client.delete_listing request + # Call the delete_listing method. + result = client.delete_listing request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_DeleteListing_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_data_exchange.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_data_exchange.rb index 2df86818b3a7..a8df5ead6ae6 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_data_exchange.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#get_data_exchange +# +def get_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::GetDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::GetDataExchangeRequest.new -# Call the get_data_exchange method. -result = client.get_data_exchange request + # Call the get_data_exchange method. + result = client.get_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_GetDataExchange_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_iam_policy.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_iam_policy.rb index a28d6e7758f5..31893c703743 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_iam_policy.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_GetIamPolicy_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_listing.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_listing.rb index 4fdb4a533e26..b74967cfd6ad 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_listing.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/get_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#get_listing +# +def get_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::GetListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::GetListingRequest.new -# Call the get_listing method. -result = client.get_listing request + # Call the get_listing method. + result = client.get_listing request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_GetListing_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_data_exchanges.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_data_exchanges.rb index 57d610ab2ffe..cc40f55e864a 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_data_exchanges.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_data_exchanges.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#list_data_exchanges +# +def list_data_exchanges + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListDataExchangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListDataExchangesRequest.new -# Call the list_data_exchanges method. -result = client.list_data_exchanges request + # Call the list_data_exchanges method. + result = client.list_data_exchanges request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. + p response + end end # [END analyticshub_v1beta1_generated_AnalyticsHubService_ListDataExchanges_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_listings.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_listings.rb index 4a4e5e775f2d..1da5531dd490 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_listings.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_listings.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#list_listings +# +def list_listings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListListingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListListingsRequest.new -# Call the list_listings method. -result = client.list_listings request + # Call the list_listings method. + result = client.list_listings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. + p response + end end # [END analyticshub_v1beta1_generated_AnalyticsHubService_ListListings_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_org_data_exchanges.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_org_data_exchanges.rb index 1ac82a46f4d1..c85c69500df4 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_org_data_exchanges.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/list_org_data_exchanges.rb @@ -19,21 +19,27 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#list_org_data_exchanges +# +def list_org_data_exchanges + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListOrgDataExchangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::ListOrgDataExchangesRequest.new -# Call the list_org_data_exchanges method. -result = client.list_org_data_exchanges request + # Call the list_org_data_exchanges method. + result = client.list_org_data_exchanges request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. + p response + end end # [END analyticshub_v1beta1_generated_AnalyticsHubService_ListOrgDataExchanges_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/set_iam_policy.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/set_iam_policy.rb index c7b20388023d..db6eb2c69cfd 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/set_iam_policy.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_SetIamPolicy_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/subscribe_listing.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/subscribe_listing.rb index 88df4e60d1a8..6b076ccf39ff 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/subscribe_listing.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/subscribe_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#subscribe_listing +# +def subscribe_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::SubscribeListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::SubscribeListingRequest.new -# Call the subscribe_listing method. -result = client.subscribe_listing request + # Call the subscribe_listing method. + result = client.subscribe_listing request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::SubscribeListingResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::SubscribeListingResponse. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_SubscribeListing_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/test_iam_permissions.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/test_iam_permissions.rb index dd9c05ebcce7..3d79ff56963c 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/test_iam_permissions.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_TestIamPermissions_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_data_exchange.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_data_exchange.rb index e810817d3370..21f9fb666e11 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_data_exchange.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_data_exchange.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#update_data_exchange +# +def update_data_exchange + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::UpdateDataExchangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::UpdateDataExchangeRequest.new -# Call the update_data_exchange method. -result = client.update_data_exchange request + # Call the update_data_exchange method. + result = client.update_data_exchange request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::DataExchange. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateDataExchange_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_listing.rb b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_listing.rb index bcfc68f977e7..15ea1c55b174 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_listing.rb +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/analytics_hub_service/update_listing.rb @@ -19,15 +19,21 @@ # [START analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_sync] require "google/cloud/bigquery/data_exchange/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client#update_listing +# +def update_listing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataExchange::V1beta1::AnalyticsHubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataExchange::V1beta1::UpdateListingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataExchange::V1beta1::UpdateListingRequest.new -# Call the update_listing method. -result = client.update_listing request + # Call the update_listing method. + result = client.update_listing request -# The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. -p result + # The returned object is of type Google::Cloud::Bigquery::DataExchange::V1beta1::Listing. + p result +end # [END analyticshub_v1beta1_generated_AnalyticsHubService_UpdateListing_sync] diff --git a/google-cloud-bigquery-data_exchange-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.dataexchange.v1beta1.json b/google-cloud-bigquery-data_exchange-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.dataexchange.v1beta1.json index 3e00220c3d3f..69a14055a9ba 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.dataexchange.v1beta1.json +++ b/google-cloud-bigquery-data_exchange-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.dataexchange.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-data_policies-v1beta1/.rubocop.yml b/google-cloud-bigquery-data_policies-v1beta1/.rubocop.yml index c5e0713d2489..5bc06b98259a 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/.rubocop.yml +++ b/google-cloud-bigquery-data_policies-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-data_policies-v1beta1.rb" diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/Gemfile b/google-cloud-bigquery-data_policies-v1beta1/snippets/Gemfile index 311c424db403..acc9ffb036ad 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/Gemfile +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/create_data_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/create_data_policy.rb index 0f53bd4f6cda..db1b33a7da6e 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/create_data_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/create_data_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#create_data_policy +# +def create_data_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataPolicies::V1beta1::CreateDataPolicyRequest.new -# Call the create_data_policy method. -result = client.create_data_policy request + # Call the create_data_policy method. + result = client.create_data_policy request -# The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. -p result + # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_CreateDataPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/delete_data_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/delete_data_policy.rb index 91cf8a5417db..1f0f15b6d8a7 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/delete_data_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/delete_data_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#delete_data_policy +# +def delete_data_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataPolicies::V1beta1::DeleteDataPolicyRequest.new -# Call the delete_data_policy method. -result = client.delete_data_policy request + # Call the delete_data_policy method. + result = client.delete_data_policy request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_DeleteDataPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_data_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_data_policy.rb index 0a8a089006fd..b295e0098e02 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_data_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_data_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#get_data_policy +# +def get_data_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataPolicies::V1beta1::GetDataPolicyRequest.new -# Call the get_data_policy method. -result = client.get_data_policy request + # Call the get_data_policy method. + result = client.get_data_policy request -# The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. -p result + # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetDataPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_iam_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_iam_policy.rb index 89abc41dca4e..f206c1e13824 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_iam_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_GetIamPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/list_data_policies.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/list_data_policies.rb index dc919d0a538d..1d16ef3cbfbc 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/list_data_policies.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/list_data_policies.rb @@ -19,21 +19,27 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#list_data_policies +# +def list_data_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataPolicies::V1beta1::ListDataPoliciesRequest.new -# Call the list_data_policies method. -result = client.list_data_policies request + # Call the list_data_policies method. + result = client.list_data_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. + p response + end end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_ListDataPolicies_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/set_iam_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/set_iam_policy.rb index 600e98671af0..57a7996ed0f2 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/set_iam_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_SetIamPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/test_iam_permissions.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/test_iam_permissions.rb index 3af4673862b4..5fd3e3c76e74 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/test_iam_permissions.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_TestIamPermissions_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/update_data_policy.rb b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/update_data_policy.rb index 3e0a338b9990..35b1482204bb 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/update_data_policy.rb +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/data_policy_service/update_data_policy.rb @@ -19,15 +19,21 @@ # [START bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_sync] require "google/cloud/bigquery/data_policies/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client#update_data_policy +# +def update_data_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataPolicies::V1beta1::UpdateDataPolicyRequest.new -# Call the update_data_policy method. -result = client.update_data_policy request + # Call the update_data_policy method. + result = client.update_data_policy request -# The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. -p result + # The returned object is of type Google::Cloud::Bigquery::DataPolicies::V1beta1::DataPolicy. + p result +end # [END bigquerydatapolicy_v1beta1_generated_DataPolicyService_UpdateDataPolicy_sync] diff --git a/google-cloud-bigquery-data_policies-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.datapolicies.v1beta1.json b/google-cloud-bigquery-data_policies-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.datapolicies.v1beta1.json index 9893f2ad79e8..426b8622759b 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.datapolicies.v1beta1.json +++ b/google-cloud-bigquery-data_policies-v1beta1/snippets/snippet_metadata_google.cloud.bigquery.datapolicies.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-data_transfer-v1/.rubocop.yml b/google-cloud-bigquery-data_transfer-v1/.rubocop.yml index 92811ed7b679..6f5635fddf0e 100644 --- a/google-cloud-bigquery-data_transfer-v1/.rubocop.yml +++ b/google-cloud-bigquery-data_transfer-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-data_transfer-v1.rb" diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/Gemfile b/google-cloud-bigquery-data_transfer-v1/snippets/Gemfile index f906e79e50b4..d8c924150014 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/Gemfile +++ b/google-cloud-bigquery-data_transfer-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/check_valid_creds.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/check_valid_creds.rb index 25a07f475d74..684970430d85 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/check_valid_creds.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/check_valid_creds.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#check_valid_creds +# +def check_valid_creds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest.new -# Call the check_valid_creds method. -result = client.check_valid_creds request + # Call the check_valid_creds method. + result = client.check_valid_creds request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_CheckValidCreds_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/create_transfer_config.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/create_transfer_config.rb index 7476b3155c34..fd5ad2797a0e 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/create_transfer_config.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/create_transfer_config.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#create_transfer_config +# +def create_transfer_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest.new -# Call the create_transfer_config method. -result = client.create_transfer_config request + # Call the create_transfer_config method. + result = client.create_transfer_config request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_CreateTransferConfig_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_config.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_config.rb index 213becb188ea..fba38df399c7 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_config.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_config.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#delete_transfer_config +# +def delete_transfer_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest.new -# Call the delete_transfer_config method. -result = client.delete_transfer_config request + # Call the delete_transfer_config method. + result = client.delete_transfer_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferConfig_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_run.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_run.rb index f0fd7cc29c1a..4df6b23d408a 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_run.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/delete_transfer_run.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#delete_transfer_run +# +def delete_transfer_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest.new -# Call the delete_transfer_run method. -result = client.delete_transfer_run request + # Call the delete_transfer_run method. + result = client.delete_transfer_run request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_DeleteTransferRun_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/enroll_data_sources.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/enroll_data_sources.rb index c07b70b8e748..3fefd25ebfb9 100644 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/enroll_data_sources.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/enroll_data_sources.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#enroll_data_sources +# +def enroll_data_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest.new -# Call the enroll_data_sources method. -result = client.enroll_data_sources request + # Call the enroll_data_sources method. + result = client.enroll_data_sources request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_EnrollDataSources_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_data_source.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_data_source.rb index 01c7bc49f181..3117e84f431f 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_data_source.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_data_source.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#get_data_source +# +def get_data_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest.new -# Call the get_data_source method. -result = client.get_data_source request + # Call the get_data_source method. + result = client.get_data_source request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::DataSource. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::DataSource. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_GetDataSource_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_config.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_config.rb index f1270084f3d8..76847db43704 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_config.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_config.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#get_transfer_config +# +def get_transfer_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest.new -# Call the get_transfer_config method. -result = client.get_transfer_config request + # Call the get_transfer_config method. + result = client.get_transfer_config request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferConfig_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_run.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_run.rb index ac622e86d64e..128199024ca8 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_run.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/get_transfer_run.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#get_transfer_run +# +def get_transfer_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest.new -# Call the get_transfer_run method. -result = client.get_transfer_run request + # Call the get_transfer_run method. + result = client.get_transfer_run request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferRun. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferRun. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_GetTransferRun_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_data_sources.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_data_sources.rb index ea3eefef9797..03cb7b436d47 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_data_sources.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_data_sources.rb @@ -19,21 +19,27 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#list_data_sources +# +def list_data_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest.new -# Call the list_data_sources method. -result = client.list_data_sources request + # Call the list_data_sources method. + result = client.list_data_sources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource. + p response + end end # [END bigquerydatatransfer_v1_generated_DataTransferService_ListDataSources_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_configs.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_configs.rb index ea210a351f17..90c5999da31f 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_configs.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_configs.rb @@ -19,21 +19,27 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#list_transfer_configs +# +def list_transfer_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest.new -# Call the list_transfer_configs method. -result = client.list_transfer_configs request + # Call the list_transfer_configs method. + result = client.list_transfer_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. + p response + end end # [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferConfigs_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_logs.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_logs.rb index 8a1f5f9b3a23..9a99d0cfd7e1 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_logs.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_logs.rb @@ -19,21 +19,27 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#list_transfer_logs +# +def list_transfer_logs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest.new -# Call the list_transfer_logs method. -result = client.list_transfer_logs request + # Call the list_transfer_logs method. + result = client.list_transfer_logs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage. + p response + end end # [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferLogs_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_runs.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_runs.rb index a08ca57068dd..e5517b7fee3e 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_runs.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/list_transfer_runs.rb @@ -19,21 +19,27 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#list_transfer_runs +# +def list_transfer_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest.new -# Call the list_transfer_runs method. -result = client.list_transfer_runs request + # Call the list_transfer_runs method. + result = client.list_transfer_runs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun. + p response + end end # [END bigquerydatatransfer_v1_generated_DataTransferService_ListTransferRuns_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/schedule_transfer_runs.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/schedule_transfer_runs.rb index 39fe832b1fac..ec820b8ba72e 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/schedule_transfer_runs.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/schedule_transfer_runs.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#schedule_transfer_runs +# +def schedule_transfer_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest.new -# Call the schedule_transfer_runs method. -result = client.schedule_transfer_runs request + # Call the schedule_transfer_runs method. + result = client.schedule_transfer_runs request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_ScheduleTransferRuns_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/start_manual_transfer_runs.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/start_manual_transfer_runs.rb index 61b9412d48d8..a1a4200fcf82 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/start_manual_transfer_runs.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/start_manual_transfer_runs.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#start_manual_transfer_runs +# +def start_manual_transfer_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest.new -# Call the start_manual_transfer_runs method. -result = client.start_manual_transfer_runs request + # Call the start_manual_transfer_runs method. + result = client.start_manual_transfer_runs request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_StartManualTransferRuns_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/update_transfer_config.rb b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/update_transfer_config.rb index bf383dfcf37d..01d7b6e5eda3 100755 --- a/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/update_transfer_config.rb +++ b/google-cloud-bigquery-data_transfer-v1/snippets/data_transfer_service/update_transfer_config.rb @@ -19,15 +19,21 @@ # [START bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_sync] require "google/cloud/bigquery/data_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client#update_transfer_config +# +def update_transfer_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest.new -# Call the update_transfer_config method. -result = client.update_transfer_config request + # Call the update_transfer_config method. + result = client.update_transfer_config request -# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. -p result + # The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig. + p result +end # [END bigquerydatatransfer_v1_generated_DataTransferService_UpdateTransferConfig_sync] diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json b/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json index cf323b26b849..3100e0316543 100644 --- a/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json +++ b/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-migration-v2/.rubocop.yml b/google-cloud-bigquery-migration-v2/.rubocop.yml index f440006968e5..57be07ac546b 100644 --- a/google-cloud-bigquery-migration-v2/.rubocop.yml +++ b/google-cloud-bigquery-migration-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-migration-v2.rb" diff --git a/google-cloud-bigquery-migration-v2/snippets/Gemfile b/google-cloud-bigquery-migration-v2/snippets/Gemfile index a519a453775d..5ff81d7f35f5 100644 --- a/google-cloud-bigquery-migration-v2/snippets/Gemfile +++ b/google-cloud-bigquery-migration-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/create_migration_workflow.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/create_migration_workflow.rb index f1796e0c313c..8a28ad201bc3 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/create_migration_workflow.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/create_migration_workflow.rb @@ -19,15 +19,21 @@ # [START bigquerymigration_v2_generated_MigrationService_CreateMigrationWorkflow_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#create_migration_workflow +# +def create_migration_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::CreateMigrationWorkflowRequest.new -# Call the create_migration_workflow method. -result = client.create_migration_workflow request + # Call the create_migration_workflow method. + result = client.create_migration_workflow request -# The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. -p result + # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. + p result +end # [END bigquerymigration_v2_generated_MigrationService_CreateMigrationWorkflow_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/delete_migration_workflow.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/delete_migration_workflow.rb index ab15fd8b12df..5a41e6ba058f 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/delete_migration_workflow.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/delete_migration_workflow.rb @@ -19,15 +19,21 @@ # [START bigquerymigration_v2_generated_MigrationService_DeleteMigrationWorkflow_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#delete_migration_workflow +# +def delete_migration_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::DeleteMigrationWorkflowRequest.new -# Call the delete_migration_workflow method. -result = client.delete_migration_workflow request + # Call the delete_migration_workflow method. + result = client.delete_migration_workflow request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerymigration_v2_generated_MigrationService_DeleteMigrationWorkflow_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_subtask.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_subtask.rb index 33cdcf362d69..28df92be024e 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_subtask.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_subtask.rb @@ -19,15 +19,21 @@ # [START bigquerymigration_v2_generated_MigrationService_GetMigrationSubtask_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#get_migration_subtask +# +def get_migration_subtask + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::GetMigrationSubtaskRequest.new -# Call the get_migration_subtask method. -result = client.get_migration_subtask request + # Call the get_migration_subtask method. + result = client.get_migration_subtask request -# The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationSubtask. -p result + # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationSubtask. + p result +end # [END bigquerymigration_v2_generated_MigrationService_GetMigrationSubtask_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_workflow.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_workflow.rb index 48a59562b1f4..108ce283eda0 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_workflow.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/get_migration_workflow.rb @@ -19,15 +19,21 @@ # [START bigquerymigration_v2_generated_MigrationService_GetMigrationWorkflow_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#get_migration_workflow +# +def get_migration_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::GetMigrationWorkflowRequest.new -# Call the get_migration_workflow method. -result = client.get_migration_workflow request + # Call the get_migration_workflow method. + result = client.get_migration_workflow request -# The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. -p result + # The returned object is of type Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. + p result +end # [END bigquerymigration_v2_generated_MigrationService_GetMigrationWorkflow_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_subtasks.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_subtasks.rb index 03f861f73186..76b34ce50b7e 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_subtasks.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_subtasks.rb @@ -19,21 +19,27 @@ # [START bigquerymigration_v2_generated_MigrationService_ListMigrationSubtasks_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#list_migration_subtasks +# +def list_migration_subtasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::ListMigrationSubtasksRequest.new -# Call the list_migration_subtasks method. -result = client.list_migration_subtasks request + # Call the list_migration_subtasks method. + result = client.list_migration_subtasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationSubtask. + p response + end end # [END bigquerymigration_v2_generated_MigrationService_ListMigrationSubtasks_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_workflows.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_workflows.rb index 089339176e0a..c2dff0cf6c34 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_workflows.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/list_migration_workflows.rb @@ -19,21 +19,27 @@ # [START bigquerymigration_v2_generated_MigrationService_ListMigrationWorkflows_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#list_migration_workflows +# +def list_migration_workflows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::ListMigrationWorkflowsRequest.new -# Call the list_migration_workflows method. -result = client.list_migration_workflows request + # Call the list_migration_workflows method. + result = client.list_migration_workflows request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Migration::V2::MigrationWorkflow. + p response + end end # [END bigquerymigration_v2_generated_MigrationService_ListMigrationWorkflows_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/migration_service/start_migration_workflow.rb b/google-cloud-bigquery-migration-v2/snippets/migration_service/start_migration_workflow.rb index 1601812d89bb..420c9c34745c 100644 --- a/google-cloud-bigquery-migration-v2/snippets/migration_service/start_migration_workflow.rb +++ b/google-cloud-bigquery-migration-v2/snippets/migration_service/start_migration_workflow.rb @@ -19,15 +19,21 @@ # [START bigquerymigration_v2_generated_MigrationService_StartMigrationWorkflow_sync] require "google/cloud/bigquery/migration/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Migration::V2::MigrationService::Client#start_migration_workflow +# +def start_migration_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Migration::V2::MigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Migration::V2::StartMigrationWorkflowRequest.new -# Call the start_migration_workflow method. -result = client.start_migration_workflow request + # Call the start_migration_workflow method. + result = client.start_migration_workflow request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigquerymigration_v2_generated_MigrationService_StartMigrationWorkflow_sync] diff --git a/google-cloud-bigquery-migration-v2/snippets/snippet_metadata_google.cloud.bigquery.migration.v2.json b/google-cloud-bigquery-migration-v2/snippets/snippet_metadata_google.cloud.bigquery.migration.v2.json index ac98a0e778f5..0076647340b8 100644 --- a/google-cloud-bigquery-migration-v2/snippets/snippet_metadata_google.cloud.bigquery.migration.v2.json +++ b/google-cloud-bigquery-migration-v2/snippets/snippet_metadata_google.cloud.bigquery.migration.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-bigquery-reservation-v1/.rubocop.yml b/google-cloud-bigquery-reservation-v1/.rubocop.yml index 0364f360675f..9001cc0bde65 100644 --- a/google-cloud-bigquery-reservation-v1/.rubocop.yml +++ b/google-cloud-bigquery-reservation-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-reservation-v1.rb" diff --git a/google-cloud-bigquery-reservation-v1/snippets/Gemfile b/google-cloud-bigquery-reservation-v1/snippets/Gemfile index f92c998c330e..06df9d1e22aa 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/Gemfile +++ b/google-cloud-bigquery-reservation-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb index 1e5b727cdad2..4e6806ac2bc5 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_assignment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_assignment +# +def create_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateAssignmentRequest.new -# Call the create_assignment method. -result = client.create_assignment request + # Call the create_assignment method. + result = client.create_assignment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_CreateAssignment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb index 068826eb2edd..88d9d25e4bf4 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_capacity_commitment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_capacity_commitment +# +def create_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateCapacityCommitmentRequest.new -# Call the create_capacity_commitment method. -result = client.create_capacity_commitment request + # Call the create_capacity_commitment method. + result = client.create_capacity_commitment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_CreateCapacityCommitment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb index c66021f95ad7..98bae5a07814 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/create_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#create_reservation +# +def create_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::CreateReservationRequest.new -# Call the create_reservation method. -result = client.create_reservation request + # Call the create_reservation method. + result = client.create_reservation request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_CreateReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb index d13786b85ce7..a3adf657a017 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_assignment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_assignment +# +def delete_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteAssignmentRequest.new -# Call the delete_assignment method. -result = client.delete_assignment request + # Call the delete_assignment method. + result = client.delete_assignment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_DeleteAssignment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb index e8fb0d0267e2..90d48edc6f19 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_capacity_commitment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_capacity_commitment +# +def delete_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteCapacityCommitmentRequest.new -# Call the delete_capacity_commitment method. -result = client.delete_capacity_commitment request + # Call the delete_capacity_commitment method. + result = client.delete_capacity_commitment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_DeleteCapacityCommitment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb index 08b9f0c032c7..7155eebb750c 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/delete_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#delete_reservation +# +def delete_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::DeleteReservationRequest.new -# Call the delete_reservation method. -result = client.delete_reservation request + # Call the delete_reservation method. + result = client.delete_reservation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_DeleteReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb index f6b3ccb13af0..8c7f6463305f 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_bi_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_bi_reservation +# +def get_bi_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetBiReservationRequest.new -# Call the get_bi_reservation method. -result = client.get_bi_reservation request + # Call the get_bi_reservation method. + result = client.get_bi_reservation request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_GetBiReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb index 31a8e218880b..f5a12e2b9914 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_capacity_commitment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_capacity_commitment +# +def get_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetCapacityCommitmentRequest.new -# Call the get_capacity_commitment method. -result = client.get_capacity_commitment request + # Call the get_capacity_commitment method. + result = client.get_capacity_commitment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_GetCapacityCommitment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb index 1769853c5961..12953115a323 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/get_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#get_reservation +# +def get_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::GetReservationRequest.new -# Call the get_reservation method. -result = client.get_reservation request + # Call the get_reservation method. + result = client.get_reservation request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_GetReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb index 0182ff9a2d31..e23738fdaeb0 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_assignments.rb @@ -19,21 +19,27 @@ # [START bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_assignments +# +def list_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListAssignmentsRequest.new -# Call the list_assignments method. -result = client.list_assignments request + # Call the list_assignments method. + result = client.list_assignments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p response + end end # [END bigqueryreservation_v1_generated_ReservationService_ListAssignments_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb index 845bdcd936a8..97b9ec6db694 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_capacity_commitments.rb @@ -19,21 +19,27 @@ # [START bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_capacity_commitments +# +def list_capacity_commitments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListCapacityCommitmentsRequest.new -# Call the list_capacity_commitments method. -result = client.list_capacity_commitments request + # Call the list_capacity_commitments method. + result = client.list_capacity_commitments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p response + end end # [END bigqueryreservation_v1_generated_ReservationService_ListCapacityCommitments_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb index 2509fd162200..d8ada437bebf 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/list_reservations.rb @@ -19,21 +19,27 @@ # [START bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#list_reservations +# +def list_reservations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::ListReservationsRequest.new -# Call the list_reservations method. -result = client.list_reservations request + # Call the list_reservations method. + result = client.list_reservations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Reservation. + p response + end end # [END bigqueryreservation_v1_generated_ReservationService_ListReservations_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb index 121e5fb31521..518e27af4494 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/merge_capacity_commitments.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#merge_capacity_commitments +# +def merge_capacity_commitments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::MergeCapacityCommitmentsRequest.new -# Call the merge_capacity_commitments method. -result = client.merge_capacity_commitments request + # Call the merge_capacity_commitments method. + result = client.merge_capacity_commitments request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_MergeCapacityCommitments_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb index 78306a6b53ee..94606562cbf8 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/move_assignment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#move_assignment +# +def move_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::MoveAssignmentRequest.new -# Call the move_assignment method. -result = client.move_assignment request + # Call the move_assignment method. + result = client.move_assignment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_MoveAssignment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb index c3633048761e..ec6163281b35 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_all_assignments.rb @@ -19,21 +19,27 @@ # [START bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_all_assignments +# +def search_all_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SearchAllAssignmentsRequest.new -# Call the search_all_assignments method. -result = client.search_all_assignments request + # Call the search_all_assignments method. + result = client.search_all_assignments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p response + end end # [END bigqueryreservation_v1_generated_ReservationService_SearchAllAssignments_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb index 30afc5aa9d01..f98dcb1b4b75 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/search_assignments.rb @@ -19,21 +19,27 @@ # [START bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#search_assignments +# +def search_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SearchAssignmentsRequest.new -# Call the search_assignments method. -result = client.search_assignments request + # Call the search_assignments method. + result = client.search_assignments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigquery::Reservation::V1::Assignment. + p response + end end # [END bigqueryreservation_v1_generated_ReservationService_SearchAssignments_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb index b7bf1ac525e1..196128341a22 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/split_capacity_commitment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#split_capacity_commitment +# +def split_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentRequest.new -# Call the split_capacity_commitment method. -result = client.split_capacity_commitment request + # Call the split_capacity_commitment method. + result = client.split_capacity_commitment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::SplitCapacityCommitmentResponse. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_SplitCapacityCommitment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb index 4539422b7474..4c434b8d9518 100644 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_assignment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_assignment +# +def update_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateAssignmentRequest.new -# Call the update_assignment method. -result = client.update_assignment request + # Call the update_assignment method. + result = client.update_assignment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Assignment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_UpdateAssignment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb index 316d11ca434f..663f25de962e 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_bi_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_bi_reservation +# +def update_bi_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateBiReservationRequest.new -# Call the update_bi_reservation method. -result = client.update_bi_reservation request + # Call the update_bi_reservation method. + result = client.update_bi_reservation request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::BiReservation. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_UpdateBiReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb index 1229222a2490..e03459a5a702 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_capacity_commitment.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_capacity_commitment +# +def update_capacity_commitment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateCapacityCommitmentRequest.new -# Call the update_capacity_commitment method. -result = client.update_capacity_commitment request + # Call the update_capacity_commitment method. + result = client.update_capacity_commitment request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::CapacityCommitment. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_UpdateCapacityCommitment_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb index 412f58c38577..59b9377e6dc9 100755 --- a/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb +++ b/google-cloud-bigquery-reservation-v1/snippets/reservation_service/update_reservation.rb @@ -19,15 +19,21 @@ # [START bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] require "google/cloud/bigquery/reservation/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client#update_reservation +# +def update_reservation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Reservation::V1::ReservationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Reservation::V1::UpdateReservationRequest.new -# Call the update_reservation method. -result = client.update_reservation request + # Call the update_reservation method. + result = client.update_reservation request -# The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. -p result + # The returned object is of type Google::Cloud::Bigquery::Reservation::V1::Reservation. + p result +end # [END bigqueryreservation_v1_generated_ReservationService_UpdateReservation_sync] diff --git a/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json b/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json index 08413312cce8..a2ca21adfbf3 100644 --- a/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json +++ b/google-cloud-bigquery-reservation-v1/snippets/snippet_metadata_google.cloud.bigquery.reservation.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigquery-storage-v1/.rubocop.yml b/google-cloud-bigquery-storage-v1/.rubocop.yml index c56b8995880d..bb0c68b12d1c 100644 --- a/google-cloud-bigquery-storage-v1/.rubocop.yml +++ b/google-cloud-bigquery-storage-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigquery-storage-v1.rb" diff --git a/google-cloud-bigquery-storage-v1/snippets/Gemfile b/google-cloud-bigquery-storage-v1/snippets/Gemfile index 279741259ad4..5ceb968cd5a6 100755 --- a/google-cloud-bigquery-storage-v1/snippets/Gemfile +++ b/google-cloud-bigquery-storage-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_read/create_read_session.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_read/create_read_session.rb index 64614a163672..d23f37aa5703 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_read/create_read_session.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_read/create_read_session.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client#create_read_session +# +def create_read_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::CreateReadSessionRequest.new -# Call the create_read_session method. -result = client.create_read_session request + # Call the create_read_session method. + result = client.create_read_session request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::ReadSession. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::ReadSession. + p result +end # [END bigquerystorage_v1_generated_BigQueryRead_CreateReadSession_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_read/read_rows.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_read/read_rows.rb index d997256e40bd..8b18110a10dc 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_read/read_rows.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_read/read_rows.rb @@ -19,18 +19,24 @@ # [START bigquerystorage_v1_generated_BigQueryRead_ReadRows_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client#read_rows +# +def read_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::ReadRowsRequest.new -# Call the read_rows method. -result = client.read_rows request + # Call the read_rows method. + result = client.read_rows request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Bigquery::Storage::V1::ReadRowsResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Bigquery::Storage::V1::ReadRowsResponse. + result.each do |response| + p response + end end # [END bigquerystorage_v1_generated_BigQueryRead_ReadRows_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_read/split_read_stream.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_read/split_read_stream.rb index 612edf362f0d..280b05a1bf86 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_read/split_read_stream.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_read/split_read_stream.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client#split_read_stream +# +def split_read_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryRead::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::SplitReadStreamRequest.new -# Call the split_read_stream method. -result = client.split_read_stream request + # Call the split_read_stream method. + result = client.split_read_stream request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::SplitReadStreamResponse. + p result +end # [END bigquerystorage_v1_generated_BigQueryRead_SplitReadStream_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/append_rows.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/append_rows.rb index a00965ceb751..0cc21ae19322 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/append_rows.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/append_rows.rb @@ -19,24 +19,30 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_AppendRows_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the append_rows method to start streaming. -output = client.append_rows input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new -input << Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Bigquery::Storage::V1::AppendRowsResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#append_rows +# +def append_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the append_rows method to start streaming. + output = client.append_rows input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new + input << Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Bigquery::Storage::V1::AppendRowsResponse. + output.each do |response| + p response + end end # [END bigquerystorage_v1_generated_BigQueryWrite_AppendRows_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/batch_commit_write_streams.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/batch_commit_write_streams.rb index c689c05f80ea..142f528a82f3 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/batch_commit_write_streams.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/batch_commit_write_streams.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#batch_commit_write_streams +# +def batch_commit_write_streams + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::BatchCommitWriteStreamsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::BatchCommitWriteStreamsRequest.new -# Call the batch_commit_write_streams method. -result = client.batch_commit_write_streams request + # Call the batch_commit_write_streams method. + result = client.batch_commit_write_streams request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::BatchCommitWriteStreamsResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::BatchCommitWriteStreamsResponse. + p result +end # [END bigquerystorage_v1_generated_BigQueryWrite_BatchCommitWriteStreams_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/create_write_stream.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/create_write_stream.rb index 464101a869b8..8a28402a5560 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/create_write_stream.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/create_write_stream.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#create_write_stream +# +def create_write_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::CreateWriteStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::CreateWriteStreamRequest.new -# Call the create_write_stream method. -result = client.create_write_stream request + # Call the create_write_stream method. + result = client.create_write_stream request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::WriteStream. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::WriteStream. + p result +end # [END bigquerystorage_v1_generated_BigQueryWrite_CreateWriteStream_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/finalize_write_stream.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/finalize_write_stream.rb index 413cf9111af5..30068d4483e2 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/finalize_write_stream.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/finalize_write_stream.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#finalize_write_stream +# +def finalize_write_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::FinalizeWriteStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::FinalizeWriteStreamRequest.new -# Call the finalize_write_stream method. -result = client.finalize_write_stream request + # Call the finalize_write_stream method. + result = client.finalize_write_stream request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::FinalizeWriteStreamResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::FinalizeWriteStreamResponse. + p result +end # [END bigquerystorage_v1_generated_BigQueryWrite_FinalizeWriteStream_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/flush_rows.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/flush_rows.rb index 17f43fa9498f..9a13d7314faf 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/flush_rows.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/flush_rows.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_FlushRows_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#flush_rows +# +def flush_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::FlushRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::FlushRowsRequest.new -# Call the flush_rows method. -result = client.flush_rows request + # Call the flush_rows method. + result = client.flush_rows request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::FlushRowsResponse. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::FlushRowsResponse. + p result +end # [END bigquerystorage_v1_generated_BigQueryWrite_FlushRows_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/big_query_write/get_write_stream.rb b/google-cloud-bigquery-storage-v1/snippets/big_query_write/get_write_stream.rb index 5faeac2c62ba..52b0aad08474 100755 --- a/google-cloud-bigquery-storage-v1/snippets/big_query_write/get_write_stream.rb +++ b/google-cloud-bigquery-storage-v1/snippets/big_query_write/get_write_stream.rb @@ -19,15 +19,21 @@ # [START bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_sync] require "google/cloud/bigquery/storage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client#get_write_stream +# +def get_write_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigquery::Storage::V1::BigQueryWrite::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigquery::Storage::V1::GetWriteStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigquery::Storage::V1::GetWriteStreamRequest.new -# Call the get_write_stream method. -result = client.get_write_stream request + # Call the get_write_stream method. + result = client.get_write_stream request -# The returned object is of type Google::Cloud::Bigquery::Storage::V1::WriteStream. -p result + # The returned object is of type Google::Cloud::Bigquery::Storage::V1::WriteStream. + p result +end # [END bigquerystorage_v1_generated_BigQueryWrite_GetWriteStream_sync] diff --git a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json index 7e136fe4f48f..ad13538d71ee 100644 --- a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json +++ b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigtable-admin-v2/.rubocop.yml b/google-cloud-bigtable-admin-v2/.rubocop.yml index 9cb86fe73482..8b307e35af07 100644 --- a/google-cloud-bigtable-admin-v2/.rubocop.yml +++ b/google-cloud-bigtable-admin-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigtable-admin-v2.rb" diff --git a/google-cloud-bigtable-admin-v2/snippets/Gemfile b/google-cloud-bigtable-admin-v2/snippets/Gemfile index d04165e46684..9dc6b8f5aca1 100755 --- a/google-cloud-bigtable-admin-v2/snippets/Gemfile +++ b/google-cloud-bigtable-admin-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_app_profile.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_app_profile.rb index 4549866fd45b..52c67e59a7b1 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_app_profile.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_app_profile.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#create_app_profile +# +def create_app_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateAppProfileRequest.new -# Call the create_app_profile method. -result = client.create_app_profile request + # Call the create_app_profile method. + result = client.create_app_profile request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_cluster.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_cluster.rb index a89c9e363a76..7870511681bb 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_cluster.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_cluster.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#create_cluster +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateClusterRequest.new -# Call the create_cluster method. -result = client.create_cluster request + # Call the create_cluster method. + result = client.create_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_instance.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_instance.rb index e2e6823c4955..02fefaa1eccc 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_instance.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/create_instance.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_app_profile.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_app_profile.rb index 07c7bfc16482..e7cace7a634b 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_app_profile.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_app_profile.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#delete_app_profile +# +def delete_app_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteAppProfileRequest.new -# Call the delete_app_profile method. -result = client.delete_app_profile request + # Call the delete_app_profile method. + result = client.delete_app_profile request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_cluster.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_cluster.rb index dc6f536423af..f52bad9b00a3 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_cluster.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_cluster.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#delete_cluster +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteClusterRequest.new -# Call the delete_cluster method. -result = client.delete_cluster request + # Call the delete_cluster method. + result = client.delete_cluster request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_instance.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_instance.rb index 9c372f5ba76f..ab3d680a5f32 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_instance.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/delete_instance.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_app_profile.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_app_profile.rb index dc38a0b58d4f..c8f5715b5026 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_app_profile.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_app_profile.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#get_app_profile +# +def get_app_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetAppProfileRequest.new -# Call the get_app_profile method. -result = client.get_app_profile request + # Call the get_app_profile method. + result = client.get_app_profile request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::AppProfile. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_cluster.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_cluster.rb index 6725c9ff2117..141714ea5de3 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_cluster.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_cluster.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#get_cluster +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetClusterRequest.new -# Call the get_cluster method. -result = client.get_cluster request + # Call the get_cluster method. + result = client.get_cluster request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Cluster. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Cluster. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_iam_policy.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_iam_policy.rb index e564922622b5..4cdf9339c98e 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_iam_policy.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_instance.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_instance.rb index 967640ad073c..9b33d74f6e2c 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_instance.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/get_instance.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_app_profiles.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_app_profiles.rb index e3b1f5c203c2..e232b6383f14 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_app_profiles.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_app_profiles.rb @@ -19,21 +19,27 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#list_app_profiles +# +def list_app_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListAppProfilesRequest.new -# Call the list_app_profiles method. -result = client.list_app_profiles request + # Call the list_app_profiles method. + result = client.list_app_profiles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::AppProfile. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::AppProfile. + p response + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_clusters.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_clusters.rb index fb7d2bd38fd0..afd54345006a 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_clusters.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_clusters.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#list_clusters +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListClustersRequest.new -# Call the list_clusters method. -result = client.list_clusters request + # Call the list_clusters method. + result = client.list_clusters request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListClustersResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListClustersResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_hot_tablets.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_hot_tablets.rb index 1daa32e48ced..8258ef83096d 100644 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_hot_tablets.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_hot_tablets.rb @@ -19,21 +19,27 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#list_hot_tablets +# +def list_hot_tablets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListHotTabletsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListHotTabletsRequest.new -# Call the list_hot_tablets method. -result = client.list_hot_tablets request + # Call the list_hot_tablets method. + result = client.list_hot_tablets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::HotTablet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::HotTablet. + p response + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_instances.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_instances.rb index 0b2291e68212..5e5a0f54184f 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_instances.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/list_instances.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::ListInstancesResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_cluster.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_cluster.rb index a7120797f9c3..981f1ca0bb65 100644 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_cluster.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_cluster.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#partial_update_cluster +# +def partial_update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateClusterRequest.new -# Call the partial_update_cluster method. -result = client.partial_update_cluster request + # Call the partial_update_cluster method. + result = client.partial_update_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_instance.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_instance.rb index f8fb2f89cca8..dd6a98c02f66 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_instance.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/partial_update_instance.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#partial_update_instance +# +def partial_update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::PartialUpdateInstanceRequest.new -# Call the partial_update_instance method. -result = client.partial_update_instance request + # Call the partial_update_instance method. + result = client.partial_update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/set_iam_policy.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/set_iam_policy.rb index 09df7ae7e1ad..23db07baa46c 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/set_iam_policy.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/test_iam_permissions.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/test_iam_permissions.rb index 7df31c3413f8..3b4d25537f6b 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/test_iam_permissions.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_app_profile.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_app_profile.rb index 471ebb45d865..a7e2cfa60485 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_app_profile.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_app_profile.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#update_app_profile +# +def update_app_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::UpdateAppProfileRequest.new -# Call the update_app_profile method. -result = client.update_app_profile request + # Call the update_app_profile method. + result = client.update_app_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_cluster.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_cluster.rb index 1df566e9d114..6dbdb1513717 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_cluster.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_cluster.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#update_cluster +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::Cluster.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::Cluster.new -# Call the update_cluster method. -result = client.update_cluster request + # Call the update_cluster method. + result = client.update_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_instance.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_instance.rb index dacae97b9ec8..2529914cac00 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_instance.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_instance_admin/update_instance.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableInstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::Instance.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::Instance.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Instance. + p result +end # [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/check_consistency.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/check_consistency.rb index bd6aefe084eb..c8196fc35662 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/check_consistency.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/check_consistency.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#check_consistency +# +def check_consistency + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CheckConsistencyRequest.new -# Call the check_consistency method. -result = client.check_consistency request + # Call the check_consistency method. + result = client.check_consistency request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::CheckConsistencyResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_backup.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_backup.rb index 9d8bd3d978e6..2e23257ee45c 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_backup.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_backup.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table.rb index f34899eb9138..347bae55221d 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#create_table +# +def create_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateTableRequest.new -# Call the create_table method. -result = client.create_table request + # Call the create_table method. + result = client.create_table request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table_from_snapshot.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table_from_snapshot.rb index 50bc6e66e266..a45f28ab717c 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table_from_snapshot.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/create_table_from_snapshot.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#create_table_from_snapshot +# +def create_table_from_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::CreateTableFromSnapshotRequest.new -# Call the create_table_from_snapshot method. -result = client.create_table_from_snapshot request + # Call the create_table_from_snapshot method. + result = client.create_table_from_snapshot request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_backup.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_backup.rb index 2d8e8bf0e59c..3a3925643e40 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_backup.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_backup.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_snapshot.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_snapshot.rb index 47dc60bb5e4a..11cface14a73 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_snapshot.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_snapshot.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#delete_snapshot +# +def delete_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteSnapshotRequest.new -# Call the delete_snapshot method. -result = client.delete_snapshot request + # Call the delete_snapshot method. + result = client.delete_snapshot request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_table.rb index 09f600e90171..63c7fc959e34 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/delete_table.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#delete_table +# +def delete_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DeleteTableRequest.new -# Call the delete_table method. -result = client.delete_table request + # Call the delete_table method. + result = client.delete_table request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/drop_row_range.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/drop_row_range.rb index 977177e63454..ea5d8542a30e 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/drop_row_range.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/drop_row_range.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#drop_row_range +# +def drop_row_range + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::DropRowRangeRequest.new -# Call the drop_row_range method. -result = client.drop_row_range request + # Call the drop_row_range method. + result = client.drop_row_range request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/generate_consistency_token.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/generate_consistency_token.rb index 7a5057091dd1..fd44a4938a2e 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/generate_consistency_token.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/generate_consistency_token.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#generate_consistency_token +# +def generate_consistency_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenRequest.new -# Call the generate_consistency_token method. -result = client.generate_consistency_token request + # Call the generate_consistency_token method. + result = client.generate_consistency_token request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::GenerateConsistencyTokenResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_backup.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_backup.rb index d37c456d5785..1ad5362459f1 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_backup.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_backup.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_iam_policy.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_iam_policy.rb index 7ceaa24dcffd..895f560bd49b 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_iam_policy.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_snapshot.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_snapshot.rb index e5570bd2c78e..9e5fb0beb96b 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_snapshot.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_snapshot.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#get_snapshot +# +def get_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetSnapshotRequest.new -# Call the get_snapshot method. -result = client.get_snapshot request + # Call the get_snapshot method. + result = client.get_snapshot request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Snapshot. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Snapshot. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_table.rb index 536df8e7ee63..e0b2e799fb6b 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/get_table.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#get_table +# +def get_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::GetTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::GetTableRequest.new -# Call the get_table method. -result = client.get_table request + # Call the get_table method. + result = client.get_table request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_backups.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_backups.rb index 30614999306b..f70abcd05e0c 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_backups.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_backups.rb @@ -19,21 +19,27 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Backup. + p response + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_snapshots.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_snapshots.rb index e3d57287105e..105d1b245a62 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_snapshots.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_snapshots.rb @@ -19,21 +19,27 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#list_snapshots +# +def list_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListSnapshotsRequest.new -# Call the list_snapshots method. -result = client.list_snapshots request + # Call the list_snapshots method. + result = client.list_snapshots request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Snapshot. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Snapshot. + p response + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_tables.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_tables.rb index 5a9b229474c0..0853f6275c34 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_tables.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/list_tables.rb @@ -19,21 +19,27 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#list_tables +# +def list_tables + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ListTablesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ListTablesRequest.new -# Call the list_tables method. -result = client.list_tables request + # Call the list_tables method. + result = client.list_tables request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Table. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Bigtable::Admin::V2::Table. + p response + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/modify_column_families.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/modify_column_families.rb index f7b58b9210d1..4ddd46d53988 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/modify_column_families.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/modify_column_families.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#modify_column_families +# +def modify_column_families + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::ModifyColumnFamiliesRequest.new -# Call the modify_column_families method. -result = client.modify_column_families request + # Call the modify_column_families method. + result = client.modify_column_families request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Table. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/restore_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/restore_table.rb index 7f65392d5fb5..52b00a1f19e2 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/restore_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/restore_table.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#restore_table +# +def restore_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::RestoreTableRequest.new -# Call the restore_table method. -result = client.restore_table request + # Call the restore_table method. + result = client.restore_table request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/set_iam_policy.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/set_iam_policy.rb index e447725e7171..acf7d78e24f1 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/set_iam_policy.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/snapshot_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/snapshot_table.rb index 2fc611e9228e..51fac0132e42 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/snapshot_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/snapshot_table.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#snapshot_table +# +def snapshot_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::SnapshotTableRequest.new -# Call the snapshot_table method. -result = client.snapshot_table request + # Call the snapshot_table method. + result = client.snapshot_table request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/test_iam_permissions.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/test_iam_permissions.rb index f75219c43594..cf9ebafa0860 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/test_iam_permissions.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/undelete_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/undelete_table.rb index 9dd3c0ae0d5e..8557bd932648 100644 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/undelete_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/undelete_table.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#undelete_table +# +def undelete_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::UndeleteTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::UndeleteTableRequest.new -# Call the undelete_table method. -result = client.undelete_table request + # Call the undelete_table method. + result = client.undelete_table request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_backup.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_backup.rb index ba9179aecbaa..26b13e910c13 100755 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_backup.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_backup.rb @@ -19,15 +19,21 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#update_backup +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::UpdateBackupRequest.new -# Call the update_backup method. -result = client.update_backup request + # Call the update_backup method. + result = client.update_backup request -# The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup. -p result + # The returned object is of type Google::Cloud::Bigtable::Admin::V2::Backup. + p result +end # [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_table.rb b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_table.rb index cef86a81e3fd..0be0afb2d9f3 100644 --- a/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_table.rb +++ b/google-cloud-bigtable-admin-v2/snippets/bigtable_table_admin/update_table.rb @@ -19,22 +19,28 @@ # [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync] require "google/cloud/bigtable/admin/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client#update_table +# +def update_table + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::Admin::V2::UpdateTableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::Admin::V2::UpdateTableRequest.new -# Call the update_table method. -result = client.update_table request + # Call the update_table method. + result = client.update_table request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync] diff --git a/google-cloud-bigtable-admin-v2/snippets/snippet_metadata_google.bigtable.admin.v2.json b/google-cloud-bigtable-admin-v2/snippets/snippet_metadata_google.bigtable.admin.v2.json index 6e36218ed242..9019c85c2ce1 100644 --- a/google-cloud-bigtable-admin-v2/snippets/snippet_metadata_google.bigtable.admin.v2.json +++ b/google-cloud-bigtable-admin-v2/snippets/snippet_metadata_google.bigtable.admin.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-bigtable-v2/.repo-metadata.json b/google-cloud-bigtable-v2/.repo-metadata.json index dd9e475dcc78..326213a18420 100644 --- a/google-cloud-bigtable-v2/.repo-metadata.json +++ b/google-cloud-bigtable-v2/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Cloud Bigtable is a fully managed, scalable NoSQL database service for large analytical and operational workloads. Note that google-cloud-bigtable-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-bigtable instead. See the readme for more details.", "ruby-cloud-env-prefix": "BIGTABLE", "ruby-cloud-product-url": "https://cloud.google.com/bigtable", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-bigtable-v2/.rubocop.yml b/google-cloud-bigtable-v2/.rubocop.yml index b7f4aaaefdbe..c6789d42c34e 100644 --- a/google-cloud-bigtable-v2/.rubocop.yml +++ b/google-cloud-bigtable-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-bigtable-v2.rb" diff --git a/google-cloud-bigtable-v2/snippets/Gemfile b/google-cloud-bigtable-v2/snippets/Gemfile index c535cacfc563..5c9c77625d61 100755 --- a/google-cloud-bigtable-v2/snippets/Gemfile +++ b/google-cloud-bigtable-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-bigtable-v2/snippets/bigtable/check_and_mutate_row.rb b/google-cloud-bigtable-v2/snippets/bigtable/check_and_mutate_row.rb index a67d56257fa8..e9414757a8d6 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/check_and_mutate_row.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/check_and_mutate_row.rb @@ -19,15 +19,21 @@ # [START bigtable_v2_generated_Bigtable_CheckAndMutateRow_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#check_and_mutate_row +# +def check_and_mutate_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest.new -# Call the check_and_mutate_row method. -result = client.check_and_mutate_row request + # Call the check_and_mutate_row method. + result = client.check_and_mutate_row request -# The returned object is of type Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse. + p result +end # [END bigtable_v2_generated_Bigtable_CheckAndMutateRow_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/mutate_row.rb b/google-cloud-bigtable-v2/snippets/bigtable/mutate_row.rb index 05e0dcb6026e..d2a35c405a3f 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/mutate_row.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/mutate_row.rb @@ -19,15 +19,21 @@ # [START bigtable_v2_generated_Bigtable_MutateRow_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#mutate_row +# +def mutate_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::MutateRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::MutateRowRequest.new -# Call the mutate_row method. -result = client.mutate_row request + # Call the mutate_row method. + result = client.mutate_row request -# The returned object is of type Google::Cloud::Bigtable::V2::MutateRowResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::V2::MutateRowResponse. + p result +end # [END bigtable_v2_generated_Bigtable_MutateRow_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/mutate_rows.rb b/google-cloud-bigtable-v2/snippets/bigtable/mutate_rows.rb index 7e395bf0c7b2..1acf577e21d9 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/mutate_rows.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/mutate_rows.rb @@ -19,18 +19,24 @@ # [START bigtable_v2_generated_Bigtable_MutateRows_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#mutate_rows +# +def mutate_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::MutateRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::MutateRowsRequest.new -# Call the mutate_rows method. -result = client.mutate_rows request + # Call the mutate_rows method. + result = client.mutate_rows request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Bigtable::V2::MutateRowsResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Bigtable::V2::MutateRowsResponse. + result.each do |response| + p response + end end # [END bigtable_v2_generated_Bigtable_MutateRows_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/ping_and_warm.rb b/google-cloud-bigtable-v2/snippets/bigtable/ping_and_warm.rb index 0649f563f3e8..e72ad862e9bf 100644 --- a/google-cloud-bigtable-v2/snippets/bigtable/ping_and_warm.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/ping_and_warm.rb @@ -19,15 +19,21 @@ # [START bigtable_v2_generated_Bigtable_PingAndWarm_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#ping_and_warm +# +def ping_and_warm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::PingAndWarmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::PingAndWarmRequest.new -# Call the ping_and_warm method. -result = client.ping_and_warm request + # Call the ping_and_warm method. + result = client.ping_and_warm request -# The returned object is of type Google::Cloud::Bigtable::V2::PingAndWarmResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::V2::PingAndWarmResponse. + p result +end # [END bigtable_v2_generated_Bigtable_PingAndWarm_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/read_modify_write_row.rb b/google-cloud-bigtable-v2/snippets/bigtable/read_modify_write_row.rb index 9541b4c0e811..05f32dea5417 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/read_modify_write_row.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/read_modify_write_row.rb @@ -19,15 +19,21 @@ # [START bigtable_v2_generated_Bigtable_ReadModifyWriteRow_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#read_modify_write_row +# +def read_modify_write_row + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest.new -# Call the read_modify_write_row method. -result = client.read_modify_write_row request + # Call the read_modify_write_row method. + result = client.read_modify_write_row request -# The returned object is of type Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse. -p result + # The returned object is of type Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse. + p result +end # [END bigtable_v2_generated_Bigtable_ReadModifyWriteRow_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/read_rows.rb b/google-cloud-bigtable-v2/snippets/bigtable/read_rows.rb index 1694408bc1b9..acc889b6c920 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/read_rows.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/read_rows.rb @@ -19,18 +19,24 @@ # [START bigtable_v2_generated_Bigtable_ReadRows_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#read_rows +# +def read_rows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::ReadRowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::ReadRowsRequest.new -# Call the read_rows method. -result = client.read_rows request + # Call the read_rows method. + result = client.read_rows request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Bigtable::V2::ReadRowsResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Bigtable::V2::ReadRowsResponse. + result.each do |response| + p response + end end # [END bigtable_v2_generated_Bigtable_ReadRows_sync] diff --git a/google-cloud-bigtable-v2/snippets/bigtable/sample_row_keys.rb b/google-cloud-bigtable-v2/snippets/bigtable/sample_row_keys.rb index 0ab747f477b4..653137c6518e 100755 --- a/google-cloud-bigtable-v2/snippets/bigtable/sample_row_keys.rb +++ b/google-cloud-bigtable-v2/snippets/bigtable/sample_row_keys.rb @@ -19,18 +19,24 @@ # [START bigtable_v2_generated_Bigtable_SampleRowKeys_sync] require "google/cloud/bigtable/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Bigtable::V2::Bigtable::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Bigtable::V2::Bigtable::Client#sample_row_keys +# +def sample_row_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Bigtable::V2::Bigtable::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Bigtable::V2::SampleRowKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Bigtable::V2::SampleRowKeysRequest.new -# Call the sample_row_keys method. -result = client.sample_row_keys request + # Call the sample_row_keys method. + result = client.sample_row_keys request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Bigtable::V2::SampleRowKeysResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Bigtable::V2::SampleRowKeysResponse. + result.each do |response| + p response + end end # [END bigtable_v2_generated_Bigtable_SampleRowKeys_sync] diff --git a/google-cloud-bigtable-v2/snippets/snippet_metadata_google.bigtable.v2.json b/google-cloud-bigtable-v2/snippets/snippet_metadata_google.bigtable.v2.json index c40e83bee98f..089a5f6b1154 100644 --- a/google-cloud-bigtable-v2/snippets/snippet_metadata_google.bigtable.v2.json +++ b/google-cloud-bigtable-v2/snippets/snippet_metadata_google.bigtable.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-billing-budgets-v1/.rubocop.yml b/google-cloud-billing-budgets-v1/.rubocop.yml index f00fb428c4e1..dc447c9263d4 100644 --- a/google-cloud-billing-budgets-v1/.rubocop.yml +++ b/google-cloud-billing-budgets-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-billing-budgets-v1.rb" diff --git a/google-cloud-billing-budgets-v1/snippets/Gemfile b/google-cloud-billing-budgets-v1/snippets/Gemfile index 1d350cb2716a..dc40b21f4846 100755 --- a/google-cloud-billing-budgets-v1/snippets/Gemfile +++ b/google-cloud-billing-budgets-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-billing-budgets-v1/snippets/budget_service/create_budget.rb b/google-cloud-billing-budgets-v1/snippets/budget_service/create_budget.rb index c3cd655f6cbf..5d49b0613fc6 100755 --- a/google-cloud-billing-budgets-v1/snippets/budget_service/create_budget.rb +++ b/google-cloud-billing-budgets-v1/snippets/budget_service/create_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1_generated_BudgetService_CreateBudget_sync] require "google/cloud/billing/budgets/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1::BudgetService::Client#create_budget +# +def create_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1::CreateBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1::CreateBudgetRequest.new -# Call the create_budget method. -result = client.create_budget request + # Call the create_budget method. + result = client.create_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. + p result +end # [END billingbudgets_v1_generated_BudgetService_CreateBudget_sync] diff --git a/google-cloud-billing-budgets-v1/snippets/budget_service/delete_budget.rb b/google-cloud-billing-budgets-v1/snippets/budget_service/delete_budget.rb index c379ec24080d..b4e79d5dc66e 100755 --- a/google-cloud-billing-budgets-v1/snippets/budget_service/delete_budget.rb +++ b/google-cloud-billing-budgets-v1/snippets/budget_service/delete_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1_generated_BudgetService_DeleteBudget_sync] require "google/cloud/billing/budgets/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1::BudgetService::Client#delete_budget +# +def delete_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1::DeleteBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1::DeleteBudgetRequest.new -# Call the delete_budget method. -result = client.delete_budget request + # Call the delete_budget method. + result = client.delete_budget request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END billingbudgets_v1_generated_BudgetService_DeleteBudget_sync] diff --git a/google-cloud-billing-budgets-v1/snippets/budget_service/get_budget.rb b/google-cloud-billing-budgets-v1/snippets/budget_service/get_budget.rb index 7b14f3d69f38..4fd89d5a4560 100755 --- a/google-cloud-billing-budgets-v1/snippets/budget_service/get_budget.rb +++ b/google-cloud-billing-budgets-v1/snippets/budget_service/get_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1_generated_BudgetService_GetBudget_sync] require "google/cloud/billing/budgets/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1::BudgetService::Client#get_budget +# +def get_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1::GetBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1::GetBudgetRequest.new -# Call the get_budget method. -result = client.get_budget request + # Call the get_budget method. + result = client.get_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. + p result +end # [END billingbudgets_v1_generated_BudgetService_GetBudget_sync] diff --git a/google-cloud-billing-budgets-v1/snippets/budget_service/list_budgets.rb b/google-cloud-billing-budgets-v1/snippets/budget_service/list_budgets.rb index 76e66872bdfc..d0b9e50c94ee 100755 --- a/google-cloud-billing-budgets-v1/snippets/budget_service/list_budgets.rb +++ b/google-cloud-billing-budgets-v1/snippets/budget_service/list_budgets.rb @@ -19,21 +19,27 @@ # [START billingbudgets_v1_generated_BudgetService_ListBudgets_sync] require "google/cloud/billing/budgets/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1::BudgetService::Client#list_budgets +# +def list_budgets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1::ListBudgetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1::ListBudgetsRequest.new -# Call the list_budgets method. -result = client.list_budgets request + # Call the list_budgets method. + result = client.list_budgets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::Budgets::V1::Budget. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::Budgets::V1::Budget. + p response + end end # [END billingbudgets_v1_generated_BudgetService_ListBudgets_sync] diff --git a/google-cloud-billing-budgets-v1/snippets/budget_service/update_budget.rb b/google-cloud-billing-budgets-v1/snippets/budget_service/update_budget.rb index 00b8a55e0c75..a14f030039f2 100755 --- a/google-cloud-billing-budgets-v1/snippets/budget_service/update_budget.rb +++ b/google-cloud-billing-budgets-v1/snippets/budget_service/update_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1_generated_BudgetService_UpdateBudget_sync] require "google/cloud/billing/budgets/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1::BudgetService::Client#update_budget +# +def update_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1::UpdateBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1::UpdateBudgetRequest.new -# Call the update_budget method. -result = client.update_budget request + # Call the update_budget method. + result = client.update_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1::Budget. + p result +end # [END billingbudgets_v1_generated_BudgetService_UpdateBudget_sync] diff --git a/google-cloud-billing-budgets-v1/snippets/snippet_metadata_google.cloud.billing.budgets.v1.json b/google-cloud-billing-budgets-v1/snippets/snippet_metadata_google.cloud.billing.budgets.v1.json index d1b04ac47df8..4d0a9ac004eb 100644 --- a/google-cloud-billing-budgets-v1/snippets/snippet_metadata_google.cloud.billing.budgets.v1.json +++ b/google-cloud-billing-budgets-v1/snippets/snippet_metadata_google.cloud.billing.budgets.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-billing-budgets-v1beta1/.rubocop.yml b/google-cloud-billing-budgets-v1beta1/.rubocop.yml index a96e1b2b8057..1d4f685e648e 100644 --- a/google-cloud-billing-budgets-v1beta1/.rubocop.yml +++ b/google-cloud-billing-budgets-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-billing-budgets-v1beta1.rb" diff --git a/google-cloud-billing-budgets-v1beta1/snippets/Gemfile b/google-cloud-billing-budgets-v1beta1/snippets/Gemfile index d644355f3c42..ae1c74719dcd 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/Gemfile +++ b/google-cloud-billing-budgets-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/create_budget.rb b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/create_budget.rb index 742632fc3285..8556568bfdb8 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/create_budget.rb +++ b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/create_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1beta1_generated_BudgetService_CreateBudget_sync] require "google/cloud/billing/budgets/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client#create_budget +# +def create_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1beta1::CreateBudgetRequest.new -# Call the create_budget method. -result = client.create_budget request + # Call the create_budget method. + result = client.create_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. + p result +end # [END billingbudgets_v1beta1_generated_BudgetService_CreateBudget_sync] diff --git a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/delete_budget.rb b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/delete_budget.rb index c45285db8c99..bd4ab3ebecf1 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/delete_budget.rb +++ b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/delete_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1beta1_generated_BudgetService_DeleteBudget_sync] require "google/cloud/billing/budgets/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client#delete_budget +# +def delete_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1beta1::DeleteBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1beta1::DeleteBudgetRequest.new -# Call the delete_budget method. -result = client.delete_budget request + # Call the delete_budget method. + result = client.delete_budget request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END billingbudgets_v1beta1_generated_BudgetService_DeleteBudget_sync] diff --git a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/get_budget.rb b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/get_budget.rb index 7a8f035faf88..3c29f5854336 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/get_budget.rb +++ b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/get_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1beta1_generated_BudgetService_GetBudget_sync] require "google/cloud/billing/budgets/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client#get_budget +# +def get_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1beta1::GetBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1beta1::GetBudgetRequest.new -# Call the get_budget method. -result = client.get_budget request + # Call the get_budget method. + result = client.get_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. + p result +end # [END billingbudgets_v1beta1_generated_BudgetService_GetBudget_sync] diff --git a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/list_budgets.rb b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/list_budgets.rb index 245b5469e22a..d1baa21aeedc 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/list_budgets.rb +++ b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/list_budgets.rb @@ -19,21 +19,27 @@ # [START billingbudgets_v1beta1_generated_BudgetService_ListBudgets_sync] require "google/cloud/billing/budgets/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client#list_budgets +# +def list_budgets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1beta1::ListBudgetsRequest.new -# Call the list_budgets method. -result = client.list_budgets request + # Call the list_budgets method. + result = client.list_budgets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::Budgets::V1beta1::Budget. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::Budgets::V1beta1::Budget. + p response + end end # [END billingbudgets_v1beta1_generated_BudgetService_ListBudgets_sync] diff --git a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/update_budget.rb b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/update_budget.rb index 944c7186ca57..625bce3aab89 100755 --- a/google-cloud-billing-budgets-v1beta1/snippets/budget_service/update_budget.rb +++ b/google-cloud-billing-budgets-v1beta1/snippets/budget_service/update_budget.rb @@ -19,15 +19,21 @@ # [START billingbudgets_v1beta1_generated_BudgetService_UpdateBudget_sync] require "google/cloud/billing/budgets/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client#update_budget +# +def update_budget + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::Budgets::V1beta1::BudgetService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::Budgets::V1beta1::UpdateBudgetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::Budgets::V1beta1::UpdateBudgetRequest.new -# Call the update_budget method. -result = client.update_budget request + # Call the update_budget method. + result = client.update_budget request -# The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. -p result + # The returned object is of type Google::Cloud::Billing::Budgets::V1beta1::Budget. + p result +end # [END billingbudgets_v1beta1_generated_BudgetService_UpdateBudget_sync] diff --git a/google-cloud-billing-budgets-v1beta1/snippets/snippet_metadata_google.cloud.billing.budgets.v1beta1.json b/google-cloud-billing-budgets-v1beta1/snippets/snippet_metadata_google.cloud.billing.budgets.v1beta1.json index 4fdcfc3ca2f5..dc7745df7ab1 100644 --- a/google-cloud-billing-budgets-v1beta1/snippets/snippet_metadata_google.cloud.billing.budgets.v1beta1.json +++ b/google-cloud-billing-budgets-v1beta1/snippets/snippet_metadata_google.cloud.billing.budgets.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-billing-v1/.rubocop.yml b/google-cloud-billing-v1/.rubocop.yml index ac7e34eadb00..cce464ee31a6 100644 --- a/google-cloud-billing-v1/.rubocop.yml +++ b/google-cloud-billing-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-billing-v1.rb" diff --git a/google-cloud-billing-v1/snippets/Gemfile b/google-cloud-billing-v1/snippets/Gemfile index dbdfe1287e84..a90332564d75 100755 --- a/google-cloud-billing-v1/snippets/Gemfile +++ b/google-cloud-billing-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-billing-v1/snippets/cloud_billing/create_billing_account.rb b/google-cloud-billing-v1/snippets/cloud_billing/create_billing_account.rb index bea3f24dc356..1bba6b614b75 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/create_billing_account.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/create_billing_account.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#create_billing_account +# +def create_billing_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::CreateBillingAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::CreateBillingAccountRequest.new -# Call the create_billing_account method. -result = client.create_billing_account request + # Call the create_billing_account method. + result = client.create_billing_account request -# The returned object is of type Google::Cloud::Billing::V1::BillingAccount. -p result + # The returned object is of type Google::Cloud::Billing::V1::BillingAccount. + p result +end # [END cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/get_billing_account.rb b/google-cloud-billing-v1/snippets/cloud_billing/get_billing_account.rb index b4c1f508a199..a6363ed298dd 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/get_billing_account.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/get_billing_account.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_GetBillingAccount_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#get_billing_account +# +def get_billing_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::GetBillingAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::GetBillingAccountRequest.new -# Call the get_billing_account method. -result = client.get_billing_account request + # Call the get_billing_account method. + result = client.get_billing_account request -# The returned object is of type Google::Cloud::Billing::V1::BillingAccount. -p result + # The returned object is of type Google::Cloud::Billing::V1::BillingAccount. + p result +end # [END cloudbilling_v1_generated_CloudBilling_GetBillingAccount_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/get_iam_policy.rb b/google-cloud-billing-v1/snippets/cloud_billing/get_iam_policy.rb index a410c0a6bf5f..40a1087ee923 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/get_iam_policy.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_GetIamPolicy_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudbilling_v1_generated_CloudBilling_GetIamPolicy_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/get_project_billing_info.rb b/google-cloud-billing-v1/snippets/cloud_billing/get_project_billing_info.rb index 43b6ebf3d2e2..bd9d60e08e88 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/get_project_billing_info.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/get_project_billing_info.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#get_project_billing_info +# +def get_project_billing_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::GetProjectBillingInfoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::GetProjectBillingInfoRequest.new -# Call the get_project_billing_info method. -result = client.get_project_billing_info request + # Call the get_project_billing_info method. + result = client.get_project_billing_info request -# The returned object is of type Google::Cloud::Billing::V1::ProjectBillingInfo. -p result + # The returned object is of type Google::Cloud::Billing::V1::ProjectBillingInfo. + p result +end # [END cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/list_billing_accounts.rb b/google-cloud-billing-v1/snippets/cloud_billing/list_billing_accounts.rb index 5658add11cac..ed55d6f02fb5 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/list_billing_accounts.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/list_billing_accounts.rb @@ -19,21 +19,27 @@ # [START cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#list_billing_accounts +# +def list_billing_accounts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::ListBillingAccountsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::ListBillingAccountsRequest.new -# Call the list_billing_accounts method. -result = client.list_billing_accounts request + # Call the list_billing_accounts method. + result = client.list_billing_accounts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::V1::BillingAccount. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::V1::BillingAccount. + p response + end end # [END cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/list_project_billing_info.rb b/google-cloud-billing-v1/snippets/cloud_billing/list_project_billing_info.rb index 27e051adb1b9..5b3ecad9369f 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/list_project_billing_info.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/list_project_billing_info.rb @@ -19,21 +19,27 @@ # [START cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#list_project_billing_info +# +def list_project_billing_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::ListProjectBillingInfoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::ListProjectBillingInfoRequest.new -# Call the list_project_billing_info method. -result = client.list_project_billing_info request + # Call the list_project_billing_info method. + result = client.list_project_billing_info request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::V1::ProjectBillingInfo. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::V1::ProjectBillingInfo. + p response + end end # [END cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/set_iam_policy.rb b/google-cloud-billing-v1/snippets/cloud_billing/set_iam_policy.rb index 320d7339fb6e..3b1bcc99f680 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/set_iam_policy.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_SetIamPolicy_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudbilling_v1_generated_CloudBilling_SetIamPolicy_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/test_iam_permissions.rb b/google-cloud-billing-v1/snippets/cloud_billing/test_iam_permissions.rb index 41180d1e1c60..d29b9271131a 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/test_iam_permissions.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_TestIamPermissions_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudbilling_v1_generated_CloudBilling_TestIamPermissions_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/update_billing_account.rb b/google-cloud-billing-v1/snippets/cloud_billing/update_billing_account.rb index 0ff8fb83b214..b2203d0c388a 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/update_billing_account.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/update_billing_account.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#update_billing_account +# +def update_billing_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::UpdateBillingAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::UpdateBillingAccountRequest.new -# Call the update_billing_account method. -result = client.update_billing_account request + # Call the update_billing_account method. + result = client.update_billing_account request -# The returned object is of type Google::Cloud::Billing::V1::BillingAccount. -p result + # The returned object is of type Google::Cloud::Billing::V1::BillingAccount. + p result +end # [END cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_billing/update_project_billing_info.rb b/google-cloud-billing-v1/snippets/cloud_billing/update_project_billing_info.rb index 2e71c95b68e8..6b7dd0daf32e 100755 --- a/google-cloud-billing-v1/snippets/cloud_billing/update_project_billing_info.rb +++ b/google-cloud-billing-v1/snippets/cloud_billing/update_project_billing_info.rb @@ -19,15 +19,21 @@ # [START cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudBilling::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudBilling::Client#update_project_billing_info +# +def update_project_billing_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudBilling::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::UpdateProjectBillingInfoRequest.new -# Call the update_project_billing_info method. -result = client.update_project_billing_info request + # Call the update_project_billing_info method. + result = client.update_project_billing_info request -# The returned object is of type Google::Cloud::Billing::V1::ProjectBillingInfo. -p result + # The returned object is of type Google::Cloud::Billing::V1::ProjectBillingInfo. + p result +end # [END cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_catalog/list_services.rb b/google-cloud-billing-v1/snippets/cloud_catalog/list_services.rb index 657fe172d6eb..ed81c3be9397 100755 --- a/google-cloud-billing-v1/snippets/cloud_catalog/list_services.rb +++ b/google-cloud-billing-v1/snippets/cloud_catalog/list_services.rb @@ -19,21 +19,27 @@ # [START cloudbilling_v1_generated_CloudCatalog_ListServices_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudCatalog::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::V1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::V1::Service. + p response + end end # [END cloudbilling_v1_generated_CloudCatalog_ListServices_sync] diff --git a/google-cloud-billing-v1/snippets/cloud_catalog/list_skus.rb b/google-cloud-billing-v1/snippets/cloud_catalog/list_skus.rb index 7728f697d273..1c719cc7ba3f 100755 --- a/google-cloud-billing-v1/snippets/cloud_catalog/list_skus.rb +++ b/google-cloud-billing-v1/snippets/cloud_catalog/list_skus.rb @@ -19,21 +19,27 @@ # [START cloudbilling_v1_generated_CloudCatalog_ListSkus_sync] require "google/cloud/billing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Billing::V1::CloudCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Billing::V1::CloudCatalog::Client#list_skus +# +def list_skus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Billing::V1::CloudCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Billing::V1::ListSkusRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Billing::V1::ListSkusRequest.new -# Call the list_skus method. -result = client.list_skus request + # Call the list_skus method. + result = client.list_skus request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Billing::V1::Sku. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Billing::V1::Sku. + p response + end end # [END cloudbilling_v1_generated_CloudCatalog_ListSkus_sync] diff --git a/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json b/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json index afa73774be21..e64349a7b9e8 100644 --- a/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json +++ b/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-binary_authorization-v1/.rubocop.yml b/google-cloud-binary_authorization-v1/.rubocop.yml index 918f0133bf55..d50625d49551 100644 --- a/google-cloud-binary_authorization-v1/.rubocop.yml +++ b/google-cloud-binary_authorization-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-binary_authorization-v1.rb" diff --git a/google-cloud-binary_authorization-v1/snippets/Gemfile b/google-cloud-binary_authorization-v1/snippets/Gemfile index 2a9371a4043d..cc948de5fb4a 100755 --- a/google-cloud-binary_authorization-v1/snippets/Gemfile +++ b/google-cloud-binary_authorization-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/create_attestor.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/create_attestor.rb index 00bcab105f4f..ab397a6de5f9 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/create_attestor.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/create_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_CreateAttestor_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#create_attestor +# +def create_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::CreateAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::CreateAttestorRequest.new -# Call the create_attestor method. -result = client.create_attestor request + # Call the create_attestor method. + result = client.create_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_CreateAttestor_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/delete_attestor.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/delete_attestor.rb index 8797a01075bd..d48987492996 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/delete_attestor.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/delete_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_DeleteAttestor_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#delete_attestor +# +def delete_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::DeleteAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::DeleteAttestorRequest.new -# Call the delete_attestor method. -result = client.delete_attestor request + # Call the delete_attestor method. + result = client.delete_attestor request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_DeleteAttestor_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_attestor.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_attestor.rb index 3f05342c584b..388a85d7a65c 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_attestor.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_GetAttestor_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#get_attestor +# +def get_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::GetAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::GetAttestorRequest.new -# Call the get_attestor method. -result = client.get_attestor request + # Call the get_attestor method. + result = client.get_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_GetAttestor_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_policy.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_policy.rb index b5ca5c27ddec..f0e036ec306a 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_policy.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/get_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_GetPolicy_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#get_policy +# +def get_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::GetPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::GetPolicyRequest.new -# Call the get_policy method. -result = client.get_policy request + # Call the get_policy method. + result = client.get_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_GetPolicy_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/list_attestors.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/list_attestors.rb index edd1a99779b4..beffcb05f5c6 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/list_attestors.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/list_attestors.rb @@ -19,21 +19,27 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_ListAttestors_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#list_attestors +# +def list_attestors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::ListAttestorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::ListAttestorsRequest.new -# Call the list_attestors method. -result = client.list_attestors request + # Call the list_attestors method. + result = client.list_attestors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BinaryAuthorization::V1::Attestor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BinaryAuthorization::V1::Attestor. + p response + end end # [END binaryauthorization_v1_generated_BinauthzManagementService_ListAttestors_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_attestor.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_attestor.rb index 66fbf994a217..950520cb6c71 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_attestor.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_UpdateAttestor_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#update_attestor +# +def update_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::UpdateAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::UpdateAttestorRequest.new -# Call the update_attestor method. -result = client.update_attestor request + # Call the update_attestor method. + result = client.update_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Attestor. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_UpdateAttestor_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_policy.rb b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_policy.rb index b200f4e4b242..6c1c94e41ea8 100755 --- a/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_policy.rb +++ b/google-cloud-binary_authorization-v1/snippets/binauthz_management_service/update_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_BinauthzManagementService_UpdatePolicy_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client#update_policy +# +def update_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::UpdatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::UpdatePolicyRequest.new -# Call the update_policy method. -result = client.update_policy request + # Call the update_policy method. + result = client.update_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. + p result +end # [END binaryauthorization_v1_generated_BinauthzManagementService_UpdatePolicy_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1.json b/google-cloud-binary_authorization-v1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1.json index 193366a8e8d7..7da4bcb67dd3 100644 --- a/google-cloud-binary_authorization-v1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1.json +++ b/google-cloud-binary_authorization-v1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-binary_authorization-v1/snippets/system_policy/get_system_policy.rb b/google-cloud-binary_authorization-v1/snippets/system_policy/get_system_policy.rb index 3bc8c6b09620..2dc9896c39dc 100755 --- a/google-cloud-binary_authorization-v1/snippets/system_policy/get_system_policy.rb +++ b/google-cloud-binary_authorization-v1/snippets/system_policy/get_system_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_SystemPolicy_GetSystemPolicy_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client#get_system_policy +# +def get_system_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::SystemPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::GetSystemPolicyRequest.new -# Call the get_system_policy method. -result = client.get_system_policy request + # Call the get_system_policy method. + result = client.get_system_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::Policy. + p result +end # [END binaryauthorization_v1_generated_SystemPolicy_GetSystemPolicy_sync] diff --git a/google-cloud-binary_authorization-v1/snippets/validation_helper/validate_attestation_occurrence.rb b/google-cloud-binary_authorization-v1/snippets/validation_helper/validate_attestation_occurrence.rb index 3c73f74a01aa..ed1969b8af80 100755 --- a/google-cloud-binary_authorization-v1/snippets/validation_helper/validate_attestation_occurrence.rb +++ b/google-cloud-binary_authorization-v1/snippets/validation_helper/validate_attestation_occurrence.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1_generated_ValidationHelper_ValidateAttestationOccurrence_sync] require "google/cloud/binary_authorization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client#validate_attestation_occurrence +# +def validate_attestation_occurrence + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1::ValidationHelper::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceRequest.new -# Call the validate_attestation_occurrence method. -result = client.validate_attestation_occurrence request + # Call the validate_attestation_occurrence method. + result = client.validate_attestation_occurrence request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceResponse. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1::ValidateAttestationOccurrenceResponse. + p result +end # [END binaryauthorization_v1_generated_ValidationHelper_ValidateAttestationOccurrence_sync] diff --git a/google-cloud-binary_authorization-v1beta1/.rubocop.yml b/google-cloud-binary_authorization-v1beta1/.rubocop.yml index 723488d03f94..7496dd195e5b 100644 --- a/google-cloud-binary_authorization-v1beta1/.rubocop.yml +++ b/google-cloud-binary_authorization-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-binary_authorization-v1beta1.rb" diff --git a/google-cloud-binary_authorization-v1beta1/snippets/Gemfile b/google-cloud-binary_authorization-v1beta1/snippets/Gemfile index ecbab357627a..cb06de5ef8df 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/Gemfile +++ b/google-cloud-binary_authorization-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/create_attestor.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/create_attestor.rb index fffdf1275d5a..a730928b0a64 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/create_attestor.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/create_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_CreateAttestor_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#create_attestor +# +def create_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::CreateAttestorRequest.new -# Call the create_attestor method. -result = client.create_attestor request + # Call the create_attestor method. + result = client.create_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_CreateAttestor_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/delete_attestor.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/delete_attestor.rb index 3f53e4c03cb2..679116073ae0 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/delete_attestor.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/delete_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_DeleteAttestor_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#delete_attestor +# +def delete_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::DeleteAttestorRequest.new -# Call the delete_attestor method. -result = client.delete_attestor request + # Call the delete_attestor method. + result = client.delete_attestor request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_DeleteAttestor_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_attestor.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_attestor.rb index 15a36283e0d1..b4d8eaa40a35 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_attestor.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_GetAttestor_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#get_attestor +# +def get_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::GetAttestorRequest.new -# Call the get_attestor method. -result = client.get_attestor request + # Call the get_attestor method. + result = client.get_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_GetAttestor_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_policy.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_policy.rb index 465814d6cc67..88755b66c27d 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_policy.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/get_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_GetPolicy_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#get_policy +# +def get_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::GetPolicyRequest.new -# Call the get_policy method. -result = client.get_policy request + # Call the get_policy method. + result = client.get_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_GetPolicy_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/list_attestors.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/list_attestors.rb index 5af1f2c2a687..61689c3eecfc 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/list_attestors.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/list_attestors.rb @@ -19,21 +19,27 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_ListAttestors_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#list_attestors +# +def list_attestors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::ListAttestorsRequest.new -# Call the list_attestors method. -result = client.list_attestors request + # Call the list_attestors method. + result = client.list_attestors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::BinaryAuthorization::V1beta1::Attestor. + p response + end end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_ListAttestors_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_attestor.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_attestor.rb index ed9a94403652..607f466e71a6 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_attestor.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_attestor.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_UpdateAttestor_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#update_attestor +# +def update_attestor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::UpdateAttestorRequest.new -# Call the update_attestor method. -result = client.update_attestor request + # Call the update_attestor method. + result = client.update_attestor request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Attestor. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_UpdateAttestor_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_policy.rb b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_policy.rb index 81807912ba64..f88f699cc84d 100755 --- a/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_policy.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/binauthz_management_service/update_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_BinauthzManagementService_UpdatePolicy_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client#update_policy +# +def update_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::BinauthzManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::UpdatePolicyRequest.new -# Call the update_policy method. -result = client.update_policy request + # Call the update_policy method. + result = client.update_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. + p result +end # [END binaryauthorization_v1beta1_generated_BinauthzManagementService_UpdatePolicy_sync] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json b/google-cloud-binary_authorization-v1beta1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json index 8e0591a2ceb3..8894b6d24a8a 100644 --- a/google-cloud-binary_authorization-v1beta1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json +++ b/google-cloud-binary_authorization-v1beta1/snippets/snippet_metadata_google.cloud.binaryauthorization.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-binary_authorization-v1beta1/snippets/system_policy/get_system_policy.rb b/google-cloud-binary_authorization-v1beta1/snippets/system_policy/get_system_policy.rb index 42eeb150af46..2a92a7cab08f 100644 --- a/google-cloud-binary_authorization-v1beta1/snippets/system_policy/get_system_policy.rb +++ b/google-cloud-binary_authorization-v1beta1/snippets/system_policy/get_system_policy.rb @@ -19,15 +19,21 @@ # [START binaryauthorization_v1beta1_generated_SystemPolicy_GetSystemPolicy_sync] require "google/cloud/binary_authorization/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client#get_system_policy +# +def get_system_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::BinaryAuthorization::V1beta1::SystemPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::BinaryAuthorization::V1beta1::GetSystemPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::BinaryAuthorization::V1beta1::GetSystemPolicyRequest.new -# Call the get_system_policy method. -result = client.get_system_policy request + # Call the get_system_policy method. + result = client.get_system_policy request -# The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. -p result + # The returned object is of type Google::Cloud::BinaryAuthorization::V1beta1::Policy. + p result +end # [END binaryauthorization_v1beta1_generated_SystemPolicy_GetSystemPolicy_sync] diff --git a/google-cloud-build-v1/.rubocop.yml b/google-cloud-build-v1/.rubocop.yml index dbf4da5e63fe..e893f15a343f 100644 --- a/google-cloud-build-v1/.rubocop.yml +++ b/google-cloud-build-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-build-v1.rb" diff --git a/google-cloud-build-v1/snippets/Gemfile b/google-cloud-build-v1/snippets/Gemfile index 95349bedc564..6992c35fe31e 100755 --- a/google-cloud-build-v1/snippets/Gemfile +++ b/google-cloud-build-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-build-v1/snippets/cloud_build/approve_build.rb b/google-cloud-build-v1/snippets/cloud_build/approve_build.rb index 64acbd85009c..5cfce367dea9 100755 --- a/google-cloud-build-v1/snippets/cloud_build/approve_build.rb +++ b/google-cloud-build-v1/snippets/cloud_build/approve_build.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_ApproveBuild_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#approve_build +# +def approve_build + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::ApproveBuildRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::ApproveBuildRequest.new -# Call the approve_build method. -result = client.approve_build request + # Call the approve_build method. + result = client.approve_build request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_ApproveBuild_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/cancel_build.rb b/google-cloud-build-v1/snippets/cloud_build/cancel_build.rb index 8cc33666e7fd..982ab016931a 100755 --- a/google-cloud-build-v1/snippets/cloud_build/cancel_build.rb +++ b/google-cloud-build-v1/snippets/cloud_build/cancel_build.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_CancelBuild_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#cancel_build +# +def cancel_build + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::CancelBuildRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::CancelBuildRequest.new -# Call the cancel_build method. -result = client.cancel_build request + # Call the cancel_build method. + result = client.cancel_build request -# The returned object is of type Google::Cloud::Build::V1::Build. -p result + # The returned object is of type Google::Cloud::Build::V1::Build. + p result +end # [END cloudbuild_v1_generated_CloudBuild_CancelBuild_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/create_build.rb b/google-cloud-build-v1/snippets/cloud_build/create_build.rb index 73289d43b101..c4efdb7331c4 100755 --- a/google-cloud-build-v1/snippets/cloud_build/create_build.rb +++ b/google-cloud-build-v1/snippets/cloud_build/create_build.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_CreateBuild_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#create_build +# +def create_build + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::CreateBuildRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::CreateBuildRequest.new -# Call the create_build method. -result = client.create_build request + # Call the create_build method. + result = client.create_build request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_CreateBuild_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/create_build_trigger.rb b/google-cloud-build-v1/snippets/cloud_build/create_build_trigger.rb index 03f7e64b8551..43ed4f345051 100755 --- a/google-cloud-build-v1/snippets/cloud_build/create_build_trigger.rb +++ b/google-cloud-build-v1/snippets/cloud_build/create_build_trigger.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#create_build_trigger +# +def create_build_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::CreateBuildTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::CreateBuildTriggerRequest.new -# Call the create_build_trigger method. -result = client.create_build_trigger request + # Call the create_build_trigger method. + result = client.create_build_trigger request -# The returned object is of type Google::Cloud::Build::V1::BuildTrigger. -p result + # The returned object is of type Google::Cloud::Build::V1::BuildTrigger. + p result +end # [END cloudbuild_v1_generated_CloudBuild_CreateBuildTrigger_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/create_worker_pool.rb b/google-cloud-build-v1/snippets/cloud_build/create_worker_pool.rb index 224c9a0a915f..2d3fa0bd2317 100755 --- a/google-cloud-build-v1/snippets/cloud_build/create_worker_pool.rb +++ b/google-cloud-build-v1/snippets/cloud_build/create_worker_pool.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#create_worker_pool +# +def create_worker_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::CreateWorkerPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::CreateWorkerPoolRequest.new -# Call the create_worker_pool method. -result = client.create_worker_pool request + # Call the create_worker_pool method. + result = client.create_worker_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_CreateWorkerPool_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/delete_build_trigger.rb b/google-cloud-build-v1/snippets/cloud_build/delete_build_trigger.rb index cd0360e4ba84..98f1a28cd798 100755 --- a/google-cloud-build-v1/snippets/cloud_build/delete_build_trigger.rb +++ b/google-cloud-build-v1/snippets/cloud_build/delete_build_trigger.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#delete_build_trigger +# +def delete_build_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::DeleteBuildTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::DeleteBuildTriggerRequest.new -# Call the delete_build_trigger method. -result = client.delete_build_trigger request + # Call the delete_build_trigger method. + result = client.delete_build_trigger request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudbuild_v1_generated_CloudBuild_DeleteBuildTrigger_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/delete_worker_pool.rb b/google-cloud-build-v1/snippets/cloud_build/delete_worker_pool.rb index e59b8a00b9ab..9d996d644709 100755 --- a/google-cloud-build-v1/snippets/cloud_build/delete_worker_pool.rb +++ b/google-cloud-build-v1/snippets/cloud_build/delete_worker_pool.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#delete_worker_pool +# +def delete_worker_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::DeleteWorkerPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::DeleteWorkerPoolRequest.new -# Call the delete_worker_pool method. -result = client.delete_worker_pool request + # Call the delete_worker_pool method. + result = client.delete_worker_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_DeleteWorkerPool_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/get_build.rb b/google-cloud-build-v1/snippets/cloud_build/get_build.rb index a1efa94f970c..57d725cf184d 100755 --- a/google-cloud-build-v1/snippets/cloud_build/get_build.rb +++ b/google-cloud-build-v1/snippets/cloud_build/get_build.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_GetBuild_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#get_build +# +def get_build + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::GetBuildRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::GetBuildRequest.new -# Call the get_build method. -result = client.get_build request + # Call the get_build method. + result = client.get_build request -# The returned object is of type Google::Cloud::Build::V1::Build. -p result + # The returned object is of type Google::Cloud::Build::V1::Build. + p result +end # [END cloudbuild_v1_generated_CloudBuild_GetBuild_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/get_build_trigger.rb b/google-cloud-build-v1/snippets/cloud_build/get_build_trigger.rb index 57535b5adb74..cf55444f124f 100755 --- a/google-cloud-build-v1/snippets/cloud_build/get_build_trigger.rb +++ b/google-cloud-build-v1/snippets/cloud_build/get_build_trigger.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#get_build_trigger +# +def get_build_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::GetBuildTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::GetBuildTriggerRequest.new -# Call the get_build_trigger method. -result = client.get_build_trigger request + # Call the get_build_trigger method. + result = client.get_build_trigger request -# The returned object is of type Google::Cloud::Build::V1::BuildTrigger. -p result + # The returned object is of type Google::Cloud::Build::V1::BuildTrigger. + p result +end # [END cloudbuild_v1_generated_CloudBuild_GetBuildTrigger_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/get_worker_pool.rb b/google-cloud-build-v1/snippets/cloud_build/get_worker_pool.rb index 14ef1f602785..ff4ef620c757 100755 --- a/google-cloud-build-v1/snippets/cloud_build/get_worker_pool.rb +++ b/google-cloud-build-v1/snippets/cloud_build/get_worker_pool.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_GetWorkerPool_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#get_worker_pool +# +def get_worker_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::GetWorkerPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::GetWorkerPoolRequest.new -# Call the get_worker_pool method. -result = client.get_worker_pool request + # Call the get_worker_pool method. + result = client.get_worker_pool request -# The returned object is of type Google::Cloud::Build::V1::WorkerPool. -p result + # The returned object is of type Google::Cloud::Build::V1::WorkerPool. + p result +end # [END cloudbuild_v1_generated_CloudBuild_GetWorkerPool_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/list_build_triggers.rb b/google-cloud-build-v1/snippets/cloud_build/list_build_triggers.rb index 73180823a7dd..90c9a68adf58 100755 --- a/google-cloud-build-v1/snippets/cloud_build/list_build_triggers.rb +++ b/google-cloud-build-v1/snippets/cloud_build/list_build_triggers.rb @@ -19,21 +19,27 @@ # [START cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#list_build_triggers +# +def list_build_triggers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::ListBuildTriggersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::ListBuildTriggersRequest.new -# Call the list_build_triggers method. -result = client.list_build_triggers request + # Call the list_build_triggers method. + result = client.list_build_triggers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Build::V1::BuildTrigger. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Build::V1::BuildTrigger. + p response + end end # [END cloudbuild_v1_generated_CloudBuild_ListBuildTriggers_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/list_builds.rb b/google-cloud-build-v1/snippets/cloud_build/list_builds.rb index bdfe729b2f33..450b1724eae3 100755 --- a/google-cloud-build-v1/snippets/cloud_build/list_builds.rb +++ b/google-cloud-build-v1/snippets/cloud_build/list_builds.rb @@ -19,21 +19,27 @@ # [START cloudbuild_v1_generated_CloudBuild_ListBuilds_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#list_builds +# +def list_builds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::ListBuildsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::ListBuildsRequest.new -# Call the list_builds method. -result = client.list_builds request + # Call the list_builds method. + result = client.list_builds request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Build::V1::Build. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Build::V1::Build. + p response + end end # [END cloudbuild_v1_generated_CloudBuild_ListBuilds_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/list_worker_pools.rb b/google-cloud-build-v1/snippets/cloud_build/list_worker_pools.rb index 685fb992664a..49bc161b2e93 100755 --- a/google-cloud-build-v1/snippets/cloud_build/list_worker_pools.rb +++ b/google-cloud-build-v1/snippets/cloud_build/list_worker_pools.rb @@ -19,21 +19,27 @@ # [START cloudbuild_v1_generated_CloudBuild_ListWorkerPools_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#list_worker_pools +# +def list_worker_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::ListWorkerPoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::ListWorkerPoolsRequest.new -# Call the list_worker_pools method. -result = client.list_worker_pools request + # Call the list_worker_pools method. + result = client.list_worker_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Build::V1::WorkerPool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Build::V1::WorkerPool. + p response + end end # [END cloudbuild_v1_generated_CloudBuild_ListWorkerPools_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/receive_trigger_webhook.rb b/google-cloud-build-v1/snippets/cloud_build/receive_trigger_webhook.rb index 46859478e146..08a1ebf5ecf4 100755 --- a/google-cloud-build-v1/snippets/cloud_build/receive_trigger_webhook.rb +++ b/google-cloud-build-v1/snippets/cloud_build/receive_trigger_webhook.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#receive_trigger_webhook +# +def receive_trigger_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::ReceiveTriggerWebhookRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::ReceiveTriggerWebhookRequest.new -# Call the receive_trigger_webhook method. -result = client.receive_trigger_webhook request + # Call the receive_trigger_webhook method. + result = client.receive_trigger_webhook request -# The returned object is of type Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse. -p result + # The returned object is of type Google::Cloud::Build::V1::ReceiveTriggerWebhookResponse. + p result +end # [END cloudbuild_v1_generated_CloudBuild_ReceiveTriggerWebhook_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/retry_build.rb b/google-cloud-build-v1/snippets/cloud_build/retry_build.rb index 9a394cec8faa..bf39ebe2d9da 100755 --- a/google-cloud-build-v1/snippets/cloud_build/retry_build.rb +++ b/google-cloud-build-v1/snippets/cloud_build/retry_build.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_RetryBuild_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#retry_build +# +def retry_build + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::RetryBuildRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::RetryBuildRequest.new -# Call the retry_build method. -result = client.retry_build request + # Call the retry_build method. + result = client.retry_build request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_RetryBuild_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/run_build_trigger.rb b/google-cloud-build-v1/snippets/cloud_build/run_build_trigger.rb index 7d2370ede28b..a924d197366a 100755 --- a/google-cloud-build-v1/snippets/cloud_build/run_build_trigger.rb +++ b/google-cloud-build-v1/snippets/cloud_build/run_build_trigger.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#run_build_trigger +# +def run_build_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::RunBuildTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::RunBuildTriggerRequest.new -# Call the run_build_trigger method. -result = client.run_build_trigger request + # Call the run_build_trigger method. + result = client.run_build_trigger request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_RunBuildTrigger_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/update_build_trigger.rb b/google-cloud-build-v1/snippets/cloud_build/update_build_trigger.rb index 8ddbb7f758e2..d21918fa6ff8 100755 --- a/google-cloud-build-v1/snippets/cloud_build/update_build_trigger.rb +++ b/google-cloud-build-v1/snippets/cloud_build/update_build_trigger.rb @@ -19,15 +19,21 @@ # [START cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#update_build_trigger +# +def update_build_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::UpdateBuildTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::UpdateBuildTriggerRequest.new -# Call the update_build_trigger method. -result = client.update_build_trigger request + # Call the update_build_trigger method. + result = client.update_build_trigger request -# The returned object is of type Google::Cloud::Build::V1::BuildTrigger. -p result + # The returned object is of type Google::Cloud::Build::V1::BuildTrigger. + p result +end # [END cloudbuild_v1_generated_CloudBuild_UpdateBuildTrigger_sync] diff --git a/google-cloud-build-v1/snippets/cloud_build/update_worker_pool.rb b/google-cloud-build-v1/snippets/cloud_build/update_worker_pool.rb index 45fcf804f524..373e4d770dd9 100755 --- a/google-cloud-build-v1/snippets/cloud_build/update_worker_pool.rb +++ b/google-cloud-build-v1/snippets/cloud_build/update_worker_pool.rb @@ -19,22 +19,28 @@ # [START cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_sync] require "google/cloud/build/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Build::V1::CloudBuild::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Build::V1::CloudBuild::Client#update_worker_pool +# +def update_worker_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Build::V1::CloudBuild::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Build::V1::UpdateWorkerPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Build::V1::UpdateWorkerPoolRequest.new -# Call the update_worker_pool method. -result = client.update_worker_pool request + # Call the update_worker_pool method. + result = client.update_worker_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudbuild_v1_generated_CloudBuild_UpdateWorkerPool_sync] diff --git a/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json b/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json index a0fd4aec6f78..0e6721636cfe 100644 --- a/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json +++ b/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-certificate_manager-v1/.rubocop.yml b/google-cloud-certificate_manager-v1/.rubocop.yml index 2909929743a4..49b1dc3efefd 100644 --- a/google-cloud-certificate_manager-v1/.rubocop.yml +++ b/google-cloud-certificate_manager-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-certificate_manager-v1.rb" diff --git a/google-cloud-certificate_manager-v1/snippets/Gemfile b/google-cloud-certificate_manager-v1/snippets/Gemfile index 08a1b5661a53..021b0054caa4 100644 --- a/google-cloud-certificate_manager-v1/snippets/Gemfile +++ b/google-cloud-certificate_manager-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate.rb index e97639ecfed2..bd30e59ddd9f 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_CreateCertificate_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#create_certificate +# +def create_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::CreateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::CreateCertificateRequest.new -# Call the create_certificate method. -result = client.create_certificate request + # Call the create_certificate method. + result = client.create_certificate request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_CreateCertificate_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_issuance_config.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_issuance_config.rb index 14badae2afcd..0a505ed0723f 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_issuance_config.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_issuance_config.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#create_certificate_issuance_config +# +def create_certificate_issuance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::CreateCertificateIssuanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::CreateCertificateIssuanceConfigRequest.new -# Call the create_certificate_issuance_config method. -result = client.create_certificate_issuance_config request + # Call the create_certificate_issuance_config method. + result = client.create_certificate_issuance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_CreateCertificateIssuanceConfig_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map.rb index df392e9d885d..785014ce22ff 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#create_certificate_map +# +def create_certificate_map + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::CreateCertificateMapRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::CreateCertificateMapRequest.new -# Call the create_certificate_map method. -result = client.create_certificate_map request + # Call the create_certificate_map method. + result = client.create_certificate_map request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_CreateCertificateMap_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map_entry.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map_entry.rb index 8e8949be67ed..df47aa1e65be 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map_entry.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_certificate_map_entry.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#create_certificate_map_entry +# +def create_certificate_map_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::CreateCertificateMapEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::CreateCertificateMapEntryRequest.new -# Call the create_certificate_map_entry method. -result = client.create_certificate_map_entry request + # Call the create_certificate_map_entry method. + result = client.create_certificate_map_entry request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_CreateCertificateMapEntry_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_dns_authorization.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_dns_authorization.rb index 836f29424246..9d22b5cf633b 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_dns_authorization.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/create_dns_authorization.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#create_dns_authorization +# +def create_dns_authorization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::CreateDnsAuthorizationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::CreateDnsAuthorizationRequest.new -# Call the create_dns_authorization method. -result = client.create_dns_authorization request + # Call the create_dns_authorization method. + result = client.create_dns_authorization request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_CreateDnsAuthorization_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate.rb index dc3e5b41dbc8..056d7fda25a6 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_DeleteCertificate_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#delete_certificate +# +def delete_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::DeleteCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::DeleteCertificateRequest.new -# Call the delete_certificate method. -result = client.delete_certificate request + # Call the delete_certificate method. + result = client.delete_certificate request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_DeleteCertificate_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_issuance_config.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_issuance_config.rb index 314ef652832a..a6e23bf4a5ce 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_issuance_config.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_issuance_config.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#delete_certificate_issuance_config +# +def delete_certificate_issuance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::DeleteCertificateIssuanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::DeleteCertificateIssuanceConfigRequest.new -# Call the delete_certificate_issuance_config method. -result = client.delete_certificate_issuance_config request + # Call the delete_certificate_issuance_config method. + result = client.delete_certificate_issuance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateIssuanceConfig_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map.rb index a444e78e382f..5eaa47100d8f 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#delete_certificate_map +# +def delete_certificate_map + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::DeleteCertificateMapRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::DeleteCertificateMapRequest.new -# Call the delete_certificate_map method. -result = client.delete_certificate_map request + # Call the delete_certificate_map method. + result = client.delete_certificate_map request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateMap_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map_entry.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map_entry.rb index 8ae3a9aa47c8..587aaf48a5f6 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map_entry.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_certificate_map_entry.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#delete_certificate_map_entry +# +def delete_certificate_map_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::DeleteCertificateMapEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::DeleteCertificateMapEntryRequest.new -# Call the delete_certificate_map_entry method. -result = client.delete_certificate_map_entry request + # Call the delete_certificate_map_entry method. + result = client.delete_certificate_map_entry request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_DeleteCertificateMapEntry_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_dns_authorization.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_dns_authorization.rb index b68f292dc053..dfe39f719d4e 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_dns_authorization.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/delete_dns_authorization.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#delete_dns_authorization +# +def delete_dns_authorization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::DeleteDnsAuthorizationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::DeleteDnsAuthorizationRequest.new -# Call the delete_dns_authorization method. -result = client.delete_dns_authorization request + # Call the delete_dns_authorization method. + result = client.delete_dns_authorization request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_DeleteDnsAuthorization_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate.rb index 2625dc57b630..c1a7ad4939ce 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate.rb @@ -19,15 +19,21 @@ # [START certificatemanager_v1_generated_CertificateManager_GetCertificate_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#get_certificate +# +def get_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::GetCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::GetCertificateRequest.new -# Call the get_certificate method. -result = client.get_certificate request + # Call the get_certificate method. + result = client.get_certificate request -# The returned object is of type Google::Cloud::CertificateManager::V1::Certificate. -p result + # The returned object is of type Google::Cloud::CertificateManager::V1::Certificate. + p result +end # [END certificatemanager_v1_generated_CertificateManager_GetCertificate_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_issuance_config.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_issuance_config.rb index c76e8bf0d8d9..7d009a9d1dc5 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_issuance_config.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_issuance_config.rb @@ -19,15 +19,21 @@ # [START certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#get_certificate_issuance_config +# +def get_certificate_issuance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::GetCertificateIssuanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::GetCertificateIssuanceConfigRequest.new -# Call the get_certificate_issuance_config method. -result = client.get_certificate_issuance_config request + # Call the get_certificate_issuance_config method. + result = client.get_certificate_issuance_config request -# The returned object is of type Google::Cloud::CertificateManager::V1::CertificateIssuanceConfig. -p result + # The returned object is of type Google::Cloud::CertificateManager::V1::CertificateIssuanceConfig. + p result +end # [END certificatemanager_v1_generated_CertificateManager_GetCertificateIssuanceConfig_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map.rb index c3e686460624..e8dc1fe43f1d 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map.rb @@ -19,15 +19,21 @@ # [START certificatemanager_v1_generated_CertificateManager_GetCertificateMap_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#get_certificate_map +# +def get_certificate_map + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::GetCertificateMapRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::GetCertificateMapRequest.new -# Call the get_certificate_map method. -result = client.get_certificate_map request + # Call the get_certificate_map method. + result = client.get_certificate_map request -# The returned object is of type Google::Cloud::CertificateManager::V1::CertificateMap. -p result + # The returned object is of type Google::Cloud::CertificateManager::V1::CertificateMap. + p result +end # [END certificatemanager_v1_generated_CertificateManager_GetCertificateMap_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map_entry.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map_entry.rb index 5d4525d5f665..411b42a71948 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map_entry.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_certificate_map_entry.rb @@ -19,15 +19,21 @@ # [START certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#get_certificate_map_entry +# +def get_certificate_map_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::GetCertificateMapEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::GetCertificateMapEntryRequest.new -# Call the get_certificate_map_entry method. -result = client.get_certificate_map_entry request + # Call the get_certificate_map_entry method. + result = client.get_certificate_map_entry request -# The returned object is of type Google::Cloud::CertificateManager::V1::CertificateMapEntry. -p result + # The returned object is of type Google::Cloud::CertificateManager::V1::CertificateMapEntry. + p result +end # [END certificatemanager_v1_generated_CertificateManager_GetCertificateMapEntry_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_dns_authorization.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_dns_authorization.rb index de02e74ebb52..9496ab022fec 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_dns_authorization.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/get_dns_authorization.rb @@ -19,15 +19,21 @@ # [START certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#get_dns_authorization +# +def get_dns_authorization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::GetDnsAuthorizationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::GetDnsAuthorizationRequest.new -# Call the get_dns_authorization method. -result = client.get_dns_authorization request + # Call the get_dns_authorization method. + result = client.get_dns_authorization request -# The returned object is of type Google::Cloud::CertificateManager::V1::DnsAuthorization. -p result + # The returned object is of type Google::Cloud::CertificateManager::V1::DnsAuthorization. + p result +end # [END certificatemanager_v1_generated_CertificateManager_GetDnsAuthorization_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_issuance_configs.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_issuance_configs.rb index 75e969d50c4f..4638f1443b4d 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_issuance_configs.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_issuance_configs.rb @@ -19,21 +19,27 @@ # [START certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#list_certificate_issuance_configs +# +def list_certificate_issuance_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::ListCertificateIssuanceConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::ListCertificateIssuanceConfigsRequest.new -# Call the list_certificate_issuance_configs method. -result = client.list_certificate_issuance_configs request + # Call the list_certificate_issuance_configs method. + result = client.list_certificate_issuance_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateIssuanceConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateIssuanceConfig. + p response + end end # [END certificatemanager_v1_generated_CertificateManager_ListCertificateIssuanceConfigs_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_map_entries.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_map_entries.rb index 1ad6e2166074..4a35d275a75e 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_map_entries.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_map_entries.rb @@ -19,21 +19,27 @@ # [START certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#list_certificate_map_entries +# +def list_certificate_map_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::ListCertificateMapEntriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::ListCertificateMapEntriesRequest.new -# Call the list_certificate_map_entries method. -result = client.list_certificate_map_entries request + # Call the list_certificate_map_entries method. + result = client.list_certificate_map_entries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateMapEntry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateMapEntry. + p response + end end # [END certificatemanager_v1_generated_CertificateManager_ListCertificateMapEntries_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_maps.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_maps.rb index 106bf46ff3f8..b98bafde0552 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_maps.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificate_maps.rb @@ -19,21 +19,27 @@ # [START certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#list_certificate_maps +# +def list_certificate_maps + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::ListCertificateMapsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::ListCertificateMapsRequest.new -# Call the list_certificate_maps method. -result = client.list_certificate_maps request + # Call the list_certificate_maps method. + result = client.list_certificate_maps request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateMap. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CertificateManager::V1::CertificateMap. + p response + end end # [END certificatemanager_v1_generated_CertificateManager_ListCertificateMaps_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificates.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificates.rb index 1585d9b681d4..d2edb2ed321a 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificates.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_certificates.rb @@ -19,21 +19,27 @@ # [START certificatemanager_v1_generated_CertificateManager_ListCertificates_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#list_certificates +# +def list_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::ListCertificatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::ListCertificatesRequest.new -# Call the list_certificates method. -result = client.list_certificates request + # Call the list_certificates method. + result = client.list_certificates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CertificateManager::V1::Certificate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CertificateManager::V1::Certificate. + p response + end end # [END certificatemanager_v1_generated_CertificateManager_ListCertificates_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_dns_authorizations.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_dns_authorizations.rb index a43c873bd757..8651104ba45e 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_dns_authorizations.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/list_dns_authorizations.rb @@ -19,21 +19,27 @@ # [START certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#list_dns_authorizations +# +def list_dns_authorizations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::ListDnsAuthorizationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::ListDnsAuthorizationsRequest.new -# Call the list_dns_authorizations method. -result = client.list_dns_authorizations request + # Call the list_dns_authorizations method. + result = client.list_dns_authorizations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CertificateManager::V1::DnsAuthorization. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CertificateManager::V1::DnsAuthorization. + p response + end end # [END certificatemanager_v1_generated_CertificateManager_ListDnsAuthorizations_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate.rb index 5623ffd18bf3..1e62b70c92ae 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_UpdateCertificate_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#update_certificate +# +def update_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::UpdateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::UpdateCertificateRequest.new -# Call the update_certificate method. -result = client.update_certificate request + # Call the update_certificate method. + result = client.update_certificate request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_UpdateCertificate_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map.rb index 769ab0bb4a26..3d0893d5a574 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#update_certificate_map +# +def update_certificate_map + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::UpdateCertificateMapRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::UpdateCertificateMapRequest.new -# Call the update_certificate_map method. -result = client.update_certificate_map request + # Call the update_certificate_map method. + result = client.update_certificate_map request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_UpdateCertificateMap_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map_entry.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map_entry.rb index 7410e048b07b..f33a98c7123e 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map_entry.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_certificate_map_entry.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#update_certificate_map_entry +# +def update_certificate_map_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::UpdateCertificateMapEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::UpdateCertificateMapEntryRequest.new -# Call the update_certificate_map_entry method. -result = client.update_certificate_map_entry request + # Call the update_certificate_map_entry method. + result = client.update_certificate_map_entry request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_UpdateCertificateMapEntry_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_dns_authorization.rb b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_dns_authorization.rb index bcd9bbf936ed..d736067ab12f 100644 --- a/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_dns_authorization.rb +++ b/google-cloud-certificate_manager-v1/snippets/certificate_manager/update_dns_authorization.rb @@ -19,22 +19,28 @@ # [START certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_sync] require "google/cloud/certificate_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CertificateManager::V1::CertificateManager::Client#update_dns_authorization +# +def update_dns_authorization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CertificateManager::V1::CertificateManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CertificateManager::V1::UpdateDnsAuthorizationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CertificateManager::V1::UpdateDnsAuthorizationRequest.new -# Call the update_dns_authorization method. -result = client.update_dns_authorization request + # Call the update_dns_authorization method. + result = client.update_dns_authorization request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END certificatemanager_v1_generated_CertificateManager_UpdateDnsAuthorization_sync] diff --git a/google-cloud-certificate_manager-v1/snippets/snippet_metadata_google.cloud.certificatemanager.v1.json b/google-cloud-certificate_manager-v1/snippets/snippet_metadata_google.cloud.certificatemanager.v1.json index 2c971ed57418..6f9df5bc909f 100644 --- a/google-cloud-certificate_manager-v1/snippets/snippet_metadata_google.cloud.certificatemanager.v1.json +++ b/google-cloud-certificate_manager-v1/snippets/snippet_metadata_google.cloud.certificatemanager.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-channel-v1/.rubocop.yml b/google-cloud-channel-v1/.rubocop.yml index f9fad40d8521..443df9c4cf48 100644 --- a/google-cloud-channel-v1/.rubocop.yml +++ b/google-cloud-channel-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-channel-v1.rb" diff --git a/google-cloud-channel-v1/snippets/Gemfile b/google-cloud-channel-v1/snippets/Gemfile index 33cb90f9d574..77e04de3a6f5 100755 --- a/google-cloud-channel-v1/snippets/Gemfile +++ b/google-cloud-channel-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/fetch_report_results.rb b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/fetch_report_results.rb index 6ba4cbe48844..2837ade6be72 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/fetch_report_results.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/fetch_report_results.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelReportsService::Client#fetch_report_results +# +def fetch_report_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::FetchReportResultsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::FetchReportResultsRequest.new -# Call the fetch_report_results method. -result = client.fetch_report_results request + # Call the fetch_report_results method. + result = client.fetch_report_results request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Row. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Row. + p response + end end # [END cloudchannel_v1_generated_CloudChannelReportsService_FetchReportResults_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/list_reports.rb b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/list_reports.rb index 2daeafc418ae..2832885ac20b 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/list_reports.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/list_reports.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelReportsService_ListReports_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelReportsService::Client#list_reports +# +def list_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListReportsRequest.new -# Call the list_reports method. -result = client.list_reports request + # Call the list_reports method. + result = client.list_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Report. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Report. + p response + end end # [END cloudchannel_v1_generated_CloudChannelReportsService_ListReports_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/run_report_job.rb b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/run_report_job.rb index 77b8c1e14a9e..c9f4ce0ac0b5 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_reports_service/run_report_job.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_reports_service/run_report_job.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelReportsService::Client#run_report_job +# +def run_report_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelReportsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::RunReportJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::RunReportJobRequest.new -# Call the run_report_job method. -result = client.run_report_job request + # Call the run_report_job method. + result = client.run_report_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelReportsService_RunReportJob_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/activate_entitlement.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/activate_entitlement.rb index 8c273618ef2d..37eb77285c0d 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/activate_entitlement.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/activate_entitlement.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#activate_entitlement +# +def activate_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ActivateEntitlementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ActivateEntitlementRequest.new -# Call the activate_entitlement method. -result = client.activate_entitlement request + # Call the activate_entitlement method. + result = client.activate_entitlement request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/cancel_entitlement.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/cancel_entitlement.rb index d84c8b06d283..0eda7aaf9577 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/cancel_entitlement.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/cancel_entitlement.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#cancel_entitlement +# +def cancel_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CancelEntitlementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CancelEntitlementRequest.new -# Call the cancel_entitlement method. -result = client.cancel_entitlement request + # Call the cancel_entitlement method. + result = client.cancel_entitlement request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/change_offer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/change_offer.rb index 598d334476d4..d2c126f324d0 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/change_offer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/change_offer.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_ChangeOffer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#change_offer +# +def change_offer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ChangeOfferRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ChangeOfferRequest.new -# Call the change_offer method. -result = client.change_offer request + # Call the change_offer method. + result = client.change_offer request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_ChangeOffer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/change_parameters.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/change_parameters.rb index e5b53ea8ec14..36a3dd8c06d3 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/change_parameters.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/change_parameters.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_ChangeParameters_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#change_parameters +# +def change_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ChangeParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ChangeParametersRequest.new -# Call the change_parameters method. -result = client.change_parameters request + # Call the change_parameters method. + result = client.change_parameters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_ChangeParameters_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/change_renewal_settings.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/change_renewal_settings.rb index f1c39d081e3b..b5c7de000b15 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/change_renewal_settings.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/change_renewal_settings.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#change_renewal_settings +# +def change_renewal_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ChangeRenewalSettingsRequest.new -# Call the change_renewal_settings method. -result = client.change_renewal_settings request + # Call the change_renewal_settings method. + result = client.change_renewal_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/check_cloud_identity_accounts_exist.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/check_cloud_identity_accounts_exist.rb index 8bf739f91813..6a6c066a71a0 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/check_cloud_identity_accounts_exist.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/check_cloud_identity_accounts_exist.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#check_cloud_identity_accounts_exist +# +def check_cloud_identity_accounts_exist + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistRequest.new -# Call the check_cloud_identity_accounts_exist method. -result = client.check_cloud_identity_accounts_exist request + # Call the check_cloud_identity_accounts_exist method. + result = client.check_cloud_identity_accounts_exist request -# The returned object is of type Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse. -p result + # The returned object is of type Google::Cloud::Channel::V1::CheckCloudIdentityAccountsExistResponse. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_link.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_link.rb index 44828e61f66c..b5f93b89022a 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_link.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_link.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#create_channel_partner_link +# +def create_channel_partner_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CreateChannelPartnerLinkRequest.new -# Call the create_channel_partner_link method. -result = client.create_channel_partner_link request + # Call the create_channel_partner_link method. + result = client.create_channel_partner_link request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_repricing_config.rb index 4eaa47c03fdb..86e99a4dd210 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/create_channel_partner_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#create_channel_partner_repricing_config +# +def create_channel_partner_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CreateChannelPartnerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CreateChannelPartnerRepricingConfigRequest.new -# Call the create_channel_partner_repricing_config method. -result = client.create_channel_partner_repricing_config request + # Call the create_channel_partner_repricing_config method. + result = client.create_channel_partner_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer.rb index f32bd0b9b159..45d0c8f4dbcb 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_CreateCustomer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#create_customer +# +def create_customer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CreateCustomerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CreateCustomerRequest.new -# Call the create_customer method. -result = client.create_customer request + # Call the create_customer method. + result = client.create_customer request -# The returned object is of type Google::Cloud::Channel::V1::Customer. -p result + # The returned object is of type Google::Cloud::Channel::V1::Customer. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_CreateCustomer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer_repricing_config.rb index ec0aa8ee5501..8d004603d463 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/create_customer_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#create_customer_repricing_config +# +def create_customer_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CreateCustomerRepricingConfigRequest.new -# Call the create_customer_repricing_config method. -result = client.create_customer_repricing_config request + # Call the create_customer_repricing_config method. + result = client.create_customer_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_CreateCustomerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/create_entitlement.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/create_entitlement.rb index 83d9b762d557..579028ac0001 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/create_entitlement.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/create_entitlement.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#create_entitlement +# +def create_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::CreateEntitlementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::CreateEntitlementRequest.new -# Call the create_entitlement method. -result = client.create_entitlement request + # Call the create_entitlement method. + result = client.create_entitlement request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_channel_partner_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_channel_partner_repricing_config.rb index 20f1de55a657..b17c72ab74a3 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_channel_partner_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_channel_partner_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#delete_channel_partner_repricing_config +# +def delete_channel_partner_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::DeleteChannelPartnerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::DeleteChannelPartnerRepricingConfigRequest.new -# Call the delete_channel_partner_repricing_config method. -result = client.delete_channel_partner_repricing_config request + # Call the delete_channel_partner_repricing_config method. + result = client.delete_channel_partner_repricing_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_DeleteChannelPartnerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer.rb index 7c77c74736d7..5ca8f2fad102 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#delete_customer +# +def delete_customer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::DeleteCustomerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::DeleteCustomerRequest.new -# Call the delete_customer method. -result = client.delete_customer request + # Call the delete_customer method. + result = client.delete_customer request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer_repricing_config.rb index e9188baad5df..f99752c6a5f2 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/delete_customer_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#delete_customer_repricing_config +# +def delete_customer_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::DeleteCustomerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::DeleteCustomerRepricingConfigRequest.new -# Call the delete_customer_repricing_config method. -result = client.delete_customer_repricing_config request + # Call the delete_customer_repricing_config method. + result = client.delete_customer_repricing_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_link.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_link.rb index 46c6599c9544..7b5644dd7ca5 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_link.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_link.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#get_channel_partner_link +# +def get_channel_partner_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::GetChannelPartnerLinkRequest.new -# Call the get_channel_partner_link method. -result = client.get_channel_partner_link request + # Call the get_channel_partner_link method. + result = client.get_channel_partner_link request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_repricing_config.rb index 2537c52ade78..d34df11aace7 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/get_channel_partner_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#get_channel_partner_repricing_config +# +def get_channel_partner_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::GetChannelPartnerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::GetChannelPartnerRepricingConfigRequest.new -# Call the get_channel_partner_repricing_config method. -result = client.get_channel_partner_repricing_config request + # Call the get_channel_partner_repricing_config method. + result = client.get_channel_partner_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer.rb index 59802c0bf835..778f98fa6897 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_GetCustomer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#get_customer +# +def get_customer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::GetCustomerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::GetCustomerRequest.new -# Call the get_customer method. -result = client.get_customer request + # Call the get_customer method. + result = client.get_customer request -# The returned object is of type Google::Cloud::Channel::V1::Customer. -p result + # The returned object is of type Google::Cloud::Channel::V1::Customer. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_GetCustomer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer_repricing_config.rb index 1e3738f5d168..650b491b7178 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/get_customer_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#get_customer_repricing_config +# +def get_customer_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::GetCustomerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::GetCustomerRepricingConfigRequest.new -# Call the get_customer_repricing_config method. -result = client.get_customer_repricing_config request + # Call the get_customer_repricing_config method. + result = client.get_customer_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_GetCustomerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/get_entitlement.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/get_entitlement.rb index b8ca0823c7b8..486128244dea 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/get_entitlement.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/get_entitlement.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_GetEntitlement_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#get_entitlement +# +def get_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::GetEntitlementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::GetEntitlementRequest.new -# Call the get_entitlement method. -result = client.get_entitlement request + # Call the get_entitlement method. + result = client.get_entitlement request -# The returned object is of type Google::Cloud::Channel::V1::Entitlement. -p result + # The returned object is of type Google::Cloud::Channel::V1::Entitlement. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_GetEntitlement_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/import_customer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/import_customer.rb index 9020299b3765..8f6dacda3663 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/import_customer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/import_customer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_ImportCustomer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#import_customer +# +def import_customer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ImportCustomerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ImportCustomerRequest.new -# Call the import_customer method. -result = client.import_customer request + # Call the import_customer method. + result = client.import_customer request -# The returned object is of type Google::Cloud::Channel::V1::Customer. -p result + # The returned object is of type Google::Cloud::Channel::V1::Customer. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_ImportCustomer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_links.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_links.rb index fa57377fbfce..ddb622105fe0 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_links.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_links.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_channel_partner_links +# +def list_channel_partner_links + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListChannelPartnerLinksRequest.new -# Call the list_channel_partner_links method. -result = client.list_channel_partner_links request + # Call the list_channel_partner_links method. + result = client.list_channel_partner_links request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerLink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerLink. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_repricing_configs.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_repricing_configs.rb index 350b733e66a2..cc290b16e4ba 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_repricing_configs.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_channel_partner_repricing_configs.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_channel_partner_repricing_configs +# +def list_channel_partner_repricing_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListChannelPartnerRepricingConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListChannelPartnerRepricingConfigsRequest.new -# Call the list_channel_partner_repricing_configs method. -result = client.list_channel_partner_repricing_configs request + # Call the list_channel_partner_repricing_configs method. + result = client.list_channel_partner_repricing_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerRepricingConfigs_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_customer_repricing_configs.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_customer_repricing_configs.rb index 08a3ea2f8fb3..be71c60d722a 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_customer_repricing_configs.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_customer_repricing_configs.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_customer_repricing_configs +# +def list_customer_repricing_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListCustomerRepricingConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListCustomerRepricingConfigsRequest.new -# Call the list_customer_repricing_configs method. -result = client.list_customer_repricing_configs request + # Call the list_customer_repricing_configs method. + result = client.list_customer_repricing_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::CustomerRepricingConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::CustomerRepricingConfig. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListCustomerRepricingConfigs_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_customers.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_customers.rb index 7fe22bfe34e1..59bac75ebd02 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_customers.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_customers.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListCustomers_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_customers +# +def list_customers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListCustomersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListCustomersRequest.new -# Call the list_customers method. -result = client.list_customers request + # Call the list_customers method. + result = client.list_customers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Customer. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Customer. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListCustomers_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_entitlements.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_entitlements.rb index 74db91bd4755..f53f6e2e219a 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_entitlements.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_entitlements.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListEntitlements_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_entitlements +# +def list_entitlements + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListEntitlementsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListEntitlementsRequest.new -# Call the list_entitlements method. -result = client.list_entitlements request + # Call the list_entitlements method. + result = client.list_entitlements request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Entitlement. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Entitlement. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListEntitlements_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_offers.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_offers.rb index 12f7e1223a65..170fe251b8cb 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_offers.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_offers.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListOffers_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_offers +# +def list_offers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListOffersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListOffersRequest.new -# Call the list_offers method. -result = client.list_offers request + # Call the list_offers method. + result = client.list_offers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Offer. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Offer. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListOffers_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_products.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_products.rb index cbb51b5ab6e5..5c012cc0fd2c 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_products.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_products.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListProducts_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_products +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListProductsRequest.new -# Call the list_products method. -result = client.list_products request + # Call the list_products method. + result = client.list_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Product. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListProducts_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_offers.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_offers.rb index 8d59263839c1..79dcc25ba28f 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_offers.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_offers.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_purchasable_offers +# +def list_purchasable_offers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListPurchasableOffersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListPurchasableOffersRequest.new -# Call the list_purchasable_offers method. -result = client.list_purchasable_offers request + # Call the list_purchasable_offers method. + result = client.list_purchasable_offers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::PurchasableOffer. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::PurchasableOffer. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_skus.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_skus.rb index a7ab2b91d035..258281ac8d60 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_skus.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_purchasable_skus.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_purchasable_skus +# +def list_purchasable_skus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListPurchasableSkusRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListPurchasableSkusRequest.new -# Call the list_purchasable_skus method. -result = client.list_purchasable_skus request + # Call the list_purchasable_skus method. + result = client.list_purchasable_skus request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::PurchasableSku. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::PurchasableSku. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_skus.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_skus.rb index d756337905c4..9cdf44cb0c19 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_skus.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_skus.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListSkus_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_skus +# +def list_skus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListSkusRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListSkusRequest.new -# Call the list_skus method. -result = client.list_skus request + # Call the list_skus method. + result = client.list_skus request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::Sku. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::Sku. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListSkus_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_subscribers.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_subscribers.rb index c1020813fb89..21ba3d0177a1 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_subscribers.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_subscribers.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListSubscribers_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_subscribers +# +def list_subscribers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListSubscribersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListSubscribersRequest.new -# Call the list_subscribers method. -result = client.list_subscribers request + # Call the list_subscribers method. + result = client.list_subscribers request -# The returned object is of type Google::Cloud::Channel::V1::ListSubscribersResponse. -p result + # The returned object is of type Google::Cloud::Channel::V1::ListSubscribersResponse. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_ListSubscribers_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_offers.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_offers.rb index 8f147068bf1b..ed24feff65ea 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_offers.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_offers.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_offers +# +def list_transferable_offers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListTransferableOffersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListTransferableOffersRequest.new -# Call the list_transferable_offers method. -result = client.list_transferable_offers request + # Call the list_transferable_offers method. + result = client.list_transferable_offers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::TransferableOffer. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::TransferableOffer. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_skus.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_skus.rb index 221da00e035a..1848c9a327d0 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_skus.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/list_transferable_skus.rb @@ -19,21 +19,27 @@ # [START cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#list_transferable_skus +# +def list_transferable_skus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ListTransferableSkusRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ListTransferableSkusRequest.new -# Call the list_transferable_skus method. -result = client.list_transferable_skus request + # Call the list_transferable_skus method. + result = client.list_transferable_skus request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Channel::V1::TransferableSku. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Channel::V1::TransferableSku. + p response + end end # [END cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/lookup_offer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/lookup_offer.rb index 5d1191bd002f..14ddb7b59883 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/lookup_offer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/lookup_offer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_LookupOffer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#lookup_offer +# +def lookup_offer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::LookupOfferRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::LookupOfferRequest.new -# Call the lookup_offer method. -result = client.lookup_offer request + # Call the lookup_offer method. + result = client.lookup_offer request -# The returned object is of type Google::Cloud::Channel::V1::Offer. -p result + # The returned object is of type Google::Cloud::Channel::V1::Offer. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_LookupOffer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/provision_cloud_identity.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/provision_cloud_identity.rb index 184b963285dc..71f102f980b1 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/provision_cloud_identity.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/provision_cloud_identity.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#provision_cloud_identity +# +def provision_cloud_identity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::ProvisionCloudIdentityRequest.new -# Call the provision_cloud_identity method. -result = client.provision_cloud_identity request + # Call the provision_cloud_identity method. + result = client.provision_cloud_identity request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/register_subscriber.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/register_subscriber.rb index 6bd122a7ac3c..e5b14fea3fb3 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/register_subscriber.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/register_subscriber.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#register_subscriber +# +def register_subscriber + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::RegisterSubscriberRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::RegisterSubscriberRequest.new -# Call the register_subscriber method. -result = client.register_subscriber request + # Call the register_subscriber method. + result = client.register_subscriber request -# The returned object is of type Google::Cloud::Channel::V1::RegisterSubscriberResponse. -p result + # The returned object is of type Google::Cloud::Channel::V1::RegisterSubscriberResponse. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/start_paid_service.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/start_paid_service.rb index 2286d0b5b5d8..d37a3e243791 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/start_paid_service.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/start_paid_service.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_StartPaidService_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#start_paid_service +# +def start_paid_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::StartPaidServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::StartPaidServiceRequest.new -# Call the start_paid_service method. -result = client.start_paid_service request + # Call the start_paid_service method. + result = client.start_paid_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_StartPaidService_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/suspend_entitlement.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/suspend_entitlement.rb index 87b6db89ffb3..a3ab0c398194 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/suspend_entitlement.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/suspend_entitlement.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#suspend_entitlement +# +def suspend_entitlement + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::SuspendEntitlementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::SuspendEntitlementRequest.new -# Call the suspend_entitlement method. -result = client.suspend_entitlement request + # Call the suspend_entitlement method. + result = client.suspend_entitlement request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements.rb index 5c46efdc3899..136cb02ede96 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#transfer_entitlements +# +def transfer_entitlements + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::TransferEntitlementsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::TransferEntitlementsRequest.new -# Call the transfer_entitlements method. -result = client.transfer_entitlements request + # Call the transfer_entitlements method. + result = client.transfer_entitlements request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements_to_google.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements_to_google.rb index c68ab853376b..fa5d4df3d624 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements_to_google.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/transfer_entitlements_to_google.rb @@ -19,22 +19,28 @@ # [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#transfer_entitlements_to_google +# +def transfer_entitlements_to_google + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::TransferEntitlementsToGoogleRequest.new -# Call the transfer_entitlements_to_google method. -result = client.transfer_entitlements_to_google request + # Call the transfer_entitlements_to_google method. + result = client.transfer_entitlements_to_google request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/unregister_subscriber.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/unregister_subscriber.rb index 0ccdbc9308b5..0d306a4f2e03 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/unregister_subscriber.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/unregister_subscriber.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#unregister_subscriber +# +def unregister_subscriber + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::UnregisterSubscriberRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::UnregisterSubscriberRequest.new -# Call the unregister_subscriber method. -result = client.unregister_subscriber request + # Call the unregister_subscriber method. + result = client.unregister_subscriber request -# The returned object is of type Google::Cloud::Channel::V1::UnregisterSubscriberResponse. -p result + # The returned object is of type Google::Cloud::Channel::V1::UnregisterSubscriberResponse. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_link.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_link.rb index 5563049d0694..6edee0293998 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_link.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_link.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#update_channel_partner_link +# +def update_channel_partner_link + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::UpdateChannelPartnerLinkRequest.new -# Call the update_channel_partner_link method. -result = client.update_channel_partner_link request + # Call the update_channel_partner_link method. + result = client.update_channel_partner_link request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerLink. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_repricing_config.rb index 49eeff49fc31..c9748c47e737 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/update_channel_partner_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#update_channel_partner_repricing_config +# +def update_channel_partner_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::UpdateChannelPartnerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::UpdateChannelPartnerRepricingConfigRequest.new -# Call the update_channel_partner_repricing_config method. -result = client.update_channel_partner_repricing_config request + # Call the update_channel_partner_repricing_config method. + result = client.update_channel_partner_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::ChannelPartnerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer.rb index 1f27f09a9591..b35e4c56af7d 100755 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#update_customer +# +def update_customer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::UpdateCustomerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::UpdateCustomerRequest.new -# Call the update_customer method. -result = client.update_customer request + # Call the update_customer method. + result = client.update_customer request -# The returned object is of type Google::Cloud::Channel::V1::Customer. -p result + # The returned object is of type Google::Cloud::Channel::V1::Customer. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_sync] diff --git a/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer_repricing_config.rb b/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer_repricing_config.rb index 0fc80c6fb0ca..67f5f55ec0cb 100644 --- a/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer_repricing_config.rb +++ b/google-cloud-channel-v1/snippets/cloud_channel_service/update_customer_repricing_config.rb @@ -19,15 +19,21 @@ # [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_sync] require "google/cloud/channel/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Channel::V1::CloudChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Channel::V1::CloudChannelService::Client#update_customer_repricing_config +# +def update_customer_repricing_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Channel::V1::CloudChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Channel::V1::UpdateCustomerRepricingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Channel::V1::UpdateCustomerRepricingConfigRequest.new -# Call the update_customer_repricing_config method. -result = client.update_customer_repricing_config request + # Call the update_customer_repricing_config method. + result = client.update_customer_repricing_config request -# The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. -p result + # The returned object is of type Google::Cloud::Channel::V1::CustomerRepricingConfig. + p result +end # [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomerRepricingConfig_sync] diff --git a/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json b/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json index d3fd73bf6926..462ea172ca20 100644 --- a/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json +++ b/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-cloud_dms-v1/.rubocop.yml b/google-cloud-cloud_dms-v1/.rubocop.yml index 535c4cde46db..87bc1b1f8f31 100644 --- a/google-cloud-cloud_dms-v1/.rubocop.yml +++ b/google-cloud-cloud_dms-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-cloud_dms-v1.rb" diff --git a/google-cloud-cloud_dms-v1/snippets/Gemfile b/google-cloud-cloud_dms-v1/snippets/Gemfile index 3ace8b297773..a0432a5985a7 100755 --- a/google-cloud-cloud_dms-v1/snippets/Gemfile +++ b/google-cloud-cloud_dms-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_connection_profile.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_connection_profile.rb index 21ff2ef69857..3b1ff18a61b4 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_connection_profile.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_connection_profile.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#create_connection_profile +# +def create_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::CreateConnectionProfileRequest.new -# Call the create_connection_profile method. -result = client.create_connection_profile request + # Call the create_connection_profile method. + result = client.create_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_CreateConnectionProfile_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_migration_job.rb index 28d0e62b0ebf..35619ee094f4 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/create_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_CreateMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#create_migration_job +# +def create_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::CreateMigrationJobRequest.new -# Call the create_migration_job method. -result = client.create_migration_job request + # Call the create_migration_job method. + result = client.create_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_CreateMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_connection_profile.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_connection_profile.rb index 676978424958..bd1e10fd0a0a 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_connection_profile.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_connection_profile.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#delete_connection_profile +# +def delete_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::DeleteConnectionProfileRequest.new -# Call the delete_connection_profile method. -result = client.delete_connection_profile request + # Call the delete_connection_profile method. + result = client.delete_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_DeleteConnectionProfile_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_migration_job.rb index a670857cfee7..3040a47bfc14 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/delete_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#delete_migration_job +# +def delete_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::DeleteMigrationJobRequest.new -# Call the delete_migration_job method. -result = client.delete_migration_job request + # Call the delete_migration_job method. + result = client.delete_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_DeleteMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/generate_ssh_script.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/generate_ssh_script.rb index 349f8a72c6cb..500502a37379 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/generate_ssh_script.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/generate_ssh_script.rb @@ -19,15 +19,21 @@ # [START datamigration_v1_generated_DataMigrationService_GenerateSshScript_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#generate_ssh_script +# +def generate_ssh_script + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::GenerateSshScriptRequest.new -# Call the generate_ssh_script method. -result = client.generate_ssh_script request + # Call the generate_ssh_script method. + result = client.generate_ssh_script request -# The returned object is of type Google::Cloud::CloudDMS::V1::SshScript. -p result + # The returned object is of type Google::Cloud::CloudDMS::V1::SshScript. + p result +end # [END datamigration_v1_generated_DataMigrationService_GenerateSshScript_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_connection_profile.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_connection_profile.rb index 48d9549f44d5..9e8240eb2105 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_connection_profile.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_connection_profile.rb @@ -19,15 +19,21 @@ # [START datamigration_v1_generated_DataMigrationService_GetConnectionProfile_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#get_connection_profile +# +def get_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::GetConnectionProfileRequest.new -# Call the get_connection_profile method. -result = client.get_connection_profile request + # Call the get_connection_profile method. + result = client.get_connection_profile request -# The returned object is of type Google::Cloud::CloudDMS::V1::ConnectionProfile. -p result + # The returned object is of type Google::Cloud::CloudDMS::V1::ConnectionProfile. + p result +end # [END datamigration_v1_generated_DataMigrationService_GetConnectionProfile_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_migration_job.rb index 1ae28ccb5f3b..1b114e7ba0e2 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/get_migration_job.rb @@ -19,15 +19,21 @@ # [START datamigration_v1_generated_DataMigrationService_GetMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#get_migration_job +# +def get_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::GetMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::GetMigrationJobRequest.new -# Call the get_migration_job method. -result = client.get_migration_job request + # Call the get_migration_job method. + result = client.get_migration_job request -# The returned object is of type Google::Cloud::CloudDMS::V1::MigrationJob. -p result + # The returned object is of type Google::Cloud::CloudDMS::V1::MigrationJob. + p result +end # [END datamigration_v1_generated_DataMigrationService_GetMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_connection_profiles.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_connection_profiles.rb index 1bb801af1df2..779142eb93f5 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_connection_profiles.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_connection_profiles.rb @@ -19,21 +19,27 @@ # [START datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#list_connection_profiles +# +def list_connection_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::ListConnectionProfilesRequest.new -# Call the list_connection_profiles method. -result = client.list_connection_profiles request + # Call the list_connection_profiles method. + result = client.list_connection_profiles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CloudDMS::V1::ConnectionProfile. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CloudDMS::V1::ConnectionProfile. + p response + end end # [END datamigration_v1_generated_DataMigrationService_ListConnectionProfiles_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_migration_jobs.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_migration_jobs.rb index 0197cd54c70a..001479cdae83 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_migration_jobs.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/list_migration_jobs.rb @@ -19,21 +19,27 @@ # [START datamigration_v1_generated_DataMigrationService_ListMigrationJobs_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#list_migration_jobs +# +def list_migration_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::ListMigrationJobsRequest.new -# Call the list_migration_jobs method. -result = client.list_migration_jobs request + # Call the list_migration_jobs method. + result = client.list_migration_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::CloudDMS::V1::MigrationJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::CloudDMS::V1::MigrationJob. + p response + end end # [END datamigration_v1_generated_DataMigrationService_ListMigrationJobs_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/promote_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/promote_migration_job.rb index 32668e188a19..57a96544b207 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/promote_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/promote_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#promote_migration_job +# +def promote_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::PromoteMigrationJobRequest.new -# Call the promote_migration_job method. -result = client.promote_migration_job request + # Call the promote_migration_job method. + result = client.promote_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_PromoteMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/restart_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/restart_migration_job.rb index d60de6f275b3..7a7373bdb0e8 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/restart_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/restart_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_RestartMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#restart_migration_job +# +def restart_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::RestartMigrationJobRequest.new -# Call the restart_migration_job method. -result = client.restart_migration_job request + # Call the restart_migration_job method. + result = client.restart_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_RestartMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/resume_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/resume_migration_job.rb index 32cabd557438..8fe79e2a18e5 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/resume_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/resume_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#resume_migration_job +# +def resume_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::ResumeMigrationJobRequest.new -# Call the resume_migration_job method. -result = client.resume_migration_job request + # Call the resume_migration_job method. + result = client.resume_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_ResumeMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/start_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/start_migration_job.rb index 2589d7d1415d..7d5e5e437f1d 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/start_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/start_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_StartMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#start_migration_job +# +def start_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::StartMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::StartMigrationJobRequest.new -# Call the start_migration_job method. -result = client.start_migration_job request + # Call the start_migration_job method. + result = client.start_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_StartMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/stop_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/stop_migration_job.rb index f0416f541443..6708e5e3dbea 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/stop_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/stop_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_StopMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#stop_migration_job +# +def stop_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::StopMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::StopMigrationJobRequest.new -# Call the stop_migration_job method. -result = client.stop_migration_job request + # Call the stop_migration_job method. + result = client.stop_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_StopMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_connection_profile.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_connection_profile.rb index ebefd40ce267..a367f3a62ad9 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_connection_profile.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_connection_profile.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#update_connection_profile +# +def update_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::UpdateConnectionProfileRequest.new -# Call the update_connection_profile method. -result = client.update_connection_profile request + # Call the update_connection_profile method. + result = client.update_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_UpdateConnectionProfile_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_migration_job.rb index 75afeee272eb..8e40178ccc82 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/update_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#update_migration_job +# +def update_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::UpdateMigrationJobRequest.new -# Call the update_migration_job method. -result = client.update_migration_job request + # Call the update_migration_job method. + result = client.update_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_UpdateMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/data_migration_service/verify_migration_job.rb b/google-cloud-cloud_dms-v1/snippets/data_migration_service/verify_migration_job.rb index 9de489af56fc..808c440b7d52 100755 --- a/google-cloud-cloud_dms-v1/snippets/data_migration_service/verify_migration_job.rb +++ b/google-cloud-cloud_dms-v1/snippets/data_migration_service/verify_migration_job.rb @@ -19,22 +19,28 @@ # [START datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_sync] require "google/cloud/cloud_dms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::CloudDMS::V1::DataMigrationService::Client#verify_migration_job +# +def verify_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::CloudDMS::V1::DataMigrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::CloudDMS::V1::VerifyMigrationJobRequest.new -# Call the verify_migration_job method. -result = client.verify_migration_job request + # Call the verify_migration_job method. + result = client.verify_migration_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datamigration_v1_generated_DataMigrationService_VerifyMigrationJob_sync] diff --git a/google-cloud-cloud_dms-v1/snippets/snippet_metadata_google.cloud.clouddms.v1.json b/google-cloud-cloud_dms-v1/snippets/snippet_metadata_google.cloud.clouddms.v1.json index e23624a0b559..3174ec94189d 100644 --- a/google-cloud-cloud_dms-v1/snippets/snippet_metadata_google.cloud.clouddms.v1.json +++ b/google-cloud-cloud_dms-v1/snippets/snippet_metadata_google.cloud.clouddms.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-compute-v1/.repo-metadata.json b/google-cloud-compute-v1/.repo-metadata.json index 70f47014093a..ee90b35943e9 100644 --- a/google-cloud-compute-v1/.repo-metadata.json +++ b/google-cloud-compute-v1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "google-cloud-compute-v1 is the official client library for the Google Cloud Compute V1 API.", "ruby-cloud-env-prefix": "COMPUTE", "ruby-cloud-product-url": "https://cloud.google.com/compute/", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-compute-v1/.rubocop.yml b/google-cloud-compute-v1/.rubocop.yml index e1ea700968d1..c3ee529afd1a 100644 --- a/google-cloud-compute-v1/.rubocop.yml +++ b/google-cloud-compute-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-compute-v1.rb" diff --git a/google-cloud-contact_center_insights-v1/.rubocop.yml b/google-cloud-contact_center_insights-v1/.rubocop.yml index f78ff1ce9272..f08be6fc8a2e 100644 --- a/google-cloud-contact_center_insights-v1/.rubocop.yml +++ b/google-cloud-contact_center_insights-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-contact_center_insights-v1.rb" diff --git a/google-cloud-contact_center_insights-v1/snippets/Gemfile b/google-cloud-contact_center_insights-v1/snippets/Gemfile index 90d56bb380ea..d22cead6ce12 100755 --- a/google-cloud-contact_center_insights-v1/snippets/Gemfile +++ b/google-cloud-contact_center_insights-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_issue_model_stats.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_issue_model_stats.rb index 332e3b51c8d9..c1f0500d258e 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_issue_model_stats.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_issue_model_stats.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#calculate_issue_model_stats +# +def calculate_issue_model_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsRequest.new -# Call the calculate_issue_model_stats method. -result = client.calculate_issue_model_stats request + # Call the calculate_issue_model_stats method. + result = client.calculate_issue_model_stats request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsResponse. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateIssueModelStatsResponse. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateIssueModelStats_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_stats.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_stats.rb index 6e0f9291c9e0..06c4acd7ff5e 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_stats.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/calculate_stats.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#calculate_stats +# +def calculate_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CalculateStatsRequest.new -# Call the calculate_stats method. -result = client.calculate_stats request + # Call the calculate_stats method. + result = client.calculate_stats request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateStatsResponse. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::CalculateStatsResponse. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CalculateStats_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_analysis.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_analysis.rb index b0c761a4ca57..81295c03c416 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_analysis.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_analysis.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#create_analysis +# +def create_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CreateAnalysisRequest.new -# Call the create_analysis method. -result = client.create_analysis request + # Call the create_analysis method. + result = client.create_analysis request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateAnalysis_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_conversation.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_conversation.rb index 0be9c7ff9be1..9b1af8ff07e6 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_conversation.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_conversation.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#create_conversation +# +def create_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CreateConversationRequest.new -# Call the create_conversation method. -result = client.create_conversation request + # Call the create_conversation method. + result = client.create_conversation request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateConversation_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_issue_model.rb index 8ad0a1d04d09..9706d2e2aa8d 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_issue_model.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#create_issue_model +# +def create_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CreateIssueModelRequest.new -# Call the create_issue_model method. -result = client.create_issue_model request + # Call the create_issue_model method. + result = client.create_issue_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_phrase_matcher.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_phrase_matcher.rb index 278b0e7cdd98..00452d98c995 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_phrase_matcher.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_phrase_matcher.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#create_phrase_matcher +# +def create_phrase_matcher + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CreatePhraseMatcherRequest.new -# Call the create_phrase_matcher method. -result = client.create_phrase_matcher request + # Call the create_phrase_matcher method. + result = client.create_phrase_matcher request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CreatePhraseMatcher_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_view.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_view.rb index 2b3f980aaf20..c8982279ab34 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_view.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/create_view.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#create_view +# +def create_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::CreateViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::CreateViewRequest.new -# Call the create_view method. -result = client.create_view request + # Call the create_view method. + result = client.create_view request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_CreateView_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_analysis.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_analysis.rb index 0b4a96c08d46..5d76c1483350 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_analysis.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_analysis.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#delete_analysis +# +def delete_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeleteAnalysisRequest.new -# Call the delete_analysis method. -result = client.delete_analysis request + # Call the delete_analysis method. + result = client.delete_analysis request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteAnalysis_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_conversation.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_conversation.rb index dba36e476a1e..772609c555cc 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_conversation.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_conversation.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#delete_conversation +# +def delete_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeleteConversationRequest.new -# Call the delete_conversation method. -result = client.delete_conversation request + # Call the delete_conversation method. + result = client.delete_conversation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteConversation_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_issue_model.rb index 66b412fa5a08..9e8cfabdf30f 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_issue_model.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#delete_issue_model +# +def delete_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeleteIssueModelRequest.new -# Call the delete_issue_model method. -result = client.delete_issue_model request + # Call the delete_issue_model method. + result = client.delete_issue_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_phrase_matcher.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_phrase_matcher.rb index 852cd18c99c3..654cab883517 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_phrase_matcher.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_phrase_matcher.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#delete_phrase_matcher +# +def delete_phrase_matcher + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeletePhraseMatcherRequest.new -# Call the delete_phrase_matcher method. -result = client.delete_phrase_matcher request + # Call the delete_phrase_matcher method. + result = client.delete_phrase_matcher request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeletePhraseMatcher_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_view.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_view.rb index 97baa78ebe85..c9abeff342c7 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_view.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/delete_view.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#delete_view +# +def delete_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeleteViewRequest.new -# Call the delete_view method. -result = client.delete_view request + # Call the delete_view method. + result = client.delete_view request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeleteView_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/deploy_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/deploy_issue_model.rb index 3de76f3ca156..d4ed26da36c0 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/deploy_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/deploy_issue_model.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#deploy_issue_model +# +def deploy_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::DeployIssueModelRequest.new -# Call the deploy_issue_model method. -result = client.deploy_issue_model request + # Call the deploy_issue_model method. + result = client.deploy_issue_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_DeployIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/export_insights_data.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/export_insights_data.rb index 78e2de552d6c..bfe2d1fe7b1b 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/export_insights_data.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/export_insights_data.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#export_insights_data +# +def export_insights_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ExportInsightsDataRequest.new -# Call the export_insights_data method. -result = client.export_insights_data request + # Call the export_insights_data method. + result = client.export_insights_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ExportInsightsData_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_analysis.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_analysis.rb index 91daba304e64..14dd1bbc9c27 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_analysis.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_analysis.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_analysis +# +def get_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetAnalysisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetAnalysisRequest.new -# Call the get_analysis method. -result = client.get_analysis request + # Call the get_analysis method. + result = client.get_analysis request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Analysis. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Analysis. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetAnalysis_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_conversation.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_conversation.rb index f77f6282dbbd..f5b2f78ef776 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_conversation.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_conversation.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_conversation +# +def get_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetConversationRequest.new -# Call the get_conversation method. -result = client.get_conversation request + # Call the get_conversation method. + result = client.get_conversation request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetConversation_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue.rb index 79250a7e1794..91256ff3d566 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_issue +# +def get_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetIssueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetIssueRequest.new -# Call the get_issue method. -result = client.get_issue request + # Call the get_issue method. + result = client.get_issue request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssue_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue_model.rb index 491f31cd175a..4bdc0a322f54 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_issue_model.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_issue_model +# +def get_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetIssueModelRequest.new -# Call the get_issue_model method. -result = client.get_issue_model request + # Call the get_issue_model method. + result = client.get_issue_model request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_phrase_matcher.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_phrase_matcher.rb index 7dff543e3755..04b84cafa79a 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_phrase_matcher.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_phrase_matcher.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_phrase_matcher +# +def get_phrase_matcher + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetPhraseMatcherRequest.new -# Call the get_phrase_matcher method. -result = client.get_phrase_matcher request + # Call the get_phrase_matcher method. + result = client.get_phrase_matcher request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetPhraseMatcher_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_settings.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_settings.rb index 3b7fe1a06d59..d8eb6d14e8b5 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_settings.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_settings.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_settings +# +def get_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetSettingsRequest.new -# Call the get_settings method. -result = client.get_settings request + # Call the get_settings method. + result = client.get_settings request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetSettings_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_view.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_view.rb index 7b71508d9cc3..4bd8c4695517 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_view.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/get_view.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_GetView_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#get_view +# +def get_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::GetViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::GetViewRequest.new -# Call the get_view method. -result = client.get_view request + # Call the get_view method. + result = client.get_view request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_GetView_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_analyses.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_analyses.rb index 8bd18127b655..fb13927d06c9 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_analyses.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_analyses.rb @@ -19,21 +19,27 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_analyses +# +def list_analyses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListAnalysesRequest.new -# Call the list_analyses method. -result = client.list_analyses request + # Call the list_analyses method. + result = client.list_analyses request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Analysis. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Analysis. + p response + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListAnalyses_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_conversations.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_conversations.rb index fe63a3dcf352..2b96aae057c0 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_conversations.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_conversations.rb @@ -19,21 +19,27 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_conversations +# +def list_conversations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListConversationsRequest.new -# Call the list_conversations method. -result = client.list_conversations request + # Call the list_conversations method. + result = client.list_conversations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Conversation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::Conversation. + p response + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListConversations_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issue_models.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issue_models.rb index 1f6a814fda77..6bde1dec6f58 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issue_models.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issue_models.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_issue_models +# +def list_issue_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListIssueModelsRequest.new -# Call the list_issue_models method. -result = client.list_issue_models request + # Call the list_issue_models method. + result = client.list_issue_models request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssueModelsResponse. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssueModelsResponse. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssueModels_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issues.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issues.rb index 98c5dd917ab6..4c7eba5cd9b4 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issues.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_issues.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_issues +# +def list_issues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListIssuesRequest.new -# Call the list_issues method. -result = client.list_issues request + # Call the list_issues method. + result = client.list_issues request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssuesResponse. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::ListIssuesResponse. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListIssues_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_phrase_matchers.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_phrase_matchers.rb index a1da631eeee3..7851123c08a3 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_phrase_matchers.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_phrase_matchers.rb @@ -19,21 +19,27 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_phrase_matchers +# +def list_phrase_matchers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListPhraseMatchersRequest.new -# Call the list_phrase_matchers method. -result = client.list_phrase_matchers request + # Call the list_phrase_matchers method. + result = client.list_phrase_matchers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. + p response + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListPhraseMatchers_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_views.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_views.rb index 23e66c1e7eec..77810165feba 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_views.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/list_views.rb @@ -19,21 +19,27 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#list_views +# +def list_views + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::ListViewsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::ListViewsRequest.new -# Call the list_views method. -result = client.list_views request + # Call the list_views method. + result = client.list_views request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::View. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ContactCenterInsights::V1::View. + p response + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_ListViews_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/undeploy_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/undeploy_issue_model.rb index 9e66fbe34752..1430e780d51c 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/undeploy_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/undeploy_issue_model.rb @@ -19,22 +19,28 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#undeploy_issue_model +# +def undeploy_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UndeployIssueModelRequest.new -# Call the undeploy_issue_model method. -result = client.undeploy_issue_model request + # Call the undeploy_issue_model method. + result = client.undeploy_issue_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UndeployIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_conversation.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_conversation.rb index 4539ca0f9d71..480bfe68c159 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_conversation.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_conversation.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_conversation +# +def update_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdateConversationRequest.new -# Call the update_conversation method. -result = client.update_conversation request + # Call the update_conversation method. + result = client.update_conversation request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Conversation. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateConversation_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue.rb index 9c05545eadad..2b176cc55ca1 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_issue +# +def update_issue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueRequest.new -# Call the update_issue method. -result = client.update_issue request + # Call the update_issue method. + result = client.update_issue request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Issue. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssue_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue_model.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue_model.rb index c5655b40188c..3149a81cf8de 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue_model.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_issue_model.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_issue_model +# +def update_issue_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdateIssueModelRequest.new -# Call the update_issue_model method. -result = client.update_issue_model request + # Call the update_issue_model method. + result = client.update_issue_model request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::IssueModel. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateIssueModel_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_phrase_matcher.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_phrase_matcher.rb index 7c6649026b31..45bf6df79fc7 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_phrase_matcher.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_phrase_matcher.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_phrase_matcher +# +def update_phrase_matcher + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdatePhraseMatcherRequest.new -# Call the update_phrase_matcher method. -result = client.update_phrase_matcher request + # Call the update_phrase_matcher method. + result = client.update_phrase_matcher request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::PhraseMatcher. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdatePhraseMatcher_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_settings.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_settings.rb index eb747afcea99..b20074775824 100755 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_settings.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_settings.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_settings +# +def update_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdateSettingsRequest.new -# Call the update_settings method. -result = client.update_settings request + # Call the update_settings method. + result = client.update_settings request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::Settings. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateSettings_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_view.rb b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_view.rb index 3ac7a15a2a85..fab0c7907d14 100644 --- a/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_view.rb +++ b/google-cloud-contact_center_insights-v1/snippets/contact_center_insights/update_view.rb @@ -19,15 +19,21 @@ # [START contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_sync] require "google/cloud/contact_center_insights/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client#update_view +# +def update_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContactCenterInsights::V1::ContactCenterInsights::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContactCenterInsights::V1::UpdateViewRequest.new -# Call the update_view method. -result = client.update_view request + # Call the update_view method. + result = client.update_view request -# The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. -p result + # The returned object is of type Google::Cloud::ContactCenterInsights::V1::View. + p result +end # [END contactcenterinsights_v1_generated_ContactCenterInsights_UpdateView_sync] diff --git a/google-cloud-contact_center_insights-v1/snippets/snippet_metadata_google.cloud.contactcenterinsights.v1.json b/google-cloud-contact_center_insights-v1/snippets/snippet_metadata_google.cloud.contactcenterinsights.v1.json index 084ebdefccb4..a9731a8e1e43 100644 --- a/google-cloud-contact_center_insights-v1/snippets/snippet_metadata_google.cloud.contactcenterinsights.v1.json +++ b/google-cloud-contact_center_insights-v1/snippets/snippet_metadata_google.cloud.contactcenterinsights.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-container-v1/.rubocop.yml b/google-cloud-container-v1/.rubocop.yml index 6d14f1448158..673412ba6530 100644 --- a/google-cloud-container-v1/.rubocop.yml +++ b/google-cloud-container-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-container-v1.rb" diff --git a/google-cloud-container-v1/snippets/Gemfile b/google-cloud-container-v1/snippets/Gemfile index 06ad7038ae0e..bc38b1d55c20 100755 --- a/google-cloud-container-v1/snippets/Gemfile +++ b/google-cloud-container-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-container-v1/snippets/cluster_manager/cancel_operation.rb b/google-cloud-container-v1/snippets/cluster_manager/cancel_operation.rb index b262f9e63611..177e6fcc5b74 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/cancel_operation.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/cancel_operation.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_CancelOperation_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#cancel_operation +# +def cancel_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::CancelOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::CancelOperationRequest.new -# Call the cancel_operation method. -result = client.cancel_operation request + # Call the cancel_operation method. + result = client.cancel_operation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END container_v1_generated_ClusterManager_CancelOperation_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/complete_ip_rotation.rb b/google-cloud-container-v1/snippets/cluster_manager/complete_ip_rotation.rb index 1d10af5db4ca..65708c475809 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/complete_ip_rotation.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/complete_ip_rotation.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_CompleteIPRotation_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#complete_ip_rotation +# +def complete_ip_rotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::CompleteIPRotationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::CompleteIPRotationRequest.new -# Call the complete_ip_rotation method. -result = client.complete_ip_rotation request + # Call the complete_ip_rotation method. + result = client.complete_ip_rotation request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_CompleteIPRotation_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/complete_node_pool_upgrade.rb b/google-cloud-container-v1/snippets/cluster_manager/complete_node_pool_upgrade.rb index 45f9e80572f5..0456b655d3e4 100644 --- a/google-cloud-container-v1/snippets/cluster_manager/complete_node_pool_upgrade.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/complete_node_pool_upgrade.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#complete_node_pool_upgrade +# +def complete_node_pool_upgrade + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::CompleteNodePoolUpgradeRequest.new -# Call the complete_node_pool_upgrade method. -result = client.complete_node_pool_upgrade request + # Call the complete_node_pool_upgrade method. + result = client.complete_node_pool_upgrade request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END container_v1_generated_ClusterManager_CompleteNodePoolUpgrade_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/create_cluster.rb b/google-cloud-container-v1/snippets/cluster_manager/create_cluster.rb index 131e644c8c4d..87935a3a4c73 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/create_cluster.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/create_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_CreateCluster_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#create_cluster +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::CreateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::CreateClusterRequest.new -# Call the create_cluster method. -result = client.create_cluster request + # Call the create_cluster method. + result = client.create_cluster request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_CreateCluster_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/create_node_pool.rb b/google-cloud-container-v1/snippets/cluster_manager/create_node_pool.rb index 114f640c52ff..0476a844c58a 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/create_node_pool.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/create_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_CreateNodePool_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#create_node_pool +# +def create_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::CreateNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::CreateNodePoolRequest.new -# Call the create_node_pool method. -result = client.create_node_pool request + # Call the create_node_pool method. + result = client.create_node_pool request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_CreateNodePool_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/delete_cluster.rb b/google-cloud-container-v1/snippets/cluster_manager/delete_cluster.rb index cd01e03ad72a..988cf1000e04 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/delete_cluster.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/delete_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_DeleteCluster_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#delete_cluster +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::DeleteClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::DeleteClusterRequest.new -# Call the delete_cluster method. -result = client.delete_cluster request + # Call the delete_cluster method. + result = client.delete_cluster request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_DeleteCluster_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/delete_node_pool.rb b/google-cloud-container-v1/snippets/cluster_manager/delete_node_pool.rb index 4db2e3ec51a1..a30383797f7d 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/delete_node_pool.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/delete_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_DeleteNodePool_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#delete_node_pool +# +def delete_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::DeleteNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::DeleteNodePoolRequest.new -# Call the delete_node_pool method. -result = client.delete_node_pool request + # Call the delete_node_pool method. + result = client.delete_node_pool request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_DeleteNodePool_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/get_cluster.rb b/google-cloud-container-v1/snippets/cluster_manager/get_cluster.rb index d158b713954e..7b03d8b71195 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/get_cluster.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/get_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_GetCluster_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#get_cluster +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::GetClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::GetClusterRequest.new -# Call the get_cluster method. -result = client.get_cluster request + # Call the get_cluster method. + result = client.get_cluster request -# The returned object is of type Google::Cloud::Container::V1::Cluster. -p result + # The returned object is of type Google::Cloud::Container::V1::Cluster. + p result +end # [END container_v1_generated_ClusterManager_GetCluster_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/get_json_web_keys.rb b/google-cloud-container-v1/snippets/cluster_manager/get_json_web_keys.rb index a0bf7a7b6986..d5578ff05a1c 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/get_json_web_keys.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/get_json_web_keys.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_GetJSONWebKeys_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#get_json_web_keys +# +def get_json_web_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::GetJSONWebKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::GetJSONWebKeysRequest.new -# Call the get_json_web_keys method. -result = client.get_json_web_keys request + # Call the get_json_web_keys method. + result = client.get_json_web_keys request -# The returned object is of type Google::Cloud::Container::V1::GetJSONWebKeysResponse. -p result + # The returned object is of type Google::Cloud::Container::V1::GetJSONWebKeysResponse. + p result +end # [END container_v1_generated_ClusterManager_GetJSONWebKeys_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/get_node_pool.rb b/google-cloud-container-v1/snippets/cluster_manager/get_node_pool.rb index 00d256225d8f..2fe0bebb9ab1 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/get_node_pool.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/get_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_GetNodePool_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#get_node_pool +# +def get_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::GetNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::GetNodePoolRequest.new -# Call the get_node_pool method. -result = client.get_node_pool request + # Call the get_node_pool method. + result = client.get_node_pool request -# The returned object is of type Google::Cloud::Container::V1::NodePool. -p result + # The returned object is of type Google::Cloud::Container::V1::NodePool. + p result +end # [END container_v1_generated_ClusterManager_GetNodePool_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/get_operation.rb b/google-cloud-container-v1/snippets/cluster_manager/get_operation.rb index 93e98f264656..428afb54d555 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/get_operation.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/get_operation.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_GetOperation_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#get_operation +# +def get_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::GetOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::GetOperationRequest.new -# Call the get_operation method. -result = client.get_operation request + # Call the get_operation method. + result = client.get_operation request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_GetOperation_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/get_server_config.rb b/google-cloud-container-v1/snippets/cluster_manager/get_server_config.rb index 1a6513984787..40aaf67c7fa9 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/get_server_config.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/get_server_config.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_GetServerConfig_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#get_server_config +# +def get_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::GetServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::GetServerConfigRequest.new -# Call the get_server_config method. -result = client.get_server_config request + # Call the get_server_config method. + result = client.get_server_config request -# The returned object is of type Google::Cloud::Container::V1::ServerConfig. -p result + # The returned object is of type Google::Cloud::Container::V1::ServerConfig. + p result +end # [END container_v1_generated_ClusterManager_GetServerConfig_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/list_clusters.rb b/google-cloud-container-v1/snippets/cluster_manager/list_clusters.rb index eff263e9ff7e..474ea3dc287e 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/list_clusters.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/list_clusters.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_ListClusters_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#list_clusters +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::ListClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::ListClustersRequest.new -# Call the list_clusters method. -result = client.list_clusters request + # Call the list_clusters method. + result = client.list_clusters request -# The returned object is of type Google::Cloud::Container::V1::ListClustersResponse. -p result + # The returned object is of type Google::Cloud::Container::V1::ListClustersResponse. + p result +end # [END container_v1_generated_ClusterManager_ListClusters_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/list_node_pools.rb b/google-cloud-container-v1/snippets/cluster_manager/list_node_pools.rb index 40453950cfc1..a4393f67c681 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/list_node_pools.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/list_node_pools.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_ListNodePools_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#list_node_pools +# +def list_node_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::ListNodePoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::ListNodePoolsRequest.new -# Call the list_node_pools method. -result = client.list_node_pools request + # Call the list_node_pools method. + result = client.list_node_pools request -# The returned object is of type Google::Cloud::Container::V1::ListNodePoolsResponse. -p result + # The returned object is of type Google::Cloud::Container::V1::ListNodePoolsResponse. + p result +end # [END container_v1_generated_ClusterManager_ListNodePools_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/list_operations.rb b/google-cloud-container-v1/snippets/cluster_manager/list_operations.rb index 704ac7cf3bf9..68a6d0911d9b 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/list_operations.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/list_operations.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_ListOperations_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#list_operations +# +def list_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::ListOperationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::ListOperationsRequest.new -# Call the list_operations method. -result = client.list_operations request + # Call the list_operations method. + result = client.list_operations request -# The returned object is of type Google::Cloud::Container::V1::ListOperationsResponse. -p result + # The returned object is of type Google::Cloud::Container::V1::ListOperationsResponse. + p result +end # [END container_v1_generated_ClusterManager_ListOperations_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/list_usable_subnetworks.rb b/google-cloud-container-v1/snippets/cluster_manager/list_usable_subnetworks.rb index cbb643290854..ee5bce98c51d 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/list_usable_subnetworks.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/list_usable_subnetworks.rb @@ -19,21 +19,27 @@ # [START container_v1_generated_ClusterManager_ListUsableSubnetworks_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#list_usable_subnetworks +# +def list_usable_subnetworks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::ListUsableSubnetworksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::ListUsableSubnetworksRequest.new -# Call the list_usable_subnetworks method. -result = client.list_usable_subnetworks request + # Call the list_usable_subnetworks method. + result = client.list_usable_subnetworks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Container::V1::UsableSubnetwork. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Container::V1::UsableSubnetwork. + p response + end end # [END container_v1_generated_ClusterManager_ListUsableSubnetworks_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/rollback_node_pool_upgrade.rb b/google-cloud-container-v1/snippets/cluster_manager/rollback_node_pool_upgrade.rb index eabb510c4387..6184be782cd8 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/rollback_node_pool_upgrade.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/rollback_node_pool_upgrade.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#rollback_node_pool_upgrade +# +def rollback_node_pool_upgrade + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::RollbackNodePoolUpgradeRequest.new -# Call the rollback_node_pool_upgrade method. -result = client.rollback_node_pool_upgrade request + # Call the rollback_node_pool_upgrade method. + result = client.rollback_node_pool_upgrade request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_RollbackNodePoolUpgrade_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_addons_config.rb b/google-cloud-container-v1/snippets/cluster_manager/set_addons_config.rb index c66de565f944..699d72585974 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_addons_config.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_addons_config.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetAddonsConfig_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_addons_config +# +def set_addons_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetAddonsConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetAddonsConfigRequest.new -# Call the set_addons_config method. -result = client.set_addons_config request + # Call the set_addons_config method. + result = client.set_addons_config request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetAddonsConfig_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_labels.rb b/google-cloud-container-v1/snippets/cluster_manager/set_labels.rb index 4746ea730645..8fbd77601935 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_labels.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_labels.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetLabels_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_labels +# +def set_labels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetLabelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetLabelsRequest.new -# Call the set_labels method. -result = client.set_labels request + # Call the set_labels method. + result = client.set_labels request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetLabels_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_legacy_abac.rb b/google-cloud-container-v1/snippets/cluster_manager/set_legacy_abac.rb index 2f532388cf73..7d196b458e9b 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_legacy_abac.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_legacy_abac.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetLegacyAbac_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_legacy_abac +# +def set_legacy_abac + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetLegacyAbacRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetLegacyAbacRequest.new -# Call the set_legacy_abac method. -result = client.set_legacy_abac request + # Call the set_legacy_abac method. + result = client.set_legacy_abac request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetLegacyAbac_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_locations.rb b/google-cloud-container-v1/snippets/cluster_manager/set_locations.rb index c6433a9b5d72..dc9de533659b 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_locations.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_locations.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetLocations_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_locations +# +def set_locations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetLocationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetLocationsRequest.new -# Call the set_locations method. -result = client.set_locations request + # Call the set_locations method. + result = client.set_locations request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetLocations_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_logging_service.rb b/google-cloud-container-v1/snippets/cluster_manager/set_logging_service.rb index 8fcff0e9b01c..6ef21a91355b 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_logging_service.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_logging_service.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetLoggingService_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_logging_service +# +def set_logging_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetLoggingServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetLoggingServiceRequest.new -# Call the set_logging_service method. -result = client.set_logging_service request + # Call the set_logging_service method. + result = client.set_logging_service request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetLoggingService_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_maintenance_policy.rb b/google-cloud-container-v1/snippets/cluster_manager/set_maintenance_policy.rb index 4b3be8da9ce3..e5747006ae3e 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_maintenance_policy.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_maintenance_policy.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetMaintenancePolicy_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_maintenance_policy +# +def set_maintenance_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetMaintenancePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetMaintenancePolicyRequest.new -# Call the set_maintenance_policy method. -result = client.set_maintenance_policy request + # Call the set_maintenance_policy method. + result = client.set_maintenance_policy request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetMaintenancePolicy_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_master_auth.rb b/google-cloud-container-v1/snippets/cluster_manager/set_master_auth.rb index 0a7b92c229d6..f462a6e9483c 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_master_auth.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_master_auth.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetMasterAuth_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_master_auth +# +def set_master_auth + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetMasterAuthRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetMasterAuthRequest.new -# Call the set_master_auth method. -result = client.set_master_auth request + # Call the set_master_auth method. + result = client.set_master_auth request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetMasterAuth_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_monitoring_service.rb b/google-cloud-container-v1/snippets/cluster_manager/set_monitoring_service.rb index 42d96b2928e8..31a515e412b4 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_monitoring_service.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_monitoring_service.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetMonitoringService_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_monitoring_service +# +def set_monitoring_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetMonitoringServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetMonitoringServiceRequest.new -# Call the set_monitoring_service method. -result = client.set_monitoring_service request + # Call the set_monitoring_service method. + result = client.set_monitoring_service request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetMonitoringService_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_network_policy.rb b/google-cloud-container-v1/snippets/cluster_manager/set_network_policy.rb index 6dc5c4ad40f0..e57d70c0a5aa 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_network_policy.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_network_policy.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetNetworkPolicy_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_network_policy +# +def set_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetNetworkPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetNetworkPolicyRequest.new -# Call the set_network_policy method. -result = client.set_network_policy request + # Call the set_network_policy method. + result = client.set_network_policy request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetNetworkPolicy_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_autoscaling.rb b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_autoscaling.rb index 5f10fcd1f346..8822686d2594 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_autoscaling.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_autoscaling.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetNodePoolAutoscaling_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_node_pool_autoscaling +# +def set_node_pool_autoscaling + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetNodePoolAutoscalingRequest.new -# Call the set_node_pool_autoscaling method. -result = client.set_node_pool_autoscaling request + # Call the set_node_pool_autoscaling method. + result = client.set_node_pool_autoscaling request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetNodePoolAutoscaling_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_management.rb b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_management.rb index 9040c4da1510..f8a9b9e47687 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_management.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_management.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetNodePoolManagement_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_node_pool_management +# +def set_node_pool_management + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetNodePoolManagementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetNodePoolManagementRequest.new -# Call the set_node_pool_management method. -result = client.set_node_pool_management request + # Call the set_node_pool_management method. + result = client.set_node_pool_management request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetNodePoolManagement_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_size.rb b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_size.rb index 0705e2840f30..394322b027a0 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_size.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/set_node_pool_size.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_SetNodePoolSize_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#set_node_pool_size +# +def set_node_pool_size + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::SetNodePoolSizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::SetNodePoolSizeRequest.new -# Call the set_node_pool_size method. -result = client.set_node_pool_size request + # Call the set_node_pool_size method. + result = client.set_node_pool_size request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_SetNodePoolSize_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/start_ip_rotation.rb b/google-cloud-container-v1/snippets/cluster_manager/start_ip_rotation.rb index 2f182e387599..c6360d73abd3 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/start_ip_rotation.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/start_ip_rotation.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_StartIPRotation_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#start_ip_rotation +# +def start_ip_rotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::StartIPRotationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::StartIPRotationRequest.new -# Call the start_ip_rotation method. -result = client.start_ip_rotation request + # Call the start_ip_rotation method. + result = client.start_ip_rotation request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_StartIPRotation_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/update_cluster.rb b/google-cloud-container-v1/snippets/cluster_manager/update_cluster.rb index ddbe46c0ec9c..63925a294b84 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/update_cluster.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/update_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_UpdateCluster_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#update_cluster +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::UpdateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::UpdateClusterRequest.new -# Call the update_cluster method. -result = client.update_cluster request + # Call the update_cluster method. + result = client.update_cluster request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_UpdateCluster_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/update_master.rb b/google-cloud-container-v1/snippets/cluster_manager/update_master.rb index 8dac5f82bce8..09391f76c5fa 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/update_master.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/update_master.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_UpdateMaster_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#update_master +# +def update_master + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::UpdateMasterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::UpdateMasterRequest.new -# Call the update_master method. -result = client.update_master request + # Call the update_master method. + result = client.update_master request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_UpdateMaster_sync] diff --git a/google-cloud-container-v1/snippets/cluster_manager/update_node_pool.rb b/google-cloud-container-v1/snippets/cluster_manager/update_node_pool.rb index 8af429974708..fb43a7e9a48b 100755 --- a/google-cloud-container-v1/snippets/cluster_manager/update_node_pool.rb +++ b/google-cloud-container-v1/snippets/cluster_manager/update_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1_generated_ClusterManager_UpdateNodePool_sync] require "google/cloud/container/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1::ClusterManager::Client#update_node_pool +# +def update_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1::UpdateNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1::UpdateNodePoolRequest.new -# Call the update_node_pool method. -result = client.update_node_pool request + # Call the update_node_pool method. + result = client.update_node_pool request -# The returned object is of type Google::Cloud::Container::V1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1::Operation. + p result +end # [END container_v1_generated_ClusterManager_UpdateNodePool_sync] diff --git a/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json b/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json index 945396c749fe..ad78de9fa5c8 100644 --- a/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json +++ b/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-container-v1beta1/.rubocop.yml b/google-cloud-container-v1beta1/.rubocop.yml index 1a8fc65d66ff..5a8cf78c8fff 100644 --- a/google-cloud-container-v1beta1/.rubocop.yml +++ b/google-cloud-container-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-container-v1beta1.rb" diff --git a/google-cloud-container-v1beta1/snippets/Gemfile b/google-cloud-container-v1beta1/snippets/Gemfile index 5932b819b972..66f45e76a946 100755 --- a/google-cloud-container-v1beta1/snippets/Gemfile +++ b/google-cloud-container-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/cancel_operation.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/cancel_operation.rb index fa6bde647aad..4b30f3509a80 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/cancel_operation.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/cancel_operation.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_CancelOperation_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#cancel_operation +# +def cancel_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::CancelOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::CancelOperationRequest.new -# Call the cancel_operation method. -result = client.cancel_operation request + # Call the cancel_operation method. + result = client.cancel_operation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END container_v1beta1_generated_ClusterManager_CancelOperation_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/complete_ip_rotation.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/complete_ip_rotation.rb index 17003d7139ca..caa036b0a00d 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/complete_ip_rotation.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/complete_ip_rotation.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_CompleteIPRotation_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#complete_ip_rotation +# +def complete_ip_rotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::CompleteIPRotationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::CompleteIPRotationRequest.new -# Call the complete_ip_rotation method. -result = client.complete_ip_rotation request + # Call the complete_ip_rotation method. + result = client.complete_ip_rotation request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_CompleteIPRotation_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/complete_node_pool_upgrade.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/complete_node_pool_upgrade.rb index 4b1d56cadbcb..496b846ce0bb 100644 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/complete_node_pool_upgrade.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/complete_node_pool_upgrade.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#complete_node_pool_upgrade +# +def complete_node_pool_upgrade + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::CompleteNodePoolUpgradeRequest.new -# Call the complete_node_pool_upgrade method. -result = client.complete_node_pool_upgrade request + # Call the complete_node_pool_upgrade method. + result = client.complete_node_pool_upgrade request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END container_v1beta1_generated_ClusterManager_CompleteNodePoolUpgrade_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/create_cluster.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/create_cluster.rb index 9f0404491de4..1db199b3b121 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/create_cluster.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/create_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_CreateCluster_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#create_cluster +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::CreateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::CreateClusterRequest.new -# Call the create_cluster method. -result = client.create_cluster request + # Call the create_cluster method. + result = client.create_cluster request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_CreateCluster_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/create_node_pool.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/create_node_pool.rb index e24329e6397e..69a77c604360 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/create_node_pool.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/create_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_CreateNodePool_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#create_node_pool +# +def create_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::CreateNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::CreateNodePoolRequest.new -# Call the create_node_pool method. -result = client.create_node_pool request + # Call the create_node_pool method. + result = client.create_node_pool request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_CreateNodePool_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/delete_cluster.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/delete_cluster.rb index 4005c84e2042..39c710ca6c1f 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/delete_cluster.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/delete_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_DeleteCluster_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#delete_cluster +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::DeleteClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::DeleteClusterRequest.new -# Call the delete_cluster method. -result = client.delete_cluster request + # Call the delete_cluster method. + result = client.delete_cluster request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_DeleteCluster_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/delete_node_pool.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/delete_node_pool.rb index ef521485f986..fe85fbb324cf 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/delete_node_pool.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/delete_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_DeleteNodePool_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#delete_node_pool +# +def delete_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::DeleteNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::DeleteNodePoolRequest.new -# Call the delete_node_pool method. -result = client.delete_node_pool request + # Call the delete_node_pool method. + result = client.delete_node_pool request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_DeleteNodePool_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/get_cluster.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/get_cluster.rb index 8f4ee9c27686..b515207c883e 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/get_cluster.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/get_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_GetCluster_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#get_cluster +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::GetClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::GetClusterRequest.new -# Call the get_cluster method. -result = client.get_cluster request + # Call the get_cluster method. + result = client.get_cluster request -# The returned object is of type Google::Cloud::Container::V1beta1::Cluster. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Cluster. + p result +end # [END container_v1beta1_generated_ClusterManager_GetCluster_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/get_json_web_keys.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/get_json_web_keys.rb index 7a539531a472..bd1477d5f06e 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/get_json_web_keys.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/get_json_web_keys.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_GetJSONWebKeys_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#get_json_web_keys +# +def get_json_web_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::GetJSONWebKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::GetJSONWebKeysRequest.new -# Call the get_json_web_keys method. -result = client.get_json_web_keys request + # Call the get_json_web_keys method. + result = client.get_json_web_keys request -# The returned object is of type Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::GetJSONWebKeysResponse. + p result +end # [END container_v1beta1_generated_ClusterManager_GetJSONWebKeys_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/get_node_pool.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/get_node_pool.rb index 9a6038850300..7c1c735d18eb 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/get_node_pool.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/get_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_GetNodePool_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#get_node_pool +# +def get_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::GetNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::GetNodePoolRequest.new -# Call the get_node_pool method. -result = client.get_node_pool request + # Call the get_node_pool method. + result = client.get_node_pool request -# The returned object is of type Google::Cloud::Container::V1beta1::NodePool. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::NodePool. + p result +end # [END container_v1beta1_generated_ClusterManager_GetNodePool_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/get_operation.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/get_operation.rb index f58087eba209..d1bca3257fe0 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/get_operation.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/get_operation.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_GetOperation_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#get_operation +# +def get_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::GetOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::GetOperationRequest.new -# Call the get_operation method. -result = client.get_operation request + # Call the get_operation method. + result = client.get_operation request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_GetOperation_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/get_server_config.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/get_server_config.rb index 460727823983..c7627e1c8796 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/get_server_config.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/get_server_config.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_GetServerConfig_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#get_server_config +# +def get_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::GetServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::GetServerConfigRequest.new -# Call the get_server_config method. -result = client.get_server_config request + # Call the get_server_config method. + result = client.get_server_config request -# The returned object is of type Google::Cloud::Container::V1beta1::ServerConfig. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::ServerConfig. + p result +end # [END container_v1beta1_generated_ClusterManager_GetServerConfig_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/list_clusters.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/list_clusters.rb index 8fedf790d10c..8c6ad6359d7a 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/list_clusters.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/list_clusters.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_ListClusters_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#list_clusters +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::ListClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::ListClustersRequest.new -# Call the list_clusters method. -result = client.list_clusters request + # Call the list_clusters method. + result = client.list_clusters request -# The returned object is of type Google::Cloud::Container::V1beta1::ListClustersResponse. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::ListClustersResponse. + p result +end # [END container_v1beta1_generated_ClusterManager_ListClusters_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/list_locations.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/list_locations.rb index 7e0a30fb31ee..1433a29d843a 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/list_locations.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/list_locations.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_ListLocations_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#list_locations +# +def list_locations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::ListLocationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::ListLocationsRequest.new -# Call the list_locations method. -result = client.list_locations request + # Call the list_locations method. + result = client.list_locations request -# The returned object is of type Google::Cloud::Container::V1beta1::ListLocationsResponse. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::ListLocationsResponse. + p result +end # [END container_v1beta1_generated_ClusterManager_ListLocations_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/list_node_pools.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/list_node_pools.rb index e9ac53c855bd..c200a1738acc 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/list_node_pools.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/list_node_pools.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_ListNodePools_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#list_node_pools +# +def list_node_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::ListNodePoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::ListNodePoolsRequest.new -# Call the list_node_pools method. -result = client.list_node_pools request + # Call the list_node_pools method. + result = client.list_node_pools request -# The returned object is of type Google::Cloud::Container::V1beta1::ListNodePoolsResponse. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::ListNodePoolsResponse. + p result +end # [END container_v1beta1_generated_ClusterManager_ListNodePools_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/list_operations.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/list_operations.rb index 37f7d2e5a8d4..c2b790fde504 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/list_operations.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/list_operations.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_ListOperations_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#list_operations +# +def list_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::ListOperationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::ListOperationsRequest.new -# Call the list_operations method. -result = client.list_operations request + # Call the list_operations method. + result = client.list_operations request -# The returned object is of type Google::Cloud::Container::V1beta1::ListOperationsResponse. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::ListOperationsResponse. + p result +end # [END container_v1beta1_generated_ClusterManager_ListOperations_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/list_usable_subnetworks.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/list_usable_subnetworks.rb index c52a064c9057..03f648d6c3e1 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/list_usable_subnetworks.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/list_usable_subnetworks.rb @@ -19,21 +19,27 @@ # [START container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#list_usable_subnetworks +# +def list_usable_subnetworks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::ListUsableSubnetworksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::ListUsableSubnetworksRequest.new -# Call the list_usable_subnetworks method. -result = client.list_usable_subnetworks request + # Call the list_usable_subnetworks method. + result = client.list_usable_subnetworks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Container::V1beta1::UsableSubnetwork. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Container::V1beta1::UsableSubnetwork. + p response + end end # [END container_v1beta1_generated_ClusterManager_ListUsableSubnetworks_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/rollback_node_pool_upgrade.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/rollback_node_pool_upgrade.rb index 08126a13f6f2..ec077f6e7f18 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/rollback_node_pool_upgrade.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/rollback_node_pool_upgrade.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#rollback_node_pool_upgrade +# +def rollback_node_pool_upgrade + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::RollbackNodePoolUpgradeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::RollbackNodePoolUpgradeRequest.new -# Call the rollback_node_pool_upgrade method. -result = client.rollback_node_pool_upgrade request + # Call the rollback_node_pool_upgrade method. + result = client.rollback_node_pool_upgrade request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_RollbackNodePoolUpgrade_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_addons_config.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_addons_config.rb index dd9a22807dd5..536d9f7d9aa6 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_addons_config.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_addons_config.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetAddonsConfig_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_addons_config +# +def set_addons_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetAddonsConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetAddonsConfigRequest.new -# Call the set_addons_config method. -result = client.set_addons_config request + # Call the set_addons_config method. + result = client.set_addons_config request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetAddonsConfig_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_labels.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_labels.rb index ce2083bb4007..8f0a62ae653e 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_labels.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_labels.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetLabels_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_labels +# +def set_labels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetLabelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetLabelsRequest.new -# Call the set_labels method. -result = client.set_labels request + # Call the set_labels method. + result = client.set_labels request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetLabels_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_legacy_abac.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_legacy_abac.rb index 0b84a236b2df..7ef082d1a414 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_legacy_abac.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_legacy_abac.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetLegacyAbac_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_legacy_abac +# +def set_legacy_abac + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetLegacyAbacRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetLegacyAbacRequest.new -# Call the set_legacy_abac method. -result = client.set_legacy_abac request + # Call the set_legacy_abac method. + result = client.set_legacy_abac request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetLegacyAbac_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_locations.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_locations.rb index cd4c1d7a054d..30dc99abcdeb 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_locations.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_locations.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetLocations_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_locations +# +def set_locations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetLocationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetLocationsRequest.new -# Call the set_locations method. -result = client.set_locations request + # Call the set_locations method. + result = client.set_locations request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetLocations_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_logging_service.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_logging_service.rb index cf0acd9b97bd..1519cf2398ae 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_logging_service.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_logging_service.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetLoggingService_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_logging_service +# +def set_logging_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetLoggingServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetLoggingServiceRequest.new -# Call the set_logging_service method. -result = client.set_logging_service request + # Call the set_logging_service method. + result = client.set_logging_service request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetLoggingService_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_maintenance_policy.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_maintenance_policy.rb index 09ed9694f88b..e4241be59df6 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_maintenance_policy.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_maintenance_policy.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_maintenance_policy +# +def set_maintenance_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetMaintenancePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetMaintenancePolicyRequest.new -# Call the set_maintenance_policy method. -result = client.set_maintenance_policy request + # Call the set_maintenance_policy method. + result = client.set_maintenance_policy request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetMaintenancePolicy_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_master_auth.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_master_auth.rb index 54431d037219..ed51334a4450 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_master_auth.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_master_auth.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetMasterAuth_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_master_auth +# +def set_master_auth + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetMasterAuthRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetMasterAuthRequest.new -# Call the set_master_auth method. -result = client.set_master_auth request + # Call the set_master_auth method. + result = client.set_master_auth request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetMasterAuth_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_monitoring_service.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_monitoring_service.rb index d0ef2aebbf00..8367a779c1ee 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_monitoring_service.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_monitoring_service.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetMonitoringService_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_monitoring_service +# +def set_monitoring_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetMonitoringServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetMonitoringServiceRequest.new -# Call the set_monitoring_service method. -result = client.set_monitoring_service request + # Call the set_monitoring_service method. + result = client.set_monitoring_service request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetMonitoringService_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_network_policy.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_network_policy.rb index 822abcea37e9..e60ebbed6523 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_network_policy.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_network_policy.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetNetworkPolicy_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_network_policy +# +def set_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetNetworkPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetNetworkPolicyRequest.new -# Call the set_network_policy method. -result = client.set_network_policy request + # Call the set_network_policy method. + result = client.set_network_policy request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetNetworkPolicy_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_autoscaling.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_autoscaling.rb index b2a97caa2bcc..88a47034ec2c 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_autoscaling.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_autoscaling.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_node_pool_autoscaling +# +def set_node_pool_autoscaling + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetNodePoolAutoscalingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetNodePoolAutoscalingRequest.new -# Call the set_node_pool_autoscaling method. -result = client.set_node_pool_autoscaling request + # Call the set_node_pool_autoscaling method. + result = client.set_node_pool_autoscaling request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetNodePoolAutoscaling_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_management.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_management.rb index 51f45cfc1236..aab8e7f59dd5 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_management.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_management.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetNodePoolManagement_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_node_pool_management +# +def set_node_pool_management + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetNodePoolManagementRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetNodePoolManagementRequest.new -# Call the set_node_pool_management method. -result = client.set_node_pool_management request + # Call the set_node_pool_management method. + result = client.set_node_pool_management request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetNodePoolManagement_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_size.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_size.rb index c7485c5b3ffb..9ec65ca50e0e 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_size.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/set_node_pool_size.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_SetNodePoolSize_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#set_node_pool_size +# +def set_node_pool_size + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::SetNodePoolSizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::SetNodePoolSizeRequest.new -# Call the set_node_pool_size method. -result = client.set_node_pool_size request + # Call the set_node_pool_size method. + result = client.set_node_pool_size request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_SetNodePoolSize_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/start_ip_rotation.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/start_ip_rotation.rb index f97e4beda6d8..cb3786cdd532 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/start_ip_rotation.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/start_ip_rotation.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_StartIPRotation_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#start_ip_rotation +# +def start_ip_rotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::StartIPRotationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::StartIPRotationRequest.new -# Call the start_ip_rotation method. -result = client.start_ip_rotation request + # Call the start_ip_rotation method. + result = client.start_ip_rotation request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_StartIPRotation_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/update_cluster.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/update_cluster.rb index 048252ff6664..5135b743506c 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/update_cluster.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/update_cluster.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_UpdateCluster_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#update_cluster +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::UpdateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::UpdateClusterRequest.new -# Call the update_cluster method. -result = client.update_cluster request + # Call the update_cluster method. + result = client.update_cluster request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_UpdateCluster_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/update_master.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/update_master.rb index 0d5628774631..261811f287a7 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/update_master.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/update_master.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_UpdateMaster_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#update_master +# +def update_master + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::UpdateMasterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::UpdateMasterRequest.new -# Call the update_master method. -result = client.update_master request + # Call the update_master method. + result = client.update_master request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_UpdateMaster_sync] diff --git a/google-cloud-container-v1beta1/snippets/cluster_manager/update_node_pool.rb b/google-cloud-container-v1beta1/snippets/cluster_manager/update_node_pool.rb index e368e2a1ca0e..b7ca7e7b8c9a 100755 --- a/google-cloud-container-v1beta1/snippets/cluster_manager/update_node_pool.rb +++ b/google-cloud-container-v1beta1/snippets/cluster_manager/update_node_pool.rb @@ -19,15 +19,21 @@ # [START container_v1beta1_generated_ClusterManager_UpdateNodePool_sync] require "google/cloud/container/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Container::V1beta1::ClusterManager::Client#update_node_pool +# +def update_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Container::V1beta1::ClusterManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new -# Call the update_node_pool method. -result = client.update_node_pool request + # Call the update_node_pool method. + result = client.update_node_pool request -# The returned object is of type Google::Cloud::Container::V1beta1::Operation. -p result + # The returned object is of type Google::Cloud::Container::V1beta1::Operation. + p result +end # [END container_v1beta1_generated_ClusterManager_UpdateNodePool_sync] diff --git a/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json b/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json index e63741cee741..4e030b6c3ce5 100644 --- a/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json +++ b/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-container_analysis-v1/.repo-metadata.json b/google-cloud-container_analysis-v1/.repo-metadata.json index 248c6a2535d1..79ec28455ab0 100644 --- a/google-cloud-container_analysis-v1/.repo-metadata.json +++ b/google-cloud-container_analysis-v1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "The Container Analysis API is an implementation of Grafeas. It stores, and enables querying and retrieval of, critical metadata about all of your software artifacts. Note that google-cloud-container_analysis-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-container_analysis instead. See the readme for more details.", "ruby-cloud-env-prefix": "CONTAINER_ANALYSIS", "ruby-cloud-product-url": "https://cloud.google.com/container-registry/docs/container-analysis", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-container_analysis-v1/.rubocop.yml b/google-cloud-container_analysis-v1/.rubocop.yml index e3c5ecead33e..4b52604f0915 100644 --- a/google-cloud-container_analysis-v1/.rubocop.yml +++ b/google-cloud-container_analysis-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-container_analysis-v1.rb" diff --git a/google-cloud-container_analysis-v1/snippets/Gemfile b/google-cloud-container_analysis-v1/snippets/Gemfile index b44ae27e99c0..c0558a5e6de3 100755 --- a/google-cloud-container_analysis-v1/snippets/Gemfile +++ b/google-cloud-container_analysis-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-container_analysis-v1/snippets/container_analysis/get_iam_policy.rb b/google-cloud-container_analysis-v1/snippets/container_analysis/get_iam_policy.rb index ba46e2d2b8fa..e90b0006e3c7 100755 --- a/google-cloud-container_analysis-v1/snippets/container_analysis/get_iam_policy.rb +++ b/google-cloud-container_analysis-v1/snippets/container_analysis/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START containeranalysis_v1_generated_ContainerAnalysis_GetIamPolicy_sync] require "google/cloud/container_analysis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END containeranalysis_v1_generated_ContainerAnalysis_GetIamPolicy_sync] diff --git a/google-cloud-container_analysis-v1/snippets/container_analysis/get_vulnerability_occurrences_summary.rb b/google-cloud-container_analysis-v1/snippets/container_analysis/get_vulnerability_occurrences_summary.rb index a206fc309392..e122a03fc485 100755 --- a/google-cloud-container_analysis-v1/snippets/container_analysis/get_vulnerability_occurrences_summary.rb +++ b/google-cloud-container_analysis-v1/snippets/container_analysis/get_vulnerability_occurrences_summary.rb @@ -19,15 +19,21 @@ # [START containeranalysis_v1_generated_ContainerAnalysis_GetVulnerabilityOccurrencesSummary_sync] require "google/cloud/container_analysis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client#get_vulnerability_occurrences_summary +# +def get_vulnerability_occurrences_summary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ContainerAnalysis::V1::GetVulnerabilityOccurrencesSummaryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ContainerAnalysis::V1::GetVulnerabilityOccurrencesSummaryRequest.new -# Call the get_vulnerability_occurrences_summary method. -result = client.get_vulnerability_occurrences_summary request + # Call the get_vulnerability_occurrences_summary method. + result = client.get_vulnerability_occurrences_summary request -# The returned object is of type Google::Cloud::ContainerAnalysis::V1::VulnerabilityOccurrencesSummary. -p result + # The returned object is of type Google::Cloud::ContainerAnalysis::V1::VulnerabilityOccurrencesSummary. + p result +end # [END containeranalysis_v1_generated_ContainerAnalysis_GetVulnerabilityOccurrencesSummary_sync] diff --git a/google-cloud-container_analysis-v1/snippets/container_analysis/set_iam_policy.rb b/google-cloud-container_analysis-v1/snippets/container_analysis/set_iam_policy.rb index 937465147df4..d54b259f8131 100755 --- a/google-cloud-container_analysis-v1/snippets/container_analysis/set_iam_policy.rb +++ b/google-cloud-container_analysis-v1/snippets/container_analysis/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START containeranalysis_v1_generated_ContainerAnalysis_SetIamPolicy_sync] require "google/cloud/container_analysis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END containeranalysis_v1_generated_ContainerAnalysis_SetIamPolicy_sync] diff --git a/google-cloud-container_analysis-v1/snippets/container_analysis/test_iam_permissions.rb b/google-cloud-container_analysis-v1/snippets/container_analysis/test_iam_permissions.rb index ac0acecffc53..39d91d94990b 100755 --- a/google-cloud-container_analysis-v1/snippets/container_analysis/test_iam_permissions.rb +++ b/google-cloud-container_analysis-v1/snippets/container_analysis/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START containeranalysis_v1_generated_ContainerAnalysis_TestIamPermissions_sync] require "google/cloud/container_analysis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ContainerAnalysis::V1::ContainerAnalysis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END containeranalysis_v1_generated_ContainerAnalysis_TestIamPermissions_sync] diff --git a/google-cloud-container_analysis-v1/snippets/snippet_metadata_google.devtools.containeranalysis.v1.json b/google-cloud-container_analysis-v1/snippets/snippet_metadata_google.devtools.containeranalysis.v1.json index 01eaaeea3f67..99db29ed3133 100644 --- a/google-cloud-container_analysis-v1/snippets/snippet_metadata_google.devtools.containeranalysis.v1.json +++ b/google-cloud-container_analysis-v1/snippets/snippet_metadata_google.devtools.containeranalysis.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-data_catalog-v1/.rubocop.yml b/google-cloud-data_catalog-v1/.rubocop.yml index 2a6a047c0bba..06198693b78e 100644 --- a/google-cloud-data_catalog-v1/.rubocop.yml +++ b/google-cloud-data_catalog-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-data_catalog-v1.rb" diff --git a/google-cloud-data_catalog-v1/snippets/Gemfile b/google-cloud-data_catalog-v1/snippets/Gemfile index 816f7b0dda4e..162c3510020d 100755 --- a/google-cloud-data_catalog-v1/snippets/Gemfile +++ b/google-cloud-data_catalog-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb index aaf6ea9bc45a..35b3784598fb 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_CreateEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry +# +def create_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateEntryRequest.new -# Call the create_entry method. -result = client.create_entry request + # Call the create_entry method. + result = client.create_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::Entry. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end # [END datacatalog_v1_generated_DataCatalog_CreateEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb index 639b4493fc46..36af58f27b5b 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/create_entry_group.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_CreateEntryGroup_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_entry_group +# +def create_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateEntryGroupRequest.new -# Call the create_entry_group method. -result = client.create_entry_group request + # Call the create_entry_group method. + result = client.create_entry_group request -# The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end # [END datacatalog_v1_generated_DataCatalog_CreateEntryGroup_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb index 5c973b613498..48daf4e35e0b 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_CreateTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag +# +def create_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagRequest.new -# Call the create_tag method. -result = client.create_tag request + # Call the create_tag method. + result = client.create_tag request -# The returned object is of type Google::Cloud::DataCatalog::V1::Tag. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + p result +end # [END datacatalog_v1_generated_DataCatalog_CreateTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb index 6808faf6deb7..2e6eeb6099a5 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_CreateTagTemplate_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template +# +def create_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagTemplateRequest.new -# Call the create_tag_template method. -result = client.create_tag_template request + # Call the create_tag_template method. + result = client.create_tag_template request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end # [END datacatalog_v1_generated_DataCatalog_CreateTagTemplate_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb index 061e1fe7f0d4..79333db20c9d 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/create_tag_template_field.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_CreateTagTemplateField_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#create_tag_template_field +# +def create_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTagTemplateFieldRequest.new -# Call the create_tag_template_field method. -result = client.create_tag_template_field request + # Call the create_tag_template_field method. + result = client.create_tag_template_field request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end # [END datacatalog_v1_generated_DataCatalog_CreateTagTemplateField_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb index a33e110a02ae..1fc2da670ea1 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_DeleteEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry +# +def delete_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteEntryRequest.new -# Call the delete_entry method. -result = client.delete_entry request + # Call the delete_entry method. + result = client.delete_entry request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_DataCatalog_DeleteEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb index 56dea1d3cacc..8f5ae1cc689d 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_entry_group.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_DeleteEntryGroup_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_entry_group +# +def delete_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteEntryGroupRequest.new -# Call the delete_entry_group method. -result = client.delete_entry_group request + # Call the delete_entry_group method. + result = client.delete_entry_group request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_DataCatalog_DeleteEntryGroup_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb index a1e8099d0d36..9d6967e2e570 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_DeleteTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag +# +def delete_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagRequest.new -# Call the delete_tag method. -result = client.delete_tag request + # Call the delete_tag method. + result = client.delete_tag request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_DataCatalog_DeleteTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb index d34416a5a0f9..0a19142446ca 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_DeleteTagTemplate_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template +# +def delete_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateRequest.new -# Call the delete_tag_template method. -result = client.delete_tag_template request + # Call the delete_tag_template method. + result = client.delete_tag_template request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_DataCatalog_DeleteTagTemplate_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb index 3661196e8a1a..e66260ee7e13 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/delete_tag_template_field.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_DeleteTagTemplateField_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#delete_tag_template_field +# +def delete_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTagTemplateFieldRequest.new -# Call the delete_tag_template_field method. -result = client.delete_tag_template_field request + # Call the delete_tag_template_field method. + result = client.delete_tag_template_field request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_DataCatalog_DeleteTagTemplateField_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb index be6104fdec09..2add38e5b2d7 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_GetEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry +# +def get_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetEntryRequest.new -# Call the get_entry method. -result = client.get_entry request + # Call the get_entry method. + result = client.get_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::Entry. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end # [END datacatalog_v1_generated_DataCatalog_GetEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb index c2aec03fef6b..ac35e485a2f3 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/get_entry_group.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_GetEntryGroup_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_entry_group +# +def get_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetEntryGroupRequest.new -# Call the get_entry_group method. -result = client.get_entry_group request + # Call the get_entry_group method. + result = client.get_entry_group request -# The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end # [END datacatalog_v1_generated_DataCatalog_GetEntryGroup_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb index ac052a1bdb0c..7b80df345746 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_GetIamPolicy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END datacatalog_v1_generated_DataCatalog_GetIamPolicy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb index f4e53f747433..81c965a9237c 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/get_tag_template.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_GetTagTemplate_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#get_tag_template +# +def get_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetTagTemplateRequest.new -# Call the get_tag_template method. -result = client.get_tag_template request + # Call the get_tag_template method. + result = client.get_tag_template request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end # [END datacatalog_v1_generated_DataCatalog_GetTagTemplate_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb index ebfcaa4341a9..d97bd55bc087 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/list_entries.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_DataCatalog_ListEntries_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entries +# +def list_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListEntriesRequest.new -# Call the list_entries method. -result = client.list_entries request + # Call the list_entries method. + result = client.list_entries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Entry. + p response + end end # [END datacatalog_v1_generated_DataCatalog_ListEntries_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb index 6d22979d176c..17510ef9feb3 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/list_entry_groups.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_DataCatalog_ListEntryGroups_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_entry_groups +# +def list_entry_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListEntryGroupsRequest.new -# Call the list_entry_groups method. -result = client.list_entry_groups request + # Call the list_entry_groups method. + result = client.list_entry_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::EntryGroup. + p response + end end # [END datacatalog_v1_generated_DataCatalog_ListEntryGroups_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb index e60f3fa62b79..2df45a5d682f 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/list_tags.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_DataCatalog_ListTags_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#list_tags +# +def list_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListTagsRequest.new -# Call the list_tags method. -result = client.list_tags request + # Call the list_tags method. + result = client.list_tags request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Tag. + p response + end end # [END datacatalog_v1_generated_DataCatalog_ListTags_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb index 4ac4484e234a..ad47b3e28f7c 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/lookup_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_LookupEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#lookup_entry +# +def lookup_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::LookupEntryRequest.new -# Call the lookup_entry method. -result = client.lookup_entry request + # Call the lookup_entry method. + result = client.lookup_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::Entry. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end # [END datacatalog_v1_generated_DataCatalog_LookupEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb index 3b75ea5dfc69..542ce22020e6 100644 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_contacts.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_ModifyEntryContacts_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_contacts +# +def modify_entry_contacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ModifyEntryContactsRequest.new -# Call the modify_entry_contacts method. -result = client.modify_entry_contacts request + # Call the modify_entry_contacts method. + result = client.modify_entry_contacts request -# The returned object is of type Google::Cloud::DataCatalog::V1::Contacts. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Contacts. + p result +end # [END datacatalog_v1_generated_DataCatalog_ModifyEntryContacts_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb index a0579f77505c..f1cb469a61c3 100644 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/modify_entry_overview.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_ModifyEntryOverview_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#modify_entry_overview +# +def modify_entry_overview + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ModifyEntryOverviewRequest.new -# Call the modify_entry_overview method. -result = client.modify_entry_overview request + # Call the modify_entry_overview method. + result = client.modify_entry_overview request -# The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryOverview. + p result +end # [END datacatalog_v1_generated_DataCatalog_ModifyEntryOverview_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb index 65ae152dc82f..b20da5b6a4c8 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_RenameTagTemplateField_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field +# +def rename_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldRequest.new -# Call the rename_tag_template_field method. -result = client.rename_tag_template_field request + # Call the rename_tag_template_field method. + result = client.rename_tag_template_field request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end # [END datacatalog_v1_generated_DataCatalog_RenameTagTemplateField_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb index b1e2bb3d808c..f426fe4ddf75 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/rename_tag_template_field_enum_value.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_RenameTagTemplateFieldEnumValue_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#rename_tag_template_field_enum_value +# +def rename_tag_template_field_enum_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::RenameTagTemplateFieldEnumValueRequest.new -# Call the rename_tag_template_field_enum_value method. -result = client.rename_tag_template_field_enum_value request + # Call the rename_tag_template_field_enum_value method. + result = client.rename_tag_template_field_enum_value request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end # [END datacatalog_v1_generated_DataCatalog_RenameTagTemplateFieldEnumValue_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb index b0b8af89cae7..dcdda483c8fa 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/search_catalog.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_DataCatalog_SearchCatalog_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#search_catalog +# +def search_catalog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::SearchCatalogRequest.new -# Call the search_catalog method. -result = client.search_catalog request + # Call the search_catalog method. + result = client.search_catalog request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::SearchCatalogResult. + p response + end end # [END datacatalog_v1_generated_DataCatalog_SearchCatalog_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb index 07fb518cbee5..7016a825060b 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_SetIamPolicy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END datacatalog_v1_generated_DataCatalog_SetIamPolicy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb index d95d11583a79..34515f818220 100644 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/star_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_StarEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#star_entry +# +def star_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::StarEntryRequest.new -# Call the star_entry method. -result = client.star_entry request + # Call the star_entry method. + result = client.star_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::StarEntryResponse. + p result +end # [END datacatalog_v1_generated_DataCatalog_StarEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb index c6f64b188ca7..80b2bc56b6d8 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_TestIamPermissions_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END datacatalog_v1_generated_DataCatalog_TestIamPermissions_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb index fa5c3e2ef977..dca663d9c907 100644 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/unstar_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UnstarEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#unstar_entry +# +def unstar_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UnstarEntryRequest.new -# Call the unstar_entry method. -result = client.unstar_entry request + # Call the unstar_entry method. + result = client.unstar_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::UnstarEntryResponse. + p result +end # [END datacatalog_v1_generated_DataCatalog_UnstarEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb index 84f6c75d465c..a472c0cf9741 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UpdateEntry_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry +# +def update_entry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateEntryRequest.new -# Call the update_entry method. -result = client.update_entry request + # Call the update_entry method. + result = client.update_entry request -# The returned object is of type Google::Cloud::DataCatalog::V1::Entry. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Entry. + p result +end # [END datacatalog_v1_generated_DataCatalog_UpdateEntry_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb index ced9cf3df7cb..b71d261904f7 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/update_entry_group.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UpdateEntryGroup_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_entry_group +# +def update_entry_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateEntryGroupRequest.new -# Call the update_entry_group method. -result = client.update_entry_group request + # Call the update_entry_group method. + result = client.update_entry_group request -# The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::EntryGroup. + p result +end # [END datacatalog_v1_generated_DataCatalog_UpdateEntryGroup_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb index ffad701d42d2..afe35119862b 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UpdateTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag +# +def update_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagRequest.new -# Call the update_tag method. -result = client.update_tag request + # Call the update_tag method. + result = client.update_tag request -# The returned object is of type Google::Cloud::DataCatalog::V1::Tag. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Tag. + p result +end # [END datacatalog_v1_generated_DataCatalog_UpdateTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb index 1f19b5a640fc..a27bcfd4e75d 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UpdateTagTemplate_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template +# +def update_tag_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateRequest.new -# Call the update_tag_template method. -result = client.update_tag_template request + # Call the update_tag_template method. + result = client.update_tag_template request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplate. + p result +end # [END datacatalog_v1_generated_DataCatalog_UpdateTagTemplate_sync] diff --git a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb index 8c3e72465634..e96b0521b261 100755 --- a/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb +++ b/google-cloud-data_catalog-v1/snippets/data_catalog/update_tag_template_field.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_DataCatalog_UpdateTagTemplateField_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::DataCatalog::Client#update_tag_template_field +# +def update_tag_template_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::DataCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTagTemplateFieldRequest.new -# Call the update_tag_template_field method. -result = client.update_tag_template_field request + # Call the update_tag_template_field method. + result = client.update_tag_template_field request -# The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::TagTemplateField. + p result +end # [END datacatalog_v1_generated_DataCatalog_UpdateTagTemplateField_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb index 9d9ee5854209..139e33550b86 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_policy_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_CreatePolicyTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_policy_tag +# +def create_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreatePolicyTagRequest.new -# Call the create_policy_tag method. -result = client.create_policy_tag request + # Call the create_policy_tag method. + result = client.create_policy_tag request -# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_CreatePolicyTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb index db628082a31b..cd45684cc6f4 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/create_taxonomy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_CreateTaxonomy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#create_taxonomy +# +def create_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::CreateTaxonomyRequest.new -# Call the create_taxonomy method. -result = client.create_taxonomy request + # Call the create_taxonomy method. + result = client.create_taxonomy request -# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_CreateTaxonomy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb index 9333892d08f5..0ee93ee736a7 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_policy_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_DeletePolicyTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_policy_tag +# +def delete_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeletePolicyTagRequest.new -# Call the delete_policy_tag method. -result = client.delete_policy_tag request + # Call the delete_policy_tag method. + result = client.delete_policy_tag request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_DeletePolicyTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb index 0c01ba554b0d..63caacd1cd22 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/delete_taxonomy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_DeleteTaxonomy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#delete_taxonomy +# +def delete_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::DeleteTaxonomyRequest.new -# Call the delete_taxonomy method. -result = client.delete_taxonomy request + # Call the delete_taxonomy method. + result = client.delete_taxonomy request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_DeleteTaxonomy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb index 0b8c7769e9a0..bc8e071703d1 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_GetIamPolicy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_GetIamPolicy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb index 5dd972e97bec..8557f82adee3 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_policy_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_GetPolicyTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_policy_tag +# +def get_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetPolicyTagRequest.new -# Call the get_policy_tag method. -result = client.get_policy_tag request + # Call the get_policy_tag method. + result = client.get_policy_tag request -# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_GetPolicyTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb index f8c21b108f9f..9d1349a42fd9 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/get_taxonomy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_GetTaxonomy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#get_taxonomy +# +def get_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::GetTaxonomyRequest.new -# Call the get_taxonomy method. -result = client.get_taxonomy request + # Call the get_taxonomy method. + result = client.get_taxonomy request -# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_GetTaxonomy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb index 31a2632e3af4..dab96e847d12 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_policy_tags.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_PolicyTagManager_ListPolicyTags_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_policy_tags +# +def list_policy_tags + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListPolicyTagsRequest.new -# Call the list_policy_tags method. -result = client.list_policy_tags request + # Call the list_policy_tags method. + result = client.list_policy_tags request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::PolicyTag. + p response + end end # [END datacatalog_v1_generated_PolicyTagManager_ListPolicyTags_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb index 71eb21105755..664a374a71a8 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/list_taxonomies.rb @@ -19,21 +19,27 @@ # [START datacatalog_v1_generated_PolicyTagManager_ListTaxonomies_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#list_taxonomies +# +def list_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ListTaxonomiesRequest.new -# Call the list_taxonomies method. -result = client.list_taxonomies request + # Call the list_taxonomies method. + result = client.list_taxonomies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataCatalog::V1::Taxonomy. + p response + end end # [END datacatalog_v1_generated_PolicyTagManager_ListTaxonomies_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb index d411bb36a10a..5a0586459865 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_SetIamPolicy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_SetIamPolicy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb index b82fae84e2f1..e7b489d0a345 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_TestIamPermissions_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_TestIamPermissions_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb index 6d9af7cf584e..df4ef27cdf52 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_policy_tag.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_UpdatePolicyTag_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_policy_tag +# +def update_policy_tag + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdatePolicyTagRequest.new -# Call the update_policy_tag method. -result = client.update_policy_tag request + # Call the update_policy_tag method. + result = client.update_policy_tag request -# The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::PolicyTag. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_UpdatePolicyTag_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb index 383be74a2346..0c00967277ca 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager/update_taxonomy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManager_UpdateTaxonomy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManager::Client#update_taxonomy +# +def update_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::UpdateTaxonomyRequest.new -# Call the update_taxonomy method. -result = client.update_taxonomy request + # Call the update_taxonomy method. + result = client.update_taxonomy request -# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end # [END datacatalog_v1_generated_PolicyTagManager_UpdateTaxonomy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb index fe490b56f6e7..9d646358e8eb 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/export_taxonomies.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManagerSerialization_ExportTaxonomies_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#export_taxonomies +# +def export_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ExportTaxonomiesRequest.new -# Call the export_taxonomies method. -result = client.export_taxonomies request + # Call the export_taxonomies method. + result = client.export_taxonomies request -# The returned object is of type Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::ExportTaxonomiesResponse. + p result +end # [END datacatalog_v1_generated_PolicyTagManagerSerialization_ExportTaxonomies_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb index 062690dcc066..5da802396aa1 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/import_taxonomies.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManagerSerialization_ImportTaxonomies_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#import_taxonomies +# +def import_taxonomies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ImportTaxonomiesRequest.new -# Call the import_taxonomies method. -result = client.import_taxonomies request + # Call the import_taxonomies method. + result = client.import_taxonomies request -# The returned object is of type Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::ImportTaxonomiesResponse. + p result +end # [END datacatalog_v1_generated_PolicyTagManagerSerialization_ImportTaxonomies_sync] diff --git a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb index b1c366bc5b30..71d08c5a3902 100755 --- a/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb +++ b/google-cloud-data_catalog-v1/snippets/policy_tag_manager_serialization/replace_taxonomy.rb @@ -19,15 +19,21 @@ # [START datacatalog_v1_generated_PolicyTagManagerSerialization_ReplaceTaxonomy_sync] require "google/cloud/data_catalog/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client#replace_taxonomy +# +def replace_taxonomy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataCatalog::V1::PolicyTagManagerSerialization::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataCatalog::V1::ReplaceTaxonomyRequest.new -# Call the replace_taxonomy method. -result = client.replace_taxonomy request + # Call the replace_taxonomy method. + result = client.replace_taxonomy request -# The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. -p result + # The returned object is of type Google::Cloud::DataCatalog::V1::Taxonomy. + p result +end # [END datacatalog_v1_generated_PolicyTagManagerSerialization_ReplaceTaxonomy_sync] diff --git a/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json b/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json index 30ad98ccdeb7..b5f2e36e74cf 100644 --- a/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json +++ b/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-data_fusion-v1/.rubocop.yml b/google-cloud-data_fusion-v1/.rubocop.yml index 657673f5ad32..e5ea1c30caa3 100644 --- a/google-cloud-data_fusion-v1/.rubocop.yml +++ b/google-cloud-data_fusion-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-data_fusion-v1.rb" diff --git a/google-cloud-data_fusion-v1/snippets/Gemfile b/google-cloud-data_fusion-v1/snippets/Gemfile index abb35cbd26ec..9e1f53021126 100755 --- a/google-cloud-data_fusion-v1/snippets/Gemfile +++ b/google-cloud-data_fusion-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/create_instance.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/create_instance.rb index a929f4cced62..cf76fb3f878f 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/create_instance.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/create_instance.rb @@ -19,22 +19,28 @@ # [START datafusion_v1_generated_DataFusion_CreateInstance_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datafusion_v1_generated_DataFusion_CreateInstance_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/delete_instance.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/delete_instance.rb index c040740f454e..93ca6026de92 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/delete_instance.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/delete_instance.rb @@ -19,22 +19,28 @@ # [START datafusion_v1_generated_DataFusion_DeleteInstance_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datafusion_v1_generated_DataFusion_DeleteInstance_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/get_instance.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/get_instance.rb index cc0211547cef..b310199c0a09 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/get_instance.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/get_instance.rb @@ -19,15 +19,21 @@ # [START datafusion_v1_generated_DataFusion_GetInstance_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::DataFusion::V1::Instance. -p result + # The returned object is of type Google::Cloud::DataFusion::V1::Instance. + p result +end # [END datafusion_v1_generated_DataFusion_GetInstance_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/list_available_versions.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/list_available_versions.rb index df31aad4c24d..4d21cf592411 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/list_available_versions.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/list_available_versions.rb @@ -19,21 +19,27 @@ # [START datafusion_v1_generated_DataFusion_ListAvailableVersions_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#list_available_versions +# +def list_available_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::ListAvailableVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::ListAvailableVersionsRequest.new -# Call the list_available_versions method. -result = client.list_available_versions request + # Call the list_available_versions method. + result = client.list_available_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataFusion::V1::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataFusion::V1::Version. + p response + end end # [END datafusion_v1_generated_DataFusion_ListAvailableVersions_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/list_instances.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/list_instances.rb index c877ce088de0..fb0cc9a11a86 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/list_instances.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/list_instances.rb @@ -19,21 +19,27 @@ # [START datafusion_v1_generated_DataFusion_ListInstances_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataFusion::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataFusion::V1::Instance. + p response + end end # [END datafusion_v1_generated_DataFusion_ListInstances_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/restart_instance.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/restart_instance.rb index 0301cf406083..7b81da6ca510 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/restart_instance.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/restart_instance.rb @@ -19,22 +19,28 @@ # [START datafusion_v1_generated_DataFusion_RestartInstance_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#restart_instance +# +def restart_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::RestartInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::RestartInstanceRequest.new -# Call the restart_instance method. -result = client.restart_instance request + # Call the restart_instance method. + result = client.restart_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datafusion_v1_generated_DataFusion_RestartInstance_sync] diff --git a/google-cloud-data_fusion-v1/snippets/data_fusion/update_instance.rb b/google-cloud-data_fusion-v1/snippets/data_fusion/update_instance.rb index de4c6be25e41..ae390cbef9ff 100755 --- a/google-cloud-data_fusion-v1/snippets/data_fusion/update_instance.rb +++ b/google-cloud-data_fusion-v1/snippets/data_fusion/update_instance.rb @@ -19,22 +19,28 @@ # [START datafusion_v1_generated_DataFusion_UpdateInstance_sync] require "google/cloud/data_fusion/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataFusion::V1::DataFusion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataFusion::V1::DataFusion::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataFusion::V1::DataFusion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataFusion::V1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataFusion::V1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datafusion_v1_generated_DataFusion_UpdateInstance_sync] diff --git a/google-cloud-data_fusion-v1/snippets/snippet_metadata_google.cloud.datafusion.v1.json b/google-cloud-data_fusion-v1/snippets/snippet_metadata_google.cloud.datafusion.v1.json index 9c0154782453..08a7b63102d0 100644 --- a/google-cloud-data_fusion-v1/snippets/snippet_metadata_google.cloud.datafusion.v1.json +++ b/google-cloud-data_fusion-v1/snippets/snippet_metadata_google.cloud.datafusion.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-data_labeling-v1beta1/.rubocop.yml b/google-cloud-data_labeling-v1beta1/.rubocop.yml index b064e5609eda..4b0b6e8859d7 100644 --- a/google-cloud-data_labeling-v1beta1/.rubocop.yml +++ b/google-cloud-data_labeling-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-data_labeling-v1beta1.rb" diff --git a/google-cloud-data_labeling-v1beta1/snippets/Gemfile b/google-cloud-data_labeling-v1beta1/snippets/Gemfile index f480c9a03dd3..18e6949c7dd7 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/Gemfile +++ b/google-cloud-data_labeling-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_annotation_spec_set.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_annotation_spec_set.rb index 6689253def30..cb8d31351071 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_annotation_spec_set.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_annotation_spec_set.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#create_annotation_spec_set +# +def create_annotation_spec_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::CreateAnnotationSpecSetRequest.new -# Call the create_annotation_spec_set method. -result = client.create_annotation_spec_set request + # Call the create_annotation_spec_set method. + result = client.create_annotation_spec_set request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_CreateAnnotationSpecSet_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_dataset.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_dataset.rb index 7be2e470c5e9..a990cd616505 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_dataset.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_dataset.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#create_dataset +# +def create_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::CreateDatasetRequest.new -# Call the create_dataset method. -result = client.create_dataset request + # Call the create_dataset method. + result = client.create_dataset request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_CreateDataset_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_evaluation_job.rb index 48cd4dd89436..6da9df7ba733 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#create_evaluation_job +# +def create_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::CreateEvaluationJobRequest.new -# Call the create_evaluation_job method. -result = client.create_evaluation_job request + # Call the create_evaluation_job method. + result = client.create_evaluation_job request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_CreateEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_instruction.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_instruction.rb index 28cf5a3feb3f..670fbb727283 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_instruction.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/create_instruction.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#create_instruction +# +def create_instruction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::CreateInstructionRequest.new -# Call the create_instruction method. -result = client.create_instruction request + # Call the create_instruction method. + result = client.create_instruction request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_CreateInstruction_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotated_dataset.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotated_dataset.rb index 6d25026e7e02..c8baf9c95650 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotated_dataset.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotated_dataset.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#delete_annotated_dataset +# +def delete_annotated_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotatedDatasetRequest.new -# Call the delete_annotated_dataset method. -result = client.delete_annotated_dataset request + # Call the delete_annotated_dataset method. + result = client.delete_annotated_dataset request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotatedDataset_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotation_spec_set.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotation_spec_set.rb index a8245a103784..392a07f56736 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotation_spec_set.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_annotation_spec_set.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#delete_annotation_spec_set +# +def delete_annotation_spec_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::DeleteAnnotationSpecSetRequest.new -# Call the delete_annotation_spec_set method. -result = client.delete_annotation_spec_set request + # Call the delete_annotation_spec_set method. + result = client.delete_annotation_spec_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_DeleteAnnotationSpecSet_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_dataset.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_dataset.rb index 262165bdeae8..fb122aeab4b6 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_dataset.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_dataset.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#delete_dataset +# +def delete_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::DeleteDatasetRequest.new -# Call the delete_dataset method. -result = client.delete_dataset request + # Call the delete_dataset method. + result = client.delete_dataset request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_DeleteDataset_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_evaluation_job.rb index 5b20e54b3cc5..84f49b0b0911 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#delete_evaluation_job +# +def delete_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::DeleteEvaluationJobRequest.new -# Call the delete_evaluation_job method. -result = client.delete_evaluation_job request + # Call the delete_evaluation_job method. + result = client.delete_evaluation_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_DeleteEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_instruction.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_instruction.rb index 2e2646b129bd..ff69ff068196 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_instruction.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/delete_instruction.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#delete_instruction +# +def delete_instruction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::DeleteInstructionRequest.new -# Call the delete_instruction method. -result = client.delete_instruction request + # Call the delete_instruction method. + result = client.delete_instruction request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_DeleteInstruction_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/export_data.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/export_data.rb index 64d9a7a185c6..35267b910a29 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/export_data.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/export_data.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ExportData_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#export_data +# +def export_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ExportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ExportDataRequest.new -# Call the export_data method. -result = client.export_data request + # Call the export_data method. + result = client.export_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ExportData_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotated_dataset.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotated_dataset.rb index 962f73337122..3886760ab0e7 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotated_dataset.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotated_dataset.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_annotated_dataset +# +def get_annotated_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetAnnotatedDatasetRequest.new -# Call the get_annotated_dataset method. -result = client.get_annotated_dataset request + # Call the get_annotated_dataset method. + result = client.get_annotated_dataset request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetAnnotatedDataset_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotation_spec_set.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotation_spec_set.rb index e7a449393149..7a21d5caa231 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotation_spec_set.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_annotation_spec_set.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_annotation_spec_set +# +def get_annotation_spec_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetAnnotationSpecSetRequest.new -# Call the get_annotation_spec_set method. -result = client.get_annotation_spec_set request + # Call the get_annotation_spec_set method. + result = client.get_annotation_spec_set request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetAnnotationSpecSet_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_data_item.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_data_item.rb index 0878978fca9d..826e4a358286 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_data_item.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_data_item.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_data_item +# +def get_data_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetDataItemRequest.new -# Call the get_data_item method. -result = client.get_data_item request + # Call the get_data_item method. + result = client.get_data_item request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::DataItem. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::DataItem. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetDataItem_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_dataset.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_dataset.rb index 9fdde255911a..b7a54eab23cc 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_dataset.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_dataset.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetDataset_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_dataset +# +def get_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetDatasetRequest.new -# Call the get_dataset method. -result = client.get_dataset request + # Call the get_dataset method. + result = client.get_dataset request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Dataset. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetDataset_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation.rb index 031436125b86..7923e2fd7519 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_evaluation +# +def get_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationRequest.new -# Call the get_evaluation method. -result = client.get_evaluation request + # Call the get_evaluation method. + result = client.get_evaluation request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::Evaluation. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Evaluation. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetEvaluation_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation_job.rb index a55dd0e42134..9c517363d606 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_evaluation_job +# +def get_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetEvaluationJobRequest.new -# Call the get_evaluation_job method. -result = client.get_evaluation_job request + # Call the get_evaluation_job method. + result = client.get_evaluation_job request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_example.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_example.rb index 29eed7b32a24..a161505d6fb3 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_example.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_example.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetExample_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_example +# +def get_example + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetExampleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetExampleRequest.new -# Call the get_example method. -result = client.get_example request + # Call the get_example method. + result = client.get_example request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::Example. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Example. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetExample_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_instruction.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_instruction.rb index 4ac60af380a4..7799bc5ae1fb 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_instruction.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/get_instruction.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#get_instruction +# +def get_instruction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::GetInstructionRequest.new -# Call the get_instruction method. -result = client.get_instruction request + # Call the get_instruction method. + result = client.get_instruction request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::Instruction. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::Instruction. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_GetInstruction_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/import_data.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/import_data.rb index 2228e77e2a97..052d84c2f383 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/import_data.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/import_data.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ImportData_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#import_data +# +def import_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ImportDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ImportDataRequest.new -# Call the import_data method. -result = client.import_data request + # Call the import_data method. + result = client.import_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ImportData_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_image.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_image.rb index 2ecd3e024c26..68724d09cda7 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_image.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_image.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_LabelImage_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#label_image +# +def label_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::LabelImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::LabelImageRequest.new -# Call the label_image method. -result = client.label_image request + # Call the label_image method. + result = client.label_image request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_LabelImage_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_text.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_text.rb index 1569e8773eed..e1fc25bfdf2f 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_text.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_text.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_LabelText_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#label_text +# +def label_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::LabelTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::LabelTextRequest.new -# Call the label_text method. -result = client.label_text request + # Call the label_text method. + result = client.label_text request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_LabelText_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_video.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_video.rb index b7f7f1f94e2b..4ff90fed4964 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_video.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/label_video.rb @@ -19,22 +19,28 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#label_video +# +def label_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::LabelVideoRequest.new -# Call the label_video method. -result = client.label_video request + # Call the label_video method. + result = client.label_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datalabeling_v1beta1_generated_DataLabelingService_LabelVideo_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotated_datasets.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotated_datasets.rb index 8513aca9a0f0..8ba39a5bf81c 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotated_datasets.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotated_datasets.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_annotated_datasets +# +def list_annotated_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListAnnotatedDatasetsRequest.new -# Call the list_annotated_datasets method. -result = client.list_annotated_datasets request + # Call the list_annotated_datasets method. + result = client.list_annotated_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotatedDataset. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListAnnotatedDatasets_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotation_spec_sets.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotation_spec_sets.rb index b20d4b088cfc..ef19b7e8d10e 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotation_spec_sets.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_annotation_spec_sets.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_annotation_spec_sets +# +def list_annotation_spec_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListAnnotationSpecSetsRequest.new -# Call the list_annotation_spec_sets method. -result = client.list_annotation_spec_sets request + # Call the list_annotation_spec_sets method. + result = client.list_annotation_spec_sets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::AnnotationSpecSet. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListAnnotationSpecSets_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_data_items.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_data_items.rb index 254c736b7d25..705ae960a469 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_data_items.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_data_items.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_data_items +# +def list_data_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListDataItemsRequest.new -# Call the list_data_items method. -result = client.list_data_items request + # Call the list_data_items method. + result = client.list_data_items request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::DataItem. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::DataItem. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListDataItems_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_datasets.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_datasets.rb index c0cc8974a459..84b0bdb53107 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_datasets.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_datasets.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_datasets +# +def list_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListDatasetsRequest.new -# Call the list_datasets method. -result = client.list_datasets request + # Call the list_datasets method. + result = client.list_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Dataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Dataset. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListDatasets_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_evaluation_jobs.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_evaluation_jobs.rb index ff38ef103f61..8ebc0864c5a8 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_evaluation_jobs.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_evaluation_jobs.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_evaluation_jobs +# +def list_evaluation_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListEvaluationJobsRequest.new -# Call the list_evaluation_jobs method. -result = client.list_evaluation_jobs request + # Call the list_evaluation_jobs method. + result = client.list_evaluation_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::EvaluationJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::EvaluationJob. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListEvaluationJobs_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_examples.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_examples.rb index 1bf15504fb6d..aaecee7ec626 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_examples.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_examples.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListExamples_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_examples +# +def list_examples + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListExamplesRequest.new -# Call the list_examples method. -result = client.list_examples request + # Call the list_examples method. + result = client.list_examples request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Example. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Example. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListExamples_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_instructions.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_instructions.rb index 265327222582..bb8048590919 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_instructions.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/list_instructions.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#list_instructions +# +def list_instructions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ListInstructionsRequest.new -# Call the list_instructions method. -result = client.list_instructions request + # Call the list_instructions method. + result = client.list_instructions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Instruction. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Instruction. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_ListInstructions_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/pause_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/pause_evaluation_job.rb index 9165d0fa80a9..02b14380c0dd 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/pause_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/pause_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#pause_evaluation_job +# +def pause_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::PauseEvaluationJobRequest.new -# Call the pause_evaluation_job method. -result = client.pause_evaluation_job request + # Call the pause_evaluation_job method. + result = client.pause_evaluation_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_PauseEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/resume_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/resume_evaluation_job.rb index d9b2b5d46feb..7bceae172b3e 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/resume_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/resume_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#resume_evaluation_job +# +def resume_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::ResumeEvaluationJobRequest.new -# Call the resume_evaluation_job method. -result = client.resume_evaluation_job request + # Call the resume_evaluation_job method. + result = client.resume_evaluation_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_ResumeEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_evaluations.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_evaluations.rb index c9017d8230c8..3a167f7776d6 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_evaluations.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_evaluations.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#search_evaluations +# +def search_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::SearchEvaluationsRequest.new -# Call the search_evaluations method. -result = client.search_evaluations request + # Call the search_evaluations method. + result = client.search_evaluations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Evaluation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::Evaluation. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_SearchEvaluations_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_example_comparisons.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_example_comparisons.rb index ac325e286ee8..a66fb42197bb 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_example_comparisons.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/search_example_comparisons.rb @@ -19,21 +19,27 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#search_example_comparisons +# +def search_example_comparisons + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsRequest.new -# Call the search_example_comparisons method. -result = client.search_example_comparisons request + # Call the search_example_comparisons method. + result = client.search_example_comparisons request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsResponse::ExampleComparison. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DataLabeling::V1beta1::SearchExampleComparisonsResponse::ExampleComparison. + p response + end end # [END datalabeling_v1beta1_generated_DataLabelingService_SearchExampleComparisons_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/update_evaluation_job.rb b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/update_evaluation_job.rb index 897dbde446bd..13999e2f9d89 100755 --- a/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/update_evaluation_job.rb +++ b/google-cloud-data_labeling-v1beta1/snippets/data_labeling_service/update_evaluation_job.rb @@ -19,15 +19,21 @@ # [START datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_sync] require "google/cloud/data_labeling/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client#update_evaluation_job +# +def update_evaluation_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataLabeling::V1beta1::DataLabelingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataLabeling::V1beta1::UpdateEvaluationJobRequest.new -# Call the update_evaluation_job method. -result = client.update_evaluation_job request + # Call the update_evaluation_job method. + result = client.update_evaluation_job request -# The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. -p result + # The returned object is of type Google::Cloud::DataLabeling::V1beta1::EvaluationJob. + p result +end # [END datalabeling_v1beta1_generated_DataLabelingService_UpdateEvaluationJob_sync] diff --git a/google-cloud-data_labeling-v1beta1/snippets/snippet_metadata_google.cloud.datalabeling.v1beta1.json b/google-cloud-data_labeling-v1beta1/snippets/snippet_metadata_google.cloud.datalabeling.v1beta1.json index ba3f447a0416..c95ba27b42c1 100644 --- a/google-cloud-data_labeling-v1beta1/snippets/snippet_metadata_google.cloud.datalabeling.v1beta1.json +++ b/google-cloud-data_labeling-v1beta1/snippets/snippet_metadata_google.cloud.datalabeling.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-dataflow-v1beta3/.rubocop.yml b/google-cloud-dataflow-v1beta3/.rubocop.yml index 5f4c1c2e5bc0..4c6e4d8dc75b 100644 --- a/google-cloud-dataflow-v1beta3/.rubocop.yml +++ b/google-cloud-dataflow-v1beta3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dataflow-v1beta3.rb" diff --git a/google-cloud-dataflow-v1beta3/snippets/Gemfile b/google-cloud-dataflow-v1beta3/snippets/Gemfile index b0fc364233af..fb47cabd37cd 100755 --- a/google-cloud-dataflow-v1beta3/snippets/Gemfile +++ b/google-cloud-dataflow-v1beta3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dataflow-v1beta3/snippets/flex_templates_service/launch_flex_template.rb b/google-cloud-dataflow-v1beta3/snippets/flex_templates_service/launch_flex_template.rb index ef1a7e3ab69f..253d686b666f 100755 --- a/google-cloud-dataflow-v1beta3/snippets/flex_templates_service/launch_flex_template.rb +++ b/google-cloud-dataflow-v1beta3/snippets/flex_templates_service/launch_flex_template.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Client#launch_flex_template +# +def launch_flex_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::FlexTemplatesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateRequest.new -# Call the launch_flex_template method. -result = client.launch_flex_template request + # Call the launch_flex_template method. + result = client.launch_flex_template request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchFlexTemplateResponse. + p result +end # [END dataflow_v1beta3_generated_FlexTemplatesService_LaunchFlexTemplate_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/aggregated_list_jobs.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/aggregated_list_jobs.rb index ea7f8c7e2488..51e9423cab4b 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/aggregated_list_jobs.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/aggregated_list_jobs.rb @@ -19,21 +19,27 @@ # [START dataflow_v1beta3_generated_Jobs_AggregatedListJobs_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#aggregated_list_jobs +# +def aggregated_list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new -# Call the aggregated_list_jobs method. -result = client.aggregated_list_jobs request + # Call the aggregated_list_jobs method. + result = client.aggregated_list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. + p response + end end # [END dataflow_v1beta3_generated_Jobs_AggregatedListJobs_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/check_active_jobs.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/check_active_jobs.rb index 6eb9d13df2bf..6ee6764c0fcf 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/check_active_jobs.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/check_active_jobs.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Jobs_CheckActiveJobs_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#check_active_jobs +# +def check_active_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::CheckActiveJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::CheckActiveJobsRequest.new -# Call the check_active_jobs method. -result = client.check_active_jobs request + # Call the check_active_jobs method. + result = client.check_active_jobs request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::CheckActiveJobsResponse. + p result +end # [END dataflow_v1beta3_generated_Jobs_CheckActiveJobs_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/create_job.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/create_job.rb index 8cdeafa81d1e..bcfb07424f5d 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/create_job.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/create_job.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Jobs_CreateJob_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + p result +end # [END dataflow_v1beta3_generated_Jobs_CreateJob_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/get_job.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/get_job.rb index 725851426380..8bec834509d7 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/get_job.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/get_job.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Jobs_GetJob_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + p result +end # [END dataflow_v1beta3_generated_Jobs_GetJob_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/list_jobs.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/list_jobs.rb index 0732c282199a..9ecbc6384f84 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/list_jobs.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/list_jobs.rb @@ -19,21 +19,27 @@ # [START dataflow_v1beta3_generated_Jobs_ListJobs_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataflow::V1beta3::Job. + p response + end end # [END dataflow_v1beta3_generated_Jobs_ListJobs_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/snapshot_job.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/snapshot_job.rb index 5730e7df280b..a0795242d628 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/snapshot_job.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/snapshot_job.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Jobs_SnapshotJob_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#snapshot_job +# +def snapshot_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::SnapshotJobRequest.new -# Call the snapshot_job method. -result = client.snapshot_job request + # Call the snapshot_job method. + result = client.snapshot_job request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. + p result +end # [END dataflow_v1beta3_generated_Jobs_SnapshotJob_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/jobs/update_job.rb b/google-cloud-dataflow-v1beta3/snippets/jobs/update_job.rb index ba58008ca9ba..4c90afc93e86 100755 --- a/google-cloud-dataflow-v1beta3/snippets/jobs/update_job.rb +++ b/google-cloud-dataflow-v1beta3/snippets/jobs/update_job.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Jobs_UpdateJob_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Jobs::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Jobs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + p result +end # [END dataflow_v1beta3_generated_Jobs_UpdateJob_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/messages/list_job_messages.rb b/google-cloud-dataflow-v1beta3/snippets/messages/list_job_messages.rb index c7238f4236d2..d27928b24dbe 100755 --- a/google-cloud-dataflow-v1beta3/snippets/messages/list_job_messages.rb +++ b/google-cloud-dataflow-v1beta3/snippets/messages/list_job_messages.rb @@ -19,21 +19,27 @@ # [START dataflow_v1beta3_generated_Messages_ListJobMessages_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Messages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Messages::Client#list_job_messages +# +def list_job_messages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Messages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::ListJobMessagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::ListJobMessagesRequest.new -# Call the list_job_messages method. -result = client.list_job_messages request + # Call the list_job_messages method. + result = client.list_job_messages request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataflow::V1beta3::JobMessage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataflow::V1beta3::JobMessage. + p response + end end # [END dataflow_v1beta3_generated_Messages_ListJobMessages_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_execution_details.rb b/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_execution_details.rb index cfd1fed47961..f29c2a46f2eb 100755 --- a/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_execution_details.rb +++ b/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_execution_details.rb @@ -19,21 +19,27 @@ # [START dataflow_v1beta3_generated_Metrics_GetJobExecutionDetails_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Metrics::Client#get_job_execution_details +# +def get_job_execution_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetJobExecutionDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetJobExecutionDetailsRequest.new -# Call the get_job_execution_details method. -result = client.get_job_execution_details request + # Call the get_job_execution_details method. + result = client.get_job_execution_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataflow::V1beta3::StageSummary. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataflow::V1beta3::StageSummary. + p response + end end # [END dataflow_v1beta3_generated_Metrics_GetJobExecutionDetails_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_metrics.rb b/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_metrics.rb index e74854e6adbf..f7a3f33c73f4 100755 --- a/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_metrics.rb +++ b/google-cloud-dataflow-v1beta3/snippets/metrics/get_job_metrics.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Metrics_GetJobMetrics_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Metrics::Client#get_job_metrics +# +def get_job_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetJobMetricsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetJobMetricsRequest.new -# Call the get_job_metrics method. -result = client.get_job_metrics request + # Call the get_job_metrics method. + result = client.get_job_metrics request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::JobMetrics. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::JobMetrics. + p result +end # [END dataflow_v1beta3_generated_Metrics_GetJobMetrics_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/metrics/get_stage_execution_details.rb b/google-cloud-dataflow-v1beta3/snippets/metrics/get_stage_execution_details.rb index 40dc07a2c22e..2a959fbdd08e 100755 --- a/google-cloud-dataflow-v1beta3/snippets/metrics/get_stage_execution_details.rb +++ b/google-cloud-dataflow-v1beta3/snippets/metrics/get_stage_execution_details.rb @@ -19,21 +19,27 @@ # [START dataflow_v1beta3_generated_Metrics_GetStageExecutionDetails_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Metrics::Client#get_stage_execution_details +# +def get_stage_execution_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Metrics::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetStageExecutionDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetStageExecutionDetailsRequest.new -# Call the get_stage_execution_details method. -result = client.get_stage_execution_details request + # Call the get_stage_execution_details method. + result = client.get_stage_execution_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataflow::V1beta3::WorkerDetails. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataflow::V1beta3::WorkerDetails. + p response + end end # [END dataflow_v1beta3_generated_Metrics_GetStageExecutionDetails_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/snapshots/delete_snapshot.rb b/google-cloud-dataflow-v1beta3/snippets/snapshots/delete_snapshot.rb index b966f8b8454b..9ab4b8ab0f35 100755 --- a/google-cloud-dataflow-v1beta3/snippets/snapshots/delete_snapshot.rb +++ b/google-cloud-dataflow-v1beta3/snippets/snapshots/delete_snapshot.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Snapshots_DeleteSnapshot_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Snapshots::Client#delete_snapshot +# +def delete_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::DeleteSnapshotRequest.new -# Call the delete_snapshot method. -result = client.delete_snapshot request + # Call the delete_snapshot method. + result = client.delete_snapshot request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::DeleteSnapshotResponse. + p result +end # [END dataflow_v1beta3_generated_Snapshots_DeleteSnapshot_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/snapshots/get_snapshot.rb b/google-cloud-dataflow-v1beta3/snippets/snapshots/get_snapshot.rb index ec0fd0101349..c6e1814a8b38 100755 --- a/google-cloud-dataflow-v1beta3/snippets/snapshots/get_snapshot.rb +++ b/google-cloud-dataflow-v1beta3/snippets/snapshots/get_snapshot.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Snapshots_GetSnapshot_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Snapshots::Client#get_snapshot +# +def get_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetSnapshotRequest.new -# Call the get_snapshot method. -result = client.get_snapshot request + # Call the get_snapshot method. + result = client.get_snapshot request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Snapshot. + p result +end # [END dataflow_v1beta3_generated_Snapshots_GetSnapshot_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/snapshots/list_snapshots.rb b/google-cloud-dataflow-v1beta3/snippets/snapshots/list_snapshots.rb index fdb0dc59e3e1..9eba368e3e5a 100755 --- a/google-cloud-dataflow-v1beta3/snippets/snapshots/list_snapshots.rb +++ b/google-cloud-dataflow-v1beta3/snippets/snapshots/list_snapshots.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_Snapshots_ListSnapshots_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::Snapshots::Client#list_snapshots +# +def list_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::Snapshots::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::ListSnapshotsRequest.new -# Call the list_snapshots method. -result = client.list_snapshots request + # Call the list_snapshots method. + result = client.list_snapshots request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::ListSnapshotsResponse. + p result +end # [END dataflow_v1beta3_generated_Snapshots_ListSnapshots_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/snippet_metadata_google.dataflow.v1beta3.json b/google-cloud-dataflow-v1beta3/snippets/snippet_metadata_google.dataflow.v1beta3.json index e10391363e77..49f82cfd8f50 100644 --- a/google-cloud-dataflow-v1beta3/snippets/snippet_metadata_google.dataflow.v1beta3.json +++ b/google-cloud-dataflow-v1beta3/snippets/snippet_metadata_google.dataflow.v1beta3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-dataflow-v1beta3/snippets/templates_service/create_job_from_template.rb b/google-cloud-dataflow-v1beta3/snippets/templates_service/create_job_from_template.rb index 52afaef61d78..dbc3fae5244c 100755 --- a/google-cloud-dataflow-v1beta3/snippets/templates_service/create_job_from_template.rb +++ b/google-cloud-dataflow-v1beta3/snippets/templates_service/create_job_from_template.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::TemplatesService::Client#create_job_from_template +# +def create_job_from_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::CreateJobFromTemplateRequest.new -# Call the create_job_from_template method. -result = client.create_job_from_template request + # Call the create_job_from_template method. + result = client.create_job_from_template request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::Job. + p result +end # [END dataflow_v1beta3_generated_TemplatesService_CreateJobFromTemplate_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/templates_service/get_template.rb b/google-cloud-dataflow-v1beta3/snippets/templates_service/get_template.rb index 93af65e3e8be..4976b879392f 100755 --- a/google-cloud-dataflow-v1beta3/snippets/templates_service/get_template.rb +++ b/google-cloud-dataflow-v1beta3/snippets/templates_service/get_template.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::TemplatesService::Client#get_template +# +def get_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::GetTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::GetTemplateRequest.new -# Call the get_template method. -result = client.get_template request + # Call the get_template method. + result = client.get_template request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::GetTemplateResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::GetTemplateResponse. + p result +end # [END dataflow_v1beta3_generated_TemplatesService_GetTemplate_sync] diff --git a/google-cloud-dataflow-v1beta3/snippets/templates_service/launch_template.rb b/google-cloud-dataflow-v1beta3/snippets/templates_service/launch_template.rb index c0a8a18b8f71..5e2945d825e3 100755 --- a/google-cloud-dataflow-v1beta3/snippets/templates_service/launch_template.rb +++ b/google-cloud-dataflow-v1beta3/snippets/templates_service/launch_template.rb @@ -19,15 +19,21 @@ # [START dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync] require "google/cloud/dataflow/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataflow::V1beta3::TemplatesService::Client#launch_template +# +def launch_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataflow::V1beta3::TemplatesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataflow::V1beta3::LaunchTemplateRequest.new -# Call the launch_template method. -result = client.launch_template request + # Call the launch_template method. + result = client.launch_template request -# The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse. -p result + # The returned object is of type Google::Cloud::Dataflow::V1beta3::LaunchTemplateResponse. + p result +end # [END dataflow_v1beta3_generated_TemplatesService_LaunchTemplate_sync] diff --git a/google-cloud-dataform-v1beta1/.rubocop.yml b/google-cloud-dataform-v1beta1/.rubocop.yml index 44b83cdf57c9..aaff5c9db949 100644 --- a/google-cloud-dataform-v1beta1/.rubocop.yml +++ b/google-cloud-dataform-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dataform-v1beta1.rb" diff --git a/google-cloud-dataform-v1beta1/snippets/Gemfile b/google-cloud-dataform-v1beta1/snippets/Gemfile index ded26f1fa58a..637c9ff29187 100644 --- a/google-cloud-dataform-v1beta1/snippets/Gemfile +++ b/google-cloud-dataform-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/cancel_workflow_invocation.rb b/google-cloud-dataform-v1beta1/snippets/dataform/cancel_workflow_invocation.rb index 53c9a2f664ac..308e4a5ab5bf 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/cancel_workflow_invocation.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/cancel_workflow_invocation.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#cancel_workflow_invocation +# +def cancel_workflow_invocation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CancelWorkflowInvocationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CancelWorkflowInvocationRequest.new -# Call the cancel_workflow_invocation method. -result = client.cancel_workflow_invocation request + # Call the cancel_workflow_invocation method. + result = client.cancel_workflow_invocation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_CancelWorkflowInvocation_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/commit_workspace_changes.rb b/google-cloud-dataform-v1beta1/snippets/dataform/commit_workspace_changes.rb index 138f489dfcd1..0e9cf86e8425 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/commit_workspace_changes.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/commit_workspace_changes.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#commit_workspace_changes +# +def commit_workspace_changes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CommitWorkspaceChangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CommitWorkspaceChangesRequest.new -# Call the commit_workspace_changes method. -result = client.commit_workspace_changes request + # Call the commit_workspace_changes method. + result = client.commit_workspace_changes request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_CommitWorkspaceChanges_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/create_compilation_result.rb b/google-cloud-dataform-v1beta1/snippets/dataform/create_compilation_result.rb index 98d88c17a146..9de3b385dd1c 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/create_compilation_result.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/create_compilation_result.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#create_compilation_result +# +def create_compilation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CreateCompilationResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CreateCompilationResultRequest.new -# Call the create_compilation_result method. -result = client.create_compilation_result request + # Call the create_compilation_result method. + result = client.create_compilation_result request -# The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. + p result +end # [END dataform_v1beta1_generated_Dataform_CreateCompilationResult_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/create_repository.rb b/google-cloud-dataform-v1beta1/snippets/dataform/create_repository.rb index d5605ebf9887..4e7e04335af9 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/create_repository.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/create_repository.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CreateRepository_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#create_repository +# +def create_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CreateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CreateRepositoryRequest.new -# Call the create_repository method. -result = client.create_repository request + # Call the create_repository method. + result = client.create_repository request -# The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + p result +end # [END dataform_v1beta1_generated_Dataform_CreateRepository_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/create_workflow_invocation.rb b/google-cloud-dataform-v1beta1/snippets/dataform/create_workflow_invocation.rb index 86e10844b387..6eff7c531727 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/create_workflow_invocation.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/create_workflow_invocation.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#create_workflow_invocation +# +def create_workflow_invocation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CreateWorkflowInvocationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CreateWorkflowInvocationRequest.new -# Call the create_workflow_invocation method. -result = client.create_workflow_invocation request + # Call the create_workflow_invocation method. + result = client.create_workflow_invocation request -# The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + p result +end # [END dataform_v1beta1_generated_Dataform_CreateWorkflowInvocation_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/create_workspace.rb b/google-cloud-dataform-v1beta1/snippets/dataform/create_workspace.rb index 8fe896e1b962..6a35d85e4223 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/create_workspace.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/create_workspace.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#create_workspace +# +def create_workspace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::CreateWorkspaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::CreateWorkspaceRequest.new -# Call the create_workspace method. -result = client.create_workspace request + # Call the create_workspace method. + result = client.create_workspace request -# The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. + p result +end # [END dataform_v1beta1_generated_Dataform_CreateWorkspace_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/delete_repository.rb b/google-cloud-dataform-v1beta1/snippets/dataform/delete_repository.rb index fa80bca42a6a..01beef459521 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/delete_repository.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/delete_repository.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_DeleteRepository_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#delete_repository +# +def delete_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::DeleteRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::DeleteRepositoryRequest.new -# Call the delete_repository method. -result = client.delete_repository request + # Call the delete_repository method. + result = client.delete_repository request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_DeleteRepository_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/delete_workflow_invocation.rb b/google-cloud-dataform-v1beta1/snippets/dataform/delete_workflow_invocation.rb index 3343e85e86a0..66a72a943b71 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/delete_workflow_invocation.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/delete_workflow_invocation.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#delete_workflow_invocation +# +def delete_workflow_invocation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::DeleteWorkflowInvocationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::DeleteWorkflowInvocationRequest.new -# Call the delete_workflow_invocation method. -result = client.delete_workflow_invocation request + # Call the delete_workflow_invocation method. + result = client.delete_workflow_invocation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_DeleteWorkflowInvocation_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/delete_workspace.rb b/google-cloud-dataform-v1beta1/snippets/dataform/delete_workspace.rb index b149b4b138b0..d7f3c845507c 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/delete_workspace.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/delete_workspace.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#delete_workspace +# +def delete_workspace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::DeleteWorkspaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::DeleteWorkspaceRequest.new -# Call the delete_workspace method. -result = client.delete_workspace request + # Call the delete_workspace method. + result = client.delete_workspace request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_DeleteWorkspace_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_diff.rb b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_diff.rb index e0c45e0478b9..0571a873b445 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_diff.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_diff.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#fetch_file_diff +# +def fetch_file_diff + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::FetchFileDiffRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::FetchFileDiffRequest.new -# Call the fetch_file_diff method. -result = client.fetch_file_diff request + # Call the fetch_file_diff method. + result = client.fetch_file_diff request -# The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileDiffResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileDiffResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_FetchFileDiff_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_git_statuses.rb b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_git_statuses.rb index cd1ade2d0053..f9a89dfdad91 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_git_statuses.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_file_git_statuses.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#fetch_file_git_statuses +# +def fetch_file_git_statuses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesRequest.new -# Call the fetch_file_git_statuses method. -result = client.fetch_file_git_statuses request + # Call the fetch_file_git_statuses method. + result = client.fetch_file_git_statuses request -# The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchFileGitStatusesResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_FetchFileGitStatuses_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_git_ahead_behind.rb b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_git_ahead_behind.rb index 58b31070c985..3205d7d83950 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_git_ahead_behind.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_git_ahead_behind.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#fetch_git_ahead_behind +# +def fetch_git_ahead_behind + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindRequest.new -# Call the fetch_git_ahead_behind method. -result = client.fetch_git_ahead_behind request + # Call the fetch_git_ahead_behind method. + result = client.fetch_git_ahead_behind request -# The returned object is of type Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchGitAheadBehindResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_FetchGitAheadBehind_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_remote_branches.rb b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_remote_branches.rb index 06b9f20d7f4e..148e6621a352 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/fetch_remote_branches.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/fetch_remote_branches.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#fetch_remote_branches +# +def fetch_remote_branches + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesRequest.new -# Call the fetch_remote_branches method. -result = client.fetch_remote_branches request + # Call the fetch_remote_branches method. + result = client.fetch_remote_branches request -# The returned object is of type Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::FetchRemoteBranchesResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_FetchRemoteBranches_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/get_compilation_result.rb b/google-cloud-dataform-v1beta1/snippets/dataform/get_compilation_result.rb index 709f75c3b5e6..9bfc38754b5c 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/get_compilation_result.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/get_compilation_result.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#get_compilation_result +# +def get_compilation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::GetCompilationResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::GetCompilationResultRequest.new -# Call the get_compilation_result method. -result = client.get_compilation_result request + # Call the get_compilation_result method. + result = client.get_compilation_result request -# The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::CompilationResult. + p result +end # [END dataform_v1beta1_generated_Dataform_GetCompilationResult_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/get_repository.rb b/google-cloud-dataform-v1beta1/snippets/dataform/get_repository.rb index aae6cea14310..10f37375ccb0 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/get_repository.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/get_repository.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_GetRepository_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#get_repository +# +def get_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::GetRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::GetRepositoryRequest.new -# Call the get_repository method. -result = client.get_repository request + # Call the get_repository method. + result = client.get_repository request -# The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + p result +end # [END dataform_v1beta1_generated_Dataform_GetRepository_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/get_workflow_invocation.rb b/google-cloud-dataform-v1beta1/snippets/dataform/get_workflow_invocation.rb index ea1ac3c9c264..946121af3187 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/get_workflow_invocation.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/get_workflow_invocation.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#get_workflow_invocation +# +def get_workflow_invocation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::GetWorkflowInvocationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::GetWorkflowInvocationRequest.new -# Call the get_workflow_invocation method. -result = client.get_workflow_invocation request + # Call the get_workflow_invocation method. + result = client.get_workflow_invocation request -# The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + p result +end # [END dataform_v1beta1_generated_Dataform_GetWorkflowInvocation_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/get_workspace.rb b/google-cloud-dataform-v1beta1/snippets/dataform/get_workspace.rb index b0c4d250cf85..765ff7c7e2fc 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/get_workspace.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/get_workspace.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_GetWorkspace_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#get_workspace +# +def get_workspace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::GetWorkspaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::GetWorkspaceRequest.new -# Call the get_workspace method. -result = client.get_workspace request + # Call the get_workspace method. + result = client.get_workspace request -# The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::Workspace. + p result +end # [END dataform_v1beta1_generated_Dataform_GetWorkspace_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/install_npm_packages.rb b/google-cloud-dataform-v1beta1/snippets/dataform/install_npm_packages.rb index 242e3772d2c2..790949b04a2d 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/install_npm_packages.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/install_npm_packages.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#install_npm_packages +# +def install_npm_packages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::InstallNpmPackagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::InstallNpmPackagesRequest.new -# Call the install_npm_packages method. -result = client.install_npm_packages request + # Call the install_npm_packages method. + result = client.install_npm_packages request -# The returned object is of type Google::Cloud::Dataform::V1beta1::InstallNpmPackagesResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::InstallNpmPackagesResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_InstallNpmPackages_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/list_compilation_results.rb b/google-cloud-dataform-v1beta1/snippets/dataform/list_compilation_results.rb index 1339e6b92332..e62ba5459589 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/list_compilation_results.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/list_compilation_results.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#list_compilation_results +# +def list_compilation_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ListCompilationResultsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ListCompilationResultsRequest.new -# Call the list_compilation_results method. -result = client.list_compilation_results request + # Call the list_compilation_results method. + result = client.list_compilation_results request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResult. + p response + end end # [END dataform_v1beta1_generated_Dataform_ListCompilationResults_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/list_repositories.rb b/google-cloud-dataform-v1beta1/snippets/dataform/list_repositories.rb index 4702af091580..4258444a8be2 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/list_repositories.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/list_repositories.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_ListRepositories_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#list_repositories +# +def list_repositories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ListRepositoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ListRepositoriesRequest.new -# Call the list_repositories method. -result = client.list_repositories request + # Call the list_repositories method. + result = client.list_repositories request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::Repository. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::Repository. + p response + end end # [END dataform_v1beta1_generated_Dataform_ListRepositories_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/list_workflow_invocations.rb b/google-cloud-dataform-v1beta1/snippets/dataform/list_workflow_invocations.rb index 63087c60af09..4b0b495ca4c0 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/list_workflow_invocations.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/list_workflow_invocations.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#list_workflow_invocations +# +def list_workflow_invocations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ListWorkflowInvocationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ListWorkflowInvocationsRequest.new -# Call the list_workflow_invocations method. -result = client.list_workflow_invocations request + # Call the list_workflow_invocations method. + result = client.list_workflow_invocations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocation. + p response + end end # [END dataform_v1beta1_generated_Dataform_ListWorkflowInvocations_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/list_workspaces.rb b/google-cloud-dataform-v1beta1/snippets/dataform/list_workspaces.rb index 7f3236dd6649..3d30da8f45ff 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/list_workspaces.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/list_workspaces.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#list_workspaces +# +def list_workspaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ListWorkspacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ListWorkspacesRequest.new -# Call the list_workspaces method. -result = client.list_workspaces request + # Call the list_workspaces method. + result = client.list_workspaces request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::Workspace. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::Workspace. + p response + end end # [END dataform_v1beta1_generated_Dataform_ListWorkspaces_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/make_directory.rb b/google-cloud-dataform-v1beta1/snippets/dataform/make_directory.rb index 1a8ab58e095e..1ed71241e558 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/make_directory.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/make_directory.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_MakeDirectory_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#make_directory +# +def make_directory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::MakeDirectoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::MakeDirectoryRequest.new -# Call the make_directory method. -result = client.make_directory request + # Call the make_directory method. + result = client.make_directory request -# The returned object is of type Google::Cloud::Dataform::V1beta1::MakeDirectoryResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::MakeDirectoryResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_MakeDirectory_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/move_directory.rb b/google-cloud-dataform-v1beta1/snippets/dataform/move_directory.rb index b2ef5ad38c58..83c89911ffaa 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/move_directory.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/move_directory.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_MoveDirectory_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#move_directory +# +def move_directory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::MoveDirectoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::MoveDirectoryRequest.new -# Call the move_directory method. -result = client.move_directory request + # Call the move_directory method. + result = client.move_directory request -# The returned object is of type Google::Cloud::Dataform::V1beta1::MoveDirectoryResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::MoveDirectoryResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_MoveDirectory_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/move_file.rb b/google-cloud-dataform-v1beta1/snippets/dataform/move_file.rb index a517bfb653e6..956dbac5a926 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/move_file.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/move_file.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_MoveFile_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#move_file +# +def move_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::MoveFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::MoveFileRequest.new -# Call the move_file method. -result = client.move_file request + # Call the move_file method. + result = client.move_file request -# The returned object is of type Google::Cloud::Dataform::V1beta1::MoveFileResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::MoveFileResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_MoveFile_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/pull_git_commits.rb b/google-cloud-dataform-v1beta1/snippets/dataform/pull_git_commits.rb index 1f9ca7985829..f600154bda17 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/pull_git_commits.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/pull_git_commits.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_PullGitCommits_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#pull_git_commits +# +def pull_git_commits + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::PullGitCommitsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::PullGitCommitsRequest.new -# Call the pull_git_commits method. -result = client.pull_git_commits request + # Call the pull_git_commits method. + result = client.pull_git_commits request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_PullGitCommits_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/push_git_commits.rb b/google-cloud-dataform-v1beta1/snippets/dataform/push_git_commits.rb index 7e6281f7ecdb..781fd81c6dcd 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/push_git_commits.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/push_git_commits.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_PushGitCommits_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#push_git_commits +# +def push_git_commits + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::PushGitCommitsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::PushGitCommitsRequest.new -# Call the push_git_commits method. -result = client.push_git_commits request + # Call the push_git_commits method. + result = client.push_git_commits request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_PushGitCommits_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/query_compilation_result_actions.rb b/google-cloud-dataform-v1beta1/snippets/dataform/query_compilation_result_actions.rb index b9a0695a0005..5bac572f1767 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/query_compilation_result_actions.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/query_compilation_result_actions.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#query_compilation_result_actions +# +def query_compilation_result_actions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::QueryCompilationResultActionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::QueryCompilationResultActionsRequest.new -# Call the query_compilation_result_actions method. -result = client.query_compilation_result_actions request + # Call the query_compilation_result_actions method. + result = client.query_compilation_result_actions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResultAction. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::CompilationResultAction. + p response + end end # [END dataform_v1beta1_generated_Dataform_QueryCompilationResultActions_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/query_directory_contents.rb b/google-cloud-dataform-v1beta1/snippets/dataform/query_directory_contents.rb index d1b87d811f46..9acb210f1dec 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/query_directory_contents.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/query_directory_contents.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#query_directory_contents +# +def query_directory_contents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsRequest.new -# Call the query_directory_contents method. -result = client.query_directory_contents request + # Call the query_directory_contents method. + result = client.query_directory_contents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsResponse::DirectoryEntry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::QueryDirectoryContentsResponse::DirectoryEntry. + p response + end end # [END dataform_v1beta1_generated_Dataform_QueryDirectoryContents_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/query_workflow_invocation_actions.rb b/google-cloud-dataform-v1beta1/snippets/dataform/query_workflow_invocation_actions.rb index 6e04aaecf578..7c5f230f6a49 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/query_workflow_invocation_actions.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/query_workflow_invocation_actions.rb @@ -19,21 +19,27 @@ # [START dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#query_workflow_invocation_actions +# +def query_workflow_invocation_actions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::QueryWorkflowInvocationActionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::QueryWorkflowInvocationActionsRequest.new -# Call the query_workflow_invocation_actions method. -result = client.query_workflow_invocation_actions request + # Call the query_workflow_invocation_actions method. + result = client.query_workflow_invocation_actions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocationAction. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataform::V1beta1::WorkflowInvocationAction. + p response + end end # [END dataform_v1beta1_generated_Dataform_QueryWorkflowInvocationActions_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/read_file.rb b/google-cloud-dataform-v1beta1/snippets/dataform/read_file.rb index 88ca49a73e5c..b51e75611509 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/read_file.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/read_file.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_ReadFile_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#read_file +# +def read_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ReadFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ReadFileRequest.new -# Call the read_file method. -result = client.read_file request + # Call the read_file method. + result = client.read_file request -# The returned object is of type Google::Cloud::Dataform::V1beta1::ReadFileResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::ReadFileResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_ReadFile_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/remove_directory.rb b/google-cloud-dataform-v1beta1/snippets/dataform/remove_directory.rb index ef1eedb9e602..5fa6d9dd71c1 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/remove_directory.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/remove_directory.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#remove_directory +# +def remove_directory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::RemoveDirectoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::RemoveDirectoryRequest.new -# Call the remove_directory method. -result = client.remove_directory request + # Call the remove_directory method. + result = client.remove_directory request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_RemoveDirectory_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/remove_file.rb b/google-cloud-dataform-v1beta1/snippets/dataform/remove_file.rb index 542ca3240d74..842a6d8c81a3 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/remove_file.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/remove_file.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_RemoveFile_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#remove_file +# +def remove_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::RemoveFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::RemoveFileRequest.new -# Call the remove_file method. -result = client.remove_file request + # Call the remove_file method. + result = client.remove_file request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_RemoveFile_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/reset_workspace_changes.rb b/google-cloud-dataform-v1beta1/snippets/dataform/reset_workspace_changes.rb index f4ce813feb58..3d11cc747422 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/reset_workspace_changes.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/reset_workspace_changes.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#reset_workspace_changes +# +def reset_workspace_changes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::ResetWorkspaceChangesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::ResetWorkspaceChangesRequest.new -# Call the reset_workspace_changes method. -result = client.reset_workspace_changes request + # Call the reset_workspace_changes method. + result = client.reset_workspace_changes request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataform_v1beta1_generated_Dataform_ResetWorkspaceChanges_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/update_repository.rb b/google-cloud-dataform-v1beta1/snippets/dataform/update_repository.rb index 04f81c9c5f3d..e7e626a9715f 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/update_repository.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/update_repository.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_UpdateRepository_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#update_repository +# +def update_repository + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::UpdateRepositoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::UpdateRepositoryRequest.new -# Call the update_repository method. -result = client.update_repository request + # Call the update_repository method. + result = client.update_repository request -# The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::Repository. + p result +end # [END dataform_v1beta1_generated_Dataform_UpdateRepository_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/dataform/write_file.rb b/google-cloud-dataform-v1beta1/snippets/dataform/write_file.rb index 3026f6c97b26..f967c639ec7a 100644 --- a/google-cloud-dataform-v1beta1/snippets/dataform/write_file.rb +++ b/google-cloud-dataform-v1beta1/snippets/dataform/write_file.rb @@ -19,15 +19,21 @@ # [START dataform_v1beta1_generated_Dataform_WriteFile_sync] require "google/cloud/dataform/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataform::V1beta1::Dataform::Client#write_file +# +def write_file + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataform::V1beta1::Dataform::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataform::V1beta1::WriteFileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataform::V1beta1::WriteFileRequest.new -# Call the write_file method. -result = client.write_file request + # Call the write_file method. + result = client.write_file request -# The returned object is of type Google::Cloud::Dataform::V1beta1::WriteFileResponse. -p result + # The returned object is of type Google::Cloud::Dataform::V1beta1::WriteFileResponse. + p result +end # [END dataform_v1beta1_generated_Dataform_WriteFile_sync] diff --git a/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json b/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json index e1190aa256e7..8c2e41f99c25 100644 --- a/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json +++ b/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-dataplex-v1/.rubocop.yml b/google-cloud-dataplex-v1/.rubocop.yml index 0e8cc0afbc3a..029e6a990334 100644 --- a/google-cloud-dataplex-v1/.rubocop.yml +++ b/google-cloud-dataplex-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dataplex-v1.rb" diff --git a/google-cloud-dataplex-v1/snippets/Gemfile b/google-cloud-dataplex-v1/snippets/Gemfile index 9c3d727fc005..4716e8d90392 100644 --- a/google-cloud-dataplex-v1/snippets/Gemfile +++ b/google-cloud-dataplex-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dataplex-v1/snippets/content_service/create_content.rb b/google-cloud-dataplex-v1/snippets/content_service/create_content.rb index e1e7ced8ae04..ec13dd85082c 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/create_content.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/create_content.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_CreateContent_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#create_content +# +def create_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateContentRequest.new -# Call the create_content method. -result = client.create_content request + # Call the create_content method. + result = client.create_content request -# The returned object is of type Google::Cloud::Dataplex::V1::Content. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Content. + p result +end # [END dataplex_v1_generated_ContentService_CreateContent_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/delete_content.rb b/google-cloud-dataplex-v1/snippets/content_service/delete_content.rb index 2f54540d4219..ee06ee0f56ac 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/delete_content.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/delete_content.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_DeleteContent_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#delete_content +# +def delete_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteContentRequest.new -# Call the delete_content method. -result = client.delete_content request + # Call the delete_content method. + result = client.delete_content request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataplex_v1_generated_ContentService_DeleteContent_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/get_content.rb b/google-cloud-dataplex-v1/snippets/content_service/get_content.rb index 4532e13e5687..cfb7bd4bf035 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/get_content.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/get_content.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_GetContent_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#get_content +# +def get_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetContentRequest.new -# Call the get_content method. -result = client.get_content request + # Call the get_content method. + result = client.get_content request -# The returned object is of type Google::Cloud::Dataplex::V1::Content. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Content. + p result +end # [END dataplex_v1_generated_ContentService_GetContent_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/get_iam_policy.rb b/google-cloud-dataplex-v1/snippets/content_service/get_iam_policy.rb index c9389dd555ac..0a65533f92b0 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/get_iam_policy.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_GetIamPolicy_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END dataplex_v1_generated_ContentService_GetIamPolicy_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/list_content.rb b/google-cloud-dataplex-v1/snippets/content_service/list_content.rb index c3ea6763a5a9..2d7f1a0503d2 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/list_content.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/list_content.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_ContentService_ListContent_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#list_content +# +def list_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListContentRequest.new -# Call the list_content method. -result = client.list_content request + # Call the list_content method. + result = client.list_content request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Content. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Content. + p response + end end # [END dataplex_v1_generated_ContentService_ListContent_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/set_iam_policy.rb b/google-cloud-dataplex-v1/snippets/content_service/set_iam_policy.rb index ce7ce34fe246..1231b63b99f3 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/set_iam_policy.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_SetIamPolicy_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END dataplex_v1_generated_ContentService_SetIamPolicy_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/test_iam_permissions.rb b/google-cloud-dataplex-v1/snippets/content_service/test_iam_permissions.rb index 506a9686491f..5fa856ba7400 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/test_iam_permissions.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_TestIamPermissions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END dataplex_v1_generated_ContentService_TestIamPermissions_sync] diff --git a/google-cloud-dataplex-v1/snippets/content_service/update_content.rb b/google-cloud-dataplex-v1/snippets/content_service/update_content.rb index 07a487949b35..f686c96eda9e 100644 --- a/google-cloud-dataplex-v1/snippets/content_service/update_content.rb +++ b/google-cloud-dataplex-v1/snippets/content_service/update_content.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_ContentService_UpdateContent_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::ContentService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::ContentService::Client#update_content +# +def update_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::ContentService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateContentRequest.new -# Call the update_content method. -result = client.update_content request + # Call the update_content method. + result = client.update_content request -# The returned object is of type Google::Cloud::Dataplex::V1::Content. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Content. + p result +end # [END dataplex_v1_generated_ContentService_UpdateContent_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/cancel_job.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/cancel_job.rb index 7ff5bee2c75a..ade64540ba1b 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/cancel_job.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/cancel_job.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_CancelJob_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#cancel_job +# +def cancel_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CancelJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CancelJobRequest.new -# Call the cancel_job method. -result = client.cancel_job request + # Call the cancel_job method. + result = client.cancel_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataplex_v1_generated_DataplexService_CancelJob_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/create_asset.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/create_asset.rb index e9664fb9052e..0de713c7ee66 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/create_asset.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/create_asset.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_CreateAsset_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#create_asset +# +def create_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateAssetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateAssetRequest.new -# Call the create_asset method. -result = client.create_asset request + # Call the create_asset method. + result = client.create_asset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_CreateAsset_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/create_environment.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/create_environment.rb index 3823ad89db42..3188a96d2eaf 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/create_environment.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/create_environment.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_CreateEnvironment_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_CreateEnvironment_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/create_lake.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/create_lake.rb index f0929753ed31..80392295af70 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/create_lake.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/create_lake.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_CreateLake_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#create_lake +# +def create_lake + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateLakeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateLakeRequest.new -# Call the create_lake method. -result = client.create_lake request + # Call the create_lake method. + result = client.create_lake request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_CreateLake_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/create_task.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/create_task.rb index 495cba625979..5593542732b6 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/create_task.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/create_task.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_CreateTask_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#create_task +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateTaskRequest.new -# Call the create_task method. -result = client.create_task request + # Call the create_task method. + result = client.create_task request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_CreateTask_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/create_zone.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/create_zone.rb index 83ab6725b1e5..2667a2a9fcc0 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/create_zone.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/create_zone.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_CreateZone_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#create_zone +# +def create_zone + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateZoneRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateZoneRequest.new -# Call the create_zone method. -result = client.create_zone request + # Call the create_zone method. + result = client.create_zone request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_CreateZone_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_asset.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_asset.rb index 1e913d94e686..f5d051235910 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_asset.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_asset.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_DeleteAsset_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#delete_asset +# +def delete_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteAssetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteAssetRequest.new -# Call the delete_asset method. -result = client.delete_asset request + # Call the delete_asset method. + result = client.delete_asset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_DeleteAsset_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_environment.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_environment.rb index b09eef382f41..f77689e37fc7 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_environment.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_environment.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_DeleteEnvironment_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_DeleteEnvironment_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_lake.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_lake.rb index 3d44dc70f36f..6bd04d50fb10 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_lake.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_lake.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_DeleteLake_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#delete_lake +# +def delete_lake + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteLakeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteLakeRequest.new -# Call the delete_lake method. -result = client.delete_lake request + # Call the delete_lake method. + result = client.delete_lake request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_DeleteLake_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_task.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_task.rb index 446b0ca69d59..b6e3fc74deb2 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_task.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_task.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_DeleteTask_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#delete_task +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteTaskRequest.new -# Call the delete_task method. -result = client.delete_task request + # Call the delete_task method. + result = client.delete_task request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_DeleteTask_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_zone.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_zone.rb index 98b3c5d719b5..58c9ccaaf618 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/delete_zone.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/delete_zone.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_DeleteZone_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#delete_zone +# +def delete_zone + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteZoneRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteZoneRequest.new -# Call the delete_zone method. -result = client.delete_zone request + # Call the delete_zone method. + result = client.delete_zone request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_DeleteZone_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_asset.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_asset.rb index 0f5c2a345288..be51f87c0260 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_asset.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_asset.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetAsset_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_asset +# +def get_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetAssetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetAssetRequest.new -# Call the get_asset method. -result = client.get_asset request + # Call the get_asset method. + result = client.get_asset request -# The returned object is of type Google::Cloud::Dataplex::V1::Asset. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Asset. + p result +end # [END dataplex_v1_generated_DataplexService_GetAsset_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_environment.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_environment.rb index d6da2f841fb7..fca4e8d06d9f 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_environment.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_environment.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetEnvironment_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Dataplex::V1::Environment. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Environment. + p result +end # [END dataplex_v1_generated_DataplexService_GetEnvironment_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_job.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_job.rb index 0815f0fcef66..335781f5e790 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_job.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_job.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetJob_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Dataplex::V1::Job. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Job. + p result +end # [END dataplex_v1_generated_DataplexService_GetJob_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_lake.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_lake.rb index 9b096248f3f7..9e70c3633b9c 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_lake.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_lake.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetLake_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_lake +# +def get_lake + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetLakeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetLakeRequest.new -# Call the get_lake method. -result = client.get_lake request + # Call the get_lake method. + result = client.get_lake request -# The returned object is of type Google::Cloud::Dataplex::V1::Lake. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Lake. + p result +end # [END dataplex_v1_generated_DataplexService_GetLake_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_task.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_task.rb index 179f2ee0613c..7dc670b81fdc 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_task.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_task.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetTask_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetTaskRequest.new -# Call the get_task method. -result = client.get_task request + # Call the get_task method. + result = client.get_task request -# The returned object is of type Google::Cloud::Dataplex::V1::Task. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Task. + p result +end # [END dataplex_v1_generated_DataplexService_GetTask_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/get_zone.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/get_zone.rb index 2a82968031f5..0177b0a78698 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/get_zone.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/get_zone.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_DataplexService_GetZone_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#get_zone +# +def get_zone + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetZoneRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetZoneRequest.new -# Call the get_zone method. -result = client.get_zone request + # Call the get_zone method. + result = client.get_zone request -# The returned object is of type Google::Cloud::Dataplex::V1::Zone. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Zone. + p result +end # [END dataplex_v1_generated_DataplexService_GetZone_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_asset_actions.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_asset_actions.rb index 26f7fbfe6c86..710a84d49a61 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_asset_actions.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_asset_actions.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListAssetActions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_asset_actions +# +def list_asset_actions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListAssetActionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListAssetActionsRequest.new -# Call the list_asset_actions method. -result = client.list_asset_actions request + # Call the list_asset_actions method. + result = client.list_asset_actions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Action. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + p response + end end # [END dataplex_v1_generated_DataplexService_ListAssetActions_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_assets.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_assets.rb index f2d720b36c20..388ea72e487b 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_assets.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_assets.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListAssets_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_assets +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListAssetsRequest.new -# Call the list_assets method. -result = client.list_assets request + # Call the list_assets method. + result = client.list_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Asset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Asset. + p response + end end # [END dataplex_v1_generated_DataplexService_ListAssets_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_environments.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_environments.rb index cd7b54d11820..ea162c263b40 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_environments.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_environments.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListEnvironments_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Environment. + p response + end end # [END dataplex_v1_generated_DataplexService_ListEnvironments_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_jobs.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_jobs.rb index de1cb3c8a356..5787a1b50ced 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_jobs.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_jobs.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListJobs_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Job. + p response + end end # [END dataplex_v1_generated_DataplexService_ListJobs_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_lake_actions.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_lake_actions.rb index 2f14b7c940b9..87aacf2f5177 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_lake_actions.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_lake_actions.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListLakeActions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_lake_actions +# +def list_lake_actions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListLakeActionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListLakeActionsRequest.new -# Call the list_lake_actions method. -result = client.list_lake_actions request + # Call the list_lake_actions method. + result = client.list_lake_actions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Action. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + p response + end end # [END dataplex_v1_generated_DataplexService_ListLakeActions_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_lakes.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_lakes.rb index c0c8f7174b37..125f66bc395d 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_lakes.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_lakes.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListLakes_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_lakes +# +def list_lakes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListLakesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListLakesRequest.new -# Call the list_lakes method. -result = client.list_lakes request + # Call the list_lakes method. + result = client.list_lakes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Lake. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Lake. + p response + end end # [END dataplex_v1_generated_DataplexService_ListLakes_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_sessions.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_sessions.rb index 9f1542146a6b..3de9072e4dd8 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_sessions.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_sessions.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListSessions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_sessions +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListSessionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListSessionsRequest.new -# Call the list_sessions method. -result = client.list_sessions request + # Call the list_sessions method. + result = client.list_sessions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Session. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Session. + p response + end end # [END dataplex_v1_generated_DataplexService_ListSessions_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_tasks.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_tasks.rb index 79d828c57c3c..9898fc01abea 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_tasks.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_tasks.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListTasks_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListTasksRequest.new -# Call the list_tasks method. -result = client.list_tasks request + # Call the list_tasks method. + result = client.list_tasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Task. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Task. + p response + end end # [END dataplex_v1_generated_DataplexService_ListTasks_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_zone_actions.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_zone_actions.rb index 9ed8d00b7869..11c786242a7d 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_zone_actions.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_zone_actions.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListZoneActions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_zone_actions +# +def list_zone_actions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListZoneActionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListZoneActionsRequest.new -# Call the list_zone_actions method. -result = client.list_zone_actions request + # Call the list_zone_actions method. + result = client.list_zone_actions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Action. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Action. + p response + end end # [END dataplex_v1_generated_DataplexService_ListZoneActions_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/list_zones.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/list_zones.rb index 6511a643f8bc..788dadb3c910 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/list_zones.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/list_zones.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_DataplexService_ListZones_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#list_zones +# +def list_zones + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListZonesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListZonesRequest.new -# Call the list_zones method. -result = client.list_zones request + # Call the list_zones method. + result = client.list_zones request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Zone. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Zone. + p response + end end # [END dataplex_v1_generated_DataplexService_ListZones_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/update_asset.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/update_asset.rb index f35fc164fd58..eff98fa9374f 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/update_asset.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/update_asset.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_UpdateAsset_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#update_asset +# +def update_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateAssetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateAssetRequest.new -# Call the update_asset method. -result = client.update_asset request + # Call the update_asset method. + result = client.update_asset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_UpdateAsset_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/update_environment.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/update_environment.rb index 6991fdded12e..05b1616d2102 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/update_environment.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/update_environment.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_UpdateEnvironment_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#update_environment +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateEnvironmentRequest.new -# Call the update_environment method. -result = client.update_environment request + # Call the update_environment method. + result = client.update_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_UpdateEnvironment_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/update_lake.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/update_lake.rb index 298223499a13..17deccf4433f 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/update_lake.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/update_lake.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_UpdateLake_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#update_lake +# +def update_lake + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateLakeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateLakeRequest.new -# Call the update_lake method. -result = client.update_lake request + # Call the update_lake method. + result = client.update_lake request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_UpdateLake_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/update_task.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/update_task.rb index 0e3982ebc2dd..27d3638b255b 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/update_task.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/update_task.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_UpdateTask_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#update_task +# +def update_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateTaskRequest.new -# Call the update_task method. -result = client.update_task request + # Call the update_task method. + result = client.update_task request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_UpdateTask_sync] diff --git a/google-cloud-dataplex-v1/snippets/dataplex_service/update_zone.rb b/google-cloud-dataplex-v1/snippets/dataplex_service/update_zone.rb index eba7c4ef652e..300b5f22afcd 100644 --- a/google-cloud-dataplex-v1/snippets/dataplex_service/update_zone.rb +++ b/google-cloud-dataplex-v1/snippets/dataplex_service/update_zone.rb @@ -19,22 +19,28 @@ # [START dataplex_v1_generated_DataplexService_UpdateZone_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::DataplexService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::DataplexService::Client#update_zone +# +def update_zone + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::DataplexService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateZoneRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateZoneRequest.new -# Call the update_zone method. -result = client.update_zone request + # Call the update_zone method. + result = client.update_zone request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataplex_v1_generated_DataplexService_UpdateZone_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/create_entity.rb b/google-cloud-dataplex-v1/snippets/metadata_service/create_entity.rb index dfc9628c510f..128c3507fe64 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/create_entity.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/create_entity.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_CreateEntity_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#create_entity +# +def create_entity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreateEntityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreateEntityRequest.new -# Call the create_entity method. -result = client.create_entity request + # Call the create_entity method. + result = client.create_entity request -# The returned object is of type Google::Cloud::Dataplex::V1::Entity. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + p result +end # [END dataplex_v1_generated_MetadataService_CreateEntity_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/create_partition.rb b/google-cloud-dataplex-v1/snippets/metadata_service/create_partition.rb index 9326b5bed815..f8e567896506 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/create_partition.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/create_partition.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_CreatePartition_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#create_partition +# +def create_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::CreatePartitionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::CreatePartitionRequest.new -# Call the create_partition method. -result = client.create_partition request + # Call the create_partition method. + result = client.create_partition request -# The returned object is of type Google::Cloud::Dataplex::V1::Partition. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Partition. + p result +end # [END dataplex_v1_generated_MetadataService_CreatePartition_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/delete_entity.rb b/google-cloud-dataplex-v1/snippets/metadata_service/delete_entity.rb index 01fb7364136c..ec593f710280 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/delete_entity.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/delete_entity.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_DeleteEntity_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#delete_entity +# +def delete_entity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeleteEntityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeleteEntityRequest.new -# Call the delete_entity method. -result = client.delete_entity request + # Call the delete_entity method. + result = client.delete_entity request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataplex_v1_generated_MetadataService_DeleteEntity_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/delete_partition.rb b/google-cloud-dataplex-v1/snippets/metadata_service/delete_partition.rb index 955bfd8e27ff..c546f5c5a323 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/delete_partition.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/delete_partition.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_DeletePartition_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#delete_partition +# +def delete_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::DeletePartitionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::DeletePartitionRequest.new -# Call the delete_partition method. -result = client.delete_partition request + # Call the delete_partition method. + result = client.delete_partition request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataplex_v1_generated_MetadataService_DeletePartition_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/get_entity.rb b/google-cloud-dataplex-v1/snippets/metadata_service/get_entity.rb index 8d544687baf9..007bfef7ca8c 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/get_entity.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/get_entity.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_GetEntity_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#get_entity +# +def get_entity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetEntityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetEntityRequest.new -# Call the get_entity method. -result = client.get_entity request + # Call the get_entity method. + result = client.get_entity request -# The returned object is of type Google::Cloud::Dataplex::V1::Entity. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + p result +end # [END dataplex_v1_generated_MetadataService_GetEntity_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/get_partition.rb b/google-cloud-dataplex-v1/snippets/metadata_service/get_partition.rb index 4733af67fd0c..6125c2891754 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/get_partition.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/get_partition.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_GetPartition_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#get_partition +# +def get_partition + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::GetPartitionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::GetPartitionRequest.new -# Call the get_partition method. -result = client.get_partition request + # Call the get_partition method. + result = client.get_partition request -# The returned object is of type Google::Cloud::Dataplex::V1::Partition. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Partition. + p result +end # [END dataplex_v1_generated_MetadataService_GetPartition_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/list_entities.rb b/google-cloud-dataplex-v1/snippets/metadata_service/list_entities.rb index 5bd3db3e5e41..0a3ec4ef8e56 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/list_entities.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/list_entities.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_MetadataService_ListEntities_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#list_entities +# +def list_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListEntitiesRequest.new -# Call the list_entities method. -result = client.list_entities request + # Call the list_entities method. + result = client.list_entities request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Entity. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Entity. + p response + end end # [END dataplex_v1_generated_MetadataService_ListEntities_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/list_partitions.rb b/google-cloud-dataplex-v1/snippets/metadata_service/list_partitions.rb index c58bab2e3024..57c8ccb5e774 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/list_partitions.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/list_partitions.rb @@ -19,21 +19,27 @@ # [START dataplex_v1_generated_MetadataService_ListPartitions_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#list_partitions +# +def list_partitions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::ListPartitionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::ListPartitionsRequest.new -# Call the list_partitions method. -result = client.list_partitions request + # Call the list_partitions method. + result = client.list_partitions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataplex::V1::Partition. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataplex::V1::Partition. + p response + end end # [END dataplex_v1_generated_MetadataService_ListPartitions_sync] diff --git a/google-cloud-dataplex-v1/snippets/metadata_service/update_entity.rb b/google-cloud-dataplex-v1/snippets/metadata_service/update_entity.rb index 73751c17ba63..5fee995e2d07 100644 --- a/google-cloud-dataplex-v1/snippets/metadata_service/update_entity.rb +++ b/google-cloud-dataplex-v1/snippets/metadata_service/update_entity.rb @@ -19,15 +19,21 @@ # [START dataplex_v1_generated_MetadataService_UpdateEntity_sync] require "google/cloud/dataplex/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataplex::V1::MetadataService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataplex::V1::MetadataService::Client#update_entity +# +def update_entity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataplex::V1::MetadataService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataplex::V1::UpdateEntityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataplex::V1::UpdateEntityRequest.new -# Call the update_entity method. -result = client.update_entity request + # Call the update_entity method. + result = client.update_entity request -# The returned object is of type Google::Cloud::Dataplex::V1::Entity. -p result + # The returned object is of type Google::Cloud::Dataplex::V1::Entity. + p result +end # [END dataplex_v1_generated_MetadataService_UpdateEntity_sync] diff --git a/google-cloud-dataplex-v1/snippets/snippet_metadata_google.cloud.dataplex.v1.json b/google-cloud-dataplex-v1/snippets/snippet_metadata_google.cloud.dataplex.v1.json index db50b2aeebde..291b8791a9f2 100644 --- a/google-cloud-dataplex-v1/snippets/snippet_metadata_google.cloud.dataplex.v1.json +++ b/google-cloud-dataplex-v1/snippets/snippet_metadata_google.cloud.dataplex.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1966,7 +1966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-dataproc-v1/.rubocop.yml b/google-cloud-dataproc-v1/.rubocop.yml index 70d96f18e2d4..3233e39a8e32 100644 --- a/google-cloud-dataproc-v1/.rubocop.yml +++ b/google-cloud-dataproc-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dataproc-v1.rb" diff --git a/google-cloud-dataproc-v1/snippets/Gemfile b/google-cloud-dataproc-v1/snippets/Gemfile index 4a5257f6d604..7d684537acda 100755 --- a/google-cloud-dataproc-v1/snippets/Gemfile +++ b/google-cloud-dataproc-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb index a14a30e67856..4e8b6b51e367 100755 --- a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb +++ b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/create_autoscaling_policy.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#create_autoscaling_policy +# +def create_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateAutoscalingPolicyRequest.new -# Call the create_autoscaling_policy method. -result = client.create_autoscaling_policy request + # Call the create_autoscaling_policy method. + result = client.create_autoscaling_policy request -# The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end # [END dataproc_v1_generated_AutoscalingPolicyService_CreateAutoscalingPolicy_sync] diff --git a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb index 48bb011130d5..e5603fd90a1b 100755 --- a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb +++ b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/delete_autoscaling_policy.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#delete_autoscaling_policy +# +def delete_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteAutoscalingPolicyRequest.new -# Call the delete_autoscaling_policy method. -result = client.delete_autoscaling_policy request + # Call the delete_autoscaling_policy method. + result = client.delete_autoscaling_policy request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataproc_v1_generated_AutoscalingPolicyService_DeleteAutoscalingPolicy_sync] diff --git a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb index 44fc318e6061..42147d8dbc9d 100755 --- a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb +++ b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/get_autoscaling_policy.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#get_autoscaling_policy +# +def get_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetAutoscalingPolicyRequest.new -# Call the get_autoscaling_policy method. -result = client.get_autoscaling_policy request + # Call the get_autoscaling_policy method. + result = client.get_autoscaling_policy request -# The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end # [END dataproc_v1_generated_AutoscalingPolicyService_GetAutoscalingPolicy_sync] diff --git a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb index 041f292920c2..e0bcadaf1839 100755 --- a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb +++ b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/list_autoscaling_policies.rb @@ -19,21 +19,27 @@ # [START dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#list_autoscaling_policies +# +def list_autoscaling_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListAutoscalingPoliciesRequest.new -# Call the list_autoscaling_policies method. -result = client.list_autoscaling_policies request + # Call the list_autoscaling_policies method. + result = client.list_autoscaling_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p response + end end # [END dataproc_v1_generated_AutoscalingPolicyService_ListAutoscalingPolicies_sync] diff --git a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb index cb437cad0f5c..2b3e2302e5cb 100755 --- a/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb +++ b/google-cloud-dataproc-v1/snippets/autoscaling_policy_service/update_autoscaling_policy.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client#update_autoscaling_policy +# +def update_autoscaling_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::AutoscalingPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateAutoscalingPolicyRequest.new -# Call the update_autoscaling_policy method. -result = client.update_autoscaling_policy request + # Call the update_autoscaling_policy method. + result = client.update_autoscaling_policy request -# The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::AutoscalingPolicy. + p result +end # [END dataproc_v1_generated_AutoscalingPolicyService_UpdateAutoscalingPolicy_sync] diff --git a/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb b/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb index 9995a2f8f038..99ba532ee3be 100755 --- a/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb +++ b/google-cloud-dataproc-v1/snippets/batch_controller/create_batch.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_BatchController_CreateBatch_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::BatchController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#create_batch +# +def create_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateBatchRequest.new -# Call the create_batch method. -result = client.create_batch request + # Call the create_batch method. + result = client.create_batch request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_BatchController_CreateBatch_sync] diff --git a/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb b/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb index be8e80251047..5c40832c96b7 100755 --- a/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb +++ b/google-cloud-dataproc-v1/snippets/batch_controller/delete_batch.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_BatchController_DeleteBatch_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::BatchController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#delete_batch +# +def delete_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteBatchRequest.new -# Call the delete_batch method. -result = client.delete_batch request + # Call the delete_batch method. + result = client.delete_batch request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataproc_v1_generated_BatchController_DeleteBatch_sync] diff --git a/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb b/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb index 8120deddfe7e..607b634e37b7 100755 --- a/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb +++ b/google-cloud-dataproc-v1/snippets/batch_controller/get_batch.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_BatchController_GetBatch_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::BatchController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#get_batch +# +def get_batch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::GetBatchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetBatchRequest.new -# Call the get_batch method. -result = client.get_batch request + # Call the get_batch method. + result = client.get_batch request -# The returned object is of type Google::Cloud::Dataproc::V1::Batch. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Batch. + p result +end # [END dataproc_v1_generated_BatchController_GetBatch_sync] diff --git a/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb b/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb index b12637cc3139..21475aa9de5c 100755 --- a/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb +++ b/google-cloud-dataproc-v1/snippets/batch_controller/list_batches.rb @@ -19,21 +19,27 @@ # [START dataproc_v1_generated_BatchController_ListBatches_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::BatchController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::BatchController::Client#list_batches +# +def list_batches + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::BatchController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListBatchesRequest.new -# Call the list_batches method. -result = client.list_batches request + # Call the list_batches method. + result = client.list_batches request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataproc::V1::Batch. + p response + end end # [END dataproc_v1_generated_BatchController_ListBatches_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb index 4e9b0beb88bb..7c339918de96 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/create_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_CreateCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#create_cluster +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateClusterRequest.new -# Call the create_cluster method. -result = client.create_cluster request + # Call the create_cluster method. + result = client.create_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_CreateCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb index 47df61edfd34..85877bbbd483 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/delete_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_DeleteCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#delete_cluster +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteClusterRequest.new -# Call the delete_cluster method. -result = client.delete_cluster request + # Call the delete_cluster method. + result = client.delete_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_DeleteCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb index 0d79a3406e8d..47d8f8e93f58 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/diagnose_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#diagnose_cluster +# +def diagnose_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DiagnoseClusterRequest.new -# Call the diagnose_cluster method. -result = client.diagnose_cluster request + # Call the diagnose_cluster method. + result = client.diagnose_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_DiagnoseCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb index 3cff3dae3a75..5b4e2528e154 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/get_cluster.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_ClusterController_GetCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#get_cluster +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::GetClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetClusterRequest.new -# Call the get_cluster method. -result = client.get_cluster request + # Call the get_cluster method. + result = client.get_cluster request -# The returned object is of type Google::Cloud::Dataproc::V1::Cluster. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Cluster. + p result +end # [END dataproc_v1_generated_ClusterController_GetCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb index ab73f1fdd079..82ee1221758c 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/list_clusters.rb @@ -19,21 +19,27 @@ # [START dataproc_v1_generated_ClusterController_ListClusters_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#list_clusters +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::ListClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListClustersRequest.new -# Call the list_clusters method. -result = client.list_clusters request + # Call the list_clusters method. + result = client.list_clusters request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataproc::V1::Cluster. + p response + end end # [END dataproc_v1_generated_ClusterController_ListClusters_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb index 5cd10af6b586..c8d95ffd7afd 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/start_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_StartCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#start_cluster +# +def start_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::StartClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::StartClusterRequest.new -# Call the start_cluster method. -result = client.start_cluster request + # Call the start_cluster method. + result = client.start_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_StartCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb index 38806925b972..c28e47e2a9fd 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/stop_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_StopCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#stop_cluster +# +def stop_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::StopClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::StopClusterRequest.new -# Call the stop_cluster method. -result = client.stop_cluster request + # Call the stop_cluster method. + result = client.stop_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_StopCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb b/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb index af60c6e58b8b..bf0e8ec8d705 100755 --- a/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb +++ b/google-cloud-dataproc-v1/snippets/cluster_controller/update_cluster.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_ClusterController_UpdateCluster_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::ClusterController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::ClusterController::Client#update_cluster +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::ClusterController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateClusterRequest.new -# Call the update_cluster method. -result = client.update_cluster request + # Call the update_cluster method. + result = client.update_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_ClusterController_UpdateCluster_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb b/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb index 671025e44abd..a09734bf5e71 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/cancel_job.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_JobController_CancelJob_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#cancel_job +# +def cancel_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::CancelJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CancelJobRequest.new -# Call the cancel_job method. -result = client.cancel_job request + # Call the cancel_job method. + result = client.cancel_job request -# The returned object is of type Google::Cloud::Dataproc::V1::Job. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end # [END dataproc_v1_generated_JobController_CancelJob_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb b/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb index 51c3bdc0cd7d..11ddb7eb42d8 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/delete_job.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_JobController_DeleteJob_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataproc_v1_generated_JobController_DeleteJob_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb b/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb index 4994ea2f9d13..664794a7029c 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/get_job.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_JobController_GetJob_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Dataproc::V1::Job. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end # [END dataproc_v1_generated_JobController_GetJob_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb b/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb index 2a4a3c83c5c6..fc1a11e1716f 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/list_jobs.rb @@ -19,21 +19,27 @@ # [START dataproc_v1_generated_JobController_ListJobs_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataproc::V1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataproc::V1::Job. + p response + end end # [END dataproc_v1_generated_JobController_ListJobs_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb b/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb index 9c71470cb82a..0ab08eaad95c 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/submit_job.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_JobController_SubmitJob_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#submit_job +# +def submit_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new -# Call the submit_job method. -result = client.submit_job request + # Call the submit_job method. + result = client.submit_job request -# The returned object is of type Google::Cloud::Dataproc::V1::Job. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end # [END dataproc_v1_generated_JobController_SubmitJob_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb b/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb index de73a37d7cb1..e897beaea710 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/submit_job_as_operation.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#submit_job_as_operation +# +def submit_job_as_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::SubmitJobRequest.new -# Call the submit_job_as_operation method. -result = client.submit_job_as_operation request + # Call the submit_job_as_operation method. + result = client.submit_job_as_operation request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_JobController_SubmitJobAsOperation_sync] diff --git a/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb b/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb index 67db9ca25384..3b6e6a2aa80e 100755 --- a/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb +++ b/google-cloud-dataproc-v1/snippets/job_controller/update_job.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_JobController_UpdateJob_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::JobController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::JobController::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::JobController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Dataproc::V1::Job. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::Job. + p result +end # [END dataproc_v1_generated_JobController_UpdateJob_sync] diff --git a/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json b/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json index 163263d6a160..4bbc48d61c85 100644 --- a/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json +++ b/google-cloud-dataproc-v1/snippets/snippet_metadata_google.cloud.dataproc.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb index 4d3ee414319a..702343418614 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/create_workflow_template.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#create_workflow_template +# +def create_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::CreateWorkflowTemplateRequest.new -# Call the create_workflow_template method. -result = client.create_workflow_template request + # Call the create_workflow_template method. + result = client.create_workflow_template request -# The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end # [END dataproc_v1_generated_WorkflowTemplateService_CreateWorkflowTemplate_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb index 4c4ef1921323..cd68e2e1405c 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/delete_workflow_template.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#delete_workflow_template +# +def delete_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::DeleteWorkflowTemplateRequest.new -# Call the delete_workflow_template method. -result = client.delete_workflow_template request + # Call the delete_workflow_template method. + result = client.delete_workflow_template request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dataproc_v1_generated_WorkflowTemplateService_DeleteWorkflowTemplate_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb index d66de221bf5d..3db6b80ebde4 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/get_workflow_template.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#get_workflow_template +# +def get_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::GetWorkflowTemplateRequest.new -# Call the get_workflow_template method. -result = client.get_workflow_template request + # Call the get_workflow_template method. + result = client.get_workflow_template request -# The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end # [END dataproc_v1_generated_WorkflowTemplateService_GetWorkflowTemplate_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb index 96cca70a311c..e0ca81b4a209 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_inline_workflow_template.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_inline_workflow_template +# +def instantiate_inline_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::InstantiateInlineWorkflowTemplateRequest.new -# Call the instantiate_inline_workflow_template method. -result = client.instantiate_inline_workflow_template request + # Call the instantiate_inline_workflow_template method. + result = client.instantiate_inline_workflow_template request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_WorkflowTemplateService_InstantiateInlineWorkflowTemplate_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb index 0ccb9605f97d..1017253e022e 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/instantiate_workflow_template.rb @@ -19,22 +19,28 @@ # [START dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#instantiate_workflow_template +# +def instantiate_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::InstantiateWorkflowTemplateRequest.new -# Call the instantiate_workflow_template method. -result = client.instantiate_workflow_template request + # Call the instantiate_workflow_template method. + result = client.instantiate_workflow_template request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dataproc_v1_generated_WorkflowTemplateService_InstantiateWorkflowTemplate_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb index 00b03aecdc88..f4a66c0fc29f 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/list_workflow_templates.rb @@ -19,21 +19,27 @@ # [START dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#list_workflow_templates +# +def list_workflow_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::ListWorkflowTemplatesRequest.new -# Call the list_workflow_templates method. -result = client.list_workflow_templates request + # Call the list_workflow_templates method. + result = client.list_workflow_templates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dataproc::V1::WorkflowTemplate. + p response + end end # [END dataproc_v1_generated_WorkflowTemplateService_ListWorkflowTemplates_sync] diff --git a/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb b/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb index e2a27f3422cb..ab4db76cc87e 100755 --- a/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb +++ b/google-cloud-dataproc-v1/snippets/workflow_template_service/update_workflow_template.rb @@ -19,15 +19,21 @@ # [START dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] require "google/cloud/dataproc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client#update_workflow_template +# +def update_workflow_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dataproc::V1::WorkflowTemplateService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dataproc::V1::UpdateWorkflowTemplateRequest.new -# Call the update_workflow_template method. -result = client.update_workflow_template request + # Call the update_workflow_template method. + result = client.update_workflow_template request -# The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. -p result + # The returned object is of type Google::Cloud::Dataproc::V1::WorkflowTemplate. + p result +end # [END dataproc_v1_generated_WorkflowTemplateService_UpdateWorkflowTemplate_sync] diff --git a/google-cloud-dataqna-v1alpha/.rubocop.yml b/google-cloud-dataqna-v1alpha/.rubocop.yml index fab95225e957..ffd1c1890e2c 100644 --- a/google-cloud-dataqna-v1alpha/.rubocop.yml +++ b/google-cloud-dataqna-v1alpha/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dataqna-v1alpha.rb" diff --git a/google-cloud-dataqna-v1alpha/snippets/Gemfile b/google-cloud-dataqna-v1alpha/snippets/Gemfile index 35c9094a1ef0..34b0de6de39c 100755 --- a/google-cloud-dataqna-v1alpha/snippets/Gemfile +++ b/google-cloud-dataqna-v1alpha/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dataqna-v1alpha/snippets/auto_suggestion_service/suggest_queries.rb b/google-cloud-dataqna-v1alpha/snippets/auto_suggestion_service/suggest_queries.rb index 37d1d41e78ef..bd3804148208 100755 --- a/google-cloud-dataqna-v1alpha/snippets/auto_suggestion_service/suggest_queries.rb +++ b/google-cloud-dataqna-v1alpha/snippets/auto_suggestion_service/suggest_queries.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client#suggest_queries +# +def suggest_queries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::AutoSuggestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::SuggestQueriesRequest.new -# Call the suggest_queries method. -result = client.suggest_queries request + # Call the suggest_queries method. + result = client.suggest_queries request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::SuggestQueriesResponse. + p result +end # [END dataqna_v1alpha_generated_AutoSuggestionService_SuggestQueries_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/question_service/create_question.rb b/google-cloud-dataqna-v1alpha/snippets/question_service/create_question.rb index 10fe4a99f81f..7d1ef5b690da 100755 --- a/google-cloud-dataqna-v1alpha/snippets/question_service/create_question.rb +++ b/google-cloud-dataqna-v1alpha/snippets/question_service/create_question.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_QuestionService_CreateQuestion_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::QuestionService::Client#create_question +# +def create_question + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::CreateQuestionRequest.new -# Call the create_question method. -result = client.create_question request + # Call the create_question method. + result = client.create_question request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + p result +end # [END dataqna_v1alpha_generated_QuestionService_CreateQuestion_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/question_service/execute_question.rb b/google-cloud-dataqna-v1alpha/snippets/question_service/execute_question.rb index 93df84620dc0..3f99694feaa6 100755 --- a/google-cloud-dataqna-v1alpha/snippets/question_service/execute_question.rb +++ b/google-cloud-dataqna-v1alpha/snippets/question_service/execute_question.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::QuestionService::Client#execute_question +# +def execute_question + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::ExecuteQuestionRequest.new -# Call the execute_question method. -result = client.execute_question request + # Call the execute_question method. + result = client.execute_question request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + p result +end # [END dataqna_v1alpha_generated_QuestionService_ExecuteQuestion_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/question_service/get_question.rb b/google-cloud-dataqna-v1alpha/snippets/question_service/get_question.rb index 72d4bc25ddf0..5f071cce3438 100755 --- a/google-cloud-dataqna-v1alpha/snippets/question_service/get_question.rb +++ b/google-cloud-dataqna-v1alpha/snippets/question_service/get_question.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_QuestionService_GetQuestion_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::QuestionService::Client#get_question +# +def get_question + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::GetQuestionRequest.new -# Call the get_question method. -result = client.get_question request + # Call the get_question method. + result = client.get_question request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::Question. + p result +end # [END dataqna_v1alpha_generated_QuestionService_GetQuestion_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/question_service/get_user_feedback.rb b/google-cloud-dataqna-v1alpha/snippets/question_service/get_user_feedback.rb index 82111b6f148d..195cbd93edd2 100755 --- a/google-cloud-dataqna-v1alpha/snippets/question_service/get_user_feedback.rb +++ b/google-cloud-dataqna-v1alpha/snippets/question_service/get_user_feedback.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_QuestionService_GetUserFeedback_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::QuestionService::Client#get_user_feedback +# +def get_user_feedback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::GetUserFeedbackRequest.new -# Call the get_user_feedback method. -result = client.get_user_feedback request + # Call the get_user_feedback method. + result = client.get_user_feedback request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. + p result +end # [END dataqna_v1alpha_generated_QuestionService_GetUserFeedback_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/question_service/update_user_feedback.rb b/google-cloud-dataqna-v1alpha/snippets/question_service/update_user_feedback.rb index 9b227280b680..82ea9bdefe90 100755 --- a/google-cloud-dataqna-v1alpha/snippets/question_service/update_user_feedback.rb +++ b/google-cloud-dataqna-v1alpha/snippets/question_service/update_user_feedback.rb @@ -19,15 +19,21 @@ # [START dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_sync] require "google/cloud/dataqna/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DataQnA::V1alpha::QuestionService::Client#update_user_feedback +# +def update_user_feedback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DataQnA::V1alpha::QuestionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DataQnA::V1alpha::UpdateUserFeedbackRequest.new -# Call the update_user_feedback method. -result = client.update_user_feedback request + # Call the update_user_feedback method. + result = client.update_user_feedback request -# The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. -p result + # The returned object is of type Google::Cloud::DataQnA::V1alpha::UserFeedback. + p result +end # [END dataqna_v1alpha_generated_QuestionService_UpdateUserFeedback_sync] diff --git a/google-cloud-dataqna-v1alpha/snippets/snippet_metadata_google.cloud.dataqna.v1alpha.json b/google-cloud-dataqna-v1alpha/snippets/snippet_metadata_google.cloud.dataqna.v1alpha.json index 3d8e456ed5bb..743090b9d33b 100644 --- a/google-cloud-dataqna-v1alpha/snippets/snippet_metadata_google.cloud.dataqna.v1alpha.json +++ b/google-cloud-dataqna-v1alpha/snippets/snippet_metadata_google.cloud.dataqna.v1alpha.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-datastore-admin-v1/.rubocop.yml b/google-cloud-datastore-admin-v1/.rubocop.yml index 5948d7510253..1b03a7328521 100644 --- a/google-cloud-datastore-admin-v1/.rubocop.yml +++ b/google-cloud-datastore-admin-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-datastore-admin-v1.rb" diff --git a/google-cloud-datastore-admin-v1/snippets/Gemfile b/google-cloud-datastore-admin-v1/snippets/Gemfile index 5548c5e201ba..2a2eab32485b 100755 --- a/google-cloud-datastore-admin-v1/snippets/Gemfile +++ b/google-cloud-datastore-admin-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/create_index.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/create_index.rb index afa60c284c87..3f10cc7800b9 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/create_index.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/create_index.rb @@ -19,22 +19,28 @@ # [START datastore_v1_generated_DatastoreAdmin_CreateIndex_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#create_index +# +def create_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::CreateIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::CreateIndexRequest.new -# Call the create_index method. -result = client.create_index request + # Call the create_index method. + result = client.create_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastore_v1_generated_DatastoreAdmin_CreateIndex_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/delete_index.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/delete_index.rb index 6ef74c2d271e..8b53d67cf1d9 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/delete_index.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/delete_index.rb @@ -19,22 +19,28 @@ # [START datastore_v1_generated_DatastoreAdmin_DeleteIndex_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#delete_index +# +def delete_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest.new -# Call the delete_index method. -result = client.delete_index request + # Call the delete_index method. + result = client.delete_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastore_v1_generated_DatastoreAdmin_DeleteIndex_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/export_entities.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/export_entities.rb index 71ef8c9d804d..0d707217d921 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/export_entities.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/export_entities.rb @@ -19,22 +19,28 @@ # [START datastore_v1_generated_DatastoreAdmin_ExportEntities_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#export_entities +# +def export_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new -# Call the export_entities method. -result = client.export_entities request + # Call the export_entities method. + result = client.export_entities request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastore_v1_generated_DatastoreAdmin_ExportEntities_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/get_index.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/get_index.rb index f1650552c056..a4898cea87fa 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/get_index.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/get_index.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_DatastoreAdmin_GetIndex_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#get_index +# +def get_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::GetIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::GetIndexRequest.new -# Call the get_index method. -result = client.get_index request + # Call the get_index method. + result = client.get_index request -# The returned object is of type Google::Cloud::Datastore::Admin::V1::Index. -p result + # The returned object is of type Google::Cloud::Datastore::Admin::V1::Index. + p result +end # [END datastore_v1_generated_DatastoreAdmin_GetIndex_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/import_entities.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/import_entities.rb index eb4fb151f941..a754947235ff 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/import_entities.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/import_entities.rb @@ -19,22 +19,28 @@ # [START datastore_v1_generated_DatastoreAdmin_ImportEntities_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#import_entities +# +def import_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest.new -# Call the import_entities method. -result = client.import_entities request + # Call the import_entities method. + result = client.import_entities request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastore_v1_generated_DatastoreAdmin_ImportEntities_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/datastore_admin/list_indexes.rb b/google-cloud-datastore-admin-v1/snippets/datastore_admin/list_indexes.rb index 375147d81ce4..04ee411f392a 100755 --- a/google-cloud-datastore-admin-v1/snippets/datastore_admin/list_indexes.rb +++ b/google-cloud-datastore-admin-v1/snippets/datastore_admin/list_indexes.rb @@ -19,21 +19,27 @@ # [START datastore_v1_generated_DatastoreAdmin_ListIndexes_sync] require "google/cloud/datastore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client#list_indexes +# +def list_indexes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::Admin::V1::ListIndexesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::Admin::V1::ListIndexesRequest.new -# Call the list_indexes method. -result = client.list_indexes request + # Call the list_indexes method. + result = client.list_indexes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastore::Admin::V1::Index. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastore::Admin::V1::Index. + p response + end end # [END datastore_v1_generated_DatastoreAdmin_ListIndexes_sync] diff --git a/google-cloud-datastore-admin-v1/snippets/snippet_metadata_google.datastore.admin.v1.json b/google-cloud-datastore-admin-v1/snippets/snippet_metadata_google.datastore.admin.v1.json index 5d7770258255..c383f3ae45e8 100644 --- a/google-cloud-datastore-admin-v1/snippets/snippet_metadata_google.datastore.admin.v1.json +++ b/google-cloud-datastore-admin-v1/snippets/snippet_metadata_google.datastore.admin.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-datastore-v1/.rubocop.yml b/google-cloud-datastore-v1/.rubocop.yml index 0237e20033b3..a97721ccf44b 100644 --- a/google-cloud-datastore-v1/.rubocop.yml +++ b/google-cloud-datastore-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-datastore-v1.rb" diff --git a/google-cloud-datastore-v1/snippets/Gemfile b/google-cloud-datastore-v1/snippets/Gemfile index 69f9b78c5581..0057b19a0343 100755 --- a/google-cloud-datastore-v1/snippets/Gemfile +++ b/google-cloud-datastore-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb b/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb index ef8e393128db..4f91cb522ea5 100755 --- a/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb +++ b/google-cloud-datastore-v1/snippets/datastore/allocate_ids.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_AllocateIds_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#allocate_ids +# +def allocate_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::AllocateIdsRequest.new -# Call the allocate_ids method. -result = client.allocate_ids request + # Call the allocate_ids method. + result = client.allocate_ids request -# The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::AllocateIdsResponse. + p result +end # [END datastore_v1_generated_Datastore_AllocateIds_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb b/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb index d0fcbf399ab3..3ea4df8d2ddd 100755 --- a/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb +++ b/google-cloud-datastore-v1/snippets/datastore/begin_transaction.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_BeginTransaction_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::BeginTransactionRequest.new -# Call the begin_transaction method. -result = client.begin_transaction request + # Call the begin_transaction method. + result = client.begin_transaction request -# The returned object is of type Google::Cloud::Datastore::V1::BeginTransactionResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::BeginTransactionResponse. + p result +end # [END datastore_v1_generated_Datastore_BeginTransaction_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/commit.rb b/google-cloud-datastore-v1/snippets/datastore/commit.rb index 3b647f022446..243a2e8e26c7 100755 --- a/google-cloud-datastore-v1/snippets/datastore/commit.rb +++ b/google-cloud-datastore-v1/snippets/datastore/commit.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_Commit_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#commit +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::CommitRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::CommitRequest.new -# Call the commit method. -result = client.commit request + # Call the commit method. + result = client.commit request -# The returned object is of type Google::Cloud::Datastore::V1::CommitResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::CommitResponse. + p result +end # [END datastore_v1_generated_Datastore_Commit_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/lookup.rb b/google-cloud-datastore-v1/snippets/datastore/lookup.rb index cb9f30506387..f047f7e34f92 100755 --- a/google-cloud-datastore-v1/snippets/datastore/lookup.rb +++ b/google-cloud-datastore-v1/snippets/datastore/lookup.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_Lookup_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#lookup +# +def lookup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::LookupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::LookupRequest.new -# Call the lookup method. -result = client.lookup request + # Call the lookup method. + result = client.lookup request -# The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::LookupResponse. + p result +end # [END datastore_v1_generated_Datastore_Lookup_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb b/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb index 9633588605db..7babf32656e7 100755 --- a/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb +++ b/google-cloud-datastore-v1/snippets/datastore/reserve_ids.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_ReserveIds_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#reserve_ids +# +def reserve_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::ReserveIdsRequest.new -# Call the reserve_ids method. -result = client.reserve_ids request + # Call the reserve_ids method. + result = client.reserve_ids request -# The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::ReserveIdsResponse. + p result +end # [END datastore_v1_generated_Datastore_ReserveIds_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/rollback.rb b/google-cloud-datastore-v1/snippets/datastore/rollback.rb index 2b00441380ff..45c43e3f95ef 100755 --- a/google-cloud-datastore-v1/snippets/datastore/rollback.rb +++ b/google-cloud-datastore-v1/snippets/datastore/rollback.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_Rollback_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#rollback +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::RollbackRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RollbackRequest.new -# Call the rollback method. -result = client.rollback request + # Call the rollback method. + result = client.rollback request -# The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::RollbackResponse. + p result +end # [END datastore_v1_generated_Datastore_Rollback_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb b/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb index 1d089eb6dd0c..d542da1f9d9c 100644 --- a/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb +++ b/google-cloud-datastore-v1/snippets/datastore/run_aggregation_query.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_RunAggregationQuery_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query +# +def run_aggregation_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new -# Call the run_aggregation_query method. -result = client.run_aggregation_query request + # Call the run_aggregation_query method. + result = client.run_aggregation_query request -# The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse. + p result +end # [END datastore_v1_generated_Datastore_RunAggregationQuery_sync] diff --git a/google-cloud-datastore-v1/snippets/datastore/run_query.rb b/google-cloud-datastore-v1/snippets/datastore/run_query.rb index 6e8628d5a5ad..41085e5f4bf5 100755 --- a/google-cloud-datastore-v1/snippets/datastore/run_query.rb +++ b/google-cloud-datastore-v1/snippets/datastore/run_query.rb @@ -19,15 +19,21 @@ # [START datastore_v1_generated_Datastore_RunQuery_sync] require "google/cloud/datastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastore::V1::Datastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastore::V1::Datastore::Client#run_query +# +def run_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastore::V1::Datastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastore::V1::RunQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastore::V1::RunQueryRequest.new -# Call the run_query method. -result = client.run_query request + # Call the run_query method. + result = client.run_query request -# The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. -p result + # The returned object is of type Google::Cloud::Datastore::V1::RunQueryResponse. + p result +end # [END datastore_v1_generated_Datastore_RunQuery_sync] diff --git a/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json b/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json index 0c210d0b7ac1..7063eb934384 100644 --- a/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json +++ b/google-cloud-datastore-v1/snippets/snippet_metadata_google.datastore.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-datastream-v1/.rubocop.yml b/google-cloud-datastream-v1/.rubocop.yml index a89726b485ba..f29ead893908 100644 --- a/google-cloud-datastream-v1/.rubocop.yml +++ b/google-cloud-datastream-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-datastream-v1.rb" diff --git a/google-cloud-datastream-v1/snippets/Gemfile b/google-cloud-datastream-v1/snippets/Gemfile index 1f3f22026c25..f1fd7d2acb2a 100644 --- a/google-cloud-datastream-v1/snippets/Gemfile +++ b/google-cloud-datastream-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-datastream-v1/snippets/datastream/create_connection_profile.rb b/google-cloud-datastream-v1/snippets/datastream/create_connection_profile.rb index 7570f085ace3..d99a70f7f4a9 100644 --- a/google-cloud-datastream-v1/snippets/datastream/create_connection_profile.rb +++ b/google-cloud-datastream-v1/snippets/datastream/create_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_CreateConnectionProfile_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#create_connection_profile +# +def create_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::CreateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::CreateConnectionProfileRequest.new -# Call the create_connection_profile method. -result = client.create_connection_profile request + # Call the create_connection_profile method. + result = client.create_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_CreateConnectionProfile_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/create_private_connection.rb b/google-cloud-datastream-v1/snippets/datastream/create_private_connection.rb index 0f1be9b9a562..d40b180b579c 100644 --- a/google-cloud-datastream-v1/snippets/datastream/create_private_connection.rb +++ b/google-cloud-datastream-v1/snippets/datastream/create_private_connection.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_CreatePrivateConnection_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#create_private_connection +# +def create_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::CreatePrivateConnectionRequest.new -# Call the create_private_connection method. -result = client.create_private_connection request + # Call the create_private_connection method. + result = client.create_private_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_CreatePrivateConnection_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/create_route.rb b/google-cloud-datastream-v1/snippets/datastream/create_route.rb index 1f221449f418..206b082553a9 100644 --- a/google-cloud-datastream-v1/snippets/datastream/create_route.rb +++ b/google-cloud-datastream-v1/snippets/datastream/create_route.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_CreateRoute_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#create_route +# +def create_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::CreateRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::CreateRouteRequest.new -# Call the create_route method. -result = client.create_route request + # Call the create_route method. + result = client.create_route request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_CreateRoute_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/create_stream.rb b/google-cloud-datastream-v1/snippets/datastream/create_stream.rb index e6d02310ba90..8d556070be3f 100644 --- a/google-cloud-datastream-v1/snippets/datastream/create_stream.rb +++ b/google-cloud-datastream-v1/snippets/datastream/create_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_CreateStream_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#create_stream +# +def create_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::CreateStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::CreateStreamRequest.new -# Call the create_stream method. -result = client.create_stream request + # Call the create_stream method. + result = client.create_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_CreateStream_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/delete_connection_profile.rb b/google-cloud-datastream-v1/snippets/datastream/delete_connection_profile.rb index 6b6906c69567..8f5e57d8254d 100644 --- a/google-cloud-datastream-v1/snippets/datastream/delete_connection_profile.rb +++ b/google-cloud-datastream-v1/snippets/datastream/delete_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_DeleteConnectionProfile_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#delete_connection_profile +# +def delete_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::DeleteConnectionProfileRequest.new -# Call the delete_connection_profile method. -result = client.delete_connection_profile request + # Call the delete_connection_profile method. + result = client.delete_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_DeleteConnectionProfile_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/delete_private_connection.rb b/google-cloud-datastream-v1/snippets/datastream/delete_private_connection.rb index 85ce4c2fc88c..bfb900c8971a 100644 --- a/google-cloud-datastream-v1/snippets/datastream/delete_private_connection.rb +++ b/google-cloud-datastream-v1/snippets/datastream/delete_private_connection.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_DeletePrivateConnection_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#delete_private_connection +# +def delete_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::DeletePrivateConnectionRequest.new -# Call the delete_private_connection method. -result = client.delete_private_connection request + # Call the delete_private_connection method. + result = client.delete_private_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_DeletePrivateConnection_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/delete_route.rb b/google-cloud-datastream-v1/snippets/datastream/delete_route.rb index 4e8f2e7ca3bd..14a1ae46ab9f 100644 --- a/google-cloud-datastream-v1/snippets/datastream/delete_route.rb +++ b/google-cloud-datastream-v1/snippets/datastream/delete_route.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_DeleteRoute_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#delete_route +# +def delete_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::DeleteRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::DeleteRouteRequest.new -# Call the delete_route method. -result = client.delete_route request + # Call the delete_route method. + result = client.delete_route request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_DeleteRoute_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/delete_stream.rb b/google-cloud-datastream-v1/snippets/datastream/delete_stream.rb index 6df65adf3130..fedad3dbd11a 100644 --- a/google-cloud-datastream-v1/snippets/datastream/delete_stream.rb +++ b/google-cloud-datastream-v1/snippets/datastream/delete_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_DeleteStream_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#delete_stream +# +def delete_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::DeleteStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::DeleteStreamRequest.new -# Call the delete_stream method. -result = client.delete_stream request + # Call the delete_stream method. + result = client.delete_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_DeleteStream_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/discover_connection_profile.rb b/google-cloud-datastream-v1/snippets/datastream/discover_connection_profile.rb index 01cb6429699e..2c24c338182a 100644 --- a/google-cloud-datastream-v1/snippets/datastream/discover_connection_profile.rb +++ b/google-cloud-datastream-v1/snippets/datastream/discover_connection_profile.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#discover_connection_profile +# +def discover_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::DiscoverConnectionProfileRequest.new -# Call the discover_connection_profile method. -result = client.discover_connection_profile request + # Call the discover_connection_profile method. + result = client.discover_connection_profile request -# The returned object is of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1::DiscoverConnectionProfileResponse. + p result +end # [END datastream_v1_generated_Datastream_DiscoverConnectionProfile_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/fetch_static_ips.rb b/google-cloud-datastream-v1/snippets/datastream/fetch_static_ips.rb index f4ec8f253c2a..c1f7df493144 100644 --- a/google-cloud-datastream-v1/snippets/datastream/fetch_static_ips.rb +++ b/google-cloud-datastream-v1/snippets/datastream/fetch_static_ips.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_FetchStaticIps_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#fetch_static_ips +# +def fetch_static_ips + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::FetchStaticIpsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::FetchStaticIpsRequest.new -# Call the fetch_static_ips method. -result = client.fetch_static_ips request + # Call the fetch_static_ips method. + result = client.fetch_static_ips request -# The returned object is of type Google::Cloud::Datastream::V1::FetchStaticIpsResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1::FetchStaticIpsResponse. + p result +end # [END datastream_v1_generated_Datastream_FetchStaticIps_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/get_connection_profile.rb b/google-cloud-datastream-v1/snippets/datastream/get_connection_profile.rb index 15357564dceb..b87aefc3607c 100644 --- a/google-cloud-datastream-v1/snippets/datastream/get_connection_profile.rb +++ b/google-cloud-datastream-v1/snippets/datastream/get_connection_profile.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_GetConnectionProfile_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#get_connection_profile +# +def get_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::GetConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::GetConnectionProfileRequest.new -# Call the get_connection_profile method. -result = client.get_connection_profile request + # Call the get_connection_profile method. + result = client.get_connection_profile request -# The returned object is of type Google::Cloud::Datastream::V1::ConnectionProfile. -p result + # The returned object is of type Google::Cloud::Datastream::V1::ConnectionProfile. + p result +end # [END datastream_v1_generated_Datastream_GetConnectionProfile_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/get_private_connection.rb b/google-cloud-datastream-v1/snippets/datastream/get_private_connection.rb index 012da9a43a1a..7d886e7e97e1 100644 --- a/google-cloud-datastream-v1/snippets/datastream/get_private_connection.rb +++ b/google-cloud-datastream-v1/snippets/datastream/get_private_connection.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_GetPrivateConnection_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#get_private_connection +# +def get_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::GetPrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::GetPrivateConnectionRequest.new -# Call the get_private_connection method. -result = client.get_private_connection request + # Call the get_private_connection method. + result = client.get_private_connection request -# The returned object is of type Google::Cloud::Datastream::V1::PrivateConnection. -p result + # The returned object is of type Google::Cloud::Datastream::V1::PrivateConnection. + p result +end # [END datastream_v1_generated_Datastream_GetPrivateConnection_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/get_route.rb b/google-cloud-datastream-v1/snippets/datastream/get_route.rb index a7b78e89f4a4..2a1badc4135f 100644 --- a/google-cloud-datastream-v1/snippets/datastream/get_route.rb +++ b/google-cloud-datastream-v1/snippets/datastream/get_route.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_GetRoute_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#get_route +# +def get_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::GetRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::GetRouteRequest.new -# Call the get_route method. -result = client.get_route request + # Call the get_route method. + result = client.get_route request -# The returned object is of type Google::Cloud::Datastream::V1::Route. -p result + # The returned object is of type Google::Cloud::Datastream::V1::Route. + p result +end # [END datastream_v1_generated_Datastream_GetRoute_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/get_stream.rb b/google-cloud-datastream-v1/snippets/datastream/get_stream.rb index fc742ad6aba8..e190a0cb8cd8 100644 --- a/google-cloud-datastream-v1/snippets/datastream/get_stream.rb +++ b/google-cloud-datastream-v1/snippets/datastream/get_stream.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_GetStream_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#get_stream +# +def get_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::GetStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::GetStreamRequest.new -# Call the get_stream method. -result = client.get_stream request + # Call the get_stream method. + result = client.get_stream request -# The returned object is of type Google::Cloud::Datastream::V1::Stream. -p result + # The returned object is of type Google::Cloud::Datastream::V1::Stream. + p result +end # [END datastream_v1_generated_Datastream_GetStream_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/get_stream_object.rb b/google-cloud-datastream-v1/snippets/datastream/get_stream_object.rb index 2854f9128414..55fe6f738ff3 100644 --- a/google-cloud-datastream-v1/snippets/datastream/get_stream_object.rb +++ b/google-cloud-datastream-v1/snippets/datastream/get_stream_object.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_GetStreamObject_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#get_stream_object +# +def get_stream_object + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::GetStreamObjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::GetStreamObjectRequest.new -# Call the get_stream_object method. -result = client.get_stream_object request + # Call the get_stream_object method. + result = client.get_stream_object request -# The returned object is of type Google::Cloud::Datastream::V1::StreamObject. -p result + # The returned object is of type Google::Cloud::Datastream::V1::StreamObject. + p result +end # [END datastream_v1_generated_Datastream_GetStreamObject_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/list_connection_profiles.rb b/google-cloud-datastream-v1/snippets/datastream/list_connection_profiles.rb index ce06aecec18c..d353a16defcd 100644 --- a/google-cloud-datastream-v1/snippets/datastream/list_connection_profiles.rb +++ b/google-cloud-datastream-v1/snippets/datastream/list_connection_profiles.rb @@ -19,21 +19,27 @@ # [START datastream_v1_generated_Datastream_ListConnectionProfiles_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#list_connection_profiles +# +def list_connection_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::ListConnectionProfilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::ListConnectionProfilesRequest.new -# Call the list_connection_profiles method. -result = client.list_connection_profiles request + # Call the list_connection_profiles method. + result = client.list_connection_profiles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1::ConnectionProfile. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1::ConnectionProfile. + p response + end end # [END datastream_v1_generated_Datastream_ListConnectionProfiles_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/list_private_connections.rb b/google-cloud-datastream-v1/snippets/datastream/list_private_connections.rb index 05f702ad8c67..8847e2451999 100644 --- a/google-cloud-datastream-v1/snippets/datastream/list_private_connections.rb +++ b/google-cloud-datastream-v1/snippets/datastream/list_private_connections.rb @@ -19,21 +19,27 @@ # [START datastream_v1_generated_Datastream_ListPrivateConnections_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#list_private_connections +# +def list_private_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::ListPrivateConnectionsRequest.new -# Call the list_private_connections method. -result = client.list_private_connections request + # Call the list_private_connections method. + result = client.list_private_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1::PrivateConnection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1::PrivateConnection. + p response + end end # [END datastream_v1_generated_Datastream_ListPrivateConnections_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/list_routes.rb b/google-cloud-datastream-v1/snippets/datastream/list_routes.rb index 338431efe719..d9dc624bad52 100644 --- a/google-cloud-datastream-v1/snippets/datastream/list_routes.rb +++ b/google-cloud-datastream-v1/snippets/datastream/list_routes.rb @@ -19,21 +19,27 @@ # [START datastream_v1_generated_Datastream_ListRoutes_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#list_routes +# +def list_routes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::ListRoutesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::ListRoutesRequest.new -# Call the list_routes method. -result = client.list_routes request + # Call the list_routes method. + result = client.list_routes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1::Route. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1::Route. + p response + end end # [END datastream_v1_generated_Datastream_ListRoutes_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/list_stream_objects.rb b/google-cloud-datastream-v1/snippets/datastream/list_stream_objects.rb index 8a944e7bfe93..43bbf1174d5a 100644 --- a/google-cloud-datastream-v1/snippets/datastream/list_stream_objects.rb +++ b/google-cloud-datastream-v1/snippets/datastream/list_stream_objects.rb @@ -19,21 +19,27 @@ # [START datastream_v1_generated_Datastream_ListStreamObjects_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#list_stream_objects +# +def list_stream_objects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::ListStreamObjectsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::ListStreamObjectsRequest.new -# Call the list_stream_objects method. -result = client.list_stream_objects request + # Call the list_stream_objects method. + result = client.list_stream_objects request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1::StreamObject. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1::StreamObject. + p response + end end # [END datastream_v1_generated_Datastream_ListStreamObjects_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/list_streams.rb b/google-cloud-datastream-v1/snippets/datastream/list_streams.rb index 6510162f432e..b455ba5b1b62 100644 --- a/google-cloud-datastream-v1/snippets/datastream/list_streams.rb +++ b/google-cloud-datastream-v1/snippets/datastream/list_streams.rb @@ -19,21 +19,27 @@ # [START datastream_v1_generated_Datastream_ListStreams_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#list_streams +# +def list_streams + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::ListStreamsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::ListStreamsRequest.new -# Call the list_streams method. -result = client.list_streams request + # Call the list_streams method. + result = client.list_streams request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1::Stream. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1::Stream. + p response + end end # [END datastream_v1_generated_Datastream_ListStreams_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/lookup_stream_object.rb b/google-cloud-datastream-v1/snippets/datastream/lookup_stream_object.rb index bef15c0d55d2..7b3a1ff1875b 100644 --- a/google-cloud-datastream-v1/snippets/datastream/lookup_stream_object.rb +++ b/google-cloud-datastream-v1/snippets/datastream/lookup_stream_object.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_LookupStreamObject_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#lookup_stream_object +# +def lookup_stream_object + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::LookupStreamObjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::LookupStreamObjectRequest.new -# Call the lookup_stream_object method. -result = client.lookup_stream_object request + # Call the lookup_stream_object method. + result = client.lookup_stream_object request -# The returned object is of type Google::Cloud::Datastream::V1::StreamObject. -p result + # The returned object is of type Google::Cloud::Datastream::V1::StreamObject. + p result +end # [END datastream_v1_generated_Datastream_LookupStreamObject_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/start_backfill_job.rb b/google-cloud-datastream-v1/snippets/datastream/start_backfill_job.rb index 52b2366b0c92..7f8fbeab8025 100644 --- a/google-cloud-datastream-v1/snippets/datastream/start_backfill_job.rb +++ b/google-cloud-datastream-v1/snippets/datastream/start_backfill_job.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_StartBackfillJob_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#start_backfill_job +# +def start_backfill_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::StartBackfillJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::StartBackfillJobRequest.new -# Call the start_backfill_job method. -result = client.start_backfill_job request + # Call the start_backfill_job method. + result = client.start_backfill_job request -# The returned object is of type Google::Cloud::Datastream::V1::StartBackfillJobResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1::StartBackfillJobResponse. + p result +end # [END datastream_v1_generated_Datastream_StartBackfillJob_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/stop_backfill_job.rb b/google-cloud-datastream-v1/snippets/datastream/stop_backfill_job.rb index 638044076215..1f01d30039cf 100644 --- a/google-cloud-datastream-v1/snippets/datastream/stop_backfill_job.rb +++ b/google-cloud-datastream-v1/snippets/datastream/stop_backfill_job.rb @@ -19,15 +19,21 @@ # [START datastream_v1_generated_Datastream_StopBackfillJob_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#stop_backfill_job +# +def stop_backfill_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::StopBackfillJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::StopBackfillJobRequest.new -# Call the stop_backfill_job method. -result = client.stop_backfill_job request + # Call the stop_backfill_job method. + result = client.stop_backfill_job request -# The returned object is of type Google::Cloud::Datastream::V1::StopBackfillJobResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1::StopBackfillJobResponse. + p result +end # [END datastream_v1_generated_Datastream_StopBackfillJob_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/update_connection_profile.rb b/google-cloud-datastream-v1/snippets/datastream/update_connection_profile.rb index df1373ae9e13..04815d97aa76 100644 --- a/google-cloud-datastream-v1/snippets/datastream/update_connection_profile.rb +++ b/google-cloud-datastream-v1/snippets/datastream/update_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_UpdateConnectionProfile_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#update_connection_profile +# +def update_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::UpdateConnectionProfileRequest.new -# Call the update_connection_profile method. -result = client.update_connection_profile request + # Call the update_connection_profile method. + result = client.update_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_UpdateConnectionProfile_sync] diff --git a/google-cloud-datastream-v1/snippets/datastream/update_stream.rb b/google-cloud-datastream-v1/snippets/datastream/update_stream.rb index 8bb6428ea2d1..d2aa5a42fff8 100644 --- a/google-cloud-datastream-v1/snippets/datastream/update_stream.rb +++ b/google-cloud-datastream-v1/snippets/datastream/update_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1_generated_Datastream_UpdateStream_sync] require "google/cloud/datastream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1::Datastream::Client#update_stream +# +def update_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1::UpdateStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1::UpdateStreamRequest.new -# Call the update_stream method. -result = client.update_stream request + # Call the update_stream method. + result = client.update_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1_generated_Datastream_UpdateStream_sync] diff --git a/google-cloud-datastream-v1/snippets/snippet_metadata_google.cloud.datastream.v1.json b/google-cloud-datastream-v1/snippets/snippet_metadata_google.cloud.datastream.v1.json index 3f2a208b483d..aa542cad1ece 100644 --- a/google-cloud-datastream-v1/snippets/snippet_metadata_google.cloud.datastream.v1.json +++ b/google-cloud-datastream-v1/snippets/snippet_metadata_google.cloud.datastream.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-datastream-v1alpha1/.rubocop.yml b/google-cloud-datastream-v1alpha1/.rubocop.yml index 908bda29b677..e4fb22e9f3c2 100644 --- a/google-cloud-datastream-v1alpha1/.rubocop.yml +++ b/google-cloud-datastream-v1alpha1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-datastream-v1alpha1.rb" diff --git a/google-cloud-datastream-v1alpha1/snippets/Gemfile b/google-cloud-datastream-v1alpha1/snippets/Gemfile index 2d05fdc98bfd..820769ee691c 100755 --- a/google-cloud-datastream-v1alpha1/snippets/Gemfile +++ b/google-cloud-datastream-v1alpha1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/create_connection_profile.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/create_connection_profile.rb index 8416de5af333..3939132803cf 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/create_connection_profile.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/create_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#create_connection_profile +# +def create_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::CreateConnectionProfileRequest.new -# Call the create_connection_profile method. -result = client.create_connection_profile request + # Call the create_connection_profile method. + result = client.create_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_CreateConnectionProfile_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/create_private_connection.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/create_private_connection.rb index 9a41c8d45bb6..6fa9202c2701 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/create_private_connection.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/create_private_connection.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#create_private_connection +# +def create_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::CreatePrivateConnectionRequest.new -# Call the create_private_connection method. -result = client.create_private_connection request + # Call the create_private_connection method. + result = client.create_private_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_CreatePrivateConnection_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/create_route.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/create_route.rb index 83a69c90c3b3..51c102dc6a0b 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/create_route.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/create_route.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_CreateRoute_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#create_route +# +def create_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::CreateRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::CreateRouteRequest.new -# Call the create_route method. -result = client.create_route request + # Call the create_route method. + result = client.create_route request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_CreateRoute_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/create_stream.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/create_stream.rb index a180679c2d42..625b6a52ef15 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/create_stream.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/create_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_CreateStream_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#create_stream +# +def create_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::CreateStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::CreateStreamRequest.new -# Call the create_stream method. -result = client.create_stream request + # Call the create_stream method. + result = client.create_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_CreateStream_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_connection_profile.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_connection_profile.rb index 28cc9498b1ee..f8f1f8161b30 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_connection_profile.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#delete_connection_profile +# +def delete_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::DeleteConnectionProfileRequest.new -# Call the delete_connection_profile method. -result = client.delete_connection_profile request + # Call the delete_connection_profile method. + result = client.delete_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_DeleteConnectionProfile_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_private_connection.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_private_connection.rb index 6dd23a56ec96..a1b4707d868a 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_private_connection.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_private_connection.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#delete_private_connection +# +def delete_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::DeletePrivateConnectionRequest.new -# Call the delete_private_connection method. -result = client.delete_private_connection request + # Call the delete_private_connection method. + result = client.delete_private_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_DeletePrivateConnection_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_route.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_route.rb index b513b46acd70..3e7e3f7357dd 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_route.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_route.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_DeleteRoute_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#delete_route +# +def delete_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::DeleteRouteRequest.new -# Call the delete_route method. -result = client.delete_route request + # Call the delete_route method. + result = client.delete_route request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_DeleteRoute_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_stream.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_stream.rb index 0bc6f6a151b4..fbd8d5ac962c 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/delete_stream.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/delete_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_DeleteStream_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#delete_stream +# +def delete_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::DeleteStreamRequest.new -# Call the delete_stream method. -result = client.delete_stream request + # Call the delete_stream method. + result = client.delete_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_DeleteStream_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/discover_connection_profile.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/discover_connection_profile.rb index 4b69fc89d4a7..5c6bafde257b 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/discover_connection_profile.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/discover_connection_profile.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#discover_connection_profile +# +def discover_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileRequest.new -# Call the discover_connection_profile method. -result = client.discover_connection_profile request + # Call the discover_connection_profile method. + result = client.discover_connection_profile request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::DiscoverConnectionProfileResponse. + p result +end # [END datastream_v1alpha1_generated_Datastream_DiscoverConnectionProfile_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_errors.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_errors.rb index 42badb211c3e..d753117e05c5 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_errors.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_errors.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_FetchErrors_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#fetch_errors +# +def fetch_errors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::FetchErrorsRequest.new -# Call the fetch_errors method. -result = client.fetch_errors request + # Call the fetch_errors method. + result = client.fetch_errors request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_FetchErrors_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_static_ips.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_static_ips.rb index 540e0ae23d48..3418357d5189 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_static_ips.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/fetch_static_ips.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_FetchStaticIps_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#fetch_static_ips +# +def fetch_static_ips + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::FetchStaticIpsRequest.new -# Call the fetch_static_ips method. -result = client.fetch_static_ips request + # Call the fetch_static_ips method. + result = client.fetch_static_ips request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::FetchStaticIpsResponse. + p result +end # [END datastream_v1alpha1_generated_Datastream_FetchStaticIps_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/get_connection_profile.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/get_connection_profile.rb index 08d9dec8fdab..3dda48aebce4 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/get_connection_profile.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/get_connection_profile.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_GetConnectionProfile_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#get_connection_profile +# +def get_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::GetConnectionProfileRequest.new -# Call the get_connection_profile method. -result = client.get_connection_profile request + # Call the get_connection_profile method. + result = client.get_connection_profile request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::ConnectionProfile. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::ConnectionProfile. + p result +end # [END datastream_v1alpha1_generated_Datastream_GetConnectionProfile_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/get_private_connection.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/get_private_connection.rb index d31d8012f219..9a9bbc7365a5 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/get_private_connection.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/get_private_connection.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#get_private_connection +# +def get_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::GetPrivateConnectionRequest.new -# Call the get_private_connection method. -result = client.get_private_connection request + # Call the get_private_connection method. + result = client.get_private_connection request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::PrivateConnection. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::PrivateConnection. + p result +end # [END datastream_v1alpha1_generated_Datastream_GetPrivateConnection_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/get_route.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/get_route.rb index 4882106482b9..fd034aaee0b4 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/get_route.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/get_route.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_GetRoute_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#get_route +# +def get_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::GetRouteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::GetRouteRequest.new -# Call the get_route method. -result = client.get_route request + # Call the get_route method. + result = client.get_route request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::Route. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::Route. + p result +end # [END datastream_v1alpha1_generated_Datastream_GetRoute_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/get_stream.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/get_stream.rb index 85f8066de769..484683ec24da 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/get_stream.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/get_stream.rb @@ -19,15 +19,21 @@ # [START datastream_v1alpha1_generated_Datastream_GetStream_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#get_stream +# +def get_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::GetStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::GetStreamRequest.new -# Call the get_stream method. -result = client.get_stream request + # Call the get_stream method. + result = client.get_stream request -# The returned object is of type Google::Cloud::Datastream::V1alpha1::Stream. -p result + # The returned object is of type Google::Cloud::Datastream::V1alpha1::Stream. + p result +end # [END datastream_v1alpha1_generated_Datastream_GetStream_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/list_connection_profiles.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/list_connection_profiles.rb index d039f6c0628a..0963c99d9466 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/list_connection_profiles.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/list_connection_profiles.rb @@ -19,21 +19,27 @@ # [START datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#list_connection_profiles +# +def list_connection_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::ListConnectionProfilesRequest.new -# Call the list_connection_profiles method. -result = client.list_connection_profiles request + # Call the list_connection_profiles method. + result = client.list_connection_profiles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1alpha1::ConnectionProfile. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1alpha1::ConnectionProfile. + p response + end end # [END datastream_v1alpha1_generated_Datastream_ListConnectionProfiles_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/list_private_connections.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/list_private_connections.rb index f7ee4b284b71..d73dcff1e434 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/list_private_connections.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/list_private_connections.rb @@ -19,21 +19,27 @@ # [START datastream_v1alpha1_generated_Datastream_ListPrivateConnections_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#list_private_connections +# +def list_private_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::ListPrivateConnectionsRequest.new -# Call the list_private_connections method. -result = client.list_private_connections request + # Call the list_private_connections method. + result = client.list_private_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1alpha1::PrivateConnection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1alpha1::PrivateConnection. + p response + end end # [END datastream_v1alpha1_generated_Datastream_ListPrivateConnections_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/list_routes.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/list_routes.rb index a5e4e01d841f..48f027aed058 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/list_routes.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/list_routes.rb @@ -19,21 +19,27 @@ # [START datastream_v1alpha1_generated_Datastream_ListRoutes_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#list_routes +# +def list_routes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::ListRoutesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::ListRoutesRequest.new -# Call the list_routes method. -result = client.list_routes request + # Call the list_routes method. + result = client.list_routes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Route. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Route. + p response + end end # [END datastream_v1alpha1_generated_Datastream_ListRoutes_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/list_streams.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/list_streams.rb index 0ce2390d0fc0..3e442b10811b 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/list_streams.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/list_streams.rb @@ -19,21 +19,27 @@ # [START datastream_v1alpha1_generated_Datastream_ListStreams_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#list_streams +# +def list_streams + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::ListStreamsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::ListStreamsRequest.new -# Call the list_streams method. -result = client.list_streams request + # Call the list_streams method. + result = client.list_streams request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Stream. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Datastream::V1alpha1::Stream. + p response + end end # [END datastream_v1alpha1_generated_Datastream_ListStreams_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/update_connection_profile.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/update_connection_profile.rb index e46189ae9207..00bb3ee032f7 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/update_connection_profile.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/update_connection_profile.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#update_connection_profile +# +def update_connection_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::UpdateConnectionProfileRequest.new -# Call the update_connection_profile method. -result = client.update_connection_profile request + # Call the update_connection_profile method. + result = client.update_connection_profile request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_UpdateConnectionProfile_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/datastream/update_stream.rb b/google-cloud-datastream-v1alpha1/snippets/datastream/update_stream.rb index ddfb547635eb..480679bec70c 100755 --- a/google-cloud-datastream-v1alpha1/snippets/datastream/update_stream.rb +++ b/google-cloud-datastream-v1alpha1/snippets/datastream/update_stream.rb @@ -19,22 +19,28 @@ # [START datastream_v1alpha1_generated_Datastream_UpdateStream_sync] require "google/cloud/datastream/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Datastream::V1alpha1::Datastream::Client#update_stream +# +def update_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Datastream::V1alpha1::Datastream::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Datastream::V1alpha1::UpdateStreamRequest.new -# Call the update_stream method. -result = client.update_stream request + # Call the update_stream method. + result = client.update_stream request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END datastream_v1alpha1_generated_Datastream_UpdateStream_sync] diff --git a/google-cloud-datastream-v1alpha1/snippets/snippet_metadata_google.cloud.datastream.v1alpha1.json b/google-cloud-datastream-v1alpha1/snippets/snippet_metadata_google.cloud.datastream.v1alpha1.json index 35a9ed1fee41..0e2330c78885 100644 --- a/google-cloud-datastream-v1alpha1/snippets/snippet_metadata_google.cloud.datastream.v1alpha1.json +++ b/google-cloud-datastream-v1alpha1/snippets/snippet_metadata_google.cloud.datastream.v1alpha1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-debugger-v2/.rubocop.yml b/google-cloud-debugger-v2/.rubocop.yml index 00cb3547d8df..5c49338aa755 100644 --- a/google-cloud-debugger-v2/.rubocop.yml +++ b/google-cloud-debugger-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-debugger-v2.rb" diff --git a/google-cloud-debugger-v2/snippets/Gemfile b/google-cloud-debugger-v2/snippets/Gemfile index b1558d15216b..8d8a2057c670 100755 --- a/google-cloud-debugger-v2/snippets/Gemfile +++ b/google-cloud-debugger-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-debugger-v2/snippets/controller/list_active_breakpoints.rb b/google-cloud-debugger-v2/snippets/controller/list_active_breakpoints.rb index 3ddffc8ac4fb..8b22c4edd82f 100755 --- a/google-cloud-debugger-v2/snippets/controller/list_active_breakpoints.rb +++ b/google-cloud-debugger-v2/snippets/controller/list_active_breakpoints.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Controller_ListActiveBreakpoints_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Controller::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Controller::Client#list_active_breakpoints +# +def list_active_breakpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Controller::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::ListActiveBreakpointsRequest.new -# Call the list_active_breakpoints method. -result = client.list_active_breakpoints request + # Call the list_active_breakpoints method. + result = client.list_active_breakpoints request -# The returned object is of type Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::ListActiveBreakpointsResponse. + p result +end # [END clouddebugger_v2_generated_Controller_ListActiveBreakpoints_sync] diff --git a/google-cloud-debugger-v2/snippets/controller/register_debuggee.rb b/google-cloud-debugger-v2/snippets/controller/register_debuggee.rb index e8196a9d3948..6ce546f9421e 100755 --- a/google-cloud-debugger-v2/snippets/controller/register_debuggee.rb +++ b/google-cloud-debugger-v2/snippets/controller/register_debuggee.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Controller_RegisterDebuggee_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Controller::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Controller::Client#register_debuggee +# +def register_debuggee + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Controller::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::RegisterDebuggeeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::RegisterDebuggeeRequest.new -# Call the register_debuggee method. -result = client.register_debuggee request + # Call the register_debuggee method. + result = client.register_debuggee request -# The returned object is of type Google::Cloud::Debugger::V2::RegisterDebuggeeResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::RegisterDebuggeeResponse. + p result +end # [END clouddebugger_v2_generated_Controller_RegisterDebuggee_sync] diff --git a/google-cloud-debugger-v2/snippets/controller/update_active_breakpoint.rb b/google-cloud-debugger-v2/snippets/controller/update_active_breakpoint.rb index 5f89f3fbe41c..26b942b28dca 100755 --- a/google-cloud-debugger-v2/snippets/controller/update_active_breakpoint.rb +++ b/google-cloud-debugger-v2/snippets/controller/update_active_breakpoint.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Controller_UpdateActiveBreakpoint_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Controller::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Controller::Client#update_active_breakpoint +# +def update_active_breakpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Controller::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::UpdateActiveBreakpointRequest.new -# Call the update_active_breakpoint method. -result = client.update_active_breakpoint request + # Call the update_active_breakpoint method. + result = client.update_active_breakpoint request -# The returned object is of type Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::UpdateActiveBreakpointResponse. + p result +end # [END clouddebugger_v2_generated_Controller_UpdateActiveBreakpoint_sync] diff --git a/google-cloud-debugger-v2/snippets/debugger/delete_breakpoint.rb b/google-cloud-debugger-v2/snippets/debugger/delete_breakpoint.rb index c68344ccf90d..b83e291a0830 100755 --- a/google-cloud-debugger-v2/snippets/debugger/delete_breakpoint.rb +++ b/google-cloud-debugger-v2/snippets/debugger/delete_breakpoint.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Debugger_DeleteBreakpoint_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Debugger::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Debugger::Client#delete_breakpoint +# +def delete_breakpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Debugger::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::DeleteBreakpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::DeleteBreakpointRequest.new -# Call the delete_breakpoint method. -result = client.delete_breakpoint request + # Call the delete_breakpoint method. + result = client.delete_breakpoint request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END clouddebugger_v2_generated_Debugger_DeleteBreakpoint_sync] diff --git a/google-cloud-debugger-v2/snippets/debugger/get_breakpoint.rb b/google-cloud-debugger-v2/snippets/debugger/get_breakpoint.rb index b833dfdab3f8..349a11a2ba5b 100755 --- a/google-cloud-debugger-v2/snippets/debugger/get_breakpoint.rb +++ b/google-cloud-debugger-v2/snippets/debugger/get_breakpoint.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Debugger_GetBreakpoint_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Debugger::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Debugger::Client#get_breakpoint +# +def get_breakpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Debugger::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::GetBreakpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::GetBreakpointRequest.new -# Call the get_breakpoint method. -result = client.get_breakpoint request + # Call the get_breakpoint method. + result = client.get_breakpoint request -# The returned object is of type Google::Cloud::Debugger::V2::GetBreakpointResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::GetBreakpointResponse. + p result +end # [END clouddebugger_v2_generated_Debugger_GetBreakpoint_sync] diff --git a/google-cloud-debugger-v2/snippets/debugger/list_breakpoints.rb b/google-cloud-debugger-v2/snippets/debugger/list_breakpoints.rb index 02bec88f6892..92f13d60bd04 100755 --- a/google-cloud-debugger-v2/snippets/debugger/list_breakpoints.rb +++ b/google-cloud-debugger-v2/snippets/debugger/list_breakpoints.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Debugger_ListBreakpoints_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Debugger::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Debugger::Client#list_breakpoints +# +def list_breakpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Debugger::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::ListBreakpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::ListBreakpointsRequest.new -# Call the list_breakpoints method. -result = client.list_breakpoints request + # Call the list_breakpoints method. + result = client.list_breakpoints request -# The returned object is of type Google::Cloud::Debugger::V2::ListBreakpointsResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::ListBreakpointsResponse. + p result +end # [END clouddebugger_v2_generated_Debugger_ListBreakpoints_sync] diff --git a/google-cloud-debugger-v2/snippets/debugger/list_debuggees.rb b/google-cloud-debugger-v2/snippets/debugger/list_debuggees.rb index 73e31f967854..fedc70f60826 100755 --- a/google-cloud-debugger-v2/snippets/debugger/list_debuggees.rb +++ b/google-cloud-debugger-v2/snippets/debugger/list_debuggees.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Debugger_ListDebuggees_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Debugger::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Debugger::Client#list_debuggees +# +def list_debuggees + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Debugger::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::ListDebuggeesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::ListDebuggeesRequest.new -# Call the list_debuggees method. -result = client.list_debuggees request + # Call the list_debuggees method. + result = client.list_debuggees request -# The returned object is of type Google::Cloud::Debugger::V2::ListDebuggeesResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::ListDebuggeesResponse. + p result +end # [END clouddebugger_v2_generated_Debugger_ListDebuggees_sync] diff --git a/google-cloud-debugger-v2/snippets/debugger/set_breakpoint.rb b/google-cloud-debugger-v2/snippets/debugger/set_breakpoint.rb index b8068df6bff8..1c24ff462ae3 100755 --- a/google-cloud-debugger-v2/snippets/debugger/set_breakpoint.rb +++ b/google-cloud-debugger-v2/snippets/debugger/set_breakpoint.rb @@ -19,15 +19,21 @@ # [START clouddebugger_v2_generated_Debugger_SetBreakpoint_sync] require "google/cloud/debugger/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Debugger::V2::Debugger::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Debugger::V2::Debugger::Client#set_breakpoint +# +def set_breakpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Debugger::V2::Debugger::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Debugger::V2::SetBreakpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Debugger::V2::SetBreakpointRequest.new -# Call the set_breakpoint method. -result = client.set_breakpoint request + # Call the set_breakpoint method. + result = client.set_breakpoint request -# The returned object is of type Google::Cloud::Debugger::V2::SetBreakpointResponse. -p result + # The returned object is of type Google::Cloud::Debugger::V2::SetBreakpointResponse. + p result +end # [END clouddebugger_v2_generated_Debugger_SetBreakpoint_sync] diff --git a/google-cloud-debugger-v2/snippets/snippet_metadata_google.devtools.clouddebugger.v2.json b/google-cloud-debugger-v2/snippets/snippet_metadata_google.devtools.clouddebugger.v2.json index 0c741b86a92f..f3ba1e284628 100644 --- a/google-cloud-debugger-v2/snippets/snippet_metadata_google.devtools.clouddebugger.v2.json +++ b/google-cloud-debugger-v2/snippets/snippet_metadata_google.devtools.clouddebugger.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-deploy-v1/.rubocop.yml b/google-cloud-deploy-v1/.rubocop.yml index 17485735ad0a..a73a27865059 100644 --- a/google-cloud-deploy-v1/.rubocop.yml +++ b/google-cloud-deploy-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-deploy-v1.rb" diff --git a/google-cloud-deploy-v1/snippets/Gemfile b/google-cloud-deploy-v1/snippets/Gemfile index daab2559317c..43bff6bde94f 100755 --- a/google-cloud-deploy-v1/snippets/Gemfile +++ b/google-cloud-deploy-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/abandon_release.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/abandon_release.rb index df9a02dfc58e..1136194ad9d2 100644 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/abandon_release.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/abandon_release.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_AbandonRelease_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#abandon_release +# +def abandon_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::AbandonReleaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::AbandonReleaseRequest.new -# Call the abandon_release method. -result = client.abandon_release request + # Call the abandon_release method. + result = client.abandon_release request -# The returned object is of type Google::Cloud::Deploy::V1::AbandonReleaseResponse. -p result + # The returned object is of type Google::Cloud::Deploy::V1::AbandonReleaseResponse. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_AbandonRelease_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/approve_rollout.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/approve_rollout.rb index 6eeff0213202..bcfe09c1bcc9 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/approve_rollout.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/approve_rollout.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_ApproveRollout_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#approve_rollout +# +def approve_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ApproveRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ApproveRolloutRequest.new -# Call the approve_rollout method. -result = client.approve_rollout request + # Call the approve_rollout method. + result = client.approve_rollout request -# The returned object is of type Google::Cloud::Deploy::V1::ApproveRolloutResponse. -p result + # The returned object is of type Google::Cloud::Deploy::V1::ApproveRolloutResponse. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_ApproveRollout_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/create_delivery_pipeline.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/create_delivery_pipeline.rb index 965ca639763c..10ed48006547 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/create_delivery_pipeline.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/create_delivery_pipeline.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#create_delivery_pipeline +# +def create_delivery_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::CreateDeliveryPipelineRequest.new -# Call the create_delivery_pipeline method. -result = client.create_delivery_pipeline request + # Call the create_delivery_pipeline method. + result = client.create_delivery_pipeline request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_CreateDeliveryPipeline_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/create_release.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/create_release.rb index 8dfb8fcd834b..aa2b9d0ef9fe 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/create_release.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/create_release.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_CreateRelease_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#create_release +# +def create_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::CreateReleaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::CreateReleaseRequest.new -# Call the create_release method. -result = client.create_release request + # Call the create_release method. + result = client.create_release request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_CreateRelease_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/create_rollout.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/create_rollout.rb index 02d4a34e09ab..d25110825efe 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/create_rollout.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/create_rollout.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_CreateRollout_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#create_rollout +# +def create_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::CreateRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::CreateRolloutRequest.new -# Call the create_rollout method. -result = client.create_rollout request + # Call the create_rollout method. + result = client.create_rollout request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_CreateRollout_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/create_target.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/create_target.rb index 5d8f415ac7f5..bc61b9014683 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/create_target.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/create_target.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_CreateTarget_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#create_target +# +def create_target + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::CreateTargetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::CreateTargetRequest.new -# Call the create_target method. -result = client.create_target request + # Call the create_target method. + result = client.create_target request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_CreateTarget_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/delete_delivery_pipeline.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/delete_delivery_pipeline.rb index 773291f61414..ddcd3a795cf5 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/delete_delivery_pipeline.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/delete_delivery_pipeline.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#delete_delivery_pipeline +# +def delete_delivery_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::DeleteDeliveryPipelineRequest.new -# Call the delete_delivery_pipeline method. -result = client.delete_delivery_pipeline request + # Call the delete_delivery_pipeline method. + result = client.delete_delivery_pipeline request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_DeleteDeliveryPipeline_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/delete_target.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/delete_target.rb index 9054c64baf46..b62104bbd746 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/delete_target.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/delete_target.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_DeleteTarget_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#delete_target +# +def delete_target + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::DeleteTargetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::DeleteTargetRequest.new -# Call the delete_target method. -result = client.delete_target request + # Call the delete_target method. + result = client.delete_target request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_DeleteTarget_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_config.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_config.rb index 26a1aa0ad991..6a9a8d08ca21 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_config.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_config.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetConfig_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_config +# +def get_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetConfigRequest.new -# Call the get_config method. -result = client.get_config request + # Call the get_config method. + result = client.get_config request -# The returned object is of type Google::Cloud::Deploy::V1::Config. -p result + # The returned object is of type Google::Cloud::Deploy::V1::Config. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetConfig_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_delivery_pipeline.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_delivery_pipeline.rb index 6955582b566f..5c78efd71545 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_delivery_pipeline.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_delivery_pipeline.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_delivery_pipeline +# +def get_delivery_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetDeliveryPipelineRequest.new -# Call the get_delivery_pipeline method. -result = client.get_delivery_pipeline request + # Call the get_delivery_pipeline method. + result = client.get_delivery_pipeline request -# The returned object is of type Google::Cloud::Deploy::V1::DeliveryPipeline. -p result + # The returned object is of type Google::Cloud::Deploy::V1::DeliveryPipeline. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetDeliveryPipeline_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_job_run.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_job_run.rb index 0fa181146d0d..513b8371b90b 100644 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_job_run.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_job_run.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetJobRun_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_job_run +# +def get_job_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetJobRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetJobRunRequest.new -# Call the get_job_run method. -result = client.get_job_run request + # Call the get_job_run method. + result = client.get_job_run request -# The returned object is of type Google::Cloud::Deploy::V1::JobRun. -p result + # The returned object is of type Google::Cloud::Deploy::V1::JobRun. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetJobRun_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_release.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_release.rb index b0daae617e60..e4cc2a8d0c3b 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_release.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_release.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetRelease_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_release +# +def get_release + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetReleaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetReleaseRequest.new -# Call the get_release method. -result = client.get_release request + # Call the get_release method. + result = client.get_release request -# The returned object is of type Google::Cloud::Deploy::V1::Release. -p result + # The returned object is of type Google::Cloud::Deploy::V1::Release. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetRelease_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_rollout.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_rollout.rb index d091e0fc9a72..15afa086242b 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_rollout.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_rollout.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetRollout_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_rollout +# +def get_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetRolloutRequest.new -# Call the get_rollout method. -result = client.get_rollout request + # Call the get_rollout method. + result = client.get_rollout request -# The returned object is of type Google::Cloud::Deploy::V1::Rollout. -p result + # The returned object is of type Google::Cloud::Deploy::V1::Rollout. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetRollout_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/get_target.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/get_target.rb index 755946ceaf2c..eb9a81211d22 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/get_target.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/get_target.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_GetTarget_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#get_target +# +def get_target + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::GetTargetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::GetTargetRequest.new -# Call the get_target method. -result = client.get_target request + # Call the get_target method. + result = client.get_target request -# The returned object is of type Google::Cloud::Deploy::V1::Target. -p result + # The returned object is of type Google::Cloud::Deploy::V1::Target. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_GetTarget_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/list_delivery_pipelines.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/list_delivery_pipelines.rb index c3be4026b759..d130e9906de8 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/list_delivery_pipelines.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/list_delivery_pipelines.rb @@ -19,21 +19,27 @@ # [START clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#list_delivery_pipelines +# +def list_delivery_pipelines + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ListDeliveryPipelinesRequest.new -# Call the list_delivery_pipelines method. -result = client.list_delivery_pipelines request + # Call the list_delivery_pipelines method. + result = client.list_delivery_pipelines request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Deploy::V1::DeliveryPipeline. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Deploy::V1::DeliveryPipeline. + p response + end end # [END clouddeploy_v1_generated_CloudDeploy_ListDeliveryPipelines_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/list_job_runs.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/list_job_runs.rb index fdfe88aa81da..475acb933cac 100644 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/list_job_runs.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/list_job_runs.rb @@ -19,21 +19,27 @@ # [START clouddeploy_v1_generated_CloudDeploy_ListJobRuns_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#list_job_runs +# +def list_job_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ListJobRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ListJobRunsRequest.new -# Call the list_job_runs method. -result = client.list_job_runs request + # Call the list_job_runs method. + result = client.list_job_runs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Deploy::V1::JobRun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Deploy::V1::JobRun. + p response + end end # [END clouddeploy_v1_generated_CloudDeploy_ListJobRuns_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/list_releases.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/list_releases.rb index 6b688e67d9f7..1c7db246b7fd 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/list_releases.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/list_releases.rb @@ -19,21 +19,27 @@ # [START clouddeploy_v1_generated_CloudDeploy_ListReleases_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#list_releases +# +def list_releases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ListReleasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ListReleasesRequest.new -# Call the list_releases method. -result = client.list_releases request + # Call the list_releases method. + result = client.list_releases request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Deploy::V1::Release. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Deploy::V1::Release. + p response + end end # [END clouddeploy_v1_generated_CloudDeploy_ListReleases_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/list_rollouts.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/list_rollouts.rb index 22a4e9efb40c..de01d9908613 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/list_rollouts.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/list_rollouts.rb @@ -19,21 +19,27 @@ # [START clouddeploy_v1_generated_CloudDeploy_ListRollouts_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#list_rollouts +# +def list_rollouts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ListRolloutsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ListRolloutsRequest.new -# Call the list_rollouts method. -result = client.list_rollouts request + # Call the list_rollouts method. + result = client.list_rollouts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Deploy::V1::Rollout. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Deploy::V1::Rollout. + p response + end end # [END clouddeploy_v1_generated_CloudDeploy_ListRollouts_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/list_targets.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/list_targets.rb index 43ce5b7ae0fd..d82c97f52c8c 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/list_targets.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/list_targets.rb @@ -19,21 +19,27 @@ # [START clouddeploy_v1_generated_CloudDeploy_ListTargets_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#list_targets +# +def list_targets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::ListTargetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::ListTargetsRequest.new -# Call the list_targets method. -result = client.list_targets request + # Call the list_targets method. + result = client.list_targets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Deploy::V1::Target. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Deploy::V1::Target. + p response + end end # [END clouddeploy_v1_generated_CloudDeploy_ListTargets_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/retry_job.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/retry_job.rb index c5b77c286449..1a23a798e479 100644 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/retry_job.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/retry_job.rb @@ -19,15 +19,21 @@ # [START clouddeploy_v1_generated_CloudDeploy_RetryJob_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#retry_job +# +def retry_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::RetryJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::RetryJobRequest.new -# Call the retry_job method. -result = client.retry_job request + # Call the retry_job method. + result = client.retry_job request -# The returned object is of type Google::Cloud::Deploy::V1::RetryJobResponse. -p result + # The returned object is of type Google::Cloud::Deploy::V1::RetryJobResponse. + p result +end # [END clouddeploy_v1_generated_CloudDeploy_RetryJob_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/update_delivery_pipeline.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/update_delivery_pipeline.rb index 653ea22acea0..5e8200ac9bc6 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/update_delivery_pipeline.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/update_delivery_pipeline.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#update_delivery_pipeline +# +def update_delivery_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::UpdateDeliveryPipelineRequest.new -# Call the update_delivery_pipeline method. -result = client.update_delivery_pipeline request + # Call the update_delivery_pipeline method. + result = client.update_delivery_pipeline request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_UpdateDeliveryPipeline_sync] diff --git a/google-cloud-deploy-v1/snippets/cloud_deploy/update_target.rb b/google-cloud-deploy-v1/snippets/cloud_deploy/update_target.rb index fea24f079655..84d11b31e779 100755 --- a/google-cloud-deploy-v1/snippets/cloud_deploy/update_target.rb +++ b/google-cloud-deploy-v1/snippets/cloud_deploy/update_target.rb @@ -19,22 +19,28 @@ # [START clouddeploy_v1_generated_CloudDeploy_UpdateTarget_sync] require "google/cloud/deploy/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Deploy::V1::CloudDeploy::Client#update_target +# +def update_target + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Deploy::V1::CloudDeploy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Deploy::V1::UpdateTargetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Deploy::V1::UpdateTargetRequest.new -# Call the update_target method. -result = client.update_target request + # Call the update_target method. + result = client.update_target request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END clouddeploy_v1_generated_CloudDeploy_UpdateTarget_sync] diff --git a/google-cloud-deploy-v1/snippets/snippet_metadata_google.cloud.deploy.v1.json b/google-cloud-deploy-v1/snippets/snippet_metadata_google.cloud.deploy.v1.json index 88fb6b85e1c7..5ec82b3671a1 100644 --- a/google-cloud-deploy-v1/snippets/snippet_metadata_google.cloud.deploy.v1.json +++ b/google-cloud-deploy-v1/snippets/snippet_metadata_google.cloud.deploy.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-dialogflow-cx-v3/.rubocop.yml b/google-cloud-dialogflow-cx-v3/.rubocop.yml index 83da6cbe1ee4..a6b50c67bede 100644 --- a/google-cloud-dialogflow-cx-v3/.rubocop.yml +++ b/google-cloud-dialogflow-cx-v3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dialogflow-cx-v3.rb" diff --git a/google-cloud-dialogflow-cx-v3/snippets/Gemfile b/google-cloud-dialogflow-cx-v3/snippets/Gemfile index 9ed3b5599f2d..cbab54af50cd 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/Gemfile +++ b/google-cloud-dialogflow-cx-v3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb index 0fdc3195b43d..32089d4a56cb 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/create_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_CreateAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#create_agent +# +def create_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateAgentRequest.new -# Call the create_agent method. -result = client.create_agent request + # Call the create_agent method. + result = client.create_agent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end # [END dialogflow_v3_generated_Agents_CreateAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb index e41a0a35240f..500d9a36eb58 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/delete_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_DeleteAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#delete_agent +# +def delete_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteAgentRequest.new -# Call the delete_agent method. -result = client.delete_agent request + # Call the delete_agent method. + result = client.delete_agent request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Agents_DeleteAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb index d1cd53491739..9379e27da989 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/export_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Agents_ExportAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#export_agent +# +def export_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportAgentRequest.new -# Call the export_agent method. -result = client.export_agent request + # Call the export_agent method. + result = client.export_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Agents_ExportAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb index 1a3658a79247..76906903a616 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_GetAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent +# +def get_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetAgentRequest.new -# Call the get_agent method. -result = client.get_agent request + # Call the get_agent method. + result = client.get_agent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end # [END dialogflow_v3_generated_Agents_GetAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb index b80a9cb41483..e4128091cede 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/get_agent_validation_result.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_GetAgentValidationResult_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#get_agent_validation_result +# +def get_agent_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetAgentValidationResultRequest.new -# Call the get_agent_validation_result method. -result = client.get_agent_validation_result request + # Call the get_agent_validation_result method. + result = client.get_agent_validation_result request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + p result +end # [END dialogflow_v3_generated_Agents_GetAgentValidationResult_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb index b5b2f5b2f4c1..0b59b92791f1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/list_agents.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Agents_ListAgents_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#list_agents +# +def list_agents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListAgentsRequest.new -# Call the list_agents method. -result = client.list_agents request + # Call the list_agents method. + result = client.list_agents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Agent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Agent. + p response + end end # [END dialogflow_v3_generated_Agents_ListAgents_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb index 91da7928bca6..b50997068774 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/restore_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Agents_RestoreAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#restore_agent +# +def restore_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RestoreAgentRequest.new -# Call the restore_agent method. -result = client.restore_agent request + # Call the restore_agent method. + result = client.restore_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Agents_RestoreAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb index 6453de82aa35..f3d54aae4084 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/update_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_UpdateAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#update_agent +# +def update_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateAgentRequest.new -# Call the update_agent method. -result = client.update_agent request + # Call the update_agent method. + result = client.update_agent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Agent. + p result +end # [END dialogflow_v3_generated_Agents_UpdateAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb b/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb index a959d24cc1cc..b5d60d09d0cd 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/agents/validate_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Agents_ValidateAgent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Agents::Client#validate_agent +# +def validate_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ValidateAgentRequest.new -# Call the validate_agent method. -result = client.validate_agent request + # Call the validate_agent method. + result = client.validate_agent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::AgentValidationResult. + p result +end # [END dialogflow_v3_generated_Agents_ValidateAgent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb b/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb index d7cb89235cc1..6644810784ad 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/changelogs/get_changelog.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Changelogs_GetChangelog_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#get_changelog +# +def get_changelog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetChangelogRequest.new -# Call the get_changelog method. -result = client.get_changelog request + # Call the get_changelog method. + result = client.get_changelog request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Changelog. + p result +end # [END dialogflow_v3_generated_Changelogs_GetChangelog_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb b/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb index 402aac9dcfe7..dacdbe022b2e 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/changelogs/list_changelogs.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Changelogs_ListChangelogs_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Changelogs::Client#list_changelogs +# +def list_changelogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Changelogs::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListChangelogsRequest.new -# Call the list_changelogs method. -result = client.list_changelogs request + # Call the list_changelogs method. + result = client.list_changelogs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Changelog. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Changelog. + p response + end end # [END dialogflow_v3_generated_Changelogs_ListChangelogs_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb b/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb index 8da2647e19ba..3c96c3e8dd13 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/deployments/get_deployment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Deployments_GetDeployment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#get_deployment +# +def get_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetDeploymentRequest.new -# Call the get_deployment method. -result = client.get_deployment request + # Call the get_deployment method. + result = client.get_deployment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Deployment. + p result +end # [END dialogflow_v3_generated_Deployments_GetDeployment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb b/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb index a363c354a53a..de8330cd3422 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/deployments/list_deployments.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Deployments_ListDeployments_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Deployments::Client#list_deployments +# +def list_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Deployments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListDeploymentsRequest.new -# Call the list_deployments method. -result = client.list_deployments request + # Call the list_deployments method. + result = client.list_deployments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Deployment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Deployment. + p response + end end # [END dialogflow_v3_generated_Deployments_ListDeployments_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb index 0c3dc3cb433e..02ee857df8d1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/entity_types/create_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_EntityTypes_CreateEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#create_entity_type +# +def create_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateEntityTypeRequest.new -# Call the create_entity_type method. -result = client.create_entity_type request + # Call the create_entity_type method. + result = client.create_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end # [END dialogflow_v3_generated_EntityTypes_CreateEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb index 30a19dbca0b0..edda66fe0c9c 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/entity_types/delete_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_EntityTypes_DeleteEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#delete_entity_type +# +def delete_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteEntityTypeRequest.new -# Call the delete_entity_type method. -result = client.delete_entity_type request + # Call the delete_entity_type method. + result = client.delete_entity_type request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_EntityTypes_DeleteEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb index c4769108d8c0..c8a483907692 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/entity_types/get_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_EntityTypes_GetEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#get_entity_type +# +def get_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetEntityTypeRequest.new -# Call the get_entity_type method. -result = client.get_entity_type request + # Call the get_entity_type method. + result = client.get_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end # [END dialogflow_v3_generated_EntityTypes_GetEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb b/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb index 4c9d09bec77b..4f461f52ee62 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/entity_types/list_entity_types.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#list_entity_types +# +def list_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListEntityTypesRequest.new -# Call the list_entity_types method. -result = client.list_entity_types request + # Call the list_entity_types method. + result = client.list_entity_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::EntityType. + p response + end end # [END dialogflow_v3_generated_EntityTypes_ListEntityTypes_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb index 8e7025ab9fb1..77d0be837f06 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/entity_types/update_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client#update_entity_type +# +def update_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateEntityTypeRequest.new -# Call the update_entity_type method. -result = client.update_entity_type request + # Call the update_entity_type method. + result = client.update_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::EntityType. + p result +end # [END dialogflow_v3_generated_EntityTypes_UpdateEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb index 6d3278e63618..d353836c52b3 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/create_environment.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Environments_CreateEnvironment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Environments_CreateEnvironment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb index 1697e9ee7f3d..a3a5ee22340e 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/delete_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Environments_DeleteEnvironment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Environments_DeleteEnvironment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb index a2835988c598..2fbbfa6556c2 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/deploy_flow.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Environments_DeployFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#deploy_flow +# +def deploy_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeployFlowRequest.new -# Call the deploy_flow method. -result = client.deploy_flow request + # Call the deploy_flow method. + result = client.deploy_flow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Environments_DeployFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb index 53e409617968..d65ac2e50cd5 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/get_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Environments_GetEnvironment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Environment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Environment. + p result +end # [END dialogflow_v3_generated_Environments_GetEnvironment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb index 10a4623fb297..8e793c5cd7c1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/list_continuous_test_results.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Environments_ListContinuousTestResults_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_continuous_test_results +# +def list_continuous_test_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListContinuousTestResultsRequest.new -# Call the list_continuous_test_results method. -result = client.list_continuous_test_results request + # Call the list_continuous_test_results method. + result = client.list_continuous_test_results request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::ContinuousTestResult. + p response + end end # [END dialogflow_v3_generated_Environments_ListContinuousTestResults_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb index ed7d9b50d63f..50f6fcb85d8a 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/list_environments.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Environments_ListEnvironments_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. + p response + end end # [END dialogflow_v3_generated_Environments_ListEnvironments_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb index 4cd0b9c06a28..dacbbd003c69 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/lookup_environment_history.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#lookup_environment_history +# +def lookup_environment_history + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::LookupEnvironmentHistoryRequest.new -# Call the lookup_environment_history method. -result = client.lookup_environment_history request + # Call the lookup_environment_history method. + result = client.lookup_environment_history request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Environment. + p response + end end # [END dialogflow_v3_generated_Environments_LookupEnvironmentHistory_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb index 6c8ebf7c77b4..cba16f941f40 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/run_continuous_test.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Environments_RunContinuousTest_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#run_continuous_test +# +def run_continuous_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RunContinuousTestRequest.new -# Call the run_continuous_test method. -result = client.run_continuous_test request + # Call the run_continuous_test method. + result = client.run_continuous_test request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Environments_RunContinuousTest_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb b/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb index db768e05d211..87bd4a0d8154 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/environments/update_environment.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Environments_UpdateEnvironment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Environments::Client#update_environment +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateEnvironmentRequest.new -# Call the update_environment method. -result = client.update_environment request + # Call the update_environment method. + result = client.update_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Environments_UpdateEnvironment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb index ab63f66a9614..8c8573a6ca25 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/create_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_CreateExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#create_experiment +# +def create_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest.new -# Call the create_experiment method. -result = client.create_experiment request + # Call the create_experiment method. + result = client.create_experiment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end # [END dialogflow_v3_generated_Experiments_CreateExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb index dae75f353847..b7ce1d5787f3 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/delete_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_DeleteExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#delete_experiment +# +def delete_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest.new -# Call the delete_experiment method. -result = client.delete_experiment request + # Call the delete_experiment method. + result = client.delete_experiment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Experiments_DeleteExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb index c259acfa3ebd..cee2ebc889f2 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/get_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_GetExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#get_experiment +# +def get_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest.new -# Call the get_experiment method. -result = client.get_experiment request + # Call the get_experiment method. + result = client.get_experiment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end # [END dialogflow_v3_generated_Experiments_GetExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb index 94c9fefe1a1f..5c8d42f3e224 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/list_experiments.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Experiments_ListExperiments_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#list_experiments +# +def list_experiments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest.new -# Call the list_experiments method. -result = client.list_experiments request + # Call the list_experiments method. + result = client.list_experiments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Experiment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Experiment. + p response + end end # [END dialogflow_v3_generated_Experiments_ListExperiments_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb index d43b2e3d6679..5b0f975be14f 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/start_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_StartExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#start_experiment +# +def start_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest.new -# Call the start_experiment method. -result = client.start_experiment request + # Call the start_experiment method. + result = client.start_experiment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end # [END dialogflow_v3_generated_Experiments_StartExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb index 4763640cefc1..1d8cd5487fa2 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/stop_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_StopExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#stop_experiment +# +def stop_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest.new -# Call the stop_experiment method. -result = client.stop_experiment request + # Call the stop_experiment method. + result = client.stop_experiment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end # [END dialogflow_v3_generated_Experiments_StopExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb b/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb index cdfc4d266ebc..c76b1231314b 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/experiments/update_experiment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Experiments_UpdateExperiment_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Experiments::Client#update_experiment +# +def update_experiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Experiments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest.new -# Call the update_experiment method. -result = client.update_experiment request + # Call the update_experiment method. + result = client.update_experiment request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Experiment. + p result +end # [END dialogflow_v3_generated_Experiments_UpdateExperiment_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb index b545c22bb961..cc4e593df769 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/create_flow.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_CreateFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#create_flow +# +def create_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateFlowRequest.new -# Call the create_flow method. -result = client.create_flow request + # Call the create_flow method. + result = client.create_flow request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end # [END dialogflow_v3_generated_Flows_CreateFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb index 2491ed777499..d52b4606f9f0 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/delete_flow.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_DeleteFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#delete_flow +# +def delete_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteFlowRequest.new -# Call the delete_flow method. -result = client.delete_flow request + # Call the delete_flow method. + result = client.delete_flow request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Flows_DeleteFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb index d5a7783c3429..a213e733c716 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/export_flow.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Flows_ExportFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#export_flow +# +def export_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportFlowRequest.new -# Call the export_flow method. -result = client.export_flow request + # Call the export_flow method. + result = client.export_flow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Flows_ExportFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb index 8f6dcf02308e..da77bcb99858 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_GetFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow +# +def get_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetFlowRequest.new -# Call the get_flow method. -result = client.get_flow request + # Call the get_flow method. + result = client.get_flow request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end # [END dialogflow_v3_generated_Flows_GetFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb index 9908780a7f39..f771a02e3937 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/get_flow_validation_result.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_GetFlowValidationResult_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#get_flow_validation_result +# +def get_flow_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetFlowValidationResultRequest.new -# Call the get_flow_validation_result method. -result = client.get_flow_validation_result request + # Call the get_flow_validation_result method. + result = client.get_flow_validation_result request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + p result +end # [END dialogflow_v3_generated_Flows_GetFlowValidationResult_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb index 0e2cda9df54a..d1bbf4817c6a 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/import_flow.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Flows_ImportFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#import_flow +# +def import_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportFlowRequest.new -# Call the import_flow method. -result = client.import_flow request + # Call the import_flow method. + result = client.import_flow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Flows_ImportFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb index 45eda5a0489b..d9e7ff1e2406 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/list_flows.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Flows_ListFlows_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#list_flows +# +def list_flows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListFlowsRequest.new -# Call the list_flows method. -result = client.list_flows request + # Call the list_flows method. + result = client.list_flows request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Flow. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Flow. + p response + end end # [END dialogflow_v3_generated_Flows_ListFlows_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb index 503cd4473acc..09e3553598df 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/train_flow.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Flows_TrainFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#train_flow +# +def train_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::TrainFlowRequest.new -# Call the train_flow method. -result = client.train_flow request + # Call the train_flow method. + result = client.train_flow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Flows_TrainFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb index 28014c26cb2a..7e9fe846f6e5 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/update_flow.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_UpdateFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#update_flow +# +def update_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateFlowRequest.new -# Call the update_flow method. -result = client.update_flow request + # Call the update_flow method. + result = client.update_flow request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Flow. + p result +end # [END dialogflow_v3_generated_Flows_UpdateFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb b/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb index 5464e34b9a2c..6f65a2dcec96 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/flows/validate_flow.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Flows_ValidateFlow_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Flows::Client#validate_flow +# +def validate_flow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Flows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ValidateFlowRequest.new -# Call the validate_flow method. -result = client.validate_flow request + # Call the validate_flow method. + result = client.validate_flow request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FlowValidationResult. + p result +end # [END dialogflow_v3_generated_Flows_ValidateFlow_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb index 50da672a3789..baa487a7a9c4 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/intents/create_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Intents_CreateIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Intents::Client#create_intent +# +def create_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateIntentRequest.new -# Call the create_intent method. -result = client.create_intent request + # Call the create_intent method. + result = client.create_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end # [END dialogflow_v3_generated_Intents_CreateIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb index ca8e03e63c71..5e9c9cb222a7 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/intents/delete_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Intents_DeleteIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Intents::Client#delete_intent +# +def delete_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteIntentRequest.new -# Call the delete_intent method. -result = client.delete_intent request + # Call the delete_intent method. + result = client.delete_intent request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Intents_DeleteIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb index 4376485d0e92..06a150d9a1f4 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/intents/get_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Intents_GetIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Intents::Client#get_intent +# +def get_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetIntentRequest.new -# Call the get_intent method. -result = client.get_intent request + # Call the get_intent method. + result = client.get_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end # [END dialogflow_v3_generated_Intents_GetIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb b/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb index 6358e42d99e6..c9f9864ff4e0 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/intents/list_intents.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Intents_ListIntents_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Intents::Client#list_intents +# +def list_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListIntentsRequest.new -# Call the list_intents method. -result = client.list_intents request + # Call the list_intents method. + result = client.list_intents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Intent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Intent. + p response + end end # [END dialogflow_v3_generated_Intents_ListIntents_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb index 4a6d92d71d90..ea22d9f3a4e1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/intents/update_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Intents_UpdateIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Intents::Client#update_intent +# +def update_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateIntentRequest.new -# Call the update_intent method. -result = client.update_intent request + # Call the update_intent method. + result = client.update_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Intent. + p result +end # [END dialogflow_v3_generated_Intents_UpdateIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb b/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb index 71040ad504b3..21196b413897 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/pages/create_page.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Pages_CreatePage_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#create_page +# +def create_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreatePageRequest.new -# Call the create_page method. -result = client.create_page request + # Call the create_page method. + result = client.create_page request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end # [END dialogflow_v3_generated_Pages_CreatePage_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb b/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb index c3d266697c1b..e8a4b9c63baa 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/pages/delete_page.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Pages_DeletePage_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#delete_page +# +def delete_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeletePageRequest.new -# Call the delete_page method. -result = client.delete_page request + # Call the delete_page method. + result = client.delete_page request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Pages_DeletePage_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb b/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb index 2b1693cb0e5e..97df46a5c27d 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/pages/get_page.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Pages_GetPage_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#get_page +# +def get_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetPageRequest.new -# Call the get_page method. -result = client.get_page request + # Call the get_page method. + result = client.get_page request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end # [END dialogflow_v3_generated_Pages_GetPage_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb b/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb index 70c25aed3668..f83136bcc31b 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/pages/list_pages.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Pages_ListPages_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#list_pages +# +def list_pages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListPagesRequest.new -# Call the list_pages method. -result = client.list_pages request + # Call the list_pages method. + result = client.list_pages request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Page. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Page. + p response + end end # [END dialogflow_v3_generated_Pages_ListPages_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb b/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb index 77821e4def70..3873dd3736df 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/pages/update_page.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Pages_UpdatePage_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Pages::Client#update_page +# +def update_page + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Pages::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdatePageRequest.new -# Call the update_page method. -result = client.update_page request + # Call the update_page method. + result = client.update_page request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Page. + p result +end # [END dialogflow_v3_generated_Pages_UpdatePage_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb index db8bca7f1745..cb18d38340b0 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/create_security_settings.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#create_security_settings +# +def create_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateSecuritySettingsRequest.new -# Call the create_security_settings method. -result = client.create_security_settings request + # Call the create_security_settings method. + result = client.create_security_settings request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end # [END dialogflow_v3_generated_SecuritySettingsService_CreateSecuritySettings_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb index 739c05d3ac1a..ac4bd3f26fc7 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/delete_security_settings.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#delete_security_settings +# +def delete_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteSecuritySettingsRequest.new -# Call the delete_security_settings method. -result = client.delete_security_settings request + # Call the delete_security_settings method. + result = client.delete_security_settings request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_SecuritySettingsService_DeleteSecuritySettings_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb index 732f434be9c2..0938996b4e95 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/get_security_settings.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#get_security_settings +# +def get_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetSecuritySettingsRequest.new -# Call the get_security_settings method. -result = client.get_security_settings request + # Call the get_security_settings method. + result = client.get_security_settings request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end # [END dialogflow_v3_generated_SecuritySettingsService_GetSecuritySettings_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb index 757ce6dd35b3..28d6eda40d5a 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/list_security_settings.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#list_security_settings +# +def list_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListSecuritySettingsRequest.new -# Call the list_security_settings method. -result = client.list_security_settings request + # Call the list_security_settings method. + result = client.list_security_settings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p response + end end # [END dialogflow_v3_generated_SecuritySettingsService_ListSecuritySettings_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb index 4528367e4992..17a5e8712572 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/security_settings_service/update_security_settings.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client#update_security_settings +# +def update_security_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SecuritySettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateSecuritySettingsRequest.new -# Call the update_security_settings method. -result = client.update_security_settings request + # Call the update_security_settings method. + result = client.update_security_settings request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SecuritySettings. + p result +end # [END dialogflow_v3_generated_SecuritySettingsService_UpdateSecuritySettings_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb index c081f3de2ba4..ba76a3a97df1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/create_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#create_session_entity_type +# +def create_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateSessionEntityTypeRequest.new -# Call the create_session_entity_type method. -result = client.create_session_entity_type request + # Call the create_session_entity_type method. + result = client.create_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + p result +end # [END dialogflow_v3_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb index 163a33a7619f..eef44f1db500 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/delete_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#delete_session_entity_type +# +def delete_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteSessionEntityTypeRequest.new -# Call the delete_session_entity_type method. -result = client.delete_session_entity_type request + # Call the delete_session_entity_type method. + result = client.delete_session_entity_type request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb index b79c68a699ff..76aa5a4bd539 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/get_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#get_session_entity_type +# +def get_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetSessionEntityTypeRequest.new -# Call the get_session_entity_type method. -result = client.get_session_entity_type request + # Call the get_session_entity_type method. + result = client.get_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + p result +end # [END dialogflow_v3_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb index 1e2e29e9d71e..15e30777f532 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/list_session_entity_types.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#list_session_entity_types +# +def list_session_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListSessionEntityTypesRequest.new -# Call the list_session_entity_types method. -result = client.list_session_entity_types request + # Call the list_session_entity_types method. + result = client.list_session_entity_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + p response + end end # [END dialogflow_v3_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb index 6f675da48c09..1895da4171f8 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/session_entity_types/update_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client#update_session_entity_type +# +def update_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateSessionEntityTypeRequest.new -# Call the update_session_entity_type method. -result = client.update_session_entity_type request + # Call the update_session_entity_type method. + result = client.update_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::SessionEntityType. + p result +end # [END dialogflow_v3_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb index bfff453405bd..c6cf56b5b94a 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/sessions/detect_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Sessions_DetectIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Sessions::Client#detect_intent +# +def detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DetectIntentRequest.new -# Call the detect_intent method. -result = client.detect_intent request + # Call the detect_intent method. + result = client.detect_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::DetectIntentResponse. + p result +end # [END dialogflow_v3_generated_Sessions_DetectIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb index c47d9e09a0cf..48f2e3b10ee3 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/sessions/fulfill_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Sessions_FulfillIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Sessions::Client#fulfill_intent +# +def fulfill_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::FulfillIntentRequest.new -# Call the fulfill_intent method. -result = client.fulfill_intent request + # Call the fulfill_intent method. + result = client.fulfill_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::FulfillIntentResponse. + p result +end # [END dialogflow_v3_generated_Sessions_FulfillIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb index 3355b8a655ec..bb70034d3506 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/sessions/match_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Sessions_MatchIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Sessions::Client#match_intent +# +def match_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::MatchIntentRequest.new -# Call the match_intent method. -result = client.match_intent request + # Call the match_intent method. + result = client.match_intent request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::MatchIntentResponse. + p result +end # [END dialogflow_v3_generated_Sessions_MatchIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb b/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb index 83ffb3708d24..d03bead391f0 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/sessions/streaming_detect_intent.rb @@ -19,24 +19,30 @@ # [START dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_detect_intent method to start streaming. -output = client.streaming_detect_intent input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new -input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Sessions::Client#streaming_detect_intent +# +def streaming_detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Sessions::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_detect_intent method to start streaming. + output = client.streaming_detect_intent input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new + input << Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Dialogflow::CX::V3::StreamingDetectIntentResponse. + output.each do |response| + p response + end end # [END dialogflow_v3_generated_Sessions_StreamingDetectIntent_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json b/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json index 9a735f51aee8..17608b2eb5bf 100644 --- a/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json +++ b/google-cloud-dialogflow-cx-v3/snippets/snippet_metadata_google.cloud.dialogflow.cx.v3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1966,7 +1966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2006,7 +2006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2046,7 +2046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2086,7 +2086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2126,7 +2126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2166,7 +2166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2206,7 +2206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2246,7 +2246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2286,7 +2286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2326,7 +2326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2366,7 +2366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2406,7 +2406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2446,7 +2446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2486,7 +2486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2526,7 +2526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2566,7 +2566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2606,7 +2606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2646,7 +2646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2686,7 +2686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2726,7 +2726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2766,7 +2766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2806,7 +2806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2846,7 +2846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2886,7 +2886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2926,7 +2926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2966,7 +2966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3006,7 +3006,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3046,7 +3046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3086,7 +3086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3126,7 +3126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3166,7 +3166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3206,7 +3206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3246,7 +3246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3286,7 +3286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3326,7 +3326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3366,7 +3366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3406,7 +3406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3446,7 +3446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3486,7 +3486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3526,7 +3526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3566,7 +3566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3606,7 +3606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3646,7 +3646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3686,7 +3686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3726,7 +3726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3766,7 +3766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3806,7 +3806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3846,7 +3846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3886,7 +3886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb index 00f8b0f21947..035606010556 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_delete_test_cases.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_delete_test_cases +# +def batch_delete_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::BatchDeleteTestCasesRequest.new -# Call the batch_delete_test_cases method. -result = client.batch_delete_test_cases request + # Call the batch_delete_test_cases method. + result = client.batch_delete_test_cases request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_TestCases_BatchDeleteTestCases_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb index a91305d52325..afcfe9de9262 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/batch_run_test_cases.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_TestCases_BatchRunTestCases_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#batch_run_test_cases +# +def batch_run_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::BatchRunTestCasesRequest.new -# Call the batch_run_test_cases method. -result = client.batch_run_test_cases request + # Call the batch_run_test_cases method. + result = client.batch_run_test_cases request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_TestCases_BatchRunTestCases_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb index 68ebca8db7ef..894ce6be8475 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/calculate_coverage.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_CalculateCoverage_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#calculate_coverage +# +def calculate_coverage + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CalculateCoverageRequest.new -# Call the calculate_coverage method. -result = client.calculate_coverage request + # Call the calculate_coverage method. + result = client.calculate_coverage request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CalculateCoverageResponse. + p result +end # [END dialogflow_v3_generated_TestCases_CalculateCoverage_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb index a18ad8497340..aa438d82ebdb 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/create_test_case.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_CreateTestCase_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#create_test_case +# +def create_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateTestCaseRequest.new -# Call the create_test_case method. -result = client.create_test_case request + # Call the create_test_case method. + result = client.create_test_case request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end # [END dialogflow_v3_generated_TestCases_CreateTestCase_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb index 85811c4c5431..818bbe653ea7 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/export_test_cases.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_TestCases_ExportTestCases_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#export_test_cases +# +def export_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ExportTestCasesRequest.new -# Call the export_test_cases method. -result = client.export_test_cases request + # Call the export_test_cases method. + result = client.export_test_cases request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_TestCases_ExportTestCases_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb index 600509851d5c..d3829a4a0539 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_GetTestCase_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case +# +def get_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseRequest.new -# Call the get_test_case method. -result = client.get_test_case request + # Call the get_test_case method. + result = client.get_test_case request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end # [END dialogflow_v3_generated_TestCases_GetTestCase_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb index e365bcbf71fb..6f88fdcd3024 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/get_test_case_result.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_GetTestCaseResult_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#get_test_case_result +# +def get_test_case_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTestCaseResultRequest.new -# Call the get_test_case_result method. -result = client.get_test_case_result request + # Call the get_test_case_result method. + result = client.get_test_case_result request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + p result +end # [END dialogflow_v3_generated_TestCases_GetTestCaseResult_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb index 677d5bb5b587..4b40d3ab1ba2 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/import_test_cases.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_TestCases_ImportTestCases_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#import_test_cases +# +def import_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ImportTestCasesRequest.new -# Call the import_test_cases method. -result = client.import_test_cases request + # Call the import_test_cases method. + result = client.import_test_cases request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_TestCases_ImportTestCases_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb index dce81f463b57..5d97bd12cb61 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_case_results.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_TestCases_ListTestCaseResults_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_case_results +# +def list_test_case_results + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTestCaseResultsRequest.new -# Call the list_test_case_results method. -result = client.list_test_case_results request + # Call the list_test_case_results method. + result = client.list_test_case_results request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCaseResult. + p response + end end # [END dialogflow_v3_generated_TestCases_ListTestCaseResults_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb index bcc67c8c4bbe..6808d1a56352 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/list_test_cases.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_TestCases_ListTestCases_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#list_test_cases +# +def list_test_cases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTestCasesRequest.new -# Call the list_test_cases method. -result = client.list_test_cases request + # Call the list_test_cases method. + result = client.list_test_cases request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCase. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TestCase. + p response + end end # [END dialogflow_v3_generated_TestCases_ListTestCases_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb index 1ef3fe5f5ce0..818534c600c7 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/run_test_case.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_TestCases_RunTestCase_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#run_test_case +# +def run_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::RunTestCaseRequest.new -# Call the run_test_case method. -result = client.run_test_case request + # Call the run_test_case method. + result = client.run_test_case request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_TestCases_RunTestCase_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb b/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb index d59f4fce34a9..bae2f74e2d8c 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/test_cases/update_test_case.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TestCases_UpdateTestCase_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TestCases::Client#update_test_case +# +def update_test_case + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TestCases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateTestCaseRequest.new -# Call the update_test_case method. -result = client.update_test_case request + # Call the update_test_case method. + result = client.update_test_case request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TestCase. + p result +end # [END dialogflow_v3_generated_TestCases_UpdateTestCase_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb index 9d25802f54d8..7dff58acd770 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/create_transition_route_group.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#create_transition_route_group +# +def create_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new -# Call the create_transition_route_group method. -result = client.create_transition_route_group request + # Call the create_transition_route_group method. + result = client.create_transition_route_group request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end # [END dialogflow_v3_generated_TransitionRouteGroups_CreateTransitionRouteGroup_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb index 69ceda98227f..08f9bb581b91 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/delete_transition_route_group.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#delete_transition_route_group +# +def delete_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new -# Call the delete_transition_route_group method. -result = client.delete_transition_route_group request + # Call the delete_transition_route_group method. + result = client.delete_transition_route_group request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_TransitionRouteGroups_DeleteTransitionRouteGroup_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb index ec96bbf9b8b0..b6795603a6ed 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/get_transition_route_group.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#get_transition_route_group +# +def get_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new -# Call the get_transition_route_group method. -result = client.get_transition_route_group request + # Call the get_transition_route_group method. + result = client.get_transition_route_group request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end # [END dialogflow_v3_generated_TransitionRouteGroups_GetTransitionRouteGroup_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb index 186560529e90..78831a1ba8f1 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/list_transition_route_groups.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#list_transition_route_groups +# +def list_transition_route_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new -# Call the list_transition_route_groups method. -result = client.list_transition_route_groups request + # Call the list_transition_route_groups method. + result = client.list_transition_route_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p response + end end # [END dialogflow_v3_generated_TransitionRouteGroups_ListTransitionRouteGroups_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb index 0e27052891d5..71fcff20fca9 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/transition_route_groups/update_transition_route_group.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client#update_transition_route_group +# +def update_transition_route_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new -# Call the update_transition_route_group method. -result = client.update_transition_route_group request + # Call the update_transition_route_group method. + result = client.update_transition_route_group request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup. + p result +end # [END dialogflow_v3_generated_TransitionRouteGroups_UpdateTransitionRouteGroup_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb index 16893495b9aa..76fc101c7ec6 100644 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/compare_versions.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Versions_CompareVersions_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#compare_versions +# +def compare_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new -# Call the compare_versions method. -result = client.compare_versions request + # Call the compare_versions method. + result = client.compare_versions request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse. + p result +end # [END dialogflow_v3_generated_Versions_CompareVersions_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb index 4ce4b861cd65..629173e2f95f 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/create_version.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Versions_CreateVersion_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#create_version +# +def create_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new -# Call the create_version method. -result = client.create_version request + # Call the create_version method. + result = client.create_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Versions_CreateVersion_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb index 982722225bdf..f5e7e4a9e582 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/delete_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Versions_DeleteVersion_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#delete_version +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new -# Call the delete_version method. -result = client.delete_version request + # Call the delete_version method. + result = client.delete_version request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Versions_DeleteVersion_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb index 09e8d91916e0..36812642eed5 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/get_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Versions_GetVersion_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#get_version +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new -# Call the get_version method. -result = client.get_version request + # Call the get_version method. + result = client.get_version request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + p result +end # [END dialogflow_v3_generated_Versions_GetVersion_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb index 65ea810c4c45..d43742a518e7 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/list_versions.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Versions_ListVersions_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#list_versions +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest.new -# Call the list_versions method. -result = client.list_versions request + # Call the list_versions method. + result = client.list_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Version. + p response + end end # [END dialogflow_v3_generated_Versions_ListVersions_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb index 4cd6ed1a907b..3b251a68360a 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/load_version.rb @@ -19,22 +19,28 @@ # [START dialogflow_v3_generated_Versions_LoadVersion_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#load_version +# +def load_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new -# Call the load_version method. -result = client.load_version request + # Call the load_version method. + result = client.load_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v3_generated_Versions_LoadVersion_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb b/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb index d715f6c302d8..11911af6629b 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/versions/update_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Versions_UpdateVersion_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Versions::Client#update_version +# +def update_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new -# Call the update_version method. -result = client.update_version request + # Call the update_version method. + result = client.update_version request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version. + p result +end # [END dialogflow_v3_generated_Versions_UpdateVersion_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb b/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb index b0eb919209c8..96c64025ea8c 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/webhooks/create_webhook.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Webhooks_CreateWebhook_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#create_webhook +# +def create_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::CreateWebhookRequest.new -# Call the create_webhook method. -result = client.create_webhook request + # Call the create_webhook method. + result = client.create_webhook request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end # [END dialogflow_v3_generated_Webhooks_CreateWebhook_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb b/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb index 8140b42ea1b3..1d4d20e17802 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/webhooks/delete_webhook.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Webhooks_DeleteWebhook_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#delete_webhook +# +def delete_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::DeleteWebhookRequest.new -# Call the delete_webhook method. -result = client.delete_webhook request + # Call the delete_webhook method. + result = client.delete_webhook request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v3_generated_Webhooks_DeleteWebhook_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb b/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb index 1ff400a29bb2..439ced36db70 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/webhooks/get_webhook.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Webhooks_GetWebhook_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#get_webhook +# +def get_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::GetWebhookRequest.new -# Call the get_webhook method. -result = client.get_webhook request + # Call the get_webhook method. + result = client.get_webhook request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end # [END dialogflow_v3_generated_Webhooks_GetWebhook_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb b/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb index 317a3f97a3c3..179a657900c5 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/webhooks/list_webhooks.rb @@ -19,21 +19,27 @@ # [START dialogflow_v3_generated_Webhooks_ListWebhooks_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#list_webhooks +# +def list_webhooks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::ListWebhooksRequest.new -# Call the list_webhooks method. -result = client.list_webhooks request + # Call the list_webhooks method. + result = client.list_webhooks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Webhook. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Webhook. + p response + end end # [END dialogflow_v3_generated_Webhooks_ListWebhooks_sync] diff --git a/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb b/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb index 520381e37101..65099188d524 100755 --- a/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb +++ b/google-cloud-dialogflow-cx-v3/snippets/webhooks/update_webhook.rb @@ -19,15 +19,21 @@ # [START dialogflow_v3_generated_Webhooks_UpdateWebhook_sync] require "google/cloud/dialogflow/cx/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::CX::V3::Webhooks::Client#update_webhook +# +def update_webhook + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::CX::V3::Webhooks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::CX::V3::UpdateWebhookRequest.new -# Call the update_webhook method. -result = client.update_webhook request + # Call the update_webhook method. + result = client.update_webhook request -# The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. -p result + # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Webhook. + p result +end # [END dialogflow_v3_generated_Webhooks_UpdateWebhook_sync] diff --git a/google-cloud-dialogflow-v2/.rubocop.yml b/google-cloud-dialogflow-v2/.rubocop.yml index bee7a2c2e6b0..8743a6db18c7 100644 --- a/google-cloud-dialogflow-v2/.rubocop.yml +++ b/google-cloud-dialogflow-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dialogflow-v2.rb" diff --git a/google-cloud-dialogflow-v2/snippets/Gemfile b/google-cloud-dialogflow-v2/snippets/Gemfile index c39bec0e917c..7f72ae4c1d17 100755 --- a/google-cloud-dialogflow-v2/snippets/Gemfile +++ b/google-cloud-dialogflow-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb index 8d808ba5c28c..a698147ec870 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/delete_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Agents_DeleteAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#delete_agent +# +def delete_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new -# Call the delete_agent method. -result = client.delete_agent request + # Call the delete_agent method. + result = client.delete_agent request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Agents_DeleteAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb index 75846a9ac371..e2245920f200 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/export_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Agents_ExportAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#export_agent +# +def export_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new -# Call the export_agent method. -result = client.export_agent request + # Call the export_agent method. + result = client.export_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Agents_ExportAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb index ba8f1f9ae4bb..e524b57c0308 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/get_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Agents_GetAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#get_agent +# +def get_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new -# Call the get_agent method. -result = client.get_agent request + # Call the get_agent method. + result = client.get_agent request -# The returned object is of type Google::Cloud::Dialogflow::V2::Agent. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + p result +end # [END dialogflow_v2_generated_Agents_GetAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb b/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb index 4a4bf7d17478..ea130347248c 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/get_validation_result.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Agents_GetValidationResult_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#get_validation_result +# +def get_validation_result + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new -# Call the get_validation_result method. -result = client.get_validation_result request + # Call the get_validation_result method. + result = client.get_validation_result request -# The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult. + p result +end # [END dialogflow_v2_generated_Agents_GetValidationResult_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb index a09767a62aae..00d7a2bed93b 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/import_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Agents_ImportAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#import_agent +# +def import_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new -# Call the import_agent method. -result = client.import_agent request + # Call the import_agent method. + result = client.import_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Agents_ImportAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb index 46dd6de7c09d..353a28590208 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/restore_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Agents_RestoreAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#restore_agent +# +def restore_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new -# Call the restore_agent method. -result = client.restore_agent request + # Call the restore_agent method. + result = client.restore_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Agents_RestoreAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb b/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb index 8714c05a25ce..4516cf3f8f7e 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/search_agents.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Agents_SearchAgents_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#search_agents +# +def search_agents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new -# Call the search_agents method. -result = client.search_agents request + # Call the search_agents method. + result = client.search_agents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Agent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Agent. + p response + end end # [END dialogflow_v2_generated_Agents_SearchAgents_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb index 7a7f39a35727..6f147d1d95a8 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/set_agent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Agents_SetAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#set_agent +# +def set_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new -# Call the set_agent method. -result = client.set_agent request + # Call the set_agent method. + result = client.set_agent request -# The returned object is of type Google::Cloud::Dialogflow::V2::Agent. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Agent. + p result +end # [END dialogflow_v2_generated_Agents_SetAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb b/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb index e51508671c6e..e36bc1052737 100755 --- a/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb +++ b/google-cloud-dialogflow-v2/snippets/agents/train_agent.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Agents_TrainAgent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Agents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Agents::Client#train_agent +# +def train_agent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Agents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new -# Call the train_agent method. -result = client.train_agent request + # Call the train_agent method. + result = client.train_agent request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Agents_TrainAgent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb b/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb index 42a274e15c04..04814abafa2a 100755 --- a/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb +++ b/google-cloud-dialogflow-v2/snippets/answer_records/list_answer_records.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::AnswerRecords::Client#list_answer_records +# +def list_answer_records + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest.new -# Call the list_answer_records method. -result = client.list_answer_records request + # Call the list_answer_records method. + result = client.list_answer_records request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::AnswerRecord. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::AnswerRecord. + p response + end end # [END dialogflow_v2_generated_AnswerRecords_ListAnswerRecords_sync] diff --git a/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb b/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb index 7891134a12f7..381a672ae363 100755 --- a/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb +++ b/google-cloud-dialogflow-v2/snippets/answer_records/update_answer_record.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::AnswerRecords::Client#update_answer_record +# +def update_answer_record + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::AnswerRecords::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest.new -# Call the update_answer_record method. -result = client.update_answer_record request + # Call the update_answer_record method. + result = client.update_answer_record request -# The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::AnswerRecord. + p result +end # [END dialogflow_v2_generated_AnswerRecords_UpdateAnswerRecord_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb b/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb index c7da072bc33c..d2bb29f06987 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/create_context.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Contexts_CreateContext_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#create_context +# +def create_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new -# Call the create_context method. -result = client.create_context request + # Call the create_context method. + result = client.create_context request -# The returned object is of type Google::Cloud::Dialogflow::V2::Context. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end # [END dialogflow_v2_generated_Contexts_CreateContext_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb b/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb index fcfd183565ac..2405d3e59fbb 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/delete_all_contexts.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#delete_all_contexts +# +def delete_all_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new -# Call the delete_all_contexts method. -result = client.delete_all_contexts request + # Call the delete_all_contexts method. + result = client.delete_all_contexts request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Contexts_DeleteAllContexts_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb b/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb index 10f2570408c7..6d666435f018 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/delete_context.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Contexts_DeleteContext_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#delete_context +# +def delete_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new -# Call the delete_context method. -result = client.delete_context request + # Call the delete_context method. + result = client.delete_context request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Contexts_DeleteContext_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb b/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb index b41db62a001c..f0175d54aff5 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/get_context.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Contexts_GetContext_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#get_context +# +def get_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetContextRequest.new -# Call the get_context method. -result = client.get_context request + # Call the get_context method. + result = client.get_context request -# The returned object is of type Google::Cloud::Dialogflow::V2::Context. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end # [END dialogflow_v2_generated_Contexts_GetContext_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb b/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb index b6d883c549d1..da27a364b9c5 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/list_contexts.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Contexts_ListContexts_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#list_contexts +# +def list_contexts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new -# Call the list_contexts method. -result = client.list_contexts request + # Call the list_contexts method. + result = client.list_contexts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Context. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Context. + p response + end end # [END dialogflow_v2_generated_Contexts_ListContexts_sync] diff --git a/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb b/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb index 2f5000147ad4..734666e26a15 100755 --- a/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb +++ b/google-cloud-dialogflow-v2/snippets/contexts/update_context.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Contexts_UpdateContext_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Contexts::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Contexts::Client#update_context +# +def update_context + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Contexts::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new -# Call the update_context method. -result = client.update_context request + # Call the update_context method. + result = client.update_context request -# The returned object is of type Google::Cloud::Dialogflow::V2::Context. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Context. + p result +end # [END dialogflow_v2_generated_Contexts_UpdateContext_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb b/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb index 12c1b88db9b1..230e76729d2b 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_datasets/create_conversation_dataset.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#create_conversation_dataset +# +def create_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationDatasetRequest.new -# Call the create_conversation_dataset method. -result = client.create_conversation_dataset request + # Call the create_conversation_dataset method. + result = client.create_conversation_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationDatasets_CreateConversationDataset_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb b/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb index 20be116823d9..ae21240602f1 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_datasets/delete_conversation_dataset.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#delete_conversation_dataset +# +def delete_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationDatasetRequest.new -# Call the delete_conversation_dataset method. -result = client.delete_conversation_dataset request + # Call the delete_conversation_dataset method. + result = client.delete_conversation_dataset request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationDatasets_DeleteConversationDataset_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb b/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb index 8ad520f5a4ca..9f3e745615fa 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_datasets/get_conversation_dataset.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#get_conversation_dataset +# +def get_conversation_dataset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationDatasetRequest.new -# Call the get_conversation_dataset method. -result = client.get_conversation_dataset request + # Call the get_conversation_dataset method. + result = client.get_conversation_dataset request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationDataset. + p result +end # [END dialogflow_v2_generated_ConversationDatasets_GetConversationDataset_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb b/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb index 0f6e79a117be..f40309a0645c 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_datasets/import_conversation_data.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#import_conversation_data +# +def import_conversation_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ImportConversationDataRequest.new -# Call the import_conversation_data method. -result = client.import_conversation_data request + # Call the import_conversation_data method. + result = client.import_conversation_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationDatasets_ImportConversationData_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb b/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb index f6c3b650b739..93888ed2d86c 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_datasets/list_conversation_datasets.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationDatasets::Client#list_conversation_datasets +# +def list_conversation_datasets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationDatasets::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationDatasetsRequest.new -# Call the list_conversation_datasets method. -result = client.list_conversation_datasets request + # Call the list_conversation_datasets method. + result = client.list_conversation_datasets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationDataset. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationDataset. + p response + end end # [END dialogflow_v2_generated_ConversationDatasets_ListConversationDatasets_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb index dabfdef15585..fc6bec660ddd 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model +# +def create_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationModelRequest.new -# Call the create_conversation_model method. -result = client.create_conversation_model request + # Call the create_conversation_model method. + result = client.create_conversation_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationModels_CreateConversationModel_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb index e7f5564727c6..15cce08184ef 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/create_conversation_model_evaluation.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#create_conversation_model_evaluation +# +def create_conversation_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationModelEvaluationRequest.new -# Call the create_conversation_model_evaluation method. -result = client.create_conversation_model_evaluation request + # Call the create_conversation_model_evaluation method. + result = client.create_conversation_model_evaluation request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationModels_CreateConversationModelEvaluation_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb index 4bc1c76e9fa4..327dbb4b3b37 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/delete_conversation_model.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#delete_conversation_model +# +def delete_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationModelRequest.new -# Call the delete_conversation_model method. -result = client.delete_conversation_model request + # Call the delete_conversation_model method. + result = client.delete_conversation_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationModels_DeleteConversationModel_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb index 1457cdb59ff6..bf6bad29190c 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/deploy_conversation_model.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#deploy_conversation_model +# +def deploy_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeployConversationModelRequest.new -# Call the deploy_conversation_model method. -result = client.deploy_conversation_model request + # Call the deploy_conversation_model method. + result = client.deploy_conversation_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationModels_DeployConversationModel_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb index 0365fd5df20a..96b1fba9c3ed 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model +# +def get_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationModelRequest.new -# Call the get_conversation_model method. -result = client.get_conversation_model request + # Call the get_conversation_model method. + result = client.get_conversation_model request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModel. + p result +end # [END dialogflow_v2_generated_ConversationModels_GetConversationModel_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb index 25498034c67c..b9ecbe02bbf9 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/get_conversation_model_evaluation.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#get_conversation_model_evaluation +# +def get_conversation_model_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationModelEvaluationRequest.new -# Call the get_conversation_model_evaluation method. -result = client.get_conversation_model_evaluation request + # Call the get_conversation_model_evaluation method. + result = client.get_conversation_model_evaluation request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + p result +end # [END dialogflow_v2_generated_ConversationModels_GetConversationModelEvaluation_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb index c39e74b36afa..c75d90baacd0 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_model_evaluations.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_model_evaluations +# +def list_conversation_model_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationModelEvaluationsRequest.new -# Call the list_conversation_model_evaluations method. -result = client.list_conversation_model_evaluations request + # Call the list_conversation_model_evaluations method. + result = client.list_conversation_model_evaluations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModelEvaluation. + p response + end end # [END dialogflow_v2_generated_ConversationModels_ListConversationModelEvaluations_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb index 2896e0be5777..3a062e69fefc 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/list_conversation_models.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#list_conversation_models +# +def list_conversation_models + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationModelsRequest.new -# Call the list_conversation_models method. -result = client.list_conversation_models request + # Call the list_conversation_models method. + result = client.list_conversation_models request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModel. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationModel. + p response + end end # [END dialogflow_v2_generated_ConversationModels_ListConversationModels_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb b/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb index cacd3cdec720..e9b8a483f5b9 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_models/undeploy_conversation_model.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationModels::Client#undeploy_conversation_model +# +def undeploy_conversation_model + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationModels::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UndeployConversationModelRequest.new -# Call the undeploy_conversation_model method. -result = client.undeploy_conversation_model request + # Call the undeploy_conversation_model method. + result = client.undeploy_conversation_model request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationModels_UndeployConversationModel_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb index e273b59cefd7..dc19f22b46fa 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/clear_suggestion_feature_config.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#clear_suggestion_feature_config +# +def clear_suggestion_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new -# Call the clear_suggestion_feature_config method. -result = client.clear_suggestion_feature_config request + # Call the clear_suggestion_feature_config method. + result = client.clear_suggestion_feature_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationProfiles_ClearSuggestionFeatureConfig_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb index 319b34986d84..89f9ac8b5b06 100755 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/create_conversation_profile.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#create_conversation_profile +# +def create_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new -# Call the create_conversation_profile method. -result = client.create_conversation_profile request + # Call the create_conversation_profile method. + result = client.create_conversation_profile request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end # [END dialogflow_v2_generated_ConversationProfiles_CreateConversationProfile_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb index fd77f05a82ac..a52caec54f47 100755 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/delete_conversation_profile.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#delete_conversation_profile +# +def delete_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new -# Call the delete_conversation_profile method. -result = client.delete_conversation_profile request + # Call the delete_conversation_profile method. + result = client.delete_conversation_profile request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_ConversationProfiles_DeleteConversationProfile_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb index 57f6bfba6913..2950de7fc56e 100755 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/get_conversation_profile.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#get_conversation_profile +# +def get_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new -# Call the get_conversation_profile method. -result = client.get_conversation_profile request + # Call the get_conversation_profile method. + result = client.get_conversation_profile request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end # [END dialogflow_v2_generated_ConversationProfiles_GetConversationProfile_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb index 002a17569c03..7296acd94880 100755 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/list_conversation_profiles.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#list_conversation_profiles +# +def list_conversation_profiles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new -# Call the list_conversation_profiles method. -result = client.list_conversation_profiles request + # Call the list_conversation_profiles method. + result = client.list_conversation_profiles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationProfile. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationProfile. + p response + end end # [END dialogflow_v2_generated_ConversationProfiles_ListConversationProfiles_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb index 42b997b2439f..92b39ca5bb4d 100644 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/set_suggestion_feature_config.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#set_suggestion_feature_config +# +def set_suggestion_feature_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new -# Call the set_suggestion_feature_config method. -result = client.set_suggestion_feature_config request + # Call the set_suggestion_feature_config method. + result = client.set_suggestion_feature_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_ConversationProfiles_SetSuggestionFeatureConfig_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb b/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb index effa0a0bd650..98e18647473d 100755 --- a/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb +++ b/google-cloud-dialogflow-v2/snippets/conversation_profiles/update_conversation_profile.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::ConversationProfiles::Client#update_conversation_profile +# +def update_conversation_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new -# Call the update_conversation_profile method. -result = client.update_conversation_profile request + # Call the update_conversation_profile method. + result = client.update_conversation_profile request -# The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile. + p result +end # [END dialogflow_v2_generated_ConversationProfiles_UpdateConversationProfile_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb b/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb index 59ae72318c06..6b004d51fc8c 100755 --- a/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb +++ b/google-cloud-dialogflow-v2/snippets/conversations/complete_conversation.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Conversations_CompleteConversation_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Conversations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Conversations::Client#complete_conversation +# +def complete_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new -# Call the complete_conversation method. -result = client.complete_conversation request + # Call the complete_conversation method. + result = client.complete_conversation request -# The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end # [END dialogflow_v2_generated_Conversations_CompleteConversation_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb b/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb index 7a0384ca2d7a..63d70b737403 100755 --- a/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb +++ b/google-cloud-dialogflow-v2/snippets/conversations/create_conversation.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Conversations_CreateConversation_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Conversations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Conversations::Client#create_conversation +# +def create_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new -# Call the create_conversation method. -result = client.create_conversation request + # Call the create_conversation method. + result = client.create_conversation request -# The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end # [END dialogflow_v2_generated_Conversations_CreateConversation_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb b/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb index 8560268924f1..5e056a738d77 100755 --- a/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb +++ b/google-cloud-dialogflow-v2/snippets/conversations/get_conversation.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Conversations_GetConversation_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Conversations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Conversations::Client#get_conversation +# +def get_conversation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new -# Call the get_conversation method. -result = client.get_conversation request + # Call the get_conversation method. + result = client.get_conversation request -# The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation. + p result +end # [END dialogflow_v2_generated_Conversations_GetConversation_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb b/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb index 89b2c6f039ab..9f018efea1b4 100755 --- a/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb +++ b/google-cloud-dialogflow-v2/snippets/conversations/list_conversations.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Conversations_ListConversations_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Conversations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Conversations::Client#list_conversations +# +def list_conversations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListConversationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListConversationsRequest.new -# Call the list_conversations method. -result = client.list_conversations request + # Call the list_conversations method. + result = client.list_conversations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Conversation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Conversation. + p response + end end # [END dialogflow_v2_generated_Conversations_ListConversations_sync] diff --git a/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb b/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb index cc2ec9bb7606..70c876dab8ff 100755 --- a/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb +++ b/google-cloud-dialogflow-v2/snippets/conversations/list_messages.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Conversations_ListMessages_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Conversations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Conversations::Client#list_messages +# +def list_messages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Conversations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new -# Call the list_messages method. -result = client.list_messages request + # Call the list_messages method. + result = client.list_messages request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Message. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Message. + p response + end end # [END dialogflow_v2_generated_Conversations_ListMessages_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/create_document.rb b/google-cloud-dialogflow-v2/snippets/documents/create_document.rb index fe11a810477e..f7ed0d46688d 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/create_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/create_document.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_CreateDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#create_document +# +def create_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new -# Call the create_document method. -result = client.create_document request + # Call the create_document method. + result = client.create_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_CreateDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb b/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb index edcc9550eeea..71b94d53c070 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/delete_document.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_DeleteDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#delete_document +# +def delete_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new -# Call the delete_document method. -result = client.delete_document request + # Call the delete_document method. + result = client.delete_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_DeleteDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/export_document.rb b/google-cloud-dialogflow-v2/snippets/documents/export_document.rb index 997c927188c4..597c20fd9c8c 100644 --- a/google-cloud-dialogflow-v2/snippets/documents/export_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/export_document.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_ExportDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#export_document +# +def export_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new -# Call the export_document method. -result = client.export_document request + # Call the export_document method. + result = client.export_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_ExportDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/get_document.rb b/google-cloud-dialogflow-v2/snippets/documents/get_document.rb index 948a2bb72b10..92f05cca774e 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/get_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/get_document.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Documents_GetDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#get_document +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new -# Call the get_document method. -result = client.get_document request + # Call the get_document method. + result = client.get_document request -# The returned object is of type Google::Cloud::Dialogflow::V2::Document. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Document. + p result +end # [END dialogflow_v2_generated_Documents_GetDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb b/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb index 12d91a40d4a2..f96a61768c82 100644 --- a/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/import_documents.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_ImportDocuments_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#import_documents +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new -# Call the import_documents method. -result = client.import_documents request + # Call the import_documents method. + result = client.import_documents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_ImportDocuments_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb b/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb index ff6e2f8590b7..e3a9ddd2d148 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/list_documents.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Documents_ListDocuments_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#list_documents +# +def list_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListDocumentsRequest.new -# Call the list_documents method. -result = client.list_documents request + # Call the list_documents method. + result = client.list_documents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Document. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Document. + p response + end end # [END dialogflow_v2_generated_Documents_ListDocuments_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb b/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb index c2621ea89adf..5aff3cd45b0f 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/reload_document.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_ReloadDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#reload_document +# +def reload_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new -# Call the reload_document method. -result = client.reload_document request + # Call the reload_document method. + result = client.reload_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_ReloadDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/documents/update_document.rb b/google-cloud-dialogflow-v2/snippets/documents/update_document.rb index 7d005bbcd283..fdf76091b744 100755 --- a/google-cloud-dialogflow-v2/snippets/documents/update_document.rb +++ b/google-cloud-dialogflow-v2/snippets/documents/update_document.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Documents_UpdateDocument_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Documents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Documents::Client#update_document +# +def update_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Documents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new -# Call the update_document method. -result = client.update_document request + # Call the update_document method. + result = client.update_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Documents_UpdateDocument_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb b/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb index 7d29ef5d479e..9f52abe92b6d 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/batch_create_entities.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_create_entities +# +def batch_create_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new -# Call the batch_create_entities method. -result = client.batch_create_entities request + # Call the batch_create_entities method. + result = client.batch_create_entities request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_EntityTypes_BatchCreateEntities_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb b/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb index e76643fe68d0..19caa421f43f 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entities.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entities +# +def batch_delete_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new -# Call the batch_delete_entities method. -result = client.batch_delete_entities request + # Call the batch_delete_entities method. + result = client.batch_delete_entities request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntities_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb b/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb index 5058693ad38e..ebcb779b2805 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/batch_delete_entity_types.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_delete_entity_types +# +def batch_delete_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new -# Call the batch_delete_entity_types method. -result = client.batch_delete_entity_types request + # Call the batch_delete_entity_types method. + result = client.batch_delete_entity_types request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_EntityTypes_BatchDeleteEntityTypes_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb b/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb index 5eb4aa809134..04a819e61325 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entities.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entities +# +def batch_update_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new -# Call the batch_update_entities method. -result = client.batch_update_entities request + # Call the batch_update_entities method. + result = client.batch_update_entities request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntities_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb b/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb index 5809219e5ce3..94a53420be7f 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/batch_update_entity_types.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#batch_update_entity_types +# +def batch_update_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new -# Call the batch_update_entity_types method. -result = client.batch_update_entity_types request + # Call the batch_update_entity_types method. + result = client.batch_update_entity_types request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_EntityTypes_BatchUpdateEntityTypes_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb b/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb index 14b0be1c754c..cb0f61f72ce6 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/create_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#create_entity_type +# +def create_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new -# Call the create_entity_type method. -result = client.create_entity_type request + # Call the create_entity_type method. + result = client.create_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end # [END dialogflow_v2_generated_EntityTypes_CreateEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb b/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb index 786b3e3549ab..f73333163c4d 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/delete_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#delete_entity_type +# +def delete_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new -# Call the delete_entity_type method. -result = client.delete_entity_type request + # Call the delete_entity_type method. + result = client.delete_entity_type request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_EntityTypes_DeleteEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb b/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb index 0fc2feafcee3..25548e62b96c 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/get_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_EntityTypes_GetEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#get_entity_type +# +def get_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new -# Call the get_entity_type method. -result = client.get_entity_type request + # Call the get_entity_type method. + result = client.get_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end # [END dialogflow_v2_generated_EntityTypes_GetEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb b/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb index ed48e37f3bc7..59d546300df5 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/list_entity_types.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#list_entity_types +# +def list_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new -# Call the list_entity_types method. -result = client.list_entity_types request + # Call the list_entity_types method. + result = client.list_entity_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::EntityType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::EntityType. + p response + end end # [END dialogflow_v2_generated_EntityTypes_ListEntityTypes_sync] diff --git a/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb b/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb index 37d2fed69fb8..6e5ecfa482da 100755 --- a/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/entity_types/update_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::EntityTypes::Client#update_entity_type +# +def update_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new -# Call the update_entity_type method. -result = client.update_entity_type request + # Call the update_entity_type method. + result = client.update_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType. + p result +end # [END dialogflow_v2_generated_EntityTypes_UpdateEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb b/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb index 942e6f1af108..5a5af56752b2 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/create_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Environments_CreateEnvironment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Google::Cloud::Dialogflow::V2::Environment. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end # [END dialogflow_v2_generated_Environments_CreateEnvironment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb b/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb index deeed355420b..f776f2c86793 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/delete_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Environments_DeleteEnvironment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Environments_DeleteEnvironment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb b/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb index 0cec25a58be6..00ae6bbcbaae 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/get_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Environments_GetEnvironment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Dialogflow::V2::Environment. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end # [END dialogflow_v2_generated_Environments_GetEnvironment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb b/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb index b08336b7fd2b..dce92e167536 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/get_environment_history.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#get_environment_history +# +def get_environment_history + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetEnvironmentHistoryRequest.new -# Call the get_environment_history method. -result = client.get_environment_history request + # Call the get_environment_history method. + result = client.get_environment_history request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::EnvironmentHistory::Entry. + p response + end end # [END dialogflow_v2_generated_Environments_GetEnvironmentHistory_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb b/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb index 2a37b22fdb32..2b1118f67bc2 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/list_environments.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Environments_ListEnvironments_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Environment. + p response + end end # [END dialogflow_v2_generated_Environments_ListEnvironments_sync] diff --git a/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb b/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb index a6574f57f30b..9a675f9be07a 100755 --- a/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb +++ b/google-cloud-dialogflow-v2/snippets/environments/update_environment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Environments_UpdateEnvironment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Environments::Client#update_environment +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest.new -# Call the update_environment method. -result = client.update_environment request + # Call the update_environment method. + result = client.update_environment request -# The returned object is of type Google::Cloud::Dialogflow::V2::Environment. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Environment. + p result +end # [END dialogflow_v2_generated_Environments_UpdateEnvironment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb b/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb index c7c91b5c85fb..0c10bc3d10c6 100755 --- a/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb +++ b/google-cloud-dialogflow-v2/snippets/fulfillments/get_fulfillment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Fulfillments::Client#get_fulfillment +# +def get_fulfillment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetFulfillmentRequest.new -# Call the get_fulfillment method. -result = client.get_fulfillment request + # Call the get_fulfillment method. + result = client.get_fulfillment request -# The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + p result +end # [END dialogflow_v2_generated_Fulfillments_GetFulfillment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb b/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb index 7f319ff7fcb6..32471c241912 100755 --- a/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb +++ b/google-cloud-dialogflow-v2/snippets/fulfillments/update_fulfillment.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Fulfillments::Client#update_fulfillment +# +def update_fulfillment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Fulfillments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateFulfillmentRequest.new -# Call the update_fulfillment method. -result = client.update_fulfillment request + # Call the update_fulfillment method. + result = client.update_fulfillment request -# The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Fulfillment. + p result +end # [END dialogflow_v2_generated_Fulfillments_UpdateFulfillment_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb b/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb index 8cc637f1a4bd..b78a3ef09218 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/batch_delete_intents.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#batch_delete_intents +# +def batch_delete_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new -# Call the batch_delete_intents method. -result = client.batch_delete_intents request + # Call the batch_delete_intents method. + result = client.batch_delete_intents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Intents_BatchDeleteIntents_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb b/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb index 0c03632b4a52..174558e4dbe1 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/batch_update_intents.rb @@ -19,22 +19,28 @@ # [START dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#batch_update_intents +# +def batch_update_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new -# Call the batch_update_intents method. -result = client.batch_update_intents request + # Call the batch_update_intents method. + result = client.batch_update_intents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END dialogflow_v2_generated_Intents_BatchUpdateIntents_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb b/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb index 6e7e2d144dfb..0ab5d19afa51 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/create_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Intents_CreateIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#create_intent +# +def create_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new -# Call the create_intent method. -result = client.create_intent request + # Call the create_intent method. + result = client.create_intent request -# The returned object is of type Google::Cloud::Dialogflow::V2::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end # [END dialogflow_v2_generated_Intents_CreateIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb b/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb index 4128ac7d98cd..6c82fa949c6c 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/delete_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Intents_DeleteIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#delete_intent +# +def delete_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new -# Call the delete_intent method. -result = client.delete_intent request + # Call the delete_intent method. + result = client.delete_intent request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Intents_DeleteIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb b/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb index 9bc5205f22f9..de6fdeb724fb 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/get_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Intents_GetIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#get_intent +# +def get_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new -# Call the get_intent method. -result = client.get_intent request + # Call the get_intent method. + result = client.get_intent request -# The returned object is of type Google::Cloud::Dialogflow::V2::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end # [END dialogflow_v2_generated_Intents_GetIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb b/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb index f78fb8ebcb53..ccb92496c303 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/list_intents.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Intents_ListIntents_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#list_intents +# +def list_intents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new -# Call the list_intents method. -result = client.list_intents request + # Call the list_intents method. + result = client.list_intents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Intent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Intent. + p response + end end # [END dialogflow_v2_generated_Intents_ListIntents_sync] diff --git a/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb b/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb index e29689c36533..35b7cc60fb96 100755 --- a/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/intents/update_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Intents_UpdateIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Intents::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Intents::Client#update_intent +# +def update_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Intents::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new -# Call the update_intent method. -result = client.update_intent request + # Call the update_intent method. + result = client.update_intent request -# The returned object is of type Google::Cloud::Dialogflow::V2::Intent. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Intent. + p result +end # [END dialogflow_v2_generated_Intents_UpdateIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb b/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb index 4f32d4049bb4..eef792abad6c 100755 --- a/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb +++ b/google-cloud-dialogflow-v2/snippets/knowledge_bases/create_knowledge_base.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#create_knowledge_base +# +def create_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateKnowledgeBaseRequest.new -# Call the create_knowledge_base method. -result = client.create_knowledge_base request + # Call the create_knowledge_base method. + result = client.create_knowledge_base request -# The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end # [END dialogflow_v2_generated_KnowledgeBases_CreateKnowledgeBase_sync] diff --git a/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb b/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb index f0b19aee2be3..3197e5a0ddd0 100755 --- a/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb +++ b/google-cloud-dialogflow-v2/snippets/knowledge_bases/delete_knowledge_base.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#delete_knowledge_base +# +def delete_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteKnowledgeBaseRequest.new -# Call the delete_knowledge_base method. -result = client.delete_knowledge_base request + # Call the delete_knowledge_base method. + result = client.delete_knowledge_base request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_KnowledgeBases_DeleteKnowledgeBase_sync] diff --git a/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb b/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb index c04424af42fd..77b707e63025 100755 --- a/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb +++ b/google-cloud-dialogflow-v2/snippets/knowledge_bases/get_knowledge_base.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#get_knowledge_base +# +def get_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetKnowledgeBaseRequest.new -# Call the get_knowledge_base method. -result = client.get_knowledge_base request + # Call the get_knowledge_base method. + result = client.get_knowledge_base request -# The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end # [END dialogflow_v2_generated_KnowledgeBases_GetKnowledgeBase_sync] diff --git a/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb b/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb index 4d6f4c015ec7..82abc518928b 100755 --- a/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb +++ b/google-cloud-dialogflow-v2/snippets/knowledge_bases/list_knowledge_bases.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#list_knowledge_bases +# +def list_knowledge_bases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListKnowledgeBasesRequest.new -# Call the list_knowledge_bases method. -result = client.list_knowledge_bases request + # Call the list_knowledge_bases method. + result = client.list_knowledge_bases request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::KnowledgeBase. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::KnowledgeBase. + p response + end end # [END dialogflow_v2_generated_KnowledgeBases_ListKnowledgeBases_sync] diff --git a/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb b/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb index 65659729dcd5..c27e3caf0a36 100755 --- a/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb +++ b/google-cloud-dialogflow-v2/snippets/knowledge_bases/update_knowledge_base.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::KnowledgeBases::Client#update_knowledge_base +# +def update_knowledge_base + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateKnowledgeBaseRequest.new -# Call the update_knowledge_base method. -result = client.update_knowledge_base request + # Call the update_knowledge_base method. + result = client.update_knowledge_base request -# The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::KnowledgeBase. + p result +end # [END dialogflow_v2_generated_KnowledgeBases_UpdateKnowledgeBase_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb b/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb index e0ebf03f7278..c28b8b879879 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/analyze_content.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_AnalyzeContent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#analyze_content +# +def analyze_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new -# Call the analyze_content method. -result = client.analyze_content request + # Call the analyze_content method. + result = client.analyze_content request -# The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse. + p result +end # [END dialogflow_v2_generated_Participants_AnalyzeContent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb b/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb index e86e5844a5fa..b53d37efe9c7 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/create_participant.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_CreateParticipant_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#create_participant +# +def create_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new -# Call the create_participant method. -result = client.create_participant request + # Call the create_participant method. + result = client.create_participant request -# The returned object is of type Google::Cloud::Dialogflow::V2::Participant. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end # [END dialogflow_v2_generated_Participants_CreateParticipant_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb b/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb index d958bb4dceb6..0543d8d1f2e9 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/get_participant.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_GetParticipant_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#get_participant +# +def get_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new -# Call the get_participant method. -result = client.get_participant request + # Call the get_participant method. + result = client.get_participant request -# The returned object is of type Google::Cloud::Dialogflow::V2::Participant. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end # [END dialogflow_v2_generated_Participants_GetParticipant_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb b/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb index 3bf846ac4d56..eade06e2a6dd 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/list_participants.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Participants_ListParticipants_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#list_participants +# +def list_participants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new -# Call the list_participants method. -result = client.list_participants request + # Call the list_participants method. + result = client.list_participants request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Participant. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Participant. + p response + end end # [END dialogflow_v2_generated_Participants_ListParticipants_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb b/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb index 2c1815c7d317..18bfc5bb4c9e 100644 --- a/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/streaming_analyze_content.rb @@ -19,24 +19,30 @@ # [START dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_analyze_content method to start streaming. -output = client.streaming_analyze_content input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new -input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#streaming_analyze_content +# +def streaming_analyze_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_analyze_content method to start streaming. + output = client.streaming_analyze_content input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + input << Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingAnalyzeContentResponse. + output.each do |response| + p response + end end # [END dialogflow_v2_generated_Participants_StreamingAnalyzeContent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb b/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb index 78bdae4e746f..f94bfea30700 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/suggest_articles.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_SuggestArticles_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#suggest_articles +# +def suggest_articles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new -# Call the suggest_articles method. -result = client.suggest_articles request + # Call the suggest_articles method. + result = client.suggest_articles request -# The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse. + p result +end # [END dialogflow_v2_generated_Participants_SuggestArticles_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb b/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb index ab1e6d51eac7..bbade0f016a4 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/suggest_faq_answers.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#suggest_faq_answers +# +def suggest_faq_answers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new -# Call the suggest_faq_answers method. -result = client.suggest_faq_answers request + # Call the suggest_faq_answers method. + result = client.suggest_faq_answers request -# The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse. + p result +end # [END dialogflow_v2_generated_Participants_SuggestFaqAnswers_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb b/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb index 8a799ee333c1..f63883cb160f 100644 --- a/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/suggest_smart_replies.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#suggest_smart_replies +# +def suggest_smart_replies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new -# Call the suggest_smart_replies method. -result = client.suggest_smart_replies request + # Call the suggest_smart_replies method. + result = client.suggest_smart_replies request -# The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse. + p result +end # [END dialogflow_v2_generated_Participants_SuggestSmartReplies_sync] diff --git a/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb b/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb index 315133dcbb81..bfb394cb04f1 100755 --- a/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb +++ b/google-cloud-dialogflow-v2/snippets/participants/update_participant.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Participants_UpdateParticipant_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Participants::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Participants::Client#update_participant +# +def update_participant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Participants::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new -# Call the update_participant method. -result = client.update_participant request + # Call the update_participant method. + result = client.update_participant request -# The returned object is of type Google::Cloud::Dialogflow::V2::Participant. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Participant. + p result +end # [END dialogflow_v2_generated_Participants_UpdateParticipant_sync] diff --git a/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb b/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb index 39ae5505ad17..a593b81dd736 100755 --- a/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/session_entity_types/create_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#create_session_entity_type +# +def create_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new -# Call the create_session_entity_type method. -result = client.create_session_entity_type request + # Call the create_session_entity_type method. + result = client.create_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end # [END dialogflow_v2_generated_SessionEntityTypes_CreateSessionEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb b/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb index 13c5e95dc9a4..067ba30eaca7 100755 --- a/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/session_entity_types/delete_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#delete_session_entity_type +# +def delete_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new -# Call the delete_session_entity_type method. -result = client.delete_session_entity_type request + # Call the delete_session_entity_type method. + result = client.delete_session_entity_type request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_SessionEntityTypes_DeleteSessionEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb b/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb index e22bcb8bd479..36c391ce94d5 100755 --- a/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/session_entity_types/get_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#get_session_entity_type +# +def get_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new -# Call the get_session_entity_type method. -result = client.get_session_entity_type request + # Call the get_session_entity_type method. + result = client.get_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end # [END dialogflow_v2_generated_SessionEntityTypes_GetSessionEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb b/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb index 7f9d916b7b63..6551d1a8099a 100755 --- a/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb +++ b/google-cloud-dialogflow-v2/snippets/session_entity_types/list_session_entity_types.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#list_session_entity_types +# +def list_session_entity_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new -# Call the list_session_entity_types method. -result = client.list_session_entity_types request + # Call the list_session_entity_types method. + result = client.list_session_entity_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::SessionEntityType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::SessionEntityType. + p response + end end # [END dialogflow_v2_generated_SessionEntityTypes_ListSessionEntityTypes_sync] diff --git a/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb b/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb index 12a9adb78ded..33a10bf8dc37 100755 --- a/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb +++ b/google-cloud-dialogflow-v2/snippets/session_entity_types/update_session_entity_type.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client#update_session_entity_type +# +def update_session_entity_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new -# Call the update_session_entity_type method. -result = client.update_session_entity_type request + # Call the update_session_entity_type method. + result = client.update_session_entity_type request -# The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType. + p result +end # [END dialogflow_v2_generated_SessionEntityTypes_UpdateSessionEntityType_sync] diff --git a/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb b/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb index 402a6b9baeb7..21a05e66465d 100755 --- a/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/sessions/detect_intent.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Sessions_DetectIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Sessions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Sessions::Client#detect_intent +# +def detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Sessions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DetectIntentRequest.new -# Call the detect_intent method. -result = client.detect_intent request + # Call the detect_intent method. + result = client.detect_intent request -# The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::DetectIntentResponse. + p result +end # [END dialogflow_v2_generated_Sessions_DetectIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb b/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb index 844e27e5e269..111092f8b70a 100755 --- a/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb +++ b/google-cloud-dialogflow-v2/snippets/sessions/streaming_detect_intent.rb @@ -19,24 +19,30 @@ # [START dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Sessions::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_detect_intent method to start streaming. -output = client.streaming_detect_intent input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new -input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Sessions::Client#streaming_detect_intent +# +def streaming_detect_intent + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Sessions::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_detect_intent method to start streaming. + output = client.streaming_detect_intent input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new + input << Google::Cloud::Dialogflow::V2::StreamingDetectIntentRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Dialogflow::V2::StreamingDetectIntentResponse. + output.each do |response| + p response + end end # [END dialogflow_v2_generated_Sessions_StreamingDetectIntent_sync] diff --git a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json index 3cc5949b409d..39b49db41280 100644 --- a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json +++ b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1926,7 +1926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1966,7 +1966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2006,7 +2006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2046,7 +2046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2086,7 +2086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2126,7 +2126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2166,7 +2166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2206,7 +2206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2246,7 +2246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2286,7 +2286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2326,7 +2326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2366,7 +2366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2406,7 +2406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2446,7 +2446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2486,7 +2486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2526,7 +2526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2566,7 +2566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2606,7 +2606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2646,7 +2646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2686,7 +2686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2726,7 +2726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2766,7 +2766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -2806,7 +2806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -2846,7 +2846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2886,7 +2886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2926,7 +2926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -2966,7 +2966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3006,7 +3006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3046,7 +3046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3086,7 +3086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3126,7 +3126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3166,7 +3166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3206,7 +3206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3246,7 +3246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3286,7 +3286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3326,7 +3326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3366,7 +3366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -3406,7 +3406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3446,7 +3446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3486,7 +3486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3526,7 +3526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3566,7 +3566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3606,7 +3606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3646,7 +3646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3686,7 +3686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3726,7 +3726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3766,7 +3766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3806,7 +3806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3846,7 +3846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3886,7 +3886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -3926,7 +3926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -3966,7 +3966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4006,7 +4006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4046,7 +4046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -4086,7 +4086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-dialogflow-v2/snippets/versions/create_version.rb b/google-cloud-dialogflow-v2/snippets/versions/create_version.rb index 4db343366d2f..b78b8b86974c 100755 --- a/google-cloud-dialogflow-v2/snippets/versions/create_version.rb +++ b/google-cloud-dialogflow-v2/snippets/versions/create_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Versions_CreateVersion_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Versions::Client#create_version +# +def create_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::CreateVersionRequest.new -# Call the create_version method. -result = client.create_version request + # Call the create_version method. + result = client.create_version request -# The returned object is of type Google::Cloud::Dialogflow::V2::Version. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end # [END dialogflow_v2_generated_Versions_CreateVersion_sync] diff --git a/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb b/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb index abd97a604b9d..c6c9541b2c16 100755 --- a/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb +++ b/google-cloud-dialogflow-v2/snippets/versions/delete_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Versions_DeleteVersion_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Versions::Client#delete_version +# +def delete_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::DeleteVersionRequest.new -# Call the delete_version method. -result = client.delete_version request + # Call the delete_version method. + result = client.delete_version request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dialogflow_v2_generated_Versions_DeleteVersion_sync] diff --git a/google-cloud-dialogflow-v2/snippets/versions/get_version.rb b/google-cloud-dialogflow-v2/snippets/versions/get_version.rb index 08a71cd9dc32..1aae1fe6a874 100755 --- a/google-cloud-dialogflow-v2/snippets/versions/get_version.rb +++ b/google-cloud-dialogflow-v2/snippets/versions/get_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Versions_GetVersion_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Versions::Client#get_version +# +def get_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::GetVersionRequest.new -# Call the get_version method. -result = client.get_version request + # Call the get_version method. + result = client.get_version request -# The returned object is of type Google::Cloud::Dialogflow::V2::Version. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end # [END dialogflow_v2_generated_Versions_GetVersion_sync] diff --git a/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb b/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb index 4af5e6225841..2c692742535d 100755 --- a/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb +++ b/google-cloud-dialogflow-v2/snippets/versions/list_versions.rb @@ -19,21 +19,27 @@ # [START dialogflow_v2_generated_Versions_ListVersions_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Versions::Client#list_versions +# +def list_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::ListVersionsRequest.new -# Call the list_versions method. -result = client.list_versions request + # Call the list_versions method. + result = client.list_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dialogflow::V2::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dialogflow::V2::Version. + p response + end end # [END dialogflow_v2_generated_Versions_ListVersions_sync] diff --git a/google-cloud-dialogflow-v2/snippets/versions/update_version.rb b/google-cloud-dialogflow-v2/snippets/versions/update_version.rb index 61c5b8035a20..250dbd305f0e 100755 --- a/google-cloud-dialogflow-v2/snippets/versions/update_version.rb +++ b/google-cloud-dialogflow-v2/snippets/versions/update_version.rb @@ -19,15 +19,21 @@ # [START dialogflow_v2_generated_Versions_UpdateVersion_sync] require "google/cloud/dialogflow/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dialogflow::V2::Versions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dialogflow::V2::Versions::Client#update_version +# +def update_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dialogflow::V2::Versions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dialogflow::V2::UpdateVersionRequest.new -# Call the update_version method. -result = client.update_version request + # Call the update_version method. + result = client.update_version request -# The returned object is of type Google::Cloud::Dialogflow::V2::Version. -p result + # The returned object is of type Google::Cloud::Dialogflow::V2::Version. + p result +end # [END dialogflow_v2_generated_Versions_UpdateVersion_sync] diff --git a/google-cloud-dlp-v2/.rubocop.yml b/google-cloud-dlp-v2/.rubocop.yml index 0150d913c831..a29f692b0af2 100644 --- a/google-cloud-dlp-v2/.rubocop.yml +++ b/google-cloud-dlp-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-dlp-v2.rb" diff --git a/google-cloud-dlp-v2/snippets/Gemfile b/google-cloud-dlp-v2/snippets/Gemfile index 6ac4ff191cfb..8ef80d42b7c1 100755 --- a/google-cloud-dlp-v2/snippets/Gemfile +++ b/google-cloud-dlp-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-dlp-v2/snippets/dlp_service/activate_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/activate_job_trigger.rb index 2eaa99ca40eb..94ef19195fbf 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/activate_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/activate_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_ActivateJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#activate_job_trigger +# +def activate_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ActivateJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ActivateJobTriggerRequest.new -# Call the activate_job_trigger method. -result = client.activate_job_trigger request + # Call the activate_job_trigger method. + result = client.activate_job_trigger request -# The returned object is of type Google::Cloud::Dlp::V2::DlpJob. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + p result +end # [END dlp_v2_generated_DlpService_ActivateJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/cancel_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/cancel_dlp_job.rb index df73698b02b2..4f24f7826b0d 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/cancel_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/cancel_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CancelDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#cancel_dlp_job +# +def cancel_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CancelDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CancelDlpJobRequest.new -# Call the cancel_dlp_job method. -result = client.cancel_dlp_job request + # Call the cancel_dlp_job method. + result = client.cancel_dlp_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_CancelDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/create_deidentify_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/create_deidentify_template.rb index a03fca2f1fcc..34c68af91c97 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/create_deidentify_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/create_deidentify_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CreateDeidentifyTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#create_deidentify_template +# +def create_deidentify_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CreateDeidentifyTemplateRequest.new -# Call the create_deidentify_template method. -result = client.create_deidentify_template request + # Call the create_deidentify_template method. + result = client.create_deidentify_template request -# The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + p result +end # [END dlp_v2_generated_DlpService_CreateDeidentifyTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/create_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/create_dlp_job.rb index 2173838218c8..1a15e6a8826f 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/create_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/create_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CreateDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#create_dlp_job +# +def create_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CreateDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CreateDlpJobRequest.new -# Call the create_dlp_job method. -result = client.create_dlp_job request + # Call the create_dlp_job method. + result = client.create_dlp_job request -# The returned object is of type Google::Cloud::Dlp::V2::DlpJob. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + p result +end # [END dlp_v2_generated_DlpService_CreateDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/create_inspect_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/create_inspect_template.rb index 46ec84143be4..fc6b223c5d77 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/create_inspect_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/create_inspect_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CreateInspectTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#create_inspect_template +# +def create_inspect_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CreateInspectTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CreateInspectTemplateRequest.new -# Call the create_inspect_template method. -result = client.create_inspect_template request + # Call the create_inspect_template method. + result = client.create_inspect_template request -# The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + p result +end # [END dlp_v2_generated_DlpService_CreateInspectTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/create_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/create_job_trigger.rb index ecfb5ed1ff6f..1243a8fef21d 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/create_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/create_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CreateJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#create_job_trigger +# +def create_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CreateJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CreateJobTriggerRequest.new -# Call the create_job_trigger method. -result = client.create_job_trigger request + # Call the create_job_trigger method. + result = client.create_job_trigger request -# The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. -p result + # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + p result +end # [END dlp_v2_generated_DlpService_CreateJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/create_stored_info_type.rb b/google-cloud-dlp-v2/snippets/dlp_service/create_stored_info_type.rb index 25880da9b447..4b3fbbcae544 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/create_stored_info_type.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/create_stored_info_type.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_CreateStoredInfoType_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#create_stored_info_type +# +def create_stored_info_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::CreateStoredInfoTypeRequest.new -# Call the create_stored_info_type method. -result = client.create_stored_info_type request + # Call the create_stored_info_type method. + result = client.create_stored_info_type request -# The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. -p result + # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + p result +end # [END dlp_v2_generated_DlpService_CreateStoredInfoType_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/deidentify_content.rb b/google-cloud-dlp-v2/snippets/dlp_service/deidentify_content.rb index fd6578570310..5357ece40fe9 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/deidentify_content.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/deidentify_content.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeidentifyContent_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#deidentify_content +# +def deidentify_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeidentifyContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeidentifyContentRequest.new -# Call the deidentify_content method. -result = client.deidentify_content request + # Call the deidentify_content method. + result = client.deidentify_content request -# The returned object is of type Google::Cloud::Dlp::V2::DeidentifyContentResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyContentResponse. + p result +end # [END dlp_v2_generated_DlpService_DeidentifyContent_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/delete_deidentify_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/delete_deidentify_template.rb index acde526e8638..10bcf2cfe443 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/delete_deidentify_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/delete_deidentify_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#delete_deidentify_template +# +def delete_deidentify_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeleteDeidentifyTemplateRequest.new -# Call the delete_deidentify_template method. -result = client.delete_deidentify_template request + # Call the delete_deidentify_template method. + result = client.delete_deidentify_template request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_DeleteDeidentifyTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/delete_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/delete_dlp_job.rb index df2d9e404916..14e32b79340e 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/delete_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/delete_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeleteDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#delete_dlp_job +# +def delete_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeleteDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeleteDlpJobRequest.new -# Call the delete_dlp_job method. -result = client.delete_dlp_job request + # Call the delete_dlp_job method. + result = client.delete_dlp_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_DeleteDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/delete_inspect_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/delete_inspect_template.rb index 063ed6f81069..ef31c29567b7 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/delete_inspect_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/delete_inspect_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeleteInspectTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#delete_inspect_template +# +def delete_inspect_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeleteInspectTemplateRequest.new -# Call the delete_inspect_template method. -result = client.delete_inspect_template request + # Call the delete_inspect_template method. + result = client.delete_inspect_template request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_DeleteInspectTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/delete_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/delete_job_trigger.rb index 19d5e2a2695e..992f1c632f43 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/delete_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/delete_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeleteJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#delete_job_trigger +# +def delete_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeleteJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeleteJobTriggerRequest.new -# Call the delete_job_trigger method. -result = client.delete_job_trigger request + # Call the delete_job_trigger method. + result = client.delete_job_trigger request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_DeleteJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/delete_stored_info_type.rb b/google-cloud-dlp-v2/snippets/dlp_service/delete_stored_info_type.rb index 8a97003031d1..4bd60de255fd 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/delete_stored_info_type.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/delete_stored_info_type.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_DeleteStoredInfoType_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#delete_stored_info_type +# +def delete_stored_info_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::DeleteStoredInfoTypeRequest.new -# Call the delete_stored_info_type method. -result = client.delete_stored_info_type request + # Call the delete_stored_info_type method. + result = client.delete_stored_info_type request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_DeleteStoredInfoType_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/finish_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/finish_dlp_job.rb index 04d29c3fa17b..d22b69139c10 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/finish_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/finish_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_FinishDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#finish_dlp_job +# +def finish_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::FinishDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::FinishDlpJobRequest.new -# Call the finish_dlp_job method. -result = client.finish_dlp_job request + # Call the finish_dlp_job method. + result = client.finish_dlp_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END dlp_v2_generated_DlpService_FinishDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/get_deidentify_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/get_deidentify_template.rb index 9f3b25d0dff4..4f9f202d6a86 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/get_deidentify_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/get_deidentify_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_GetDeidentifyTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#get_deidentify_template +# +def get_deidentify_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::GetDeidentifyTemplateRequest.new -# Call the get_deidentify_template method. -result = client.get_deidentify_template request + # Call the get_deidentify_template method. + result = client.get_deidentify_template request -# The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + p result +end # [END dlp_v2_generated_DlpService_GetDeidentifyTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/get_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/get_dlp_job.rb index 869336dad0a0..4eb10cbc445b 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/get_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/get_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_GetDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#get_dlp_job +# +def get_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::GetDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::GetDlpJobRequest.new -# Call the get_dlp_job method. -result = client.get_dlp_job request + # Call the get_dlp_job method. + result = client.get_dlp_job request -# The returned object is of type Google::Cloud::Dlp::V2::DlpJob. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DlpJob. + p result +end # [END dlp_v2_generated_DlpService_GetDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/get_inspect_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/get_inspect_template.rb index 8c7e7571c697..d9090fdd89c4 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/get_inspect_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/get_inspect_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_GetInspectTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#get_inspect_template +# +def get_inspect_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::GetInspectTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::GetInspectTemplateRequest.new -# Call the get_inspect_template method. -result = client.get_inspect_template request + # Call the get_inspect_template method. + result = client.get_inspect_template request -# The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + p result +end # [END dlp_v2_generated_DlpService_GetInspectTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/get_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/get_job_trigger.rb index f96e377e8b69..1083d619051b 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/get_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/get_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_GetJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#get_job_trigger +# +def get_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::GetJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::GetJobTriggerRequest.new -# Call the get_job_trigger method. -result = client.get_job_trigger request + # Call the get_job_trigger method. + result = client.get_job_trigger request -# The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. -p result + # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + p result +end # [END dlp_v2_generated_DlpService_GetJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/get_stored_info_type.rb b/google-cloud-dlp-v2/snippets/dlp_service/get_stored_info_type.rb index 9059c2b5646e..4c26ea3fb159 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/get_stored_info_type.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/get_stored_info_type.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_GetStoredInfoType_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#get_stored_info_type +# +def get_stored_info_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::GetStoredInfoTypeRequest.new -# Call the get_stored_info_type method. -result = client.get_stored_info_type request + # Call the get_stored_info_type method. + result = client.get_stored_info_type request -# The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. -p result + # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + p result +end # [END dlp_v2_generated_DlpService_GetStoredInfoType_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_dlp_job.rb b/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_dlp_job.rb index bc522b2f7614..86fe816b62f1 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_dlp_job.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_dlp_job.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_HybridInspectDlpJob_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#hybrid_inspect_dlp_job +# +def hybrid_inspect_dlp_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::HybridInspectDlpJobRequest.new -# Call the hybrid_inspect_dlp_job method. -result = client.hybrid_inspect_dlp_job request + # Call the hybrid_inspect_dlp_job method. + result = client.hybrid_inspect_dlp_job request -# The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. + p result +end # [END dlp_v2_generated_DlpService_HybridInspectDlpJob_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_job_trigger.rb index 0ac34b5fb096..f6e7f1af4d9f 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/hybrid_inspect_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_HybridInspectJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#hybrid_inspect_job_trigger +# +def hybrid_inspect_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::HybridInspectJobTriggerRequest.new -# Call the hybrid_inspect_job_trigger method. -result = client.hybrid_inspect_job_trigger request + # Call the hybrid_inspect_job_trigger method. + result = client.hybrid_inspect_job_trigger request -# The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::HybridInspectResponse. + p result +end # [END dlp_v2_generated_DlpService_HybridInspectJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/inspect_content.rb b/google-cloud-dlp-v2/snippets/dlp_service/inspect_content.rb index aa8aef83e1f1..85eba7533015 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/inspect_content.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/inspect_content.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_InspectContent_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#inspect_content +# +def inspect_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::InspectContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::InspectContentRequest.new -# Call the inspect_content method. -result = client.inspect_content request + # Call the inspect_content method. + result = client.inspect_content request -# The returned object is of type Google::Cloud::Dlp::V2::InspectContentResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::InspectContentResponse. + p result +end # [END dlp_v2_generated_DlpService_InspectContent_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_deidentify_templates.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_deidentify_templates.rb index 4f68b6c086a7..cb97faaa1b0b 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_deidentify_templates.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_deidentify_templates.rb @@ -19,21 +19,27 @@ # [START dlp_v2_generated_DlpService_ListDeidentifyTemplates_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_deidentify_templates +# +def list_deidentify_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListDeidentifyTemplatesRequest.new -# Call the list_deidentify_templates method. -result = client.list_deidentify_templates request + # Call the list_deidentify_templates method. + result = client.list_deidentify_templates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dlp::V2::DeidentifyTemplate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dlp::V2::DeidentifyTemplate. + p response + end end # [END dlp_v2_generated_DlpService_ListDeidentifyTemplates_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_dlp_jobs.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_dlp_jobs.rb index 594ebd566e74..f4280149a5e7 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_dlp_jobs.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_dlp_jobs.rb @@ -19,21 +19,27 @@ # [START dlp_v2_generated_DlpService_ListDlpJobs_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_dlp_jobs +# +def list_dlp_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListDlpJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListDlpJobsRequest.new -# Call the list_dlp_jobs method. -result = client.list_dlp_jobs request + # Call the list_dlp_jobs method. + result = client.list_dlp_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dlp::V2::DlpJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dlp::V2::DlpJob. + p response + end end # [END dlp_v2_generated_DlpService_ListDlpJobs_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_info_types.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_info_types.rb index c7ca16c8b487..2d215052a609 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_info_types.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_info_types.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_ListInfoTypes_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_info_types +# +def list_info_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListInfoTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListInfoTypesRequest.new -# Call the list_info_types method. -result = client.list_info_types request + # Call the list_info_types method. + result = client.list_info_types request -# The returned object is of type Google::Cloud::Dlp::V2::ListInfoTypesResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::ListInfoTypesResponse. + p result +end # [END dlp_v2_generated_DlpService_ListInfoTypes_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_inspect_templates.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_inspect_templates.rb index 48aa954a80cf..c84960e09064 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_inspect_templates.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_inspect_templates.rb @@ -19,21 +19,27 @@ # [START dlp_v2_generated_DlpService_ListInspectTemplates_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_inspect_templates +# +def list_inspect_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListInspectTemplatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListInspectTemplatesRequest.new -# Call the list_inspect_templates method. -result = client.list_inspect_templates request + # Call the list_inspect_templates method. + result = client.list_inspect_templates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dlp::V2::InspectTemplate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dlp::V2::InspectTemplate. + p response + end end # [END dlp_v2_generated_DlpService_ListInspectTemplates_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_job_triggers.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_job_triggers.rb index c3396407821c..91e4864a49c3 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_job_triggers.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_job_triggers.rb @@ -19,21 +19,27 @@ # [START dlp_v2_generated_DlpService_ListJobTriggers_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_job_triggers +# +def list_job_triggers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListJobTriggersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListJobTriggersRequest.new -# Call the list_job_triggers method. -result = client.list_job_triggers request + # Call the list_job_triggers method. + result = client.list_job_triggers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dlp::V2::JobTrigger. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dlp::V2::JobTrigger. + p response + end end # [END dlp_v2_generated_DlpService_ListJobTriggers_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/list_stored_info_types.rb b/google-cloud-dlp-v2/snippets/dlp_service/list_stored_info_types.rb index 79b1855de71b..f3550d278cbe 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/list_stored_info_types.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/list_stored_info_types.rb @@ -19,21 +19,27 @@ # [START dlp_v2_generated_DlpService_ListStoredInfoTypes_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#list_stored_info_types +# +def list_stored_info_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ListStoredInfoTypesRequest.new -# Call the list_stored_info_types method. -result = client.list_stored_info_types request + # Call the list_stored_info_types method. + result = client.list_stored_info_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Dlp::V2::StoredInfoType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Dlp::V2::StoredInfoType. + p response + end end # [END dlp_v2_generated_DlpService_ListStoredInfoTypes_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/redact_image.rb b/google-cloud-dlp-v2/snippets/dlp_service/redact_image.rb index 122ca0d7feca..dfc727dc08bb 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/redact_image.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/redact_image.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_RedactImage_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#redact_image +# +def redact_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::RedactImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::RedactImageRequest.new -# Call the redact_image method. -result = client.redact_image request + # Call the redact_image method. + result = client.redact_image request -# The returned object is of type Google::Cloud::Dlp::V2::RedactImageResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::RedactImageResponse. + p result +end # [END dlp_v2_generated_DlpService_RedactImage_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/reidentify_content.rb b/google-cloud-dlp-v2/snippets/dlp_service/reidentify_content.rb index 249aefc6c645..e4c367b943f2 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/reidentify_content.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/reidentify_content.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_ReidentifyContent_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#reidentify_content +# +def reidentify_content + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::ReidentifyContentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::ReidentifyContentRequest.new -# Call the reidentify_content method. -result = client.reidentify_content request + # Call the reidentify_content method. + result = client.reidentify_content request -# The returned object is of type Google::Cloud::Dlp::V2::ReidentifyContentResponse. -p result + # The returned object is of type Google::Cloud::Dlp::V2::ReidentifyContentResponse. + p result +end # [END dlp_v2_generated_DlpService_ReidentifyContent_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/update_deidentify_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/update_deidentify_template.rb index aafa135d3fe4..36d6aec924bc 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/update_deidentify_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/update_deidentify_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#update_deidentify_template +# +def update_deidentify_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::UpdateDeidentifyTemplateRequest.new -# Call the update_deidentify_template method. -result = client.update_deidentify_template request + # Call the update_deidentify_template method. + result = client.update_deidentify_template request -# The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::DeidentifyTemplate. + p result +end # [END dlp_v2_generated_DlpService_UpdateDeidentifyTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/update_inspect_template.rb b/google-cloud-dlp-v2/snippets/dlp_service/update_inspect_template.rb index 1b9ea0b0c889..3da6c1b94739 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/update_inspect_template.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/update_inspect_template.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_UpdateInspectTemplate_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#update_inspect_template +# +def update_inspect_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::UpdateInspectTemplateRequest.new -# Call the update_inspect_template method. -result = client.update_inspect_template request + # Call the update_inspect_template method. + result = client.update_inspect_template request -# The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. -p result + # The returned object is of type Google::Cloud::Dlp::V2::InspectTemplate. + p result +end # [END dlp_v2_generated_DlpService_UpdateInspectTemplate_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/update_job_trigger.rb b/google-cloud-dlp-v2/snippets/dlp_service/update_job_trigger.rb index d37940ae983f..654d3aa89df0 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/update_job_trigger.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/update_job_trigger.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_UpdateJobTrigger_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#update_job_trigger +# +def update_job_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::UpdateJobTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::UpdateJobTriggerRequest.new -# Call the update_job_trigger method. -result = client.update_job_trigger request + # Call the update_job_trigger method. + result = client.update_job_trigger request -# The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. -p result + # The returned object is of type Google::Cloud::Dlp::V2::JobTrigger. + p result +end # [END dlp_v2_generated_DlpService_UpdateJobTrigger_sync] diff --git a/google-cloud-dlp-v2/snippets/dlp_service/update_stored_info_type.rb b/google-cloud-dlp-v2/snippets/dlp_service/update_stored_info_type.rb index 7852bb3fad67..2a0ac8acce1d 100755 --- a/google-cloud-dlp-v2/snippets/dlp_service/update_stored_info_type.rb +++ b/google-cloud-dlp-v2/snippets/dlp_service/update_stored_info_type.rb @@ -19,15 +19,21 @@ # [START dlp_v2_generated_DlpService_UpdateStoredInfoType_sync] require "google/cloud/dlp/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Dlp::V2::DlpService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Dlp::V2::DlpService::Client#update_stored_info_type +# +def update_stored_info_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Dlp::V2::DlpService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Dlp::V2::UpdateStoredInfoTypeRequest.new -# Call the update_stored_info_type method. -result = client.update_stored_info_type request + # Call the update_stored_info_type method. + result = client.update_stored_info_type request -# The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. -p result + # The returned object is of type Google::Cloud::Dlp::V2::StoredInfoType. + p result +end # [END dlp_v2_generated_DlpService_UpdateStoredInfoType_sync] diff --git a/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json b/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json index 5e67ab83e9b9..c2a2e02fb2b2 100644 --- a/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json +++ b/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-document_ai-v1/.rubocop.yml b/google-cloud-document_ai-v1/.rubocop.yml index 5a9f241493b2..81caad112a12 100644 --- a/google-cloud-document_ai-v1/.rubocop.yml +++ b/google-cloud-document_ai-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-document_ai-v1.rb" diff --git a/google-cloud-document_ai-v1/snippets/Gemfile b/google-cloud-document_ai-v1/snippets/Gemfile index 04fdf37bb16d..d69dc0da458f 100755 --- a/google-cloud-document_ai-v1/snippets/Gemfile +++ b/google-cloud-document_ai-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb index 7d92cdc51279..88d7e5d786a7 100755 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/batch_process_documents.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#batch_process_documents +# +def batch_process_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::BatchProcessRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::BatchProcessRequest.new -# Call the batch_process_documents method. -result = client.batch_process_documents request + # Call the batch_process_documents method. + result = client.batch_process_documents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb index efd803036c16..cfaf5e2eadaf 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/create_processor.rb @@ -19,15 +19,21 @@ # [START documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#create_processor +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::CreateProcessorRequest.new -# Call the create_processor method. -result = client.create_processor request + # Call the create_processor method. + result = client.create_processor request -# The returned object is of type Google::Cloud::DocumentAI::V1::Processor. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + p result +end # [END documentai_v1_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb index 6921f2e034c2..cc090a05ae81 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_DeleteProcessor_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::DeleteProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::DeleteProcessorRequest.new -# Call the delete_processor method. -result = client.delete_processor request + # Call the delete_processor method. + result = client.delete_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb index 5297d76c9326..c5e9b6d056ee 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/delete_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#delete_processor_version +# +def delete_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::DeleteProcessorVersionRequest.new -# Call the delete_processor_version method. -result = client.delete_processor_version request + # Call the delete_processor_version method. + result = client.delete_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb index 9af21dc85c63..09c6590e55bd 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/deploy_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#deploy_processor_version +# +def deploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::DeployProcessorVersionRequest.new -# Call the deploy_processor_version method. -result = client.deploy_processor_version request + # Call the deploy_processor_version method. + result = client.deploy_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb index a9f6c386d298..ed615fff1a22 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/disable_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_DisableProcessor_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#disable_processor +# +def disable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::DisableProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::DisableProcessorRequest.new -# Call the disable_processor method. -result = client.disable_processor request + # Call the disable_processor method. + result = client.disable_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb index c3cb56439d34..799a77282f57 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/enable_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_EnableProcessor_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#enable_processor +# +def enable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::EnableProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::EnableProcessorRequest.new -# Call the enable_processor method. -result = client.enable_processor request + # Call the enable_processor method. + result = client.enable_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb index 6b5028447123..6085b03bf451 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/fetch_processor_types.rb @@ -19,15 +19,21 @@ # [START documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types +# +def fetch_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::FetchProcessorTypesRequest.new -# Call the fetch_processor_types method. -result = client.fetch_processor_types request + # Call the fetch_processor_types method. + result = client.fetch_processor_types request -# The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1::FetchProcessorTypesResponse. + p result +end # [END documentai_v1_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb index cb637635500a..332ee174d8b8 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor.rb @@ -19,15 +19,21 @@ # [START documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetProcessorRequest.new -# Call the get_processor method. -result = client.get_processor request + # Call the get_processor method. + result = client.get_processor request -# The returned object is of type Google::Cloud::DocumentAI::V1::Processor. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1::Processor. + p result +end # [END documentai_v1_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb index a275a83bc1d3..ea2d8b3a2af4 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/get_processor_version.rb @@ -19,15 +19,21 @@ # [START documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#get_processor_version +# +def get_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::GetProcessorVersionRequest.new -# Call the get_processor_version method. -result = client.get_processor_version request + # Call the get_processor_version method. + result = client.get_processor_version request -# The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessorVersion. + p result +end # [END documentai_v1_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb index ee8bbaa96007..45f25af92f16 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_types.rb @@ -19,21 +19,27 @@ # [START documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_types +# +def list_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ListProcessorTypesRequest.new -# Call the list_processor_types method. -result = client.list_processor_types request + # Call the list_processor_types method. + result = client.list_processor_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorType. + p response + end end # [END documentai_v1_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb index b7e2ff6ec5c4..ed7733d6b9e3 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processor_versions.rb @@ -19,21 +19,27 @@ # [START documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processor_versions +# +def list_processor_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ListProcessorVersionsRequest.new -# Call the list_processor_versions method. -result = client.list_processor_versions request + # Call the list_processor_versions method. + result = client.list_processor_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1::ProcessorVersion. + p response + end end # [END documentai_v1_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb index 73257a44f84f..71e2d8a42684 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/list_processors.rb @@ -19,21 +19,27 @@ # [START documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#list_processors +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::ListProcessorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ListProcessorsRequest.new -# Call the list_processors method. -result = client.list_processors request + # Call the list_processors method. + result = client.list_processors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1::Processor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1::Processor. + p response + end end # [END documentai_v1_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb index 3236cb343659..5e7f83150dc0 100755 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/process_document.rb @@ -19,15 +19,21 @@ # [START documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#process_document +# +def process_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::ProcessRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ProcessRequest.new -# Call the process_document method. -result = client.process_document request + # Call the process_document method. + result = client.process_document request -# The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1::ProcessResponse. + p result +end # [END documentai_v1_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb index cd200fb68a3e..a043f9f06877 100755 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/review_document.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_ReviewDocument_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#review_document +# +def review_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::ReviewDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::ReviewDocumentRequest.new -# Call the review_document method. -result = client.review_document request + # Call the review_document method. + result = client.review_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb index 4279740ca36a..ab5612527820 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/set_default_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#set_default_processor_version +# +def set_default_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::SetDefaultProcessorVersionRequest.new -# Call the set_default_processor_version method. -result = client.set_default_processor_version request + # Call the set_default_processor_version method. + result = client.set_default_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb b/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb index cd6e02eb465d..6c538289d555 100644 --- a/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb +++ b/google-cloud-document_ai-v1/snippets/document_processor_service/undeploy_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] require "google/cloud/document_ai/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#undeploy_processor_version +# +def undeploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1::UndeployProcessorVersionRequest.new -# Call the undeploy_processor_version method. -result = client.undeploy_processor_version request + # Call the undeploy_processor_version method. + result = client.undeploy_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json b/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json index 5af795e22b37..fd60a3a548de 100644 --- a/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json +++ b/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-document_ai-v1beta3/.rubocop.yml b/google-cloud-document_ai-v1beta3/.rubocop.yml index bcfb999d0689..945616d355d4 100644 --- a/google-cloud-document_ai-v1beta3/.rubocop.yml +++ b/google-cloud-document_ai-v1beta3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-document_ai-v1beta3.rb" diff --git a/google-cloud-document_ai-v1beta3/snippets/Gemfile b/google-cloud-document_ai-v1beta3/snippets/Gemfile index c2087b9b2873..cc38821b4df4 100755 --- a/google-cloud-document_ai-v1beta3/snippets/Gemfile +++ b/google-cloud-document_ai-v1beta3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb index 0d7cc2b96974..6ad6334c0a94 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/batch_process_documents.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#batch_process_documents +# +def batch_process_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::BatchProcessRequest.new -# Call the batch_process_documents method. -result = client.batch_process_documents request + # Call the batch_process_documents method. + result = client.batch_process_documents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_BatchProcessDocuments_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb index 69a6b59f48ba..44c1349bcdda 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/create_processor.rb @@ -19,15 +19,21 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#create_processor +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::CreateProcessorRequest.new -# Call the create_processor method. -result = client.create_processor request + # Call the create_processor method. + result = client.create_processor request -# The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end # [END documentai_v1beta3_generated_DocumentProcessorService_CreateProcessor_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb index 14b541f99206..d2068448b020 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorRequest.new -# Call the delete_processor method. -result = client.delete_processor request + # Call the delete_processor method. + result = client.delete_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessor_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb index 1292f1632092..50ea758a2b9f 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/delete_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#delete_processor_version +# +def delete_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeleteProcessorVersionRequest.new -# Call the delete_processor_version method. -result = client.delete_processor_version request + # Call the delete_processor_version method. + result = client.delete_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_DeleteProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb index 9ab342bba820..48e63d7afef7 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/deploy_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#deploy_processor_version +# +def deploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DeployProcessorVersionRequest.new -# Call the deploy_processor_version method. -result = client.deploy_processor_version request + # Call the deploy_processor_version method. + result = client.deploy_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_DeployProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb index d0efaedb0611..8930886e7b7d 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/disable_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#disable_processor +# +def disable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::DisableProcessorRequest.new -# Call the disable_processor method. -result = client.disable_processor request + # Call the disable_processor method. + result = client.disable_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_DisableProcessor_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb index 7daafcb2c5cb..98653ed8315c 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/enable_processor.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#enable_processor +# +def enable_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EnableProcessorRequest.new -# Call the enable_processor method. -result = client.enable_processor request + # Call the enable_processor method. + result = client.enable_processor request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_EnableProcessor_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb index d213e22469c3..9687bbc09c5f 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/fetch_processor_types.rb @@ -19,15 +19,21 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types +# +def fetch_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesRequest.new -# Call the fetch_processor_types method. -result = client.fetch_processor_types request + # Call the fetch_processor_types method. + result = client.fetch_processor_types request -# The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::FetchProcessorTypesResponse. + p result +end # [END documentai_v1beta3_generated_DocumentProcessorService_FetchProcessorTypes_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb index 52d5c1eb8181..1e32e737dfd0 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor.rb @@ -19,15 +19,21 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest.new -# Call the get_processor method. -result = client.get_processor request + # Call the get_processor method. + result = client.get_processor request -# The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Processor. + p result +end # [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessor_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb index 5426bed4dd49..d6f23e5ccae6 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_processor_version.rb @@ -19,15 +19,21 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_processor_version +# +def get_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest.new -# Call the get_processor_version method. -result = client.get_processor_version request + # Call the get_processor_version method. + result = client.get_processor_version request -# The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p result +end # [END documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb index ca987b579b30..06d4388aeea3 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_types.rb @@ -19,21 +19,27 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_types +# +def list_processor_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorTypesRequest.new -# Call the list_processor_types method. -result = client.list_processor_types request + # Call the list_processor_types method. + result = client.list_processor_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorType. + p response + end end # [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorTypes_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb index 8302505dcc5b..86ba641a872b 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processor_versions.rb @@ -19,21 +19,27 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processor_versions +# +def list_processor_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorVersionsRequest.new -# Call the list_processor_versions method. -result = client.list_processor_versions request + # Call the list_processor_versions method. + result = client.list_processor_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion. + p response + end end # [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessorVersions_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb index af9aa4ead312..520caeed9569 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_processors.rb @@ -19,21 +19,27 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_processors +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest.new -# Call the list_processors method. -result = client.list_processors request + # Call the list_processors method. + result = client.list_processors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Processor. + p response + end end # [END documentai_v1beta3_generated_DocumentProcessorService_ListProcessors_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb index 51a466725943..ab5e9a8a2946 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/process_document.rb @@ -19,15 +19,21 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#process_document +# +def process_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ProcessRequest.new -# Call the process_document method. -result = client.process_document request + # Call the process_document method. + result = client.process_document request -# The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. -p result + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::ProcessResponse. + p result +end # [END documentai_v1beta3_generated_DocumentProcessorService_ProcessDocument_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb index 557b328d3882..7e8014ca3c46 100755 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/review_document.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#review_document +# +def review_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest.new -# Call the review_document method. -result = client.review_document request + # Call the review_document method. + result = client.review_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_ReviewDocument_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb index 79a343655bb6..a0392eee5565 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/set_default_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#set_default_processor_version +# +def set_default_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::SetDefaultProcessorVersionRequest.new -# Call the set_default_processor_version method. -result = client.set_default_processor_version request + # Call the set_default_processor_version method. + result = client.set_default_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_SetDefaultProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb index 90771de70c2f..730fda169920 100644 --- a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/undeploy_processor_version.rb @@ -19,22 +19,28 @@ # [START documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] require "google/cloud/document_ai/v1beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#undeploy_processor_version +# +def undeploy_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::UndeployProcessorVersionRequest.new -# Call the undeploy_processor_version method. -result = client.undeploy_processor_version request + # Call the undeploy_processor_version method. + result = client.undeploy_processor_version request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END documentai_v1beta3_generated_DocumentProcessorService_UndeployProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json index d92827c4da4a..417b1497b0d1 100644 --- a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json +++ b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-domains-v1/.rubocop.yml b/google-cloud-domains-v1/.rubocop.yml index 03e934e39823..f7175338efc9 100644 --- a/google-cloud-domains-v1/.rubocop.yml +++ b/google-cloud-domains-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-domains-v1.rb" diff --git a/google-cloud-domains-v1/snippets/Gemfile b/google-cloud-domains-v1/snippets/Gemfile index ee01707886fd..d6b8a1044671 100644 --- a/google-cloud-domains-v1/snippets/Gemfile +++ b/google-cloud-domains-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-domains-v1/snippets/domains/configure_contact_settings.rb b/google-cloud-domains-v1/snippets/domains/configure_contact_settings.rb index 84ba2d2de21c..33c808cb7c6a 100644 --- a/google-cloud-domains-v1/snippets/domains/configure_contact_settings.rb +++ b/google-cloud-domains-v1/snippets/domains/configure_contact_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_ConfigureContactSettings_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#configure_contact_settings +# +def configure_contact_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ConfigureContactSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ConfigureContactSettingsRequest.new -# Call the configure_contact_settings method. -result = client.configure_contact_settings request + # Call the configure_contact_settings method. + result = client.configure_contact_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_ConfigureContactSettings_sync] diff --git a/google-cloud-domains-v1/snippets/domains/configure_dns_settings.rb b/google-cloud-domains-v1/snippets/domains/configure_dns_settings.rb index c4e0bcd881b3..f1a995589c32 100644 --- a/google-cloud-domains-v1/snippets/domains/configure_dns_settings.rb +++ b/google-cloud-domains-v1/snippets/domains/configure_dns_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_ConfigureDnsSettings_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#configure_dns_settings +# +def configure_dns_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ConfigureDnsSettingsRequest.new -# Call the configure_dns_settings method. -result = client.configure_dns_settings request + # Call the configure_dns_settings method. + result = client.configure_dns_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_ConfigureDnsSettings_sync] diff --git a/google-cloud-domains-v1/snippets/domains/configure_management_settings.rb b/google-cloud-domains-v1/snippets/domains/configure_management_settings.rb index 1fbd12e63151..8da4850a603a 100644 --- a/google-cloud-domains-v1/snippets/domains/configure_management_settings.rb +++ b/google-cloud-domains-v1/snippets/domains/configure_management_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_ConfigureManagementSettings_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#configure_management_settings +# +def configure_management_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ConfigureManagementSettingsRequest.new -# Call the configure_management_settings method. -result = client.configure_management_settings request + # Call the configure_management_settings method. + result = client.configure_management_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_ConfigureManagementSettings_sync] diff --git a/google-cloud-domains-v1/snippets/domains/delete_registration.rb b/google-cloud-domains-v1/snippets/domains/delete_registration.rb index 47c0efa61baa..d7b617df2c6d 100644 --- a/google-cloud-domains-v1/snippets/domains/delete_registration.rb +++ b/google-cloud-domains-v1/snippets/domains/delete_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_DeleteRegistration_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#delete_registration +# +def delete_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::DeleteRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::DeleteRegistrationRequest.new -# Call the delete_registration method. -result = client.delete_registration request + # Call the delete_registration method. + result = client.delete_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_DeleteRegistration_sync] diff --git a/google-cloud-domains-v1/snippets/domains/export_registration.rb b/google-cloud-domains-v1/snippets/domains/export_registration.rb index 70801579ffa8..2d6c8e6aadcc 100644 --- a/google-cloud-domains-v1/snippets/domains/export_registration.rb +++ b/google-cloud-domains-v1/snippets/domains/export_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_ExportRegistration_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#export_registration +# +def export_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ExportRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ExportRegistrationRequest.new -# Call the export_registration method. -result = client.export_registration request + # Call the export_registration method. + result = client.export_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_ExportRegistration_sync] diff --git a/google-cloud-domains-v1/snippets/domains/get_registration.rb b/google-cloud-domains-v1/snippets/domains/get_registration.rb index d6f28d44c71f..a4824ff0a92d 100644 --- a/google-cloud-domains-v1/snippets/domains/get_registration.rb +++ b/google-cloud-domains-v1/snippets/domains/get_registration.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_GetRegistration_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#get_registration +# +def get_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::GetRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::GetRegistrationRequest.new -# Call the get_registration method. -result = client.get_registration request + # Call the get_registration method. + result = client.get_registration request -# The returned object is of type Google::Cloud::Domains::V1::Registration. -p result + # The returned object is of type Google::Cloud::Domains::V1::Registration. + p result +end # [END domains_v1_generated_Domains_GetRegistration_sync] diff --git a/google-cloud-domains-v1/snippets/domains/list_registrations.rb b/google-cloud-domains-v1/snippets/domains/list_registrations.rb index 930ae8231692..9c3380fa6841 100644 --- a/google-cloud-domains-v1/snippets/domains/list_registrations.rb +++ b/google-cloud-domains-v1/snippets/domains/list_registrations.rb @@ -19,21 +19,27 @@ # [START domains_v1_generated_Domains_ListRegistrations_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#list_registrations +# +def list_registrations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ListRegistrationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ListRegistrationsRequest.new -# Call the list_registrations method. -result = client.list_registrations request + # Call the list_registrations method. + result = client.list_registrations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Domains::V1::Registration. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Domains::V1::Registration. + p response + end end # [END domains_v1_generated_Domains_ListRegistrations_sync] diff --git a/google-cloud-domains-v1/snippets/domains/register_domain.rb b/google-cloud-domains-v1/snippets/domains/register_domain.rb index 3e29e8381301..1c55a9cc9c4f 100644 --- a/google-cloud-domains-v1/snippets/domains/register_domain.rb +++ b/google-cloud-domains-v1/snippets/domains/register_domain.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_RegisterDomain_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#register_domain +# +def register_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::RegisterDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::RegisterDomainRequest.new -# Call the register_domain method. -result = client.register_domain request + # Call the register_domain method. + result = client.register_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_RegisterDomain_sync] diff --git a/google-cloud-domains-v1/snippets/domains/reset_authorization_code.rb b/google-cloud-domains-v1/snippets/domains/reset_authorization_code.rb index 689519a637be..151e51f6b90d 100644 --- a/google-cloud-domains-v1/snippets/domains/reset_authorization_code.rb +++ b/google-cloud-domains-v1/snippets/domains/reset_authorization_code.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_ResetAuthorizationCode_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#reset_authorization_code +# +def reset_authorization_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::ResetAuthorizationCodeRequest.new -# Call the reset_authorization_code method. -result = client.reset_authorization_code request + # Call the reset_authorization_code method. + result = client.reset_authorization_code request -# The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. -p result + # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. + p result +end # [END domains_v1_generated_Domains_ResetAuthorizationCode_sync] diff --git a/google-cloud-domains-v1/snippets/domains/retrieve_authorization_code.rb b/google-cloud-domains-v1/snippets/domains/retrieve_authorization_code.rb index b1b81072a9fa..e880ed8d75ac 100644 --- a/google-cloud-domains-v1/snippets/domains/retrieve_authorization_code.rb +++ b/google-cloud-domains-v1/snippets/domains/retrieve_authorization_code.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_RetrieveAuthorizationCode_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#retrieve_authorization_code +# +def retrieve_authorization_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::RetrieveAuthorizationCodeRequest.new -# Call the retrieve_authorization_code method. -result = client.retrieve_authorization_code request + # Call the retrieve_authorization_code method. + result = client.retrieve_authorization_code request -# The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. -p result + # The returned object is of type Google::Cloud::Domains::V1::AuthorizationCode. + p result +end # [END domains_v1_generated_Domains_RetrieveAuthorizationCode_sync] diff --git a/google-cloud-domains-v1/snippets/domains/retrieve_register_parameters.rb b/google-cloud-domains-v1/snippets/domains/retrieve_register_parameters.rb index 5dd6cb2b8ce9..5f45d836895c 100644 --- a/google-cloud-domains-v1/snippets/domains/retrieve_register_parameters.rb +++ b/google-cloud-domains-v1/snippets/domains/retrieve_register_parameters.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_RetrieveRegisterParameters_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#retrieve_register_parameters +# +def retrieve_register_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::RetrieveRegisterParametersRequest.new -# Call the retrieve_register_parameters method. -result = client.retrieve_register_parameters request + # Call the retrieve_register_parameters method. + result = client.retrieve_register_parameters request -# The returned object is of type Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1::RetrieveRegisterParametersResponse. + p result +end # [END domains_v1_generated_Domains_RetrieveRegisterParameters_sync] diff --git a/google-cloud-domains-v1/snippets/domains/retrieve_transfer_parameters.rb b/google-cloud-domains-v1/snippets/domains/retrieve_transfer_parameters.rb index 96f6b647e821..b79673ecbf60 100644 --- a/google-cloud-domains-v1/snippets/domains/retrieve_transfer_parameters.rb +++ b/google-cloud-domains-v1/snippets/domains/retrieve_transfer_parameters.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_RetrieveTransferParameters_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#retrieve_transfer_parameters +# +def retrieve_transfer_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::RetrieveTransferParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::RetrieveTransferParametersRequest.new -# Call the retrieve_transfer_parameters method. -result = client.retrieve_transfer_parameters request + # Call the retrieve_transfer_parameters method. + result = client.retrieve_transfer_parameters request -# The returned object is of type Google::Cloud::Domains::V1::RetrieveTransferParametersResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1::RetrieveTransferParametersResponse. + p result +end # [END domains_v1_generated_Domains_RetrieveTransferParameters_sync] diff --git a/google-cloud-domains-v1/snippets/domains/search_domains.rb b/google-cloud-domains-v1/snippets/domains/search_domains.rb index 9fcb2d43a0b9..410abbbfc012 100644 --- a/google-cloud-domains-v1/snippets/domains/search_domains.rb +++ b/google-cloud-domains-v1/snippets/domains/search_domains.rb @@ -19,15 +19,21 @@ # [START domains_v1_generated_Domains_SearchDomains_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#search_domains +# +def search_domains + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::SearchDomainsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::SearchDomainsRequest.new -# Call the search_domains method. -result = client.search_domains request + # Call the search_domains method. + result = client.search_domains request -# The returned object is of type Google::Cloud::Domains::V1::SearchDomainsResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1::SearchDomainsResponse. + p result +end # [END domains_v1_generated_Domains_SearchDomains_sync] diff --git a/google-cloud-domains-v1/snippets/domains/transfer_domain.rb b/google-cloud-domains-v1/snippets/domains/transfer_domain.rb index dc3a7f110a57..2e552bf9c3ae 100644 --- a/google-cloud-domains-v1/snippets/domains/transfer_domain.rb +++ b/google-cloud-domains-v1/snippets/domains/transfer_domain.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_TransferDomain_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#transfer_domain +# +def transfer_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::TransferDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::TransferDomainRequest.new -# Call the transfer_domain method. -result = client.transfer_domain request + # Call the transfer_domain method. + result = client.transfer_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_TransferDomain_sync] diff --git a/google-cloud-domains-v1/snippets/domains/update_registration.rb b/google-cloud-domains-v1/snippets/domains/update_registration.rb index 14521b89df0b..1cd2cf2d69b9 100644 --- a/google-cloud-domains-v1/snippets/domains/update_registration.rb +++ b/google-cloud-domains-v1/snippets/domains/update_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1_generated_Domains_UpdateRegistration_sync] require "google/cloud/domains/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1::Domains::Client#update_registration +# +def update_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1::UpdateRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1::UpdateRegistrationRequest.new -# Call the update_registration method. -result = client.update_registration request + # Call the update_registration method. + result = client.update_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1_generated_Domains_UpdateRegistration_sync] diff --git a/google-cloud-domains-v1/snippets/snippet_metadata_google.cloud.domains.v1.json b/google-cloud-domains-v1/snippets/snippet_metadata_google.cloud.domains.v1.json index 024c1920361b..f60609d11734 100644 --- a/google-cloud-domains-v1/snippets/snippet_metadata_google.cloud.domains.v1.json +++ b/google-cloud-domains-v1/snippets/snippet_metadata_google.cloud.domains.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-domains-v1beta1/.rubocop.yml b/google-cloud-domains-v1beta1/.rubocop.yml index 79bf158d3f4b..13815a529d90 100644 --- a/google-cloud-domains-v1beta1/.rubocop.yml +++ b/google-cloud-domains-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-domains-v1beta1.rb" diff --git a/google-cloud-domains-v1beta1/snippets/Gemfile b/google-cloud-domains-v1beta1/snippets/Gemfile index b22e5958c90d..04ad99f5788c 100755 --- a/google-cloud-domains-v1beta1/snippets/Gemfile +++ b/google-cloud-domains-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-domains-v1beta1/snippets/domains/configure_contact_settings.rb b/google-cloud-domains-v1beta1/snippets/domains/configure_contact_settings.rb index ebfd7304a938..3c7659ae413c 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/configure_contact_settings.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/configure_contact_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_ConfigureContactSettings_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#configure_contact_settings +# +def configure_contact_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ConfigureContactSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ConfigureContactSettingsRequest.new -# Call the configure_contact_settings method. -result = client.configure_contact_settings request + # Call the configure_contact_settings method. + result = client.configure_contact_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_ConfigureContactSettings_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/configure_dns_settings.rb b/google-cloud-domains-v1beta1/snippets/domains/configure_dns_settings.rb index 7728229ad06e..a4bfd87969d7 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/configure_dns_settings.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/configure_dns_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_ConfigureDnsSettings_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#configure_dns_settings +# +def configure_dns_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ConfigureDnsSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ConfigureDnsSettingsRequest.new -# Call the configure_dns_settings method. -result = client.configure_dns_settings request + # Call the configure_dns_settings method. + result = client.configure_dns_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_ConfigureDnsSettings_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/configure_management_settings.rb b/google-cloud-domains-v1beta1/snippets/domains/configure_management_settings.rb index f8fcbc3531f7..66cebba0539b 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/configure_management_settings.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/configure_management_settings.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_ConfigureManagementSettings_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#configure_management_settings +# +def configure_management_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ConfigureManagementSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ConfigureManagementSettingsRequest.new -# Call the configure_management_settings method. -result = client.configure_management_settings request + # Call the configure_management_settings method. + result = client.configure_management_settings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_ConfigureManagementSettings_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/delete_registration.rb b/google-cloud-domains-v1beta1/snippets/domains/delete_registration.rb index cb87a5557b69..a4ee5c140f57 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/delete_registration.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/delete_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_DeleteRegistration_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#delete_registration +# +def delete_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::DeleteRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::DeleteRegistrationRequest.new -# Call the delete_registration method. -result = client.delete_registration request + # Call the delete_registration method. + result = client.delete_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_DeleteRegistration_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/export_registration.rb b/google-cloud-domains-v1beta1/snippets/domains/export_registration.rb index 9291adb04a5d..95fa2007997e 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/export_registration.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/export_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_ExportRegistration_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#export_registration +# +def export_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ExportRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ExportRegistrationRequest.new -# Call the export_registration method. -result = client.export_registration request + # Call the export_registration method. + result = client.export_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_ExportRegistration_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/get_registration.rb b/google-cloud-domains-v1beta1/snippets/domains/get_registration.rb index 05ac427cdd78..e0371bebe728 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/get_registration.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/get_registration.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_GetRegistration_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#get_registration +# +def get_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::GetRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::GetRegistrationRequest.new -# Call the get_registration method. -result = client.get_registration request + # Call the get_registration method. + result = client.get_registration request -# The returned object is of type Google::Cloud::Domains::V1beta1::Registration. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::Registration. + p result +end # [END domains_v1beta1_generated_Domains_GetRegistration_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/list_registrations.rb b/google-cloud-domains-v1beta1/snippets/domains/list_registrations.rb index 31736155b82b..b1c5f23eced6 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/list_registrations.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/list_registrations.rb @@ -19,21 +19,27 @@ # [START domains_v1beta1_generated_Domains_ListRegistrations_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#list_registrations +# +def list_registrations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ListRegistrationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ListRegistrationsRequest.new -# Call the list_registrations method. -result = client.list_registrations request + # Call the list_registrations method. + result = client.list_registrations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Domains::V1beta1::Registration. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Domains::V1beta1::Registration. + p response + end end # [END domains_v1beta1_generated_Domains_ListRegistrations_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/register_domain.rb b/google-cloud-domains-v1beta1/snippets/domains/register_domain.rb index c35694b9c7da..18705457c534 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/register_domain.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/register_domain.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_RegisterDomain_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#register_domain +# +def register_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::RegisterDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::RegisterDomainRequest.new -# Call the register_domain method. -result = client.register_domain request + # Call the register_domain method. + result = client.register_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_RegisterDomain_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/reset_authorization_code.rb b/google-cloud-domains-v1beta1/snippets/domains/reset_authorization_code.rb index 7a89d2c16ef4..9afb99806915 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/reset_authorization_code.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/reset_authorization_code.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_ResetAuthorizationCode_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#reset_authorization_code +# +def reset_authorization_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::ResetAuthorizationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::ResetAuthorizationCodeRequest.new -# Call the reset_authorization_code method. -result = client.reset_authorization_code request + # Call the reset_authorization_code method. + result = client.reset_authorization_code request -# The returned object is of type Google::Cloud::Domains::V1beta1::AuthorizationCode. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::AuthorizationCode. + p result +end # [END domains_v1beta1_generated_Domains_ResetAuthorizationCode_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/retrieve_authorization_code.rb b/google-cloud-domains-v1beta1/snippets/domains/retrieve_authorization_code.rb index 2d7587376860..0abd47aa0592 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/retrieve_authorization_code.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/retrieve_authorization_code.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_RetrieveAuthorizationCode_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#retrieve_authorization_code +# +def retrieve_authorization_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::RetrieveAuthorizationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::RetrieveAuthorizationCodeRequest.new -# Call the retrieve_authorization_code method. -result = client.retrieve_authorization_code request + # Call the retrieve_authorization_code method. + result = client.retrieve_authorization_code request -# The returned object is of type Google::Cloud::Domains::V1beta1::AuthorizationCode. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::AuthorizationCode. + p result +end # [END domains_v1beta1_generated_Domains_RetrieveAuthorizationCode_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/retrieve_register_parameters.rb b/google-cloud-domains-v1beta1/snippets/domains/retrieve_register_parameters.rb index ac16157ac6af..f90dd51ec3f8 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/retrieve_register_parameters.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/retrieve_register_parameters.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_RetrieveRegisterParameters_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#retrieve_register_parameters +# +def retrieve_register_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersRequest.new -# Call the retrieve_register_parameters method. -result = client.retrieve_register_parameters request + # Call the retrieve_register_parameters method. + result = client.retrieve_register_parameters request -# The returned object is of type Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::RetrieveRegisterParametersResponse. + p result +end # [END domains_v1beta1_generated_Domains_RetrieveRegisterParameters_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/retrieve_transfer_parameters.rb b/google-cloud-domains-v1beta1/snippets/domains/retrieve_transfer_parameters.rb index 6cfb1dc5082e..001d11457acf 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/retrieve_transfer_parameters.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/retrieve_transfer_parameters.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_RetrieveTransferParameters_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#retrieve_transfer_parameters +# +def retrieve_transfer_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::RetrieveTransferParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::RetrieveTransferParametersRequest.new -# Call the retrieve_transfer_parameters method. -result = client.retrieve_transfer_parameters request + # Call the retrieve_transfer_parameters method. + result = client.retrieve_transfer_parameters request -# The returned object is of type Google::Cloud::Domains::V1beta1::RetrieveTransferParametersResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::RetrieveTransferParametersResponse. + p result +end # [END domains_v1beta1_generated_Domains_RetrieveTransferParameters_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/search_domains.rb b/google-cloud-domains-v1beta1/snippets/domains/search_domains.rb index a1b07762352d..eac7c5ea764c 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/search_domains.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/search_domains.rb @@ -19,15 +19,21 @@ # [START domains_v1beta1_generated_Domains_SearchDomains_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#search_domains +# +def search_domains + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::SearchDomainsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::SearchDomainsRequest.new -# Call the search_domains method. -result = client.search_domains request + # Call the search_domains method. + result = client.search_domains request -# The returned object is of type Google::Cloud::Domains::V1beta1::SearchDomainsResponse. -p result + # The returned object is of type Google::Cloud::Domains::V1beta1::SearchDomainsResponse. + p result +end # [END domains_v1beta1_generated_Domains_SearchDomains_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/transfer_domain.rb b/google-cloud-domains-v1beta1/snippets/domains/transfer_domain.rb index 98d57fa57721..3a6b93e9dc23 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/transfer_domain.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/transfer_domain.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_TransferDomain_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#transfer_domain +# +def transfer_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::TransferDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::TransferDomainRequest.new -# Call the transfer_domain method. -result = client.transfer_domain request + # Call the transfer_domain method. + result = client.transfer_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_TransferDomain_sync] diff --git a/google-cloud-domains-v1beta1/snippets/domains/update_registration.rb b/google-cloud-domains-v1beta1/snippets/domains/update_registration.rb index a99c10715a13..a25422208f83 100755 --- a/google-cloud-domains-v1beta1/snippets/domains/update_registration.rb +++ b/google-cloud-domains-v1beta1/snippets/domains/update_registration.rb @@ -19,22 +19,28 @@ # [START domains_v1beta1_generated_Domains_UpdateRegistration_sync] require "google/cloud/domains/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Domains::V1beta1::Domains::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Domains::V1beta1::Domains::Client#update_registration +# +def update_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Domains::V1beta1::Domains::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Domains::V1beta1::UpdateRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Domains::V1beta1::UpdateRegistrationRequest.new -# Call the update_registration method. -result = client.update_registration request + # Call the update_registration method. + result = client.update_registration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END domains_v1beta1_generated_Domains_UpdateRegistration_sync] diff --git a/google-cloud-domains-v1beta1/snippets/snippet_metadata_google.cloud.domains.v1beta1.json b/google-cloud-domains-v1beta1/snippets/snippet_metadata_google.cloud.domains.v1beta1.json index fa574abb97a9..70778af5548f 100644 --- a/google-cloud-domains-v1beta1/snippets/snippet_metadata_google.cloud.domains.v1beta1.json +++ b/google-cloud-domains-v1beta1/snippets/snippet_metadata_google.cloud.domains.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-error_reporting-v1beta1/.rubocop.yml b/google-cloud-error_reporting-v1beta1/.rubocop.yml index a4bef27f32b2..2c05870db49e 100644 --- a/google-cloud-error_reporting-v1beta1/.rubocop.yml +++ b/google-cloud-error_reporting-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-error_reporting-v1beta1.rb" diff --git a/google-cloud-error_reporting-v1beta1/snippets/Gemfile b/google-cloud-error_reporting-v1beta1/snippets/Gemfile index 4d9c8637868e..b8c8e9b93712 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/Gemfile +++ b/google-cloud-error_reporting-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-error_reporting-v1beta1/snippets/error_group_service/get_group.rb b/google-cloud-error_reporting-v1beta1/snippets/error_group_service/get_group.rb index dc011f317351..48bbfe7061f9 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/error_group_service/get_group.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/error_group_service/get_group.rb @@ -19,15 +19,21 @@ # [START clouderrorreporting_v1beta1_generated_ErrorGroupService_GetGroup_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client#get_group +# +def get_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::GetGroupRequest.new -# Call the get_group method. -result = client.get_group request + # Call the get_group method. + result = client.get_group request -# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ErrorGroup. -p result + # The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ErrorGroup. + p result +end # [END clouderrorreporting_v1beta1_generated_ErrorGroupService_GetGroup_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/error_group_service/update_group.rb b/google-cloud-error_reporting-v1beta1/snippets/error_group_service/update_group.rb index 1bb96b0c1f1e..a29f0d6adf66 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/error_group_service/update_group.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/error_group_service/update_group.rb @@ -19,15 +19,21 @@ # [START clouderrorreporting_v1beta1_generated_ErrorGroupService_UpdateGroup_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client#update_group +# +def update_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ErrorGroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::UpdateGroupRequest.new -# Call the update_group method. -result = client.update_group request + # Call the update_group method. + result = client.update_group request -# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ErrorGroup. -p result + # The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ErrorGroup. + p result +end # [END clouderrorreporting_v1beta1_generated_ErrorGroupService_UpdateGroup_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/delete_events.rb b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/delete_events.rb index 6a9a98886145..5a409f9f67f3 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/delete_events.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/delete_events.rb @@ -19,15 +19,21 @@ # [START clouderrorreporting_v1beta1_generated_ErrorStatsService_DeleteEvents_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client#delete_events +# +def delete_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::DeleteEventsRequest.new -# Call the delete_events method. -result = client.delete_events request + # Call the delete_events method. + result = client.delete_events request -# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse. -p result + # The returned object is of type Google::Cloud::ErrorReporting::V1beta1::DeleteEventsResponse. + p result +end # [END clouderrorreporting_v1beta1_generated_ErrorStatsService_DeleteEvents_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_events.rb b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_events.rb index 753f46c1de32..df62f65bd087 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_events.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_events.rb @@ -19,21 +19,27 @@ # [START clouderrorreporting_v1beta1_generated_ErrorStatsService_ListEvents_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client#list_events +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::ListEventsRequest.new -# Call the list_events method. -result = client.list_events request + # Call the list_events method. + result = client.list_events request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorEvent. + p response + end end # [END clouderrorreporting_v1beta1_generated_ErrorStatsService_ListEvents_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_group_stats.rb b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_group_stats.rb index 47852a908c0f..8557025dde1c 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_group_stats.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/error_stats_service/list_group_stats.rb @@ -19,21 +19,27 @@ # [START clouderrorreporting_v1beta1_generated_ErrorStatsService_ListGroupStats_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client#list_group_stats +# +def list_group_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::ListGroupStatsRequest.new -# Call the list_group_stats method. -result = client.list_group_stats request + # Call the list_group_stats method. + result = client.list_group_stats request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ErrorReporting::V1beta1::ErrorGroupStats. + p response + end end # [END clouderrorreporting_v1beta1_generated_ErrorStatsService_ListGroupStats_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/report_errors_service/report_error_event.rb b/google-cloud-error_reporting-v1beta1/snippets/report_errors_service/report_error_event.rb index 10ab6d3ee800..4102328d453b 100755 --- a/google-cloud-error_reporting-v1beta1/snippets/report_errors_service/report_error_event.rb +++ b/google-cloud-error_reporting-v1beta1/snippets/report_errors_service/report_error_event.rb @@ -19,15 +19,21 @@ # [START clouderrorreporting_v1beta1_generated_ReportErrorsService_ReportErrorEvent_sync] require "google/cloud/error_reporting/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client#report_error_event +# +def report_error_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ErrorReporting::V1beta1::ReportErrorsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventRequest.new -# Call the report_error_event method. -result = client.report_error_event request + # Call the report_error_event method. + result = client.report_error_event request -# The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse. -p result + # The returned object is of type Google::Cloud::ErrorReporting::V1beta1::ReportErrorEventResponse. + p result +end # [END clouderrorreporting_v1beta1_generated_ReportErrorsService_ReportErrorEvent_sync] diff --git a/google-cloud-error_reporting-v1beta1/snippets/snippet_metadata_google.devtools.clouderrorreporting.v1beta1.json b/google-cloud-error_reporting-v1beta1/snippets/snippet_metadata_google.devtools.clouderrorreporting.v1beta1.json index 76b5019323cb..90c02d53b8ee 100644 --- a/google-cloud-error_reporting-v1beta1/snippets/snippet_metadata_google.devtools.clouderrorreporting.v1beta1.json +++ b/google-cloud-error_reporting-v1beta1/snippets/snippet_metadata_google.devtools.clouderrorreporting.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-essential_contacts-v1/.rubocop.yml b/google-cloud-essential_contacts-v1/.rubocop.yml index 6975c26e28d0..d77eebc409d6 100644 --- a/google-cloud-essential_contacts-v1/.rubocop.yml +++ b/google-cloud-essential_contacts-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-essential_contacts-v1.rb" diff --git a/google-cloud-essential_contacts-v1/snippets/Gemfile b/google-cloud-essential_contacts-v1/snippets/Gemfile index b4b65f9a8fbc..7f351b2dd11f 100755 --- a/google-cloud-essential_contacts-v1/snippets/Gemfile +++ b/google-cloud-essential_contacts-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/compute_contacts.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/compute_contacts.rb index 5ff0d6f1346f..af580b27192d 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/compute_contacts.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/compute_contacts.rb @@ -19,21 +19,27 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#compute_contacts +# +def compute_contacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::ComputeContactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::ComputeContactsRequest.new -# Call the compute_contacts method. -result = client.compute_contacts request + # Call the compute_contacts method. + result = client.compute_contacts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact. + p response + end end # [END essentialcontacts_v1_generated_EssentialContactsService_ComputeContacts_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/create_contact.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/create_contact.rb index 4b898a1793e8..1255ec236770 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/create_contact.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/create_contact.rb @@ -19,15 +19,21 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_CreateContact_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#create_contact +# +def create_contact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::CreateContactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::CreateContactRequest.new -# Call the create_contact method. -result = client.create_contact request + # Call the create_contact method. + result = client.create_contact request -# The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. -p result + # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. + p result +end # [END essentialcontacts_v1_generated_EssentialContactsService_CreateContact_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/delete_contact.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/delete_contact.rb index bb122d31dd1b..a0d2bf27b3d2 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/delete_contact.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/delete_contact.rb @@ -19,15 +19,21 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#delete_contact +# +def delete_contact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::DeleteContactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::DeleteContactRequest.new -# Call the delete_contact method. -result = client.delete_contact request + # Call the delete_contact method. + result = client.delete_contact request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END essentialcontacts_v1_generated_EssentialContactsService_DeleteContact_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/get_contact.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/get_contact.rb index af2b647cbcb9..62a4046f8aeb 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/get_contact.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/get_contact.rb @@ -19,15 +19,21 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_GetContact_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#get_contact +# +def get_contact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::GetContactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::GetContactRequest.new -# Call the get_contact method. -result = client.get_contact request + # Call the get_contact method. + result = client.get_contact request -# The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. -p result + # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. + p result +end # [END essentialcontacts_v1_generated_EssentialContactsService_GetContact_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/list_contacts.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/list_contacts.rb index 25836511c9cb..eec40cc939a0 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/list_contacts.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/list_contacts.rb @@ -19,21 +19,27 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_ListContacts_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#list_contacts +# +def list_contacts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::ListContactsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::ListContactsRequest.new -# Call the list_contacts method. -result = client.list_contacts request + # Call the list_contacts method. + result = client.list_contacts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::EssentialContacts::V1::Contact. + p response + end end # [END essentialcontacts_v1_generated_EssentialContactsService_ListContacts_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/send_test_message.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/send_test_message.rb index c1100930843b..0bb5f79d6f82 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/send_test_message.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/send_test_message.rb @@ -19,15 +19,21 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#send_test_message +# +def send_test_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::SendTestMessageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::SendTestMessageRequest.new -# Call the send_test_message method. -result = client.send_test_message request + # Call the send_test_message method. + result = client.send_test_message request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END essentialcontacts_v1_generated_EssentialContactsService_SendTestMessage_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/update_contact.rb b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/update_contact.rb index 12a3fdbfdf29..bdcb6605c678 100755 --- a/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/update_contact.rb +++ b/google-cloud-essential_contacts-v1/snippets/essential_contacts_service/update_contact.rb @@ -19,15 +19,21 @@ # [START essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_sync] require "google/cloud/essential_contacts/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client#update_contact +# +def update_contact + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::EssentialContacts::V1::EssentialContactsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::EssentialContacts::V1::UpdateContactRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::EssentialContacts::V1::UpdateContactRequest.new -# Call the update_contact method. -result = client.update_contact request + # Call the update_contact method. + result = client.update_contact request -# The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. -p result + # The returned object is of type Google::Cloud::EssentialContacts::V1::Contact. + p result +end # [END essentialcontacts_v1_generated_EssentialContactsService_UpdateContact_sync] diff --git a/google-cloud-essential_contacts-v1/snippets/snippet_metadata_google.cloud.essentialcontacts.v1.json b/google-cloud-essential_contacts-v1/snippets/snippet_metadata_google.cloud.essentialcontacts.v1.json index e16b8982de0b..9b7ec65e1e06 100644 --- a/google-cloud-essential_contacts-v1/snippets/snippet_metadata_google.cloud.essentialcontacts.v1.json +++ b/google-cloud-essential_contacts-v1/snippets/snippet_metadata_google.cloud.essentialcontacts.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-eventarc-publishing-v1/.rubocop.yml b/google-cloud-eventarc-publishing-v1/.rubocop.yml index 8312884160f9..60ae90f7ab76 100644 --- a/google-cloud-eventarc-publishing-v1/.rubocop.yml +++ b/google-cloud-eventarc-publishing-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-eventarc-publishing-v1.rb" diff --git a/google-cloud-eventarc-publishing-v1/snippets/Gemfile b/google-cloud-eventarc-publishing-v1/snippets/Gemfile index eb5e3b7ce91a..ac1c8209571c 100644 --- a/google-cloud-eventarc-publishing-v1/snippets/Gemfile +++ b/google-cloud-eventarc-publishing-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_channel_connection_events.rb b/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_channel_connection_events.rb index ea1ce74dfdd7..1593646edb04 100644 --- a/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_channel_connection_events.rb +++ b/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_channel_connection_events.rb @@ -19,15 +19,21 @@ # [START eventarcpublishing_v1_generated_Publisher_PublishChannelConnectionEvents_sync] require "google/cloud/eventarc/publishing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::Publishing::V1::Publisher::Client#publish_channel_connection_events +# +def publish_channel_connection_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new -# Call the publish_channel_connection_events method. -result = client.publish_channel_connection_events request + # Call the publish_channel_connection_events method. + result = client.publish_channel_connection_events request -# The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse. -p result + # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse. + p result +end # [END eventarcpublishing_v1_generated_Publisher_PublishChannelConnectionEvents_sync] diff --git a/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_events.rb b/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_events.rb index a58ba268e24f..3c8872c783e0 100644 --- a/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_events.rb +++ b/google-cloud-eventarc-publishing-v1/snippets/publisher/publish_events.rb @@ -19,15 +19,21 @@ # [START eventarcpublishing_v1_generated_Publisher_PublishEvents_sync] require "google/cloud/eventarc/publishing/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::Publishing::V1::Publisher::Client#publish_events +# +def publish_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::Publishing::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new -# Call the publish_events method. -result = client.publish_events request + # Call the publish_events method. + result = client.publish_events request -# The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse. -p result + # The returned object is of type Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse. + p result +end # [END eventarcpublishing_v1_generated_Publisher_PublishEvents_sync] diff --git a/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json b/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json index 2940a26cbed0..cee1cea9a9b5 100644 --- a/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json +++ b/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-eventarc-v1/.rubocop.yml b/google-cloud-eventarc-v1/.rubocop.yml index 0196f3903393..abf9cb09ce60 100644 --- a/google-cloud-eventarc-v1/.rubocop.yml +++ b/google-cloud-eventarc-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-eventarc-v1.rb" diff --git a/google-cloud-eventarc-v1/snippets/Gemfile b/google-cloud-eventarc-v1/snippets/Gemfile index f0eb9258c523..69c9987cef7e 100755 --- a/google-cloud-eventarc-v1/snippets/Gemfile +++ b/google-cloud-eventarc-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-eventarc-v1/snippets/eventarc/create_channel.rb b/google-cloud-eventarc-v1/snippets/eventarc/create_channel.rb index 30be78ac2976..ff7a0296dab2 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/create_channel.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/create_channel.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_CreateChannel_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#create_channel +# +def create_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::CreateChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::CreateChannelRequest.new -# Call the create_channel method. -result = client.create_channel request + # Call the create_channel method. + result = client.create_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_CreateChannel_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/create_channel_connection.rb b/google-cloud-eventarc-v1/snippets/eventarc/create_channel_connection.rb index 1f9b22c0fa21..3b9cd2ebcfbd 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/create_channel_connection.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/create_channel_connection.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_CreateChannelConnection_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#create_channel_connection +# +def create_channel_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest.new -# Call the create_channel_connection method. -result = client.create_channel_connection request + # Call the create_channel_connection method. + result = client.create_channel_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_CreateChannelConnection_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/create_trigger.rb b/google-cloud-eventarc-v1/snippets/eventarc/create_trigger.rb index 0deb8f391a50..1c9d481dc14f 100755 --- a/google-cloud-eventarc-v1/snippets/eventarc/create_trigger.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/create_trigger.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_CreateTrigger_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#create_trigger +# +def create_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::CreateTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::CreateTriggerRequest.new -# Call the create_trigger method. -result = client.create_trigger request + # Call the create_trigger method. + result = client.create_trigger request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_CreateTrigger_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/delete_channel.rb b/google-cloud-eventarc-v1/snippets/eventarc/delete_channel.rb index cb59070d0e11..442d0d3bfae4 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/delete_channel.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/delete_channel.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_DeleteChannel_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#delete_channel +# +def delete_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::DeleteChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::DeleteChannelRequest.new -# Call the delete_channel method. -result = client.delete_channel request + # Call the delete_channel method. + result = client.delete_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_DeleteChannel_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/delete_channel_connection.rb b/google-cloud-eventarc-v1/snippets/eventarc/delete_channel_connection.rb index 3cd2571580ec..f7565c1d79d2 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/delete_channel_connection.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/delete_channel_connection.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_DeleteChannelConnection_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#delete_channel_connection +# +def delete_channel_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest.new -# Call the delete_channel_connection method. -result = client.delete_channel_connection request + # Call the delete_channel_connection method. + result = client.delete_channel_connection request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_DeleteChannelConnection_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/delete_trigger.rb b/google-cloud-eventarc-v1/snippets/eventarc/delete_trigger.rb index 274288a208ef..5efb935cabde 100755 --- a/google-cloud-eventarc-v1/snippets/eventarc/delete_trigger.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/delete_trigger.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_DeleteTrigger_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#delete_trigger +# +def delete_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::DeleteTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::DeleteTriggerRequest.new -# Call the delete_trigger method. -result = client.delete_trigger request + # Call the delete_trigger method. + result = client.delete_trigger request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_DeleteTrigger_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/get_channel.rb b/google-cloud-eventarc-v1/snippets/eventarc/get_channel.rb index 98ba27f21a3b..98d520364191 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/get_channel.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/get_channel.rb @@ -19,15 +19,21 @@ # [START eventarc_v1_generated_Eventarc_GetChannel_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#get_channel +# +def get_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::GetChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::GetChannelRequest.new -# Call the get_channel method. -result = client.get_channel request + # Call the get_channel method. + result = client.get_channel request -# The returned object is of type Google::Cloud::Eventarc::V1::Channel. -p result + # The returned object is of type Google::Cloud::Eventarc::V1::Channel. + p result +end # [END eventarc_v1_generated_Eventarc_GetChannel_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/get_channel_connection.rb b/google-cloud-eventarc-v1/snippets/eventarc/get_channel_connection.rb index 31f327ec4c1d..caef5b50dce2 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/get_channel_connection.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/get_channel_connection.rb @@ -19,15 +19,21 @@ # [START eventarc_v1_generated_Eventarc_GetChannelConnection_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#get_channel_connection +# +def get_channel_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::GetChannelConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::GetChannelConnectionRequest.new -# Call the get_channel_connection method. -result = client.get_channel_connection request + # Call the get_channel_connection method. + result = client.get_channel_connection request -# The returned object is of type Google::Cloud::Eventarc::V1::ChannelConnection. -p result + # The returned object is of type Google::Cloud::Eventarc::V1::ChannelConnection. + p result +end # [END eventarc_v1_generated_Eventarc_GetChannelConnection_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/get_provider.rb b/google-cloud-eventarc-v1/snippets/eventarc/get_provider.rb index df75788ee3e3..ceb3fe0c3f70 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/get_provider.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/get_provider.rb @@ -19,15 +19,21 @@ # [START eventarc_v1_generated_Eventarc_GetProvider_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#get_provider +# +def get_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::GetProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::GetProviderRequest.new -# Call the get_provider method. -result = client.get_provider request + # Call the get_provider method. + result = client.get_provider request -# The returned object is of type Google::Cloud::Eventarc::V1::Provider. -p result + # The returned object is of type Google::Cloud::Eventarc::V1::Provider. + p result +end # [END eventarc_v1_generated_Eventarc_GetProvider_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/get_trigger.rb b/google-cloud-eventarc-v1/snippets/eventarc/get_trigger.rb index f43e394de6b7..c8313b3077ff 100755 --- a/google-cloud-eventarc-v1/snippets/eventarc/get_trigger.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/get_trigger.rb @@ -19,15 +19,21 @@ # [START eventarc_v1_generated_Eventarc_GetTrigger_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#get_trigger +# +def get_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::GetTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::GetTriggerRequest.new -# Call the get_trigger method. -result = client.get_trigger request + # Call the get_trigger method. + result = client.get_trigger request -# The returned object is of type Google::Cloud::Eventarc::V1::Trigger. -p result + # The returned object is of type Google::Cloud::Eventarc::V1::Trigger. + p result +end # [END eventarc_v1_generated_Eventarc_GetTrigger_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/list_channel_connections.rb b/google-cloud-eventarc-v1/snippets/eventarc/list_channel_connections.rb index 86e4d41ef4c7..ea8944d6a64c 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/list_channel_connections.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/list_channel_connections.rb @@ -19,21 +19,27 @@ # [START eventarc_v1_generated_Eventarc_ListChannelConnections_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#list_channel_connections +# +def list_channel_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::ListChannelConnectionsRequest.new -# Call the list_channel_connections method. -result = client.list_channel_connections request + # Call the list_channel_connections method. + result = client.list_channel_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Eventarc::V1::ChannelConnection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Eventarc::V1::ChannelConnection. + p response + end end # [END eventarc_v1_generated_Eventarc_ListChannelConnections_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/list_channels.rb b/google-cloud-eventarc-v1/snippets/eventarc/list_channels.rb index 15eeccd5021a..b6c3fca35c49 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/list_channels.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/list_channels.rb @@ -19,21 +19,27 @@ # [START eventarc_v1_generated_Eventarc_ListChannels_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#list_channels +# +def list_channels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::ListChannelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::ListChannelsRequest.new -# Call the list_channels method. -result = client.list_channels request + # Call the list_channels method. + result = client.list_channels request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Eventarc::V1::Channel. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Eventarc::V1::Channel. + p response + end end # [END eventarc_v1_generated_Eventarc_ListChannels_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/list_providers.rb b/google-cloud-eventarc-v1/snippets/eventarc/list_providers.rb index 258fcbfc21e6..51b538e00ec5 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/list_providers.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/list_providers.rb @@ -19,21 +19,27 @@ # [START eventarc_v1_generated_Eventarc_ListProviders_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#list_providers +# +def list_providers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::ListProvidersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::ListProvidersRequest.new -# Call the list_providers method. -result = client.list_providers request + # Call the list_providers method. + result = client.list_providers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Eventarc::V1::Provider. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Eventarc::V1::Provider. + p response + end end # [END eventarc_v1_generated_Eventarc_ListProviders_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/list_triggers.rb b/google-cloud-eventarc-v1/snippets/eventarc/list_triggers.rb index 5e601daceaa6..1eef20c730b7 100755 --- a/google-cloud-eventarc-v1/snippets/eventarc/list_triggers.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/list_triggers.rb @@ -19,21 +19,27 @@ # [START eventarc_v1_generated_Eventarc_ListTriggers_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#list_triggers +# +def list_triggers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::ListTriggersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::ListTriggersRequest.new -# Call the list_triggers method. -result = client.list_triggers request + # Call the list_triggers method. + result = client.list_triggers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Eventarc::V1::Trigger. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Eventarc::V1::Trigger. + p response + end end # [END eventarc_v1_generated_Eventarc_ListTriggers_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/update_channel.rb b/google-cloud-eventarc-v1/snippets/eventarc/update_channel.rb index ed5255cfb2b9..baf043c7f987 100644 --- a/google-cloud-eventarc-v1/snippets/eventarc/update_channel.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/update_channel.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_UpdateChannel_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#update_channel +# +def update_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::UpdateChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::UpdateChannelRequest.new -# Call the update_channel method. -result = client.update_channel request + # Call the update_channel method. + result = client.update_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_UpdateChannel_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/update_trigger.rb b/google-cloud-eventarc-v1/snippets/eventarc/update_trigger.rb index ef815b919831..91420d8bd981 100755 --- a/google-cloud-eventarc-v1/snippets/eventarc/update_trigger.rb +++ b/google-cloud-eventarc-v1/snippets/eventarc/update_trigger.rb @@ -19,22 +19,28 @@ # [START eventarc_v1_generated_Eventarc_UpdateTrigger_sync] require "google/cloud/eventarc/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Eventarc::V1::Eventarc::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#update_trigger +# +def update_trigger + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Eventarc::V1::UpdateTriggerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::UpdateTriggerRequest.new -# Call the update_trigger method. -result = client.update_trigger request + # Call the update_trigger method. + result = client.update_trigger request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END eventarc_v1_generated_Eventarc_UpdateTrigger_sync] diff --git a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json index 73698a08c2e2..1f7ee57181a4 100644 --- a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json +++ b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-filestore-v1/.rubocop.yml b/google-cloud-filestore-v1/.rubocop.yml index 7d3a6c75c521..b050e479d838 100644 --- a/google-cloud-filestore-v1/.rubocop.yml +++ b/google-cloud-filestore-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-filestore-v1.rb" diff --git a/google-cloud-filestore-v1/snippets/Gemfile b/google-cloud-filestore-v1/snippets/Gemfile index b1b48957c388..081b30f950f9 100755 --- a/google-cloud-filestore-v1/snippets/Gemfile +++ b/google-cloud-filestore-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_backup.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_backup.rb index 181d6c4f2a50..84ce3a83fd6a 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_backup.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_backup.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_CreateBackup_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_CreateBackup_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_instance.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_instance.rb index 5bc0c267e668..2e407c03bfe8 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_instance.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/create_instance.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_CreateInstance_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_CreateInstance_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_backup.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_backup.rb index d19851795320..97c3f42fe90c 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_backup.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_backup.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_DeleteBackup_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_DeleteBackup_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_instance.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_instance.rb index a189045a145a..5f412ebb534d 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_instance.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/delete_instance.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_DeleteInstance_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_DeleteInstance_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_backup.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_backup.rb index f3c5c8b4d4c0..674ed304e212 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_backup.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_backup.rb @@ -19,15 +19,21 @@ # [START file_v1_generated_CloudFilestoreManager_GetBackup_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::Filestore::V1::Backup. -p result + # The returned object is of type Google::Cloud::Filestore::V1::Backup. + p result +end # [END file_v1_generated_CloudFilestoreManager_GetBackup_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_instance.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_instance.rb index cdf8e1393aa1..e79c78938b43 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_instance.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/get_instance.rb @@ -19,15 +19,21 @@ # [START file_v1_generated_CloudFilestoreManager_GetInstance_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Filestore::V1::Instance. -p result + # The returned object is of type Google::Cloud::Filestore::V1::Instance. + p result +end # [END file_v1_generated_CloudFilestoreManager_GetInstance_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_backups.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_backups.rb index 6b223c78e9e5..0046575b6249 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_backups.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_backups.rb @@ -19,21 +19,27 @@ # [START file_v1_generated_CloudFilestoreManager_ListBackups_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Filestore::V1::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Filestore::V1::Backup. + p response + end end # [END file_v1_generated_CloudFilestoreManager_ListBackups_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_instances.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_instances.rb index b72d344b3283..1a7644f0c53c 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_instances.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/list_instances.rb @@ -19,21 +19,27 @@ # [START file_v1_generated_CloudFilestoreManager_ListInstances_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Filestore::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Filestore::V1::Instance. + p response + end end # [END file_v1_generated_CloudFilestoreManager_ListInstances_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/restore_instance.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/restore_instance.rb index ac3934edc6b5..b92702f52804 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/restore_instance.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/restore_instance.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_RestoreInstance_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#restore_instance +# +def restore_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::RestoreInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::RestoreInstanceRequest.new -# Call the restore_instance method. -result = client.restore_instance request + # Call the restore_instance method. + result = client.restore_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_RestoreInstance_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_backup.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_backup.rb index be268a2b4537..f7c145d9262b 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_backup.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_backup.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_UpdateBackup_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#update_backup +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::UpdateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::UpdateBackupRequest.new -# Call the update_backup method. -result = client.update_backup request + # Call the update_backup method. + result = client.update_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_UpdateBackup_sync] diff --git a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_instance.rb b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_instance.rb index 460c89a25f71..a3f3cc1388c4 100755 --- a/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_instance.rb +++ b/google-cloud-filestore-v1/snippets/cloud_filestore_manager/update_instance.rb @@ -19,22 +19,28 @@ # [START file_v1_generated_CloudFilestoreManager_UpdateInstance_sync] require "google/cloud/filestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Filestore::V1::CloudFilestoreManager::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Filestore::V1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Filestore::V1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END file_v1_generated_CloudFilestoreManager_UpdateInstance_sync] diff --git a/google-cloud-filestore-v1/snippets/snippet_metadata_google.cloud.filestore.v1.json b/google-cloud-filestore-v1/snippets/snippet_metadata_google.cloud.filestore.v1.json index c1b271839ce3..2b57ab4ccc84 100644 --- a/google-cloud-filestore-v1/snippets/snippet_metadata_google.cloud.filestore.v1.json +++ b/google-cloud-filestore-v1/snippets/snippet_metadata_google.cloud.filestore.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-firestore-admin-v1/.rubocop.yml b/google-cloud-firestore-admin-v1/.rubocop.yml index 4b1b698eb98c..8cc38d8fdd28 100644 --- a/google-cloud-firestore-admin-v1/.rubocop.yml +++ b/google-cloud-firestore-admin-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-firestore-admin-v1.rb" diff --git a/google-cloud-firestore-admin-v1/snippets/Gemfile b/google-cloud-firestore-admin-v1/snippets/Gemfile index ec5ab3213893..dab5591b69f2 100755 --- a/google-cloud-firestore-admin-v1/snippets/Gemfile +++ b/google-cloud-firestore-admin-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb index b2ee206c272d..df7d59a38f39 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/create_index.rb @@ -19,22 +19,28 @@ # [START firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#create_index +# +def create_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new -# Call the create_index method. -result = client.create_index request + # Call the create_index method. + result = client.create_index request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END firestore_v1_generated_FirestoreAdmin_CreateIndex_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb index f34763b3cc6d..f6016fc17b59 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/delete_index.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#delete_index +# +def delete_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new -# Call the delete_index method. -result = client.delete_index request + # Call the delete_index method. + result = client.delete_index request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END firestore_v1_generated_FirestoreAdmin_DeleteIndex_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb index 269bb3afd7c7..0decd8f54497 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/export_documents.rb @@ -19,22 +19,28 @@ # [START firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#export_documents +# +def export_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new -# Call the export_documents method. -result = client.export_documents request + # Call the export_documents method. + result = client.export_documents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END firestore_v1_generated_FirestoreAdmin_ExportDocuments_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb index b449ec50f7b7..1b24e22b60bd 100644 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_database.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_database +# +def get_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new -# Call the get_database method. -result = client.get_database request + # Call the get_database method. + result = client.get_database request -# The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. -p result + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. + p result +end # [END firestore_v1_generated_FirestoreAdmin_GetDatabase_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb index 66aaec441718..8310927f6ca3 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_field.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_FirestoreAdmin_GetField_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_field +# +def get_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new -# Call the get_field method. -result = client.get_field request + # Call the get_field method. + result = client.get_field request -# The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. -p result + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. + p result +end # [END firestore_v1_generated_FirestoreAdmin_GetField_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb index f4b1cfe2f324..50847d556214 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/get_index.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_FirestoreAdmin_GetIndex_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#get_index +# +def get_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new -# Call the get_index method. -result = client.get_index request + # Call the get_index method. + result = client.get_index request -# The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. -p result + # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. + p result +end # [END firestore_v1_generated_FirestoreAdmin_GetIndex_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb index 82a98b6f97fc..0c2000f5d740 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/import_documents.rb @@ -19,22 +19,28 @@ # [START firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#import_documents +# +def import_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new -# Call the import_documents method. -result = client.import_documents request + # Call the import_documents method. + result = client.import_documents request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END firestore_v1_generated_FirestoreAdmin_ImportDocuments_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb index d9ced68cddea..1c905c879a4d 100644 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_databases.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_databases +# +def list_databases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new -# Call the list_databases method. -result = client.list_databases request + # Call the list_databases method. + result = client.list_databases request -# The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. -p result + # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. + p result +end # [END firestore_v1_generated_FirestoreAdmin_ListDatabases_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb index 15f1f37447d6..4bc24c14f000 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_fields.rb @@ -19,21 +19,27 @@ # [START firestore_v1_generated_FirestoreAdmin_ListFields_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields +# +def list_fields + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new -# Call the list_fields method. -result = client.list_fields request + # Call the list_fields method. + result = client.list_fields request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Field. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Field. + p response + end end # [END firestore_v1_generated_FirestoreAdmin_ListFields_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb index af7cd1076004..71c3b53e0212 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/list_indexes.rb @@ -19,21 +19,27 @@ # [START firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes +# +def list_indexes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new -# Call the list_indexes method. -result = client.list_indexes request + # Call the list_indexes method. + result = client.list_indexes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Index. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Index. + p response + end end # [END firestore_v1_generated_FirestoreAdmin_ListIndexes_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb index 58975ba5e074..449ec4e84876 100644 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_database.rb @@ -19,22 +19,28 @@ # [START firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_database +# +def update_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new -# Call the update_database method. -result = client.update_database request + # Call the update_database method. + result = client.update_database request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END firestore_v1_generated_FirestoreAdmin_UpdateDatabase_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb b/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb index 4fcb5e38885a..05581f99f1a1 100755 --- a/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb +++ b/google-cloud-firestore-admin-v1/snippets/firestore_admin/update_field.rb @@ -19,22 +19,28 @@ # [START firestore_v1_generated_FirestoreAdmin_UpdateField_sync] require "google/cloud/firestore/admin/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field +# +def update_field + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new -# Call the update_field method. -result = client.update_field request + # Call the update_field method. + result = client.update_field request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END firestore_v1_generated_FirestoreAdmin_UpdateField_sync] diff --git a/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json b/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json index 2da180717bce..2b5ee73575e0 100644 --- a/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json +++ b/google-cloud-firestore-admin-v1/snippets/snippet_metadata_google.firestore.admin.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-firestore-v1/.rubocop.yml b/google-cloud-firestore-v1/.rubocop.yml index 5edd37347bac..b39192458484 100644 --- a/google-cloud-firestore-v1/.rubocop.yml +++ b/google-cloud-firestore-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-firestore-v1.rb" diff --git a/google-cloud-firestore-v1/snippets/Gemfile b/google-cloud-firestore-v1/snippets/Gemfile index 95fd1e1e454a..7f07b6859a91 100755 --- a/google-cloud-firestore-v1/snippets/Gemfile +++ b/google-cloud-firestore-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb b/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb index dc5d4533ceaf..301d151b5b6e 100755 --- a/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb +++ b/google-cloud-firestore-v1/snippets/firestore/batch_get_documents.rb @@ -19,18 +19,24 @@ # [START firestore_v1_generated_Firestore_BatchGetDocuments_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#batch_get_documents +# +def batch_get_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new -# Call the batch_get_documents method. -result = client.batch_get_documents request + # Call the batch_get_documents method. + result = client.batch_get_documents request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse. + result.each do |response| + p response + end end # [END firestore_v1_generated_Firestore_BatchGetDocuments_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/batch_write.rb b/google-cloud-firestore-v1/snippets/firestore/batch_write.rb index f498f6e88e78..2194beba19b1 100755 --- a/google-cloud-firestore-v1/snippets/firestore/batch_write.rb +++ b/google-cloud-firestore-v1/snippets/firestore/batch_write.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_BatchWrite_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#batch_write +# +def batch_write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::BatchWriteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BatchWriteRequest.new -# Call the batch_write method. -result = client.batch_write request + # Call the batch_write method. + result = client.batch_write request -# The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. -p result + # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse. + p result +end # [END firestore_v1_generated_Firestore_BatchWrite_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb b/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb index c0c67e036994..f5f3f1eb384e 100755 --- a/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb +++ b/google-cloud-firestore-v1/snippets/firestore/begin_transaction.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_BeginTransaction_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#begin_transaction +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new -# Call the begin_transaction method. -result = client.begin_transaction request + # Call the begin_transaction method. + result = client.begin_transaction request -# The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. -p result + # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse. + p result +end # [END firestore_v1_generated_Firestore_BeginTransaction_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/commit.rb b/google-cloud-firestore-v1/snippets/firestore/commit.rb index c81e63ec2817..f41b568b072e 100755 --- a/google-cloud-firestore-v1/snippets/firestore/commit.rb +++ b/google-cloud-firestore-v1/snippets/firestore/commit.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_Commit_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#commit +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::CommitRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::CommitRequest.new -# Call the commit method. -result = client.commit request + # Call the commit method. + result = client.commit request -# The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. -p result + # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse. + p result +end # [END firestore_v1_generated_Firestore_Commit_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/create_document.rb b/google-cloud-firestore-v1/snippets/firestore/create_document.rb index c4e4c525373e..c32a5f61d31b 100755 --- a/google-cloud-firestore-v1/snippets/firestore/create_document.rb +++ b/google-cloud-firestore-v1/snippets/firestore/create_document.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_CreateDocument_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#create_document +# +def create_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new -# Call the create_document method. -result = client.create_document request + # Call the create_document method. + result = client.create_document request -# The returned object is of type Google::Cloud::Firestore::V1::Document. -p result + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end # [END firestore_v1_generated_Firestore_CreateDocument_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/delete_document.rb b/google-cloud-firestore-v1/snippets/firestore/delete_document.rb index 6a30a7be970e..962f6ce8e779 100755 --- a/google-cloud-firestore-v1/snippets/firestore/delete_document.rb +++ b/google-cloud-firestore-v1/snippets/firestore/delete_document.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_DeleteDocument_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#delete_document +# +def delete_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new -# Call the delete_document method. -result = client.delete_document request + # Call the delete_document method. + result = client.delete_document request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END firestore_v1_generated_Firestore_DeleteDocument_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/get_document.rb b/google-cloud-firestore-v1/snippets/firestore/get_document.rb index fbb5cd61704a..45b371fd11ec 100755 --- a/google-cloud-firestore-v1/snippets/firestore/get_document.rb +++ b/google-cloud-firestore-v1/snippets/firestore/get_document.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_GetDocument_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#get_document +# +def get_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::GetDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::GetDocumentRequest.new -# Call the get_document method. -result = client.get_document request + # Call the get_document method. + result = client.get_document request -# The returned object is of type Google::Cloud::Firestore::V1::Document. -p result + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end # [END firestore_v1_generated_Firestore_GetDocument_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb b/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb index ff4e998ba310..350fbd80c3cf 100755 --- a/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb +++ b/google-cloud-firestore-v1/snippets/firestore/list_collection_ids.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_ListCollectionIds_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#list_collection_ids +# +def list_collection_ids + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new -# Call the list_collection_ids method. -result = client.list_collection_ids request + # Call the list_collection_ids method. + result = client.list_collection_ids request -# The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. -p result + # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse. + p result +end # [END firestore_v1_generated_Firestore_ListCollectionIds_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/list_documents.rb b/google-cloud-firestore-v1/snippets/firestore/list_documents.rb index 773fc2620890..8fe8671d60db 100755 --- a/google-cloud-firestore-v1/snippets/firestore/list_documents.rb +++ b/google-cloud-firestore-v1/snippets/firestore/list_documents.rb @@ -19,21 +19,27 @@ # [START firestore_v1_generated_Firestore_ListDocuments_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#list_documents +# +def list_documents + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new -# Call the list_documents method. -result = client.list_documents request + # Call the list_documents method. + result = client.list_documents request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Firestore::V1::Document. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Firestore::V1::Document. + p response + end end # [END firestore_v1_generated_Firestore_ListDocuments_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/listen.rb b/google-cloud-firestore-v1/snippets/firestore/listen.rb index e146367a6b42..8ea48e3bab46 100755 --- a/google-cloud-firestore-v1/snippets/firestore/listen.rb +++ b/google-cloud-firestore-v1/snippets/firestore/listen.rb @@ -19,24 +19,30 @@ # [START firestore_v1_generated_Firestore_Listen_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the listen method to start streaming. -output = client.listen input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Firestore::V1::ListenRequest.new -input << Google::Cloud::Firestore::V1::ListenRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#listen +# +def listen + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the listen method to start streaming. + output = client.listen input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Firestore::V1::ListenRequest.new + input << Google::Cloud::Firestore::V1::ListenRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse. + output.each do |response| + p response + end end # [END firestore_v1_generated_Firestore_Listen_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/partition_query.rb b/google-cloud-firestore-v1/snippets/firestore/partition_query.rb index 8d2782f4a850..5098c4f59e7b 100755 --- a/google-cloud-firestore-v1/snippets/firestore/partition_query.rb +++ b/google-cloud-firestore-v1/snippets/firestore/partition_query.rb @@ -19,21 +19,27 @@ # [START firestore_v1_generated_Firestore_PartitionQuery_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#partition_query +# +def partition_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new -# Call the partition_query method. -result = client.partition_query request + # Call the partition_query method. + result = client.partition_query request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Firestore::V1::Cursor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Firestore::V1::Cursor. + p response + end end # [END firestore_v1_generated_Firestore_PartitionQuery_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/rollback.rb b/google-cloud-firestore-v1/snippets/firestore/rollback.rb index 68d441c40145..ad55364f6c95 100755 --- a/google-cloud-firestore-v1/snippets/firestore/rollback.rb +++ b/google-cloud-firestore-v1/snippets/firestore/rollback.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_Rollback_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#rollback +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::RollbackRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RollbackRequest.new -# Call the rollback method. -result = client.rollback request + # Call the rollback method. + result = client.rollback request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END firestore_v1_generated_Firestore_Rollback_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb b/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb index e47df8ac895f..d2195878a946 100644 --- a/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb +++ b/google-cloud-firestore-v1/snippets/firestore/run_aggregation_query.rb @@ -19,18 +19,24 @@ # [START firestore_v1_generated_Firestore_RunAggregationQuery_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#run_aggregation_query +# +def run_aggregation_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RunAggregationQueryRequest.new -# Call the run_aggregation_query method. -result = client.run_aggregation_query request + # Call the run_aggregation_query method. + result = client.run_aggregation_query request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Firestore::V1::RunAggregationQueryResponse. + result.each do |response| + p response + end end # [END firestore_v1_generated_Firestore_RunAggregationQuery_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/run_query.rb b/google-cloud-firestore-v1/snippets/firestore/run_query.rb index ba98cd67916a..b77bd8739124 100755 --- a/google-cloud-firestore-v1/snippets/firestore/run_query.rb +++ b/google-cloud-firestore-v1/snippets/firestore/run_query.rb @@ -19,18 +19,24 @@ # [START firestore_v1_generated_Firestore_RunQuery_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#run_query +# +def run_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::RunQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::RunQueryRequest.new -# Call the run_query method. -result = client.run_query request + # Call the run_query method. + result = client.run_query request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Firestore::V1::RunQueryResponse. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Firestore::V1::RunQueryResponse. + result.each do |response| + p response + end end # [END firestore_v1_generated_Firestore_RunQuery_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/update_document.rb b/google-cloud-firestore-v1/snippets/firestore/update_document.rb index 3507da20bd6a..386ccaf95eeb 100755 --- a/google-cloud-firestore-v1/snippets/firestore/update_document.rb +++ b/google-cloud-firestore-v1/snippets/firestore/update_document.rb @@ -19,15 +19,21 @@ # [START firestore_v1_generated_Firestore_UpdateDocument_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#update_document +# +def update_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new -# Call the update_document method. -result = client.update_document request + # Call the update_document method. + result = client.update_document request -# The returned object is of type Google::Cloud::Firestore::V1::Document. -p result + # The returned object is of type Google::Cloud::Firestore::V1::Document. + p result +end # [END firestore_v1_generated_Firestore_UpdateDocument_sync] diff --git a/google-cloud-firestore-v1/snippets/firestore/write.rb b/google-cloud-firestore-v1/snippets/firestore/write.rb index 0384db432e3a..c023f058fdcb 100755 --- a/google-cloud-firestore-v1/snippets/firestore/write.rb +++ b/google-cloud-firestore-v1/snippets/firestore/write.rb @@ -19,24 +19,30 @@ # [START firestore_v1_generated_Firestore_Write_sync] require "google/cloud/firestore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Firestore::V1::Firestore::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the write method to start streaming. -output = client.write input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Firestore::V1::WriteRequest.new -input << Google::Cloud::Firestore::V1::WriteRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Firestore::V1::Firestore::Client#write +# +def write + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Firestore::V1::Firestore::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the write method to start streaming. + output = client.write input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Firestore::V1::WriteRequest.new + input << Google::Cloud::Firestore::V1::WriteRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse. + output.each do |response| + p response + end end # [END firestore_v1_generated_Firestore_Write_sync] diff --git a/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json b/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json index 8aae8be97a27..a2e870ce19c2 100644 --- a/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json +++ b/google-cloud-firestore-v1/snippets/snippet_metadata_google.firestore.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-functions-v1/.rubocop.yml b/google-cloud-functions-v1/.rubocop.yml index 6a22d0d9336b..4a540ce1fbcf 100644 --- a/google-cloud-functions-v1/.rubocop.yml +++ b/google-cloud-functions-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-functions-v1.rb" diff --git a/google-cloud-functions-v1/snippets/Gemfile b/google-cloud-functions-v1/snippets/Gemfile index d7bb76453ea3..45887ac911d8 100755 --- a/google-cloud-functions-v1/snippets/Gemfile +++ b/google-cloud-functions-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/call_function.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/call_function.rb index 9a599a232b46..08975c94591e 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/call_function.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/call_function.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_CallFunction_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#call_function +# +def call_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::CallFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::CallFunctionRequest.new -# Call the call_function method. -result = client.call_function request + # Call the call_function method. + result = client.call_function request -# The returned object is of type Google::Cloud::Functions::V1::CallFunctionResponse. -p result + # The returned object is of type Google::Cloud::Functions::V1::CallFunctionResponse. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_CallFunction_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/create_function.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/create_function.rb index 3237f50c0a8b..e7d0b11dad80 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/create_function.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/create_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_CreateFunction_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#create_function +# +def create_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::CreateFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::CreateFunctionRequest.new -# Call the create_function method. -result = client.create_function request + # Call the create_function method. + result = client.create_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v1_generated_CloudFunctionsService_CreateFunction_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/delete_function.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/delete_function.rb index db6be42aea5f..18d02c84820c 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/delete_function.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/delete_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_DeleteFunction_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#delete_function +# +def delete_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::DeleteFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::DeleteFunctionRequest.new -# Call the delete_function method. -result = client.delete_function request + # Call the delete_function method. + result = client.delete_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v1_generated_CloudFunctionsService_DeleteFunction_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/generate_download_url.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/generate_download_url.rb index e7aae50e796a..1b0221970fa0 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/generate_download_url.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/generate_download_url.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_GenerateDownloadUrl_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#generate_download_url +# +def generate_download_url + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::GenerateDownloadUrlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::GenerateDownloadUrlRequest.new -# Call the generate_download_url method. -result = client.generate_download_url request + # Call the generate_download_url method. + result = client.generate_download_url request -# The returned object is of type Google::Cloud::Functions::V1::GenerateDownloadUrlResponse. -p result + # The returned object is of type Google::Cloud::Functions::V1::GenerateDownloadUrlResponse. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_GenerateDownloadUrl_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/generate_upload_url.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/generate_upload_url.rb index 61c33bbad4df..cbb3071f5fc5 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/generate_upload_url.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/generate_upload_url.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_GenerateUploadUrl_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#generate_upload_url +# +def generate_upload_url + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::GenerateUploadUrlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::GenerateUploadUrlRequest.new -# Call the generate_upload_url method. -result = client.generate_upload_url request + # Call the generate_upload_url method. + result = client.generate_upload_url request -# The returned object is of type Google::Cloud::Functions::V1::GenerateUploadUrlResponse. -p result + # The returned object is of type Google::Cloud::Functions::V1::GenerateUploadUrlResponse. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_GenerateUploadUrl_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/get_function.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/get_function.rb index f4d2f9e24e6d..1ca7362eb0b5 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/get_function.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/get_function.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_GetFunction_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#get_function +# +def get_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::GetFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::GetFunctionRequest.new -# Call the get_function method. -result = client.get_function request + # Call the get_function method. + result = client.get_function request -# The returned object is of type Google::Cloud::Functions::V1::CloudFunction. -p result + # The returned object is of type Google::Cloud::Functions::V1::CloudFunction. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_GetFunction_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/get_iam_policy.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/get_iam_policy.rb index 143dcd21e67a..c993296fa819 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/get_iam_policy.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_GetIamPolicy_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_GetIamPolicy_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/list_functions.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/list_functions.rb index 25ce9d49242d..2630e3619900 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/list_functions.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/list_functions.rb @@ -19,21 +19,27 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_ListFunctions_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#list_functions +# +def list_functions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::ListFunctionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::ListFunctionsRequest.new -# Call the list_functions method. -result = client.list_functions request + # Call the list_functions method. + result = client.list_functions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Functions::V1::CloudFunction. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Functions::V1::CloudFunction. + p response + end end # [END cloudfunctions_v1_generated_CloudFunctionsService_ListFunctions_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/set_iam_policy.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/set_iam_policy.rb index 6bb6739c0f6c..299a37d535a2 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/set_iam_policy.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_SetIamPolicy_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_SetIamPolicy_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/test_iam_permissions.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/test_iam_permissions.rb index 6e9d2af4f94a..eb2f3782c675 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/test_iam_permissions.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_TestIamPermissions_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudfunctions_v1_generated_CloudFunctionsService_TestIamPermissions_sync] diff --git a/google-cloud-functions-v1/snippets/cloud_functions_service/update_function.rb b/google-cloud-functions-v1/snippets/cloud_functions_service/update_function.rb index 86f9dca2656d..7debc9b0abda 100755 --- a/google-cloud-functions-v1/snippets/cloud_functions_service/update_function.rb +++ b/google-cloud-functions-v1/snippets/cloud_functions_service/update_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v1_generated_CloudFunctionsService_UpdateFunction_sync] require "google/cloud/functions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V1::CloudFunctionsService::Client#update_function +# +def update_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V1::CloudFunctionsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V1::UpdateFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V1::UpdateFunctionRequest.new -# Call the update_function method. -result = client.update_function request + # Call the update_function method. + result = client.update_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v1_generated_CloudFunctionsService_UpdateFunction_sync] diff --git a/google-cloud-functions-v1/snippets/snippet_metadata_google.cloud.functions.v1.json b/google-cloud-functions-v1/snippets/snippet_metadata_google.cloud.functions.v1.json index 59e409ced7f0..147ef1d2430b 100644 --- a/google-cloud-functions-v1/snippets/snippet_metadata_google.cloud.functions.v1.json +++ b/google-cloud-functions-v1/snippets/snippet_metadata_google.cloud.functions.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-functions-v2/.rubocop.yml b/google-cloud-functions-v2/.rubocop.yml index f7e33cc21bce..e04c1f319ea6 100644 --- a/google-cloud-functions-v2/.rubocop.yml +++ b/google-cloud-functions-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-functions-v2.rb" diff --git a/google-cloud-functions-v2/snippets/Gemfile b/google-cloud-functions-v2/snippets/Gemfile index 43701216b7fb..f655c3a782f4 100644 --- a/google-cloud-functions-v2/snippets/Gemfile +++ b/google-cloud-functions-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-functions-v2/snippets/function_service/create_function.rb b/google-cloud-functions-v2/snippets/function_service/create_function.rb index 13a44a11082f..ff809d29a656 100644 --- a/google-cloud-functions-v2/snippets/function_service/create_function.rb +++ b/google-cloud-functions-v2/snippets/function_service/create_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v2_generated_FunctionService_CreateFunction_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#create_function +# +def create_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::CreateFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::CreateFunctionRequest.new -# Call the create_function method. -result = client.create_function request + # Call the create_function method. + result = client.create_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v2_generated_FunctionService_CreateFunction_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/delete_function.rb b/google-cloud-functions-v2/snippets/function_service/delete_function.rb index 8718553a0136..a1946ab8e9d1 100644 --- a/google-cloud-functions-v2/snippets/function_service/delete_function.rb +++ b/google-cloud-functions-v2/snippets/function_service/delete_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v2_generated_FunctionService_DeleteFunction_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#delete_function +# +def delete_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::DeleteFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::DeleteFunctionRequest.new -# Call the delete_function method. -result = client.delete_function request + # Call the delete_function method. + result = client.delete_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v2_generated_FunctionService_DeleteFunction_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/generate_download_url.rb b/google-cloud-functions-v2/snippets/function_service/generate_download_url.rb index 41f0f72f153f..2ccc4d4609ee 100644 --- a/google-cloud-functions-v2/snippets/function_service/generate_download_url.rb +++ b/google-cloud-functions-v2/snippets/function_service/generate_download_url.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v2_generated_FunctionService_GenerateDownloadUrl_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#generate_download_url +# +def generate_download_url + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::GenerateDownloadUrlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::GenerateDownloadUrlRequest.new -# Call the generate_download_url method. -result = client.generate_download_url request + # Call the generate_download_url method. + result = client.generate_download_url request -# The returned object is of type Google::Cloud::Functions::V2::GenerateDownloadUrlResponse. -p result + # The returned object is of type Google::Cloud::Functions::V2::GenerateDownloadUrlResponse. + p result +end # [END cloudfunctions_v2_generated_FunctionService_GenerateDownloadUrl_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/generate_upload_url.rb b/google-cloud-functions-v2/snippets/function_service/generate_upload_url.rb index 0618528185b1..0811f255da5a 100644 --- a/google-cloud-functions-v2/snippets/function_service/generate_upload_url.rb +++ b/google-cloud-functions-v2/snippets/function_service/generate_upload_url.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#generate_upload_url +# +def generate_upload_url + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::GenerateUploadUrlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::GenerateUploadUrlRequest.new -# Call the generate_upload_url method. -result = client.generate_upload_url request + # Call the generate_upload_url method. + result = client.generate_upload_url request -# The returned object is of type Google::Cloud::Functions::V2::GenerateUploadUrlResponse. -p result + # The returned object is of type Google::Cloud::Functions::V2::GenerateUploadUrlResponse. + p result +end # [END cloudfunctions_v2_generated_FunctionService_GenerateUploadUrl_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/get_function.rb b/google-cloud-functions-v2/snippets/function_service/get_function.rb index 6b512e962caf..450e9d106951 100644 --- a/google-cloud-functions-v2/snippets/function_service/get_function.rb +++ b/google-cloud-functions-v2/snippets/function_service/get_function.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v2_generated_FunctionService_GetFunction_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#get_function +# +def get_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::GetFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::GetFunctionRequest.new -# Call the get_function method. -result = client.get_function request + # Call the get_function method. + result = client.get_function request -# The returned object is of type Google::Cloud::Functions::V2::Function. -p result + # The returned object is of type Google::Cloud::Functions::V2::Function. + p result +end # [END cloudfunctions_v2_generated_FunctionService_GetFunction_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/list_functions.rb b/google-cloud-functions-v2/snippets/function_service/list_functions.rb index 942a89b0d37c..b7e01d826c60 100644 --- a/google-cloud-functions-v2/snippets/function_service/list_functions.rb +++ b/google-cloud-functions-v2/snippets/function_service/list_functions.rb @@ -19,21 +19,27 @@ # [START cloudfunctions_v2_generated_FunctionService_ListFunctions_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#list_functions +# +def list_functions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::ListFunctionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::ListFunctionsRequest.new -# Call the list_functions method. -result = client.list_functions request + # Call the list_functions method. + result = client.list_functions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Functions::V2::Function. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Functions::V2::Function. + p response + end end # [END cloudfunctions_v2_generated_FunctionService_ListFunctions_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/list_runtimes.rb b/google-cloud-functions-v2/snippets/function_service/list_runtimes.rb index 4ff3aff04071..4ba623d1f5a0 100644 --- a/google-cloud-functions-v2/snippets/function_service/list_runtimes.rb +++ b/google-cloud-functions-v2/snippets/function_service/list_runtimes.rb @@ -19,15 +19,21 @@ # [START cloudfunctions_v2_generated_FunctionService_ListRuntimes_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#list_runtimes +# +def list_runtimes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::ListRuntimesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::ListRuntimesRequest.new -# Call the list_runtimes method. -result = client.list_runtimes request + # Call the list_runtimes method. + result = client.list_runtimes request -# The returned object is of type Google::Cloud::Functions::V2::ListRuntimesResponse. -p result + # The returned object is of type Google::Cloud::Functions::V2::ListRuntimesResponse. + p result +end # [END cloudfunctions_v2_generated_FunctionService_ListRuntimes_sync] diff --git a/google-cloud-functions-v2/snippets/function_service/update_function.rb b/google-cloud-functions-v2/snippets/function_service/update_function.rb index c9be2853427a..f81b5c1c54b4 100644 --- a/google-cloud-functions-v2/snippets/function_service/update_function.rb +++ b/google-cloud-functions-v2/snippets/function_service/update_function.rb @@ -19,22 +19,28 @@ # [START cloudfunctions_v2_generated_FunctionService_UpdateFunction_sync] require "google/cloud/functions/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Functions::V2::FunctionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Functions::V2::FunctionService::Client#update_function +# +def update_function + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Functions::V2::FunctionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Functions::V2::UpdateFunctionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Functions::V2::UpdateFunctionRequest.new -# Call the update_function method. -result = client.update_function request + # Call the update_function method. + result = client.update_function request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudfunctions_v2_generated_FunctionService_UpdateFunction_sync] diff --git a/google-cloud-functions-v2/snippets/snippet_metadata_google.cloud.functions.v2.json b/google-cloud-functions-v2/snippets/snippet_metadata_google.cloud.functions.v2.json index bf731b810f59..11b7571ab0d5 100644 --- a/google-cloud-functions-v2/snippets/snippet_metadata_google.cloud.functions.v2.json +++ b/google-cloud-functions-v2/snippets/snippet_metadata_google.cloud.functions.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gaming-v1/.rubocop.yml b/google-cloud-gaming-v1/.rubocop.yml index 00cccde7ba5e..bb35206c4fcf 100644 --- a/google-cloud-gaming-v1/.rubocop.yml +++ b/google-cloud-gaming-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gaming-v1.rb" diff --git a/google-cloud-gaming-v1/snippets/Gemfile b/google-cloud-gaming-v1/snippets/Gemfile index bd13937cbd23..abc8045fb767 100755 --- a/google-cloud-gaming-v1/snippets/Gemfile +++ b/google-cloud-gaming-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/create_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/create_game_server_cluster.rb index 4cc005152209..838f8f5c613d 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/create_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/create_game_server_cluster.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#create_game_server_cluster +# +def create_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::CreateGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::CreateGameServerClusterRequest.new -# Call the create_game_server_cluster method. -result = client.create_game_server_cluster request + # Call the create_game_server_cluster method. + result = client.create_game_server_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerClustersService_CreateGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/delete_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/delete_game_server_cluster.rb index 1adb6ce7ceba..d9f0e94db95a 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/delete_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/delete_game_server_cluster.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#delete_game_server_cluster +# +def delete_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest.new -# Call the delete_game_server_cluster method. -result = client.delete_game_server_cluster request + # Call the delete_game_server_cluster method. + result = client.delete_game_server_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerClustersService_DeleteGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/get_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/get_game_server_cluster.rb index 0a23c8bb82e1..8fb973837f96 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/get_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/get_game_server_cluster.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#get_game_server_cluster +# +def get_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::GetGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::GetGameServerClusterRequest.new -# Call the get_game_server_cluster method. -result = client.get_game_server_cluster request + # Call the get_game_server_cluster method. + result = client.get_game_server_cluster request -# The returned object is of type Google::Cloud::Gaming::V1::GameServerCluster. -p result + # The returned object is of type Google::Cloud::Gaming::V1::GameServerCluster. + p result +end # [END gameservices_v1_generated_GameServerClustersService_GetGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/list_game_server_clusters.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/list_game_server_clusters.rb index 2eb8d482d508..2d0cfafedf91 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/list_game_server_clusters.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/list_game_server_clusters.rb @@ -19,21 +19,27 @@ # [START gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#list_game_server_clusters +# +def list_game_server_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::ListGameServerClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::ListGameServerClustersRequest.new -# Call the list_game_server_clusters method. -result = client.list_game_server_clusters request + # Call the list_game_server_clusters method. + result = client.list_game_server_clusters request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Gaming::V1::GameServerCluster. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Gaming::V1::GameServerCluster. + p response + end end # [END gameservices_v1_generated_GameServerClustersService_ListGameServerClusters_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_create_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_create_game_server_cluster.rb index 9b0aaecbeb43..09dc2f9aa0fd 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_create_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_create_game_server_cluster.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#preview_create_game_server_cluster +# +def preview_create_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest.new -# Call the preview_create_game_server_cluster method. -result = client.preview_create_game_server_cluster request + # Call the preview_create_game_server_cluster method. + result = client.preview_create_game_server_cluster request -# The returned object is of type Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse. + p result +end # [END gameservices_v1_generated_GameServerClustersService_PreviewCreateGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_delete_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_delete_game_server_cluster.rb index acdfca806c05..282d0b12cb7a 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_delete_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_delete_game_server_cluster.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#preview_delete_game_server_cluster +# +def preview_delete_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest.new -# Call the preview_delete_game_server_cluster method. -result = client.preview_delete_game_server_cluster request + # Call the preview_delete_game_server_cluster method. + result = client.preview_delete_game_server_cluster request -# The returned object is of type Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse. + p result +end # [END gameservices_v1_generated_GameServerClustersService_PreviewDeleteGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_update_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_update_game_server_cluster.rb index a72bb0068e6a..6696cb48fa05 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_update_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/preview_update_game_server_cluster.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#preview_update_game_server_cluster +# +def preview_update_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest.new -# Call the preview_update_game_server_cluster method. -result = client.preview_update_game_server_cluster request + # Call the preview_update_game_server_cluster method. + result = client.preview_update_game_server_cluster request -# The returned object is of type Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse. + p result +end # [END gameservices_v1_generated_GameServerClustersService_PreviewUpdateGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_clusters_service/update_game_server_cluster.rb b/google-cloud-gaming-v1/snippets/game_server_clusters_service/update_game_server_cluster.rb index 0ec75842b0f2..50062c1f4670 100755 --- a/google-cloud-gaming-v1/snippets/game_server_clusters_service/update_game_server_cluster.rb +++ b/google-cloud-gaming-v1/snippets/game_server_clusters_service/update_game_server_cluster.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerClustersService::Client#update_game_server_cluster +# +def update_game_server_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerClustersService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest.new -# Call the update_game_server_cluster method. -result = client.update_game_server_cluster request + # Call the update_game_server_cluster method. + result = client.update_game_server_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerClustersService_UpdateGameServerCluster_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_configs_service/create_game_server_config.rb b/google-cloud-gaming-v1/snippets/game_server_configs_service/create_game_server_config.rb index 1a87bec0c879..fe31155f9844 100755 --- a/google-cloud-gaming-v1/snippets/game_server_configs_service/create_game_server_config.rb +++ b/google-cloud-gaming-v1/snippets/game_server_configs_service/create_game_server_config.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerConfigsService::Client#create_game_server_config +# +def create_game_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::CreateGameServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::CreateGameServerConfigRequest.new -# Call the create_game_server_config method. -result = client.create_game_server_config request + # Call the create_game_server_config method. + result = client.create_game_server_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerConfigsService_CreateGameServerConfig_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_configs_service/delete_game_server_config.rb b/google-cloud-gaming-v1/snippets/game_server_configs_service/delete_game_server_config.rb index cf75b4d45050..399494e9df9e 100755 --- a/google-cloud-gaming-v1/snippets/game_server_configs_service/delete_game_server_config.rb +++ b/google-cloud-gaming-v1/snippets/game_server_configs_service/delete_game_server_config.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerConfigsService::Client#delete_game_server_config +# +def delete_game_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::DeleteGameServerConfigRequest.new -# Call the delete_game_server_config method. -result = client.delete_game_server_config request + # Call the delete_game_server_config method. + result = client.delete_game_server_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerConfigsService_DeleteGameServerConfig_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_configs_service/get_game_server_config.rb b/google-cloud-gaming-v1/snippets/game_server_configs_service/get_game_server_config.rb index a7a1344170c5..4c8d1e569296 100755 --- a/google-cloud-gaming-v1/snippets/game_server_configs_service/get_game_server_config.rb +++ b/google-cloud-gaming-v1/snippets/game_server_configs_service/get_game_server_config.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerConfigsService::Client#get_game_server_config +# +def get_game_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::GetGameServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::GetGameServerConfigRequest.new -# Call the get_game_server_config method. -result = client.get_game_server_config request + # Call the get_game_server_config method. + result = client.get_game_server_config request -# The returned object is of type Google::Cloud::Gaming::V1::GameServerConfig. -p result + # The returned object is of type Google::Cloud::Gaming::V1::GameServerConfig. + p result +end # [END gameservices_v1_generated_GameServerConfigsService_GetGameServerConfig_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_configs_service/list_game_server_configs.rb b/google-cloud-gaming-v1/snippets/game_server_configs_service/list_game_server_configs.rb index ef71e0b9b861..c083ae65307e 100755 --- a/google-cloud-gaming-v1/snippets/game_server_configs_service/list_game_server_configs.rb +++ b/google-cloud-gaming-v1/snippets/game_server_configs_service/list_game_server_configs.rb @@ -19,21 +19,27 @@ # [START gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerConfigsService::Client#list_game_server_configs +# +def list_game_server_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerConfigsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::ListGameServerConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::ListGameServerConfigsRequest.new -# Call the list_game_server_configs method. -result = client.list_game_server_configs request + # Call the list_game_server_configs method. + result = client.list_game_server_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Gaming::V1::GameServerConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Gaming::V1::GameServerConfig. + p response + end end # [END gameservices_v1_generated_GameServerConfigsService_ListGameServerConfigs_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/create_game_server_deployment.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/create_game_server_deployment.rb index cfb2ee57771e..d7bdb0690bf9 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/create_game_server_deployment.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/create_game_server_deployment.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#create_game_server_deployment +# +def create_game_server_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::CreateGameServerDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::CreateGameServerDeploymentRequest.new -# Call the create_game_server_deployment method. -result = client.create_game_server_deployment request + # Call the create_game_server_deployment method. + result = client.create_game_server_deployment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerDeploymentsService_CreateGameServerDeployment_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/delete_game_server_deployment.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/delete_game_server_deployment.rb index d9387001621d..6c215dbaf301 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/delete_game_server_deployment.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/delete_game_server_deployment.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#delete_game_server_deployment +# +def delete_game_server_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::DeleteGameServerDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::DeleteGameServerDeploymentRequest.new -# Call the delete_game_server_deployment method. -result = client.delete_game_server_deployment request + # Call the delete_game_server_deployment method. + result = client.delete_game_server_deployment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerDeploymentsService_DeleteGameServerDeployment_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/fetch_deployment_state.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/fetch_deployment_state.rb index 1f522cb981df..4abd72607c17 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/fetch_deployment_state.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/fetch_deployment_state.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#fetch_deployment_state +# +def fetch_deployment_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::FetchDeploymentStateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::FetchDeploymentStateRequest.new -# Call the fetch_deployment_state method. -result = client.fetch_deployment_state request + # Call the fetch_deployment_state method. + result = client.fetch_deployment_state request -# The returned object is of type Google::Cloud::Gaming::V1::FetchDeploymentStateResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::FetchDeploymentStateResponse. + p result +end # [END gameservices_v1_generated_GameServerDeploymentsService_FetchDeploymentState_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment.rb index ac9d5a626289..550ea360618a 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#get_game_server_deployment +# +def get_game_server_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::GetGameServerDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::GetGameServerDeploymentRequest.new -# Call the get_game_server_deployment method. -result = client.get_game_server_deployment request + # Call the get_game_server_deployment method. + result = client.get_game_server_deployment request -# The returned object is of type Google::Cloud::Gaming::V1::GameServerDeployment. -p result + # The returned object is of type Google::Cloud::Gaming::V1::GameServerDeployment. + p result +end # [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeployment_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment_rollout.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment_rollout.rb index 019d85437e88..0e8d6c607959 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment_rollout.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/get_game_server_deployment_rollout.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#get_game_server_deployment_rollout +# +def get_game_server_deployment_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::GetGameServerDeploymentRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::GetGameServerDeploymentRolloutRequest.new -# Call the get_game_server_deployment_rollout method. -result = client.get_game_server_deployment_rollout request + # Call the get_game_server_deployment_rollout method. + result = client.get_game_server_deployment_rollout request -# The returned object is of type Google::Cloud::Gaming::V1::GameServerDeploymentRollout. -p result + # The returned object is of type Google::Cloud::Gaming::V1::GameServerDeploymentRollout. + p result +end # [END gameservices_v1_generated_GameServerDeploymentsService_GetGameServerDeploymentRollout_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/list_game_server_deployments.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/list_game_server_deployments.rb index 9a42f2937111..83d99556dc15 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/list_game_server_deployments.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/list_game_server_deployments.rb @@ -19,21 +19,27 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#list_game_server_deployments +# +def list_game_server_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::ListGameServerDeploymentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::ListGameServerDeploymentsRequest.new -# Call the list_game_server_deployments method. -result = client.list_game_server_deployments request + # Call the list_game_server_deployments method. + result = client.list_game_server_deployments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Gaming::V1::GameServerDeployment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Gaming::V1::GameServerDeployment. + p response + end end # [END gameservices_v1_generated_GameServerDeploymentsService_ListGameServerDeployments_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/preview_game_server_deployment_rollout.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/preview_game_server_deployment_rollout.rb index ed914a1fcd87..82a21115c77e 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/preview_game_server_deployment_rollout.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/preview_game_server_deployment_rollout.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#preview_game_server_deployment_rollout +# +def preview_game_server_deployment_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutRequest.new -# Call the preview_game_server_deployment_rollout method. -result = client.preview_game_server_deployment_rollout request + # Call the preview_game_server_deployment_rollout method. + result = client.preview_game_server_deployment_rollout request -# The returned object is of type Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse. + p result +end # [END gameservices_v1_generated_GameServerDeploymentsService_PreviewGameServerDeploymentRollout_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment.rb index 963ebe24d6b9..d395980432b8 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#update_game_server_deployment +# +def update_game_server_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRequest.new -# Call the update_game_server_deployment method. -result = client.update_game_server_deployment request + # Call the update_game_server_deployment method. + result = client.update_game_server_deployment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeployment_sync] diff --git a/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment_rollout.rb b/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment_rollout.rb index 38b4495a2a0a..a33e7a7571ee 100755 --- a/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment_rollout.rb +++ b/google-cloud-gaming-v1/snippets/game_server_deployments_service/update_game_server_deployment_rollout.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client#update_game_server_deployment_rollout +# +def update_game_server_deployment_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRolloutRequest.new -# Call the update_game_server_deployment_rollout method. -result = client.update_game_server_deployment_rollout request + # Call the update_game_server_deployment_rollout method. + result = client.update_game_server_deployment_rollout request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_GameServerDeploymentsService_UpdateGameServerDeploymentRollout_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/create_realm.rb b/google-cloud-gaming-v1/snippets/realms_service/create_realm.rb index 01d07996f79b..571ded550d1f 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/create_realm.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/create_realm.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_RealmsService_CreateRealm_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#create_realm +# +def create_realm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::CreateRealmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::CreateRealmRequest.new -# Call the create_realm method. -result = client.create_realm request + # Call the create_realm method. + result = client.create_realm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_RealmsService_CreateRealm_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/delete_realm.rb b/google-cloud-gaming-v1/snippets/realms_service/delete_realm.rb index 881db3cd22dc..92c9ea28abfe 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/delete_realm.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/delete_realm.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_RealmsService_DeleteRealm_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#delete_realm +# +def delete_realm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::DeleteRealmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::DeleteRealmRequest.new -# Call the delete_realm method. -result = client.delete_realm request + # Call the delete_realm method. + result = client.delete_realm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_RealmsService_DeleteRealm_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/get_realm.rb b/google-cloud-gaming-v1/snippets/realms_service/get_realm.rb index ebd8f677ff84..207eb741e3f4 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/get_realm.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/get_realm.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_RealmsService_GetRealm_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#get_realm +# +def get_realm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::GetRealmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::GetRealmRequest.new -# Call the get_realm method. -result = client.get_realm request + # Call the get_realm method. + result = client.get_realm request -# The returned object is of type Google::Cloud::Gaming::V1::Realm. -p result + # The returned object is of type Google::Cloud::Gaming::V1::Realm. + p result +end # [END gameservices_v1_generated_RealmsService_GetRealm_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/list_realms.rb b/google-cloud-gaming-v1/snippets/realms_service/list_realms.rb index 4f1603a1dbe0..a958e16e99c9 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/list_realms.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/list_realms.rb @@ -19,21 +19,27 @@ # [START gameservices_v1_generated_RealmsService_ListRealms_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#list_realms +# +def list_realms + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::ListRealmsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::ListRealmsRequest.new -# Call the list_realms method. -result = client.list_realms request + # Call the list_realms method. + result = client.list_realms request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Gaming::V1::Realm. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Gaming::V1::Realm. + p response + end end # [END gameservices_v1_generated_RealmsService_ListRealms_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/preview_realm_update.rb b/google-cloud-gaming-v1/snippets/realms_service/preview_realm_update.rb index 32276a1c5417..f9c1c5edac1f 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/preview_realm_update.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/preview_realm_update.rb @@ -19,15 +19,21 @@ # [START gameservices_v1_generated_RealmsService_PreviewRealmUpdate_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#preview_realm_update +# +def preview_realm_update + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::PreviewRealmUpdateRequest.new -# Call the preview_realm_update method. -result = client.preview_realm_update request + # Call the preview_realm_update method. + result = client.preview_realm_update request -# The returned object is of type Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse. -p result + # The returned object is of type Google::Cloud::Gaming::V1::PreviewRealmUpdateResponse. + p result +end # [END gameservices_v1_generated_RealmsService_PreviewRealmUpdate_sync] diff --git a/google-cloud-gaming-v1/snippets/realms_service/update_realm.rb b/google-cloud-gaming-v1/snippets/realms_service/update_realm.rb index 8af6ff600068..70aee09d253d 100755 --- a/google-cloud-gaming-v1/snippets/realms_service/update_realm.rb +++ b/google-cloud-gaming-v1/snippets/realms_service/update_realm.rb @@ -19,22 +19,28 @@ # [START gameservices_v1_generated_RealmsService_UpdateRealm_sync] require "google/cloud/gaming/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Gaming::V1::RealmsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Gaming::V1::RealmsService::Client#update_realm +# +def update_realm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Gaming::V1::RealmsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Gaming::V1::UpdateRealmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Gaming::V1::UpdateRealmRequest.new -# Call the update_realm method. -result = client.update_realm request + # Call the update_realm method. + result = client.update_realm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gameservices_v1_generated_RealmsService_UpdateRealm_sync] diff --git a/google-cloud-gaming-v1/snippets/snippet_metadata_google.cloud.gaming.v1.json b/google-cloud-gaming-v1/snippets/snippet_metadata_google.cloud.gaming.v1.json index 09bcb50831d3..947473bef434 100644 --- a/google-cloud-gaming-v1/snippets/snippet_metadata_google.cloud.gaming.v1.json +++ b/google-cloud-gaming-v1/snippets/snippet_metadata_google.cloud.gaming.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gke_backup-v1/.rubocop.yml b/google-cloud-gke_backup-v1/.rubocop.yml index 7a5cce1d038b..bdd7d3ac54fd 100644 --- a/google-cloud-gke_backup-v1/.rubocop.yml +++ b/google-cloud-gke_backup-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gke_backup-v1.rb" diff --git a/google-cloud-gke_backup-v1/snippets/Gemfile b/google-cloud-gke_backup-v1/snippets/Gemfile index 41bacd28e42f..3ef809ecd159 100644 --- a/google-cloud-gke_backup-v1/snippets/Gemfile +++ b/google-cloud-gke_backup-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup.rb index 53b38cc9f85b..54900a4326ec 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_CreateBackup_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_CreateBackup_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup_plan.rb index 334ea268a2df..ed6b6b435a50 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_backup_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#create_backup_plan +# +def create_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::CreateBackupPlanRequest.new -# Call the create_backup_plan method. -result = client.create_backup_plan request + # Call the create_backup_plan method. + result = client.create_backup_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_CreateBackupPlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore.rb index 2f4dab3c5121..4d8ee25d21fd 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_CreateRestore_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#create_restore +# +def create_restore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::CreateRestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::CreateRestoreRequest.new -# Call the create_restore method. -result = client.create_restore request + # Call the create_restore method. + result = client.create_restore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_CreateRestore_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore_plan.rb index d73316005651..acc0447e4f2d 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/create_restore_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#create_restore_plan +# +def create_restore_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::CreateRestorePlanRequest.new -# Call the create_restore_plan method. -result = client.create_restore_plan request + # Call the create_restore_plan method. + result = client.create_restore_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_CreateRestorePlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup.rb index 874d686089c4..3624c9feeb5d 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_DeleteBackup_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_DeleteBackup_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup_plan.rb index d44b0ae764d5..0956fe5e9e8e 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_backup_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#delete_backup_plan +# +def delete_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::DeleteBackupPlanRequest.new -# Call the delete_backup_plan method. -result = client.delete_backup_plan request + # Call the delete_backup_plan method. + result = client.delete_backup_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_DeleteBackupPlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore.rb index 6732f3b28dcd..bff216b21e78 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_DeleteRestore_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#delete_restore +# +def delete_restore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::DeleteRestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::DeleteRestoreRequest.new -# Call the delete_restore method. -result = client.delete_restore request + # Call the delete_restore method. + result = client.delete_restore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_DeleteRestore_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore_plan.rb index 413997f04c98..2d18f84d427a 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/delete_restore_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#delete_restore_plan +# +def delete_restore_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::DeleteRestorePlanRequest.new -# Call the delete_restore_plan method. -result = client.delete_restore_plan request + # Call the delete_restore_plan method. + result = client.delete_restore_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_DeleteRestorePlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup.rb index a0048f91a653..01775fd1da09 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetBackup_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::GkeBackup::V1::Backup. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::Backup. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetBackup_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup_plan.rb index fcfae8572318..68190c1b9dee 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_backup_plan.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetBackupPlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_backup_plan +# +def get_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetBackupPlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetBackupPlanRequest.new -# Call the get_backup_plan method. -result = client.get_backup_plan request + # Call the get_backup_plan method. + result = client.get_backup_plan request -# The returned object is of type Google::Cloud::GkeBackup::V1::BackupPlan. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::BackupPlan. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetBackupPlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore.rb index 4a93c022f83d..e1f5f9168a2b 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetRestore_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_restore +# +def get_restore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetRestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetRestoreRequest.new -# Call the get_restore method. -result = client.get_restore request + # Call the get_restore method. + result = client.get_restore request -# The returned object is of type Google::Cloud::GkeBackup::V1::Restore. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::Restore. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetRestore_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore_plan.rb index cd0c500ca3d3..dd18e55f79c4 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_restore_plan.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetRestorePlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_restore_plan +# +def get_restore_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetRestorePlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetRestorePlanRequest.new -# Call the get_restore_plan method. -result = client.get_restore_plan request + # Call the get_restore_plan method. + result = client.get_restore_plan request -# The returned object is of type Google::Cloud::GkeBackup::V1::RestorePlan. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::RestorePlan. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetRestorePlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_backup.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_backup.rb index 4a3bbc818b06..4003dddcf5b8 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_backup.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_backup.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_volume_backup +# +def get_volume_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetVolumeBackupRequest.new -# Call the get_volume_backup method. -result = client.get_volume_backup request + # Call the get_volume_backup method. + result = client.get_volume_backup request -# The returned object is of type Google::Cloud::GkeBackup::V1::VolumeBackup. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::VolumeBackup. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetVolumeBackup_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_restore.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_restore.rb index 901d1ca93d21..792a09844391 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_restore.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/get_volume_restore.rb @@ -19,15 +19,21 @@ # [START gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#get_volume_restore +# +def get_volume_restore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::GetVolumeRestoreRequest.new -# Call the get_volume_restore method. -result = client.get_volume_restore request + # Call the get_volume_restore method. + result = client.get_volume_restore request -# The returned object is of type Google::Cloud::GkeBackup::V1::VolumeRestore. -p result + # The returned object is of type Google::Cloud::GkeBackup::V1::VolumeRestore. + p result +end # [END gkebackup_v1_generated_BackupForGKE_GetVolumeRestore_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backup_plans.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backup_plans.rb index 1e87df9ce5b0..606d724a6663 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backup_plans.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backup_plans.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListBackupPlans_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_backup_plans +# +def list_backup_plans + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListBackupPlansRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListBackupPlansRequest.new -# Call the list_backup_plans method. -result = client.list_backup_plans request + # Call the list_backup_plans method. + result = client.list_backup_plans request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::BackupPlan. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::BackupPlan. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListBackupPlans_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backups.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backups.rb index 74dc222dbb14..2fbf9c153a01 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backups.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_backups.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListBackups_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::Backup. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListBackups_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restore_plans.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restore_plans.rb index 73c38ad39c6b..0e18d513ad17 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restore_plans.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restore_plans.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListRestorePlans_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_restore_plans +# +def list_restore_plans + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListRestorePlansRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListRestorePlansRequest.new -# Call the list_restore_plans method. -result = client.list_restore_plans request + # Call the list_restore_plans method. + result = client.list_restore_plans request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::RestorePlan. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::RestorePlan. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListRestorePlans_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restores.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restores.rb index 16e721334057..b1d271406451 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restores.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_restores.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListRestores_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_restores +# +def list_restores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListRestoresRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListRestoresRequest.new -# Call the list_restores method. -result = client.list_restores request + # Call the list_restores method. + result = client.list_restores request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::Restore. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::Restore. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListRestores_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_backups.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_backups.rb index e73cd6f18cd0..bdc7cc5fc103 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_backups.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_backups.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_volume_backups +# +def list_volume_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListVolumeBackupsRequest.new -# Call the list_volume_backups method. -result = client.list_volume_backups request + # Call the list_volume_backups method. + result = client.list_volume_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeBackup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeBackup. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListVolumeBackups_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_restores.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_restores.rb index e55818c93a99..e34dba37d899 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_restores.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/list_volume_restores.rb @@ -19,21 +19,27 @@ # [START gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#list_volume_restores +# +def list_volume_restores + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::ListVolumeRestoresRequest.new -# Call the list_volume_restores method. -result = client.list_volume_restores request + # Call the list_volume_restores method. + result = client.list_volume_restores request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeRestore. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeBackup::V1::VolumeRestore. + p response + end end # [END gkebackup_v1_generated_BackupForGKE_ListVolumeRestores_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup.rb index 583ea1c96578..701b2c8b2b7c 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_UpdateBackup_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#update_backup +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::UpdateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::UpdateBackupRequest.new -# Call the update_backup method. -result = client.update_backup request + # Call the update_backup method. + result = client.update_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_UpdateBackup_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup_plan.rb index 02f3a1b812ad..8f1b257225a5 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_backup_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#update_backup_plan +# +def update_backup_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::UpdateBackupPlanRequest.new -# Call the update_backup_plan method. -result = client.update_backup_plan request + # Call the update_backup_plan method. + result = client.update_backup_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_UpdateBackupPlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore.rb index 9df3a011e1bd..4d628476ede4 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_UpdateRestore_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#update_restore +# +def update_restore + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::UpdateRestoreRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::UpdateRestoreRequest.new -# Call the update_restore method. -result = client.update_restore request + # Call the update_restore method. + result = client.update_restore request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_UpdateRestore_sync] diff --git a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore_plan.rb b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore_plan.rb index 823a181667ac..d8fea3852850 100644 --- a/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore_plan.rb +++ b/google-cloud-gke_backup-v1/snippets/backup_for_gke/update_restore_plan.rb @@ -19,22 +19,28 @@ # [START gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_sync] require "google/cloud/gke_backup/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeBackup::V1::BackupForGKE::Client#update_restore_plan +# +def update_restore_plan + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeBackup::V1::BackupForGKE::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeBackup::V1::UpdateRestorePlanRequest.new -# Call the update_restore_plan method. -result = client.update_restore_plan request + # Call the update_restore_plan method. + result = client.update_restore_plan request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkebackup_v1_generated_BackupForGKE_UpdateRestorePlan_sync] diff --git a/google-cloud-gke_backup-v1/snippets/snippet_metadata_google.cloud.gkebackup.v1.json b/google-cloud-gke_backup-v1/snippets/snippet_metadata_google.cloud.gkebackup.v1.json index 5b10de235917..deaef88638af 100644 --- a/google-cloud-gke_backup-v1/snippets/snippet_metadata_google.cloud.gkebackup.v1.json +++ b/google-cloud-gke_backup-v1/snippets/snippet_metadata_google.cloud.gkebackup.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gke_connect-gateway-v1beta1/.rubocop.yml b/google-cloud-gke_connect-gateway-v1beta1/.rubocop.yml index 5acf1f0ddee2..9feb6df81c18 100644 --- a/google-cloud-gke_connect-gateway-v1beta1/.rubocop.yml +++ b/google-cloud-gke_connect-gateway-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gke_connect-gateway-v1beta1.rb" diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/Gemfile b/google-cloud-gke_connect-gateway-v1beta1/snippets/Gemfile index 2d35f3a2c1b8..1c7c8771ed74 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/Gemfile +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/delete_resource.rb b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/delete_resource.rb index f1a494fe1a0d..5506c4dc841a 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/delete_resource.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/delete_resource.rb @@ -19,15 +19,21 @@ # [START connectgateway_v1beta1_generated_GatewayService_DeleteResource_sync] require "google/cloud/gke_connect/gateway/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client#delete_resource +# +def delete_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Api::HttpBody.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Api::HttpBody.new -# Call the delete_resource method. -result = client.delete_resource request + # Call the delete_resource method. + result = client.delete_resource request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END connectgateway_v1beta1_generated_GatewayService_DeleteResource_sync] diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/get_resource.rb b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/get_resource.rb index 3e8600f1f1fc..b9629aebe505 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/get_resource.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/get_resource.rb @@ -19,15 +19,21 @@ # [START connectgateway_v1beta1_generated_GatewayService_GetResource_sync] require "google/cloud/gke_connect/gateway/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client#get_resource +# +def get_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Api::HttpBody.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Api::HttpBody.new -# Call the get_resource method. -result = client.get_resource request + # Call the get_resource method. + result = client.get_resource request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END connectgateway_v1beta1_generated_GatewayService_GetResource_sync] diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/patch_resource.rb b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/patch_resource.rb index 1f9ea2ce60e6..783e0040f17f 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/patch_resource.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/patch_resource.rb @@ -19,15 +19,21 @@ # [START connectgateway_v1beta1_generated_GatewayService_PatchResource_sync] require "google/cloud/gke_connect/gateway/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client#patch_resource +# +def patch_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Api::HttpBody.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Api::HttpBody.new -# Call the patch_resource method. -result = client.patch_resource request + # Call the patch_resource method. + result = client.patch_resource request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END connectgateway_v1beta1_generated_GatewayService_PatchResource_sync] diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/post_resource.rb b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/post_resource.rb index 73a5a3e17417..7b7e60b1ccde 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/post_resource.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/post_resource.rb @@ -19,15 +19,21 @@ # [START connectgateway_v1beta1_generated_GatewayService_PostResource_sync] require "google/cloud/gke_connect/gateway/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client#post_resource +# +def post_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Api::HttpBody.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Api::HttpBody.new -# Call the post_resource method. -result = client.post_resource request + # Call the post_resource method. + result = client.post_resource request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END connectgateway_v1beta1_generated_GatewayService_PostResource_sync] diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/put_resource.rb b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/put_resource.rb index 2772b55deb08..98a792099517 100755 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/put_resource.rb +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/gateway_service/put_resource.rb @@ -19,15 +19,21 @@ # [START connectgateway_v1beta1_generated_GatewayService_PutResource_sync] require "google/cloud/gke_connect/gateway/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client#put_resource +# +def put_resource + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Api::HttpBody.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Api::HttpBody.new -# Call the put_resource method. -result = client.put_resource request + # Call the put_resource method. + result = client.put_resource request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END connectgateway_v1beta1_generated_GatewayService_PutResource_sync] diff --git a/google-cloud-gke_connect-gateway-v1beta1/snippets/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json b/google-cloud-gke_connect-gateway-v1beta1/snippets/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json index e91da3ef8b35..8858588b89f6 100644 --- a/google-cloud-gke_connect-gateway-v1beta1/snippets/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json +++ b/google-cloud-gke_connect-gateway-v1beta1/snippets/snippet_metadata_google.cloud.gkeconnect.gateway.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gke_hub-v1/.rubocop.yml b/google-cloud-gke_hub-v1/.rubocop.yml index 0d36e5dbbab8..363761232662 100644 --- a/google-cloud-gke_hub-v1/.rubocop.yml +++ b/google-cloud-gke_hub-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gke_hub-v1.rb" diff --git a/google-cloud-gke_hub-v1/snippets/Gemfile b/google-cloud-gke_hub-v1/snippets/Gemfile index 5828b5412b1d..6f6618b13d59 100755 --- a/google-cloud-gke_hub-v1/snippets/Gemfile +++ b/google-cloud-gke_hub-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_feature.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_feature.rb index f69b134828fb..9f2e5d2b170e 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/create_feature.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_feature.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_CreateFeature_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_feature +# +def create_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::CreateFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateFeatureRequest.new -# Call the create_feature method. -result = client.create_feature request + # Call the create_feature method. + result = client.create_feature request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_CreateFeature_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership.rb index 6620ed68f5b7..3def53a3a95d 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/create_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_CreateMembership_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#create_membership +# +def create_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::CreateMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::CreateMembershipRequest.new -# Call the create_membership method. -result = client.create_membership request + # Call the create_membership method. + result = client.create_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_CreateMembership_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_feature.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_feature.rb index d064078871d1..ce5cf37cbb59 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_feature.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_feature.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_DeleteFeature_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_feature +# +def delete_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::DeleteFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteFeatureRequest.new -# Call the delete_feature method. -result = client.delete_feature request + # Call the delete_feature method. + result = client.delete_feature request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_DeleteFeature_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership.rb index eebab7ba38ec..9dc495ce1056 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/delete_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_DeleteMembership_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#delete_membership +# +def delete_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::DeleteMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::DeleteMembershipRequest.new -# Call the delete_membership method. -result = client.delete_membership request + # Call the delete_membership method. + result = client.delete_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_DeleteMembership_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/generate_connect_manifest.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/generate_connect_manifest.rb index abb9947b398a..b3e82de6c69e 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/generate_connect_manifest.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/generate_connect_manifest.rb @@ -19,15 +19,21 @@ # [START gkehub_v1_generated_GkeHub_GenerateConnectManifest_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#generate_connect_manifest +# +def generate_connect_manifest + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GenerateConnectManifestRequest.new -# Call the generate_connect_manifest method. -result = client.generate_connect_manifest request + # Call the generate_connect_manifest method. + result = client.generate_connect_manifest request -# The returned object is of type Google::Cloud::GkeHub::V1::GenerateConnectManifestResponse. -p result + # The returned object is of type Google::Cloud::GkeHub::V1::GenerateConnectManifestResponse. + p result +end # [END gkehub_v1_generated_GkeHub_GenerateConnectManifest_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_feature.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_feature.rb index b948b2065030..966a16168577 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/get_feature.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_feature.rb @@ -19,15 +19,21 @@ # [START gkehub_v1_generated_GkeHub_GetFeature_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_feature +# +def get_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::GetFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetFeatureRequest.new -# Call the get_feature method. -result = client.get_feature request + # Call the get_feature method. + result = client.get_feature request -# The returned object is of type Google::Cloud::GkeHub::V1::Feature. -p result + # The returned object is of type Google::Cloud::GkeHub::V1::Feature. + p result +end # [END gkehub_v1_generated_GkeHub_GetFeature_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership.rb index db8e0e09b068..5fe283185425 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/get_membership.rb @@ -19,15 +19,21 @@ # [START gkehub_v1_generated_GkeHub_GetMembership_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#get_membership +# +def get_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::GetMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::GetMembershipRequest.new -# Call the get_membership method. -result = client.get_membership request + # Call the get_membership method. + result = client.get_membership request -# The returned object is of type Google::Cloud::GkeHub::V1::Membership. -p result + # The returned object is of type Google::Cloud::GkeHub::V1::Membership. + p result +end # [END gkehub_v1_generated_GkeHub_GetMembership_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_features.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_features.rb index d39a7ddc9d6c..04339deb3ea2 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/list_features.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_features.rb @@ -19,21 +19,27 @@ # [START gkehub_v1_generated_GkeHub_ListFeatures_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_features +# +def list_features + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::ListFeaturesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListFeaturesRequest.new -# Call the list_features method. -result = client.list_features request + # Call the list_features method. + result = client.list_features request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeHub::V1::Feature. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeHub::V1::Feature. + p response + end end # [END gkehub_v1_generated_GkeHub_ListFeatures_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/list_memberships.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/list_memberships.rb index d96f0101ed65..d162887e7031 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/list_memberships.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/list_memberships.rb @@ -19,21 +19,27 @@ # [START gkehub_v1_generated_GkeHub_ListMemberships_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#list_memberships +# +def list_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::ListMembershipsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::ListMembershipsRequest.new -# Call the list_memberships method. -result = client.list_memberships request + # Call the list_memberships method. + result = client.list_memberships request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeHub::V1::Membership. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeHub::V1::Membership. + p response + end end # [END gkehub_v1_generated_GkeHub_ListMemberships_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_feature.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_feature.rb index 52d54261595b..3fc913602851 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/update_feature.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_feature.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_UpdateFeature_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_feature +# +def update_feature + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::UpdateFeatureRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateFeatureRequest.new -# Call the update_feature method. -result = client.update_feature request + # Call the update_feature method. + result = client.update_feature request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_UpdateFeature_sync] diff --git a/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership.rb b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership.rb index f0d8230d9b17..87675e5319bc 100755 --- a/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership.rb +++ b/google-cloud-gke_hub-v1/snippets/gke_hub/update_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1_generated_GkeHub_UpdateMembership_sync] require "google/cloud/gke_hub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1::GkeHub::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1::GkeHub::Client#update_membership +# +def update_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1::GkeHub::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1::UpdateMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1::UpdateMembershipRequest.new -# Call the update_membership method. -result = client.update_membership request + # Call the update_membership method. + result = client.update_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1_generated_GkeHub_UpdateMembership_sync] diff --git a/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json b/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json index 4bca914782b3..85ee431e1cf6 100644 --- a/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json +++ b/google-cloud-gke_hub-v1/snippets/snippet_metadata_google.cloud.gkehub.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gke_hub-v1beta1/.rubocop.yml b/google-cloud-gke_hub-v1beta1/.rubocop.yml index 105a5fe676e8..8e24e592235a 100644 --- a/google-cloud-gke_hub-v1beta1/.rubocop.yml +++ b/google-cloud-gke_hub-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gke_hub-v1beta1.rb" diff --git a/google-cloud-gke_hub-v1beta1/snippets/Gemfile b/google-cloud-gke_hub-v1beta1/snippets/Gemfile index 3d466066b638..d525b328087a 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/Gemfile +++ b/google-cloud-gke_hub-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/create_membership.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/create_membership.rb index d78e80b6e9f6..5d5f4945f698 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/create_membership.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/create_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#create_membership +# +def create_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::CreateMembershipRequest.new -# Call the create_membership method. -result = client.create_membership request + # Call the create_membership method. + result = client.create_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1beta1_generated_GkeHubMembershipService_CreateMembership_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/delete_membership.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/delete_membership.rb index 6ec13e5df22d..4fb90fd63aac 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/delete_membership.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/delete_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#delete_membership +# +def delete_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::DeleteMembershipRequest.new -# Call the delete_membership method. -result = client.delete_membership request + # Call the delete_membership method. + result = client.delete_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1beta1_generated_GkeHubMembershipService_DeleteMembership_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_connect_manifest.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_connect_manifest.rb index 569718844a80..1ead18e77d41 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_connect_manifest.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_connect_manifest.rb @@ -19,15 +19,21 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_GenerateConnectManifest_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#generate_connect_manifest +# +def generate_connect_manifest + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestRequest.new -# Call the generate_connect_manifest method. -result = client.generate_connect_manifest request + # Call the generate_connect_manifest method. + result = client.generate_connect_manifest request -# The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse. -p result + # The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateConnectManifestResponse. + p result +end # [END gkehub_v1beta1_generated_GkeHubMembershipService_GenerateConnectManifest_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_exclusivity_manifest.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_exclusivity_manifest.rb index 18b78b34a035..c58699926615 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_exclusivity_manifest.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/generate_exclusivity_manifest.rb @@ -19,15 +19,21 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_GenerateExclusivityManifest_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#generate_exclusivity_manifest +# +def generate_exclusivity_manifest + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestRequest.new -# Call the generate_exclusivity_manifest method. -result = client.generate_exclusivity_manifest request + # Call the generate_exclusivity_manifest method. + result = client.generate_exclusivity_manifest request -# The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse. -p result + # The returned object is of type Google::Cloud::GkeHub::V1beta1::GenerateExclusivityManifestResponse. + p result +end # [END gkehub_v1beta1_generated_GkeHubMembershipService_GenerateExclusivityManifest_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/get_membership.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/get_membership.rb index bbcf353d46a1..8d37df9c8384 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/get_membership.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/get_membership.rb @@ -19,15 +19,21 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_GetMembership_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#get_membership +# +def get_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::GetMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::GetMembershipRequest.new -# Call the get_membership method. -result = client.get_membership request + # Call the get_membership method. + result = client.get_membership request -# The returned object is of type Google::Cloud::GkeHub::V1beta1::Membership. -p result + # The returned object is of type Google::Cloud::GkeHub::V1beta1::Membership. + p result +end # [END gkehub_v1beta1_generated_GkeHubMembershipService_GetMembership_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/list_memberships.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/list_memberships.rb index 864c729e3bc7..ae2247bc71cd 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/list_memberships.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/list_memberships.rb @@ -19,21 +19,27 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_ListMemberships_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#list_memberships +# +def list_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::ListMembershipsRequest.new -# Call the list_memberships method. -result = client.list_memberships request + # Call the list_memberships method. + result = client.list_memberships request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeHub::V1beta1::Membership. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeHub::V1beta1::Membership. + p response + end end # [END gkehub_v1beta1_generated_GkeHubMembershipService_ListMemberships_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/update_membership.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/update_membership.rb index 156337878745..568077e3faa7 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/update_membership.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/update_membership.rb @@ -19,22 +19,28 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_UpdateMembership_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#update_membership +# +def update_membership + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::UpdateMembershipRequest.new -# Call the update_membership method. -result = client.update_membership request + # Call the update_membership method. + result = client.update_membership request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkehub_v1beta1_generated_GkeHubMembershipService_UpdateMembership_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/validate_exclusivity.rb b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/validate_exclusivity.rb index ad60eb62909f..3d03ef048b37 100755 --- a/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/validate_exclusivity.rb +++ b/google-cloud-gke_hub-v1beta1/snippets/gke_hub_membership_service/validate_exclusivity.rb @@ -19,15 +19,21 @@ # [START gkehub_v1beta1_generated_GkeHubMembershipService_ValidateExclusivity_sync] require "google/cloud/gke_hub/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client#validate_exclusivity +# +def validate_exclusivity + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeHub::V1beta1::GkeHubMembershipService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeHub::V1beta1::ValidateExclusivityRequest.new -# Call the validate_exclusivity method. -result = client.validate_exclusivity request + # Call the validate_exclusivity method. + result = client.validate_exclusivity request -# The returned object is of type Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse. -p result + # The returned object is of type Google::Cloud::GkeHub::V1beta1::ValidateExclusivityResponse. + p result +end # [END gkehub_v1beta1_generated_GkeHubMembershipService_ValidateExclusivity_sync] diff --git a/google-cloud-gke_hub-v1beta1/snippets/snippet_metadata_google.cloud.gkehub.v1beta1.json b/google-cloud-gke_hub-v1beta1/snippets/snippet_metadata_google.cloud.gkehub.v1beta1.json index 7760268237ad..dc9d44941fb0 100644 --- a/google-cloud-gke_hub-v1beta1/snippets/snippet_metadata_google.cloud.gkehub.v1beta1.json +++ b/google-cloud-gke_hub-v1beta1/snippets/snippet_metadata_google.cloud.gkehub.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-gke_multi_cloud-v1/.rubocop.yml b/google-cloud-gke_multi_cloud-v1/.rubocop.yml index 27b7aa0985fa..f68fc0484dd0 100644 --- a/google-cloud-gke_multi_cloud-v1/.rubocop.yml +++ b/google-cloud-gke_multi_cloud-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-gke_multi_cloud-v1.rb" diff --git a/google-cloud-gke_multi_cloud-v1/snippets/Gemfile b/google-cloud-gke_multi_cloud-v1/snippets/Gemfile index df38101a5d6a..2e85813d7102 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/Gemfile +++ b/google-cloud-gke_multi_cloud-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_cluster.rb index 863c7680b048..4802cd784b22 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_CreateAwsCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#create_aws_cluster +# +def create_aws_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::CreateAwsClusterRequest.new -# Call the create_aws_cluster method. -result = client.create_aws_cluster request + # Call the create_aws_cluster method. + result = client.create_aws_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_CreateAwsCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_node_pool.rb index 61fd6302a06d..25538fb42ded 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/create_aws_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_CreateAwsNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#create_aws_node_pool +# +def create_aws_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::CreateAwsNodePoolRequest.new -# Call the create_aws_node_pool method. -result = client.create_aws_node_pool request + # Call the create_aws_node_pool method. + result = client.create_aws_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_CreateAwsNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_cluster.rb index bfd088523612..5cf834e90b1f 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_DeleteAwsCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#delete_aws_cluster +# +def delete_aws_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsClusterRequest.new -# Call the delete_aws_cluster method. -result = client.delete_aws_cluster request + # Call the delete_aws_cluster method. + result = client.delete_aws_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_DeleteAwsCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_node_pool.rb index f81045db6ff7..a64103b74014 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/delete_aws_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_DeleteAwsNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#delete_aws_node_pool +# +def delete_aws_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::DeleteAwsNodePoolRequest.new -# Call the delete_aws_node_pool method. -result = client.delete_aws_node_pool request + # Call the delete_aws_node_pool method. + result = client.delete_aws_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_DeleteAwsNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/generate_aws_access_token.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/generate_aws_access_token.rb index 7c4dfddd466e..54bfb4238ff0 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/generate_aws_access_token.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/generate_aws_access_token.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AwsClusters_GenerateAwsAccessToken_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#generate_aws_access_token +# +def generate_aws_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenRequest.new -# Call the generate_aws_access_token method. -result = client.generate_aws_access_token request + # Call the generate_aws_access_token method. + result = client.generate_aws_access_token request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAwsAccessTokenResponse. + p result +end # [END gkemulticloud_v1_generated_AwsClusters_GenerateAwsAccessToken_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_cluster.rb index d47314b3d535..b7ff62c25864 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_cluster.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AwsClusters_GetAwsCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#get_aws_cluster +# +def get_aws_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAwsClusterRequest.new -# Call the get_aws_cluster method. -result = client.get_aws_cluster request + # Call the get_aws_cluster method. + result = client.get_aws_cluster request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsCluster. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsCluster. + p result +end # [END gkemulticloud_v1_generated_AwsClusters_GetAwsCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_node_pool.rb index 625fc1ea3f80..fd2a4acf9c72 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_node_pool.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AwsClusters_GetAwsNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#get_aws_node_pool +# +def get_aws_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAwsNodePoolRequest.new -# Call the get_aws_node_pool method. -result = client.get_aws_node_pool request + # Call the get_aws_node_pool method. + result = client.get_aws_node_pool request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsNodePool. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsNodePool. + p result +end # [END gkemulticloud_v1_generated_AwsClusters_GetAwsNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_server_config.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_server_config.rb index 0bca1052cea5..d806006d537e 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_server_config.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/get_aws_server_config.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AwsClusters_GetAwsServerConfig_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#get_aws_server_config +# +def get_aws_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAwsServerConfigRequest.new -# Call the get_aws_server_config method. -result = client.get_aws_server_config request + # Call the get_aws_server_config method. + result = client.get_aws_server_config request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsServerConfig. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AwsServerConfig. + p result +end # [END gkemulticloud_v1_generated_AwsClusters_GetAwsServerConfig_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_clusters.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_clusters.rb index 7d023500373f..622ea7e4e77c 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_clusters.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_clusters.rb @@ -19,21 +19,27 @@ # [START gkemulticloud_v1_generated_AwsClusters_ListAwsClusters_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#list_aws_clusters +# +def list_aws_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::ListAwsClustersRequest.new -# Call the list_aws_clusters method. -result = client.list_aws_clusters request + # Call the list_aws_clusters method. + result = client.list_aws_clusters request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsCluster. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsCluster. + p response + end end # [END gkemulticloud_v1_generated_AwsClusters_ListAwsClusters_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_node_pools.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_node_pools.rb index ed8ffabc8100..0b49c309eb7d 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_node_pools.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/list_aws_node_pools.rb @@ -19,21 +19,27 @@ # [START gkemulticloud_v1_generated_AwsClusters_ListAwsNodePools_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#list_aws_node_pools +# +def list_aws_node_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::ListAwsNodePoolsRequest.new -# Call the list_aws_node_pools method. -result = client.list_aws_node_pools request + # Call the list_aws_node_pools method. + result = client.list_aws_node_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AwsNodePool. + p response + end end # [END gkemulticloud_v1_generated_AwsClusters_ListAwsNodePools_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_cluster.rb index 1bd958ede07b..aa460c4696df 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_UpdateAwsCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#update_aws_cluster +# +def update_aws_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsClusterRequest.new -# Call the update_aws_cluster method. -result = client.update_aws_cluster request + # Call the update_aws_cluster method. + result = client.update_aws_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_UpdateAwsCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_node_pool.rb index 25121f2047db..bdda1279ffc4 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/aws_clusters/update_aws_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AwsClusters_UpdateAwsNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client#update_aws_node_pool +# +def update_aws_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AwsClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::UpdateAwsNodePoolRequest.new -# Call the update_aws_node_pool method. -result = client.update_aws_node_pool request + # Call the update_aws_node_pool method. + result = client.update_aws_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AwsClusters_UpdateAwsNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_client.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_client.rb index 7978f46fb0d5..f3674717f6f8 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_client.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_client.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_CreateAzureClient_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#create_azure_client +# +def create_azure_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::CreateAzureClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::CreateAzureClientRequest.new -# Call the create_azure_client method. -result = client.create_azure_client request + # Call the create_azure_client method. + result = client.create_azure_client request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_CreateAzureClient_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_cluster.rb index 96931c763a02..00a193953501 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_CreateAzureCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#create_azure_cluster +# +def create_azure_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::CreateAzureClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::CreateAzureClusterRequest.new -# Call the create_azure_cluster method. -result = client.create_azure_cluster request + # Call the create_azure_cluster method. + result = client.create_azure_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_CreateAzureCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_node_pool.rb index 7368d2da8bcf..5c478bd9f290 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/create_azure_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_CreateAzureNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#create_azure_node_pool +# +def create_azure_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::CreateAzureNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::CreateAzureNodePoolRequest.new -# Call the create_azure_node_pool method. -result = client.create_azure_node_pool request + # Call the create_azure_node_pool method. + result = client.create_azure_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_CreateAzureNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_client.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_client.rb index fd97b926c503..9c261a4516a8 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_client.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_client.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_DeleteAzureClient_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#delete_azure_client +# +def delete_azure_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureClientRequest.new -# Call the delete_azure_client method. -result = client.delete_azure_client request + # Call the delete_azure_client method. + result = client.delete_azure_client request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureClient_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_cluster.rb index cd36a50bbb99..68bef56c4c9b 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_DeleteAzureCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#delete_azure_cluster +# +def delete_azure_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureClusterRequest.new -# Call the delete_azure_cluster method. -result = client.delete_azure_cluster request + # Call the delete_azure_cluster method. + result = client.delete_azure_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_node_pool.rb index 521bbbe33fb1..406d72b0683d 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/delete_azure_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_DeleteAzureNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#delete_azure_node_pool +# +def delete_azure_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::DeleteAzureNodePoolRequest.new -# Call the delete_azure_node_pool method. -result = client.delete_azure_node_pool request + # Call the delete_azure_node_pool method. + result = client.delete_azure_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_DeleteAzureNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/generate_azure_access_token.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/generate_azure_access_token.rb index d0e1203dd237..71d01ae1fee4 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/generate_azure_access_token.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/generate_azure_access_token.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AzureClusters_GenerateAzureAccessToken_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#generate_azure_access_token +# +def generate_azure_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GenerateAzureAccessTokenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GenerateAzureAccessTokenRequest.new -# Call the generate_azure_access_token method. -result = client.generate_azure_access_token request + # Call the generate_azure_access_token method. + result = client.generate_azure_access_token request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAzureAccessTokenResponse. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAzureAccessTokenResponse. + p result +end # [END gkemulticloud_v1_generated_AzureClusters_GenerateAzureAccessToken_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_client.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_client.rb index ba6e1e3ffb36..7a068828eb21 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_client.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_client.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AzureClusters_GetAzureClient_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#get_azure_client +# +def get_azure_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAzureClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAzureClientRequest.new -# Call the get_azure_client method. -result = client.get_azure_client request + # Call the get_azure_client method. + result = client.get_azure_client request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureClient. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureClient. + p result +end # [END gkemulticloud_v1_generated_AzureClusters_GetAzureClient_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_cluster.rb index a1bb843028be..9dc656ccf3ea 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_cluster.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#get_azure_cluster +# +def get_azure_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAzureClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAzureClusterRequest.new -# Call the get_azure_cluster method. -result = client.get_azure_cluster request + # Call the get_azure_cluster method. + result = client.get_azure_cluster request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureCluster. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureCluster. + p result +end # [END gkemulticloud_v1_generated_AzureClusters_GetAzureCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_node_pool.rb index 4abf1240a1be..732d041f1d0b 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_node_pool.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#get_azure_node_pool +# +def get_azure_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAzureNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAzureNodePoolRequest.new -# Call the get_azure_node_pool method. -result = client.get_azure_node_pool request + # Call the get_azure_node_pool method. + result = client.get_azure_node_pool request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureNodePool. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureNodePool. + p result +end # [END gkemulticloud_v1_generated_AzureClusters_GetAzureNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_server_config.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_server_config.rb index ef3b6cc5b726..840eeee53d8c 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_server_config.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/get_azure_server_config.rb @@ -19,15 +19,21 @@ # [START gkemulticloud_v1_generated_AzureClusters_GetAzureServerConfig_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#get_azure_server_config +# +def get_azure_server_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::GetAzureServerConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::GetAzureServerConfigRequest.new -# Call the get_azure_server_config method. -result = client.get_azure_server_config request + # Call the get_azure_server_config method. + result = client.get_azure_server_config request -# The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureServerConfig. -p result + # The returned object is of type Google::Cloud::GkeMultiCloud::V1::AzureServerConfig. + p result +end # [END gkemulticloud_v1_generated_AzureClusters_GetAzureServerConfig_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clients.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clients.rb index 439648a32258..9bdba78b8669 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clients.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clients.rb @@ -19,21 +19,27 @@ # [START gkemulticloud_v1_generated_AzureClusters_ListAzureClients_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#list_azure_clients +# +def list_azure_clients + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::ListAzureClientsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::ListAzureClientsRequest.new -# Call the list_azure_clients method. -result = client.list_azure_clients request + # Call the list_azure_clients method. + result = client.list_azure_clients request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureClient. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureClient. + p response + end end # [END gkemulticloud_v1_generated_AzureClusters_ListAzureClients_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clusters.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clusters.rb index 22f0002b3411..7f8ba5b3f035 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clusters.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_clusters.rb @@ -19,21 +19,27 @@ # [START gkemulticloud_v1_generated_AzureClusters_ListAzureClusters_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#list_azure_clusters +# +def list_azure_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::ListAzureClustersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::ListAzureClustersRequest.new -# Call the list_azure_clusters method. -result = client.list_azure_clusters request + # Call the list_azure_clusters method. + result = client.list_azure_clusters request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureCluster. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureCluster. + p response + end end # [END gkemulticloud_v1_generated_AzureClusters_ListAzureClusters_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_node_pools.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_node_pools.rb index 86906fce878f..38a0ec397760 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_node_pools.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/list_azure_node_pools.rb @@ -19,21 +19,27 @@ # [START gkemulticloud_v1_generated_AzureClusters_ListAzureNodePools_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#list_azure_node_pools +# +def list_azure_node_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::ListAzureNodePoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::ListAzureNodePoolsRequest.new -# Call the list_azure_node_pools method. -result = client.list_azure_node_pools request + # Call the list_azure_node_pools method. + result = client.list_azure_node_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureNodePool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::GkeMultiCloud::V1::AzureNodePool. + p response + end end # [END gkemulticloud_v1_generated_AzureClusters_ListAzureNodePools_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_cluster.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_cluster.rb index 3c321bbc316e..dc5ca801671e 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_cluster.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_cluster.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_UpdateAzureCluster_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#update_azure_cluster +# +def update_azure_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::UpdateAzureClusterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::UpdateAzureClusterRequest.new -# Call the update_azure_cluster method. -result = client.update_azure_cluster request + # Call the update_azure_cluster method. + result = client.update_azure_cluster request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_UpdateAzureCluster_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_node_pool.rb b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_node_pool.rb index 8b8123bf40fc..a1fd12b88b31 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_node_pool.rb +++ b/google-cloud-gke_multi_cloud-v1/snippets/azure_clusters/update_azure_node_pool.rb @@ -19,22 +19,28 @@ # [START gkemulticloud_v1_generated_AzureClusters_UpdateAzureNodePool_sync] require "google/cloud/gke_multi_cloud/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client#update_azure_node_pool +# +def update_azure_node_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::GkeMultiCloud::V1::AzureClusters::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::GkeMultiCloud::V1::UpdateAzureNodePoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::GkeMultiCloud::V1::UpdateAzureNodePoolRequest.new -# Call the update_azure_node_pool method. -result = client.update_azure_node_pool request + # Call the update_azure_node_pool method. + result = client.update_azure_node_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END gkemulticloud_v1_generated_AzureClusters_UpdateAzureNodePool_sync] diff --git a/google-cloud-gke_multi_cloud-v1/snippets/snippet_metadata_google.cloud.gkemulticloud.v1.json b/google-cloud-gke_multi_cloud-v1/snippets/snippet_metadata_google.cloud.gkemulticloud.v1.json index b7ffce4ff4f0..e61e4e6541c7 100644 --- a/google-cloud-gke_multi_cloud-v1/snippets/snippet_metadata_google.cloud.gkemulticloud.v1.json +++ b/google-cloud-gke_multi_cloud-v1/snippets/snippet_metadata_google.cloud.gkemulticloud.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-iap-v1/.rubocop.yml b/google-cloud-iap-v1/.rubocop.yml index 43457a36cb99..31e888922cba 100644 --- a/google-cloud-iap-v1/.rubocop.yml +++ b/google-cloud-iap-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-iap-v1.rb" diff --git a/google-cloud-iap-v1/snippets/Gemfile b/google-cloud-iap-v1/snippets/Gemfile index bcd020f0881b..d41ea51e6482 100755 --- a/google-cloud-iap-v1/snippets/Gemfile +++ b/google-cloud-iap-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/create_tunnel_dest_group.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/create_tunnel_dest_group.rb index 3502f83b7039..00e5e2718e9b 100644 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/create_tunnel_dest_group.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/create_tunnel_dest_group.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_CreateTunnelDestGroup_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#create_tunnel_dest_group +# +def create_tunnel_dest_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::CreateTunnelDestGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::CreateTunnelDestGroupRequest.new -# Call the create_tunnel_dest_group method. -result = client.create_tunnel_dest_group request + # Call the create_tunnel_dest_group method. + result = client.create_tunnel_dest_group request -# The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. -p result + # The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_CreateTunnelDestGroup_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/delete_tunnel_dest_group.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/delete_tunnel_dest_group.rb index a896a9e1346d..881f89995ec9 100644 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/delete_tunnel_dest_group.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/delete_tunnel_dest_group.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_DeleteTunnelDestGroup_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#delete_tunnel_dest_group +# +def delete_tunnel_dest_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::DeleteTunnelDestGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::DeleteTunnelDestGroupRequest.new -# Call the delete_tunnel_dest_group method. -result = client.delete_tunnel_dest_group request + # Call the delete_tunnel_dest_group method. + result = client.delete_tunnel_dest_group request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_DeleteTunnelDestGroup_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iam_policy.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iam_policy.rb index a0b57e70c5d3..f247a40176bb 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iam_policy.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_GetIamPolicy_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_GetIamPolicy_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iap_settings.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iap_settings.rb index 488be5c36ce6..fac31f91001a 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iap_settings.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_iap_settings.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_GetIapSettings_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#get_iap_settings +# +def get_iap_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::GetIapSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::GetIapSettingsRequest.new -# Call the get_iap_settings method. -result = client.get_iap_settings request + # Call the get_iap_settings method. + result = client.get_iap_settings request -# The returned object is of type Google::Cloud::Iap::V1::IapSettings. -p result + # The returned object is of type Google::Cloud::Iap::V1::IapSettings. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_GetIapSettings_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_tunnel_dest_group.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_tunnel_dest_group.rb index 2799a7333a06..df824d960359 100644 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_tunnel_dest_group.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/get_tunnel_dest_group.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_GetTunnelDestGroup_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#get_tunnel_dest_group +# +def get_tunnel_dest_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::GetTunnelDestGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::GetTunnelDestGroupRequest.new -# Call the get_tunnel_dest_group method. -result = client.get_tunnel_dest_group request + # Call the get_tunnel_dest_group method. + result = client.get_tunnel_dest_group request -# The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. -p result + # The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_GetTunnelDestGroup_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/list_tunnel_dest_groups.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/list_tunnel_dest_groups.rb index 0e8b29f7fd35..741d037ebc99 100644 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/list_tunnel_dest_groups.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/list_tunnel_dest_groups.rb @@ -19,21 +19,27 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_ListTunnelDestGroups_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#list_tunnel_dest_groups +# +def list_tunnel_dest_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::ListTunnelDestGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::ListTunnelDestGroupsRequest.new -# Call the list_tunnel_dest_groups method. -result = client.list_tunnel_dest_groups request + # Call the list_tunnel_dest_groups method. + result = client.list_tunnel_dest_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Iap::V1::TunnelDestGroup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Iap::V1::TunnelDestGroup. + p response + end end # [END iap_v1_generated_IdentityAwareProxyAdminService_ListTunnelDestGroups_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/set_iam_policy.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/set_iam_policy.rb index 00e4d3957dab..831691128179 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/set_iam_policy.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_SetIamPolicy_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_SetIamPolicy_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/test_iam_permissions.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/test_iam_permissions.rb index c658ed39099c..aead2ffbe47e 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/test_iam_permissions.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_TestIamPermissions_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_TestIamPermissions_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_iap_settings.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_iap_settings.rb index a32945f69854..5c9ab8e06e9a 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_iap_settings.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_iap_settings.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_UpdateIapSettings_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#update_iap_settings +# +def update_iap_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::UpdateIapSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::UpdateIapSettingsRequest.new -# Call the update_iap_settings method. -result = client.update_iap_settings request + # Call the update_iap_settings method. + result = client.update_iap_settings request -# The returned object is of type Google::Cloud::Iap::V1::IapSettings. -p result + # The returned object is of type Google::Cloud::Iap::V1::IapSettings. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_UpdateIapSettings_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_tunnel_dest_group.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_tunnel_dest_group.rb index 9841406a4abb..ac21066d7da0 100644 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_tunnel_dest_group.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_admin_service/update_tunnel_dest_group.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyAdminService_UpdateTunnelDestGroup_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client#update_tunnel_dest_group +# +def update_tunnel_dest_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyAdminService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::UpdateTunnelDestGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::UpdateTunnelDestGroupRequest.new -# Call the update_tunnel_dest_group method. -result = client.update_tunnel_dest_group request + # Call the update_tunnel_dest_group method. + result = client.update_tunnel_dest_group request -# The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. -p result + # The returned object is of type Google::Cloud::Iap::V1::TunnelDestGroup. + p result +end # [END iap_v1_generated_IdentityAwareProxyAdminService_UpdateTunnelDestGroup_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_brand.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_brand.rb index 6e84e5d66306..d174614a2f4f 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_brand.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_brand.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_CreateBrand_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#create_brand +# +def create_brand + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::CreateBrandRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::CreateBrandRequest.new -# Call the create_brand method. -result = client.create_brand request + # Call the create_brand method. + result = client.create_brand request -# The returned object is of type Google::Cloud::Iap::V1::Brand. -p result + # The returned object is of type Google::Cloud::Iap::V1::Brand. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_CreateBrand_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_identity_aware_proxy_client.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_identity_aware_proxy_client.rb index b8682598f227..5373aefd6eab 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_identity_aware_proxy_client.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/create_identity_aware_proxy_client.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_CreateIdentityAwareProxyClient_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#create_identity_aware_proxy_client +# +def create_identity_aware_proxy_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::CreateIdentityAwareProxyClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::CreateIdentityAwareProxyClientRequest.new -# Call the create_identity_aware_proxy_client method. -result = client.create_identity_aware_proxy_client request + # Call the create_identity_aware_proxy_client method. + result = client.create_identity_aware_proxy_client request -# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. -p result + # The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_CreateIdentityAwareProxyClient_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/delete_identity_aware_proxy_client.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/delete_identity_aware_proxy_client.rb index 2af299ccb09a..fdd749a6a86b 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/delete_identity_aware_proxy_client.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/delete_identity_aware_proxy_client.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_DeleteIdentityAwareProxyClient_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#delete_identity_aware_proxy_client +# +def delete_identity_aware_proxy_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::DeleteIdentityAwareProxyClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::DeleteIdentityAwareProxyClientRequest.new -# Call the delete_identity_aware_proxy_client method. -result = client.delete_identity_aware_proxy_client request + # Call the delete_identity_aware_proxy_client method. + result = client.delete_identity_aware_proxy_client request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_DeleteIdentityAwareProxyClient_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_brand.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_brand.rb index 9d04359cebe4..50fa428d0f94 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_brand.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_brand.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_GetBrand_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#get_brand +# +def get_brand + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::GetBrandRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::GetBrandRequest.new -# Call the get_brand method. -result = client.get_brand request + # Call the get_brand method. + result = client.get_brand request -# The returned object is of type Google::Cloud::Iap::V1::Brand. -p result + # The returned object is of type Google::Cloud::Iap::V1::Brand. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_GetBrand_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_identity_aware_proxy_client.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_identity_aware_proxy_client.rb index cd2fb66b1e6c..1eedf2eb686c 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_identity_aware_proxy_client.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/get_identity_aware_proxy_client.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_GetIdentityAwareProxyClient_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#get_identity_aware_proxy_client +# +def get_identity_aware_proxy_client + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::GetIdentityAwareProxyClientRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::GetIdentityAwareProxyClientRequest.new -# Call the get_identity_aware_proxy_client method. -result = client.get_identity_aware_proxy_client request + # Call the get_identity_aware_proxy_client method. + result = client.get_identity_aware_proxy_client request -# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. -p result + # The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_GetIdentityAwareProxyClient_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_brands.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_brands.rb index 6475a19ea80b..bdf2a136dae7 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_brands.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_brands.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_ListBrands_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#list_brands +# +def list_brands + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::ListBrandsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::ListBrandsRequest.new -# Call the list_brands method. -result = client.list_brands request + # Call the list_brands method. + result = client.list_brands request -# The returned object is of type Google::Cloud::Iap::V1::ListBrandsResponse. -p result + # The returned object is of type Google::Cloud::Iap::V1::ListBrandsResponse. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_ListBrands_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_identity_aware_proxy_clients.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_identity_aware_proxy_clients.rb index d127c63e6fef..49f0b430b3bf 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_identity_aware_proxy_clients.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/list_identity_aware_proxy_clients.rb @@ -19,21 +19,27 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_ListIdentityAwareProxyClients_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#list_identity_aware_proxy_clients +# +def list_identity_aware_proxy_clients + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::ListIdentityAwareProxyClientsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::ListIdentityAwareProxyClientsRequest.new -# Call the list_identity_aware_proxy_clients method. -result = client.list_identity_aware_proxy_clients request + # Call the list_identity_aware_proxy_clients method. + result = client.list_identity_aware_proxy_clients request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Iap::V1::IdentityAwareProxyClient. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Iap::V1::IdentityAwareProxyClient. + p response + end end # [END iap_v1_generated_IdentityAwareProxyOAuthService_ListIdentityAwareProxyClients_sync] diff --git a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/reset_identity_aware_proxy_client_secret.rb b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/reset_identity_aware_proxy_client_secret.rb index 1f40f33f244b..e73c63c1d4ce 100755 --- a/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/reset_identity_aware_proxy_client_secret.rb +++ b/google-cloud-iap-v1/snippets/identity_aware_proxy_o_auth_service/reset_identity_aware_proxy_client_secret.rb @@ -19,15 +19,21 @@ # [START iap_v1_generated_IdentityAwareProxyOAuthService_ResetIdentityAwareProxyClientSecret_sync] require "google/cloud/iap/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client#reset_identity_aware_proxy_client_secret +# +def reset_identity_aware_proxy_client_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iap::V1::IdentityAwareProxyOAuthService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iap::V1::ResetIdentityAwareProxyClientSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iap::V1::ResetIdentityAwareProxyClientSecretRequest.new -# Call the reset_identity_aware_proxy_client_secret method. -result = client.reset_identity_aware_proxy_client_secret request + # Call the reset_identity_aware_proxy_client_secret method. + result = client.reset_identity_aware_proxy_client_secret request -# The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. -p result + # The returned object is of type Google::Cloud::Iap::V1::IdentityAwareProxyClient. + p result +end # [END iap_v1_generated_IdentityAwareProxyOAuthService_ResetIdentityAwareProxyClientSecret_sync] diff --git a/google-cloud-iap-v1/snippets/snippet_metadata_google.cloud.iap.v1.json b/google-cloud-iap-v1/snippets/snippet_metadata_google.cloud.iap.v1.json index e3e296faee75..18cbe58d6ca9 100644 --- a/google-cloud-iap-v1/snippets/snippet_metadata_google.cloud.iap.v1.json +++ b/google-cloud-iap-v1/snippets/snippet_metadata_google.cloud.iap.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-ids-v1/.rubocop.yml b/google-cloud-ids-v1/.rubocop.yml index d4e42a9e7cb1..73dd9e852660 100644 --- a/google-cloud-ids-v1/.rubocop.yml +++ b/google-cloud-ids-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-ids-v1.rb" diff --git a/google-cloud-ids-v1/snippets/Gemfile b/google-cloud-ids-v1/snippets/Gemfile index f7edafa4f796..758648e032cf 100644 --- a/google-cloud-ids-v1/snippets/Gemfile +++ b/google-cloud-ids-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-ids-v1/snippets/ids/create_endpoint.rb b/google-cloud-ids-v1/snippets/ids/create_endpoint.rb index 61b43669ca2e..9662b1f5b500 100644 --- a/google-cloud-ids-v1/snippets/ids/create_endpoint.rb +++ b/google-cloud-ids-v1/snippets/ids/create_endpoint.rb @@ -19,22 +19,28 @@ # [START ids_v1_generated_IDS_CreateEndpoint_sync] require "google/cloud/ids/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::IDS::V1::IDS::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::IDS::V1::IDS::Client#create_endpoint +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::IDS::V1::IDS::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::IDS::V1::CreateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::IDS::V1::CreateEndpointRequest.new -# Call the create_endpoint method. -result = client.create_endpoint request + # Call the create_endpoint method. + result = client.create_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END ids_v1_generated_IDS_CreateEndpoint_sync] diff --git a/google-cloud-ids-v1/snippets/ids/delete_endpoint.rb b/google-cloud-ids-v1/snippets/ids/delete_endpoint.rb index 184fa7b1cbe4..13d06f5591a6 100644 --- a/google-cloud-ids-v1/snippets/ids/delete_endpoint.rb +++ b/google-cloud-ids-v1/snippets/ids/delete_endpoint.rb @@ -19,22 +19,28 @@ # [START ids_v1_generated_IDS_DeleteEndpoint_sync] require "google/cloud/ids/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::IDS::V1::IDS::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::IDS::V1::IDS::Client#delete_endpoint +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::IDS::V1::IDS::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::IDS::V1::DeleteEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::IDS::V1::DeleteEndpointRequest.new -# Call the delete_endpoint method. -result = client.delete_endpoint request + # Call the delete_endpoint method. + result = client.delete_endpoint request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END ids_v1_generated_IDS_DeleteEndpoint_sync] diff --git a/google-cloud-ids-v1/snippets/ids/get_endpoint.rb b/google-cloud-ids-v1/snippets/ids/get_endpoint.rb index c132204332ed..6662fbd0fff4 100644 --- a/google-cloud-ids-v1/snippets/ids/get_endpoint.rb +++ b/google-cloud-ids-v1/snippets/ids/get_endpoint.rb @@ -19,15 +19,21 @@ # [START ids_v1_generated_IDS_GetEndpoint_sync] require "google/cloud/ids/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::IDS::V1::IDS::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::IDS::V1::IDS::Client#get_endpoint +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::IDS::V1::IDS::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::IDS::V1::GetEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::IDS::V1::GetEndpointRequest.new -# Call the get_endpoint method. -result = client.get_endpoint request + # Call the get_endpoint method. + result = client.get_endpoint request -# The returned object is of type Google::Cloud::IDS::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::IDS::V1::Endpoint. + p result +end # [END ids_v1_generated_IDS_GetEndpoint_sync] diff --git a/google-cloud-ids-v1/snippets/ids/list_endpoints.rb b/google-cloud-ids-v1/snippets/ids/list_endpoints.rb index a6a04694cfd6..ac628fa2f697 100644 --- a/google-cloud-ids-v1/snippets/ids/list_endpoints.rb +++ b/google-cloud-ids-v1/snippets/ids/list_endpoints.rb @@ -19,21 +19,27 @@ # [START ids_v1_generated_IDS_ListEndpoints_sync] require "google/cloud/ids/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::IDS::V1::IDS::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::IDS::V1::IDS::Client#list_endpoints +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::IDS::V1::IDS::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::IDS::V1::ListEndpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::IDS::V1::ListEndpointsRequest.new -# Call the list_endpoints method. -result = client.list_endpoints request + # Call the list_endpoints method. + result = client.list_endpoints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::IDS::V1::Endpoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::IDS::V1::Endpoint. + p response + end end # [END ids_v1_generated_IDS_ListEndpoints_sync] diff --git a/google-cloud-ids-v1/snippets/snippet_metadata_google.cloud.ids.v1.json b/google-cloud-ids-v1/snippets/snippet_metadata_google.cloud.ids.v1.json index 12e05e7aa838..8ac94309befd 100644 --- a/google-cloud-ids-v1/snippets/snippet_metadata_google.cloud.ids.v1.json +++ b/google-cloud-ids-v1/snippets/snippet_metadata_google.cloud.ids.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-iot-v1/.rubocop.yml b/google-cloud-iot-v1/.rubocop.yml index 5e8ebd813638..ae19d0fff487 100644 --- a/google-cloud-iot-v1/.rubocop.yml +++ b/google-cloud-iot-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-iot-v1.rb" diff --git a/google-cloud-iot-v1/snippets/Gemfile b/google-cloud-iot-v1/snippets/Gemfile index 19f84c301f62..049375a47cee 100755 --- a/google-cloud-iot-v1/snippets/Gemfile +++ b/google-cloud-iot-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-iot-v1/snippets/device_manager/bind_device_to_gateway.rb b/google-cloud-iot-v1/snippets/device_manager/bind_device_to_gateway.rb index 7475342f9b9a..a4f85789ab7c 100755 --- a/google-cloud-iot-v1/snippets/device_manager/bind_device_to_gateway.rb +++ b/google-cloud-iot-v1/snippets/device_manager/bind_device_to_gateway.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_BindDeviceToGateway_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#bind_device_to_gateway +# +def bind_device_to_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::BindDeviceToGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::BindDeviceToGatewayRequest.new -# Call the bind_device_to_gateway method. -result = client.bind_device_to_gateway request + # Call the bind_device_to_gateway method. + result = client.bind_device_to_gateway request -# The returned object is of type Google::Cloud::Iot::V1::BindDeviceToGatewayResponse. -p result + # The returned object is of type Google::Cloud::Iot::V1::BindDeviceToGatewayResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_BindDeviceToGateway_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/create_device.rb b/google-cloud-iot-v1/snippets/device_manager/create_device.rb index d05ccc665b53..28213ad7cdc8 100755 --- a/google-cloud-iot-v1/snippets/device_manager/create_device.rb +++ b/google-cloud-iot-v1/snippets/device_manager/create_device.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_CreateDevice_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#create_device +# +def create_device + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::CreateDeviceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::CreateDeviceRequest.new -# Call the create_device method. -result = client.create_device request + # Call the create_device method. + result = client.create_device request -# The returned object is of type Google::Cloud::Iot::V1::Device. -p result + # The returned object is of type Google::Cloud::Iot::V1::Device. + p result +end # [END cloudiot_v1_generated_DeviceManager_CreateDevice_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/create_device_registry.rb b/google-cloud-iot-v1/snippets/device_manager/create_device_registry.rb index dc3316c0d96a..dbe34faee41b 100755 --- a/google-cloud-iot-v1/snippets/device_manager/create_device_registry.rb +++ b/google-cloud-iot-v1/snippets/device_manager/create_device_registry.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_CreateDeviceRegistry_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#create_device_registry +# +def create_device_registry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::CreateDeviceRegistryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::CreateDeviceRegistryRequest.new -# Call the create_device_registry method. -result = client.create_device_registry request + # Call the create_device_registry method. + result = client.create_device_registry request -# The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. -p result + # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. + p result +end # [END cloudiot_v1_generated_DeviceManager_CreateDeviceRegistry_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/delete_device.rb b/google-cloud-iot-v1/snippets/device_manager/delete_device.rb index d364db64fc70..b511083b6233 100755 --- a/google-cloud-iot-v1/snippets/device_manager/delete_device.rb +++ b/google-cloud-iot-v1/snippets/device_manager/delete_device.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_DeleteDevice_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#delete_device +# +def delete_device + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::DeleteDeviceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::DeleteDeviceRequest.new -# Call the delete_device method. -result = client.delete_device request + # Call the delete_device method. + result = client.delete_device request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudiot_v1_generated_DeviceManager_DeleteDevice_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/delete_device_registry.rb b/google-cloud-iot-v1/snippets/device_manager/delete_device_registry.rb index 6d9305e123a0..745004e93733 100755 --- a/google-cloud-iot-v1/snippets/device_manager/delete_device_registry.rb +++ b/google-cloud-iot-v1/snippets/device_manager/delete_device_registry.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_DeleteDeviceRegistry_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#delete_device_registry +# +def delete_device_registry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::DeleteDeviceRegistryRequest.new -# Call the delete_device_registry method. -result = client.delete_device_registry request + # Call the delete_device_registry method. + result = client.delete_device_registry request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudiot_v1_generated_DeviceManager_DeleteDeviceRegistry_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/get_device.rb b/google-cloud-iot-v1/snippets/device_manager/get_device.rb index 6506dcd1fd04..7311285067da 100755 --- a/google-cloud-iot-v1/snippets/device_manager/get_device.rb +++ b/google-cloud-iot-v1/snippets/device_manager/get_device.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_GetDevice_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#get_device +# +def get_device + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::GetDeviceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::GetDeviceRequest.new -# Call the get_device method. -result = client.get_device request + # Call the get_device method. + result = client.get_device request -# The returned object is of type Google::Cloud::Iot::V1::Device. -p result + # The returned object is of type Google::Cloud::Iot::V1::Device. + p result +end # [END cloudiot_v1_generated_DeviceManager_GetDevice_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/get_device_registry.rb b/google-cloud-iot-v1/snippets/device_manager/get_device_registry.rb index 6d3ddb496d16..98372069337b 100755 --- a/google-cloud-iot-v1/snippets/device_manager/get_device_registry.rb +++ b/google-cloud-iot-v1/snippets/device_manager/get_device_registry.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_GetDeviceRegistry_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#get_device_registry +# +def get_device_registry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::GetDeviceRegistryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::GetDeviceRegistryRequest.new -# Call the get_device_registry method. -result = client.get_device_registry request + # Call the get_device_registry method. + result = client.get_device_registry request -# The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. -p result + # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. + p result +end # [END cloudiot_v1_generated_DeviceManager_GetDeviceRegistry_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/get_iam_policy.rb b/google-cloud-iot-v1/snippets/device_manager/get_iam_policy.rb index 2d403f11dfb1..3681ecc5e332 100755 --- a/google-cloud-iot-v1/snippets/device_manager/get_iam_policy.rb +++ b/google-cloud-iot-v1/snippets/device_manager/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_GetIamPolicy_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudiot_v1_generated_DeviceManager_GetIamPolicy_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/list_device_config_versions.rb b/google-cloud-iot-v1/snippets/device_manager/list_device_config_versions.rb index afb2b5b78a72..398dc476cdf3 100755 --- a/google-cloud-iot-v1/snippets/device_manager/list_device_config_versions.rb +++ b/google-cloud-iot-v1/snippets/device_manager/list_device_config_versions.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_ListDeviceConfigVersions_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#list_device_config_versions +# +def list_device_config_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::ListDeviceConfigVersionsRequest.new -# Call the list_device_config_versions method. -result = client.list_device_config_versions request + # Call the list_device_config_versions method. + result = client.list_device_config_versions request -# The returned object is of type Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse. -p result + # The returned object is of type Google::Cloud::Iot::V1::ListDeviceConfigVersionsResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_ListDeviceConfigVersions_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/list_device_registries.rb b/google-cloud-iot-v1/snippets/device_manager/list_device_registries.rb index e8d498d7e73a..df750942998d 100755 --- a/google-cloud-iot-v1/snippets/device_manager/list_device_registries.rb +++ b/google-cloud-iot-v1/snippets/device_manager/list_device_registries.rb @@ -19,21 +19,27 @@ # [START cloudiot_v1_generated_DeviceManager_ListDeviceRegistries_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#list_device_registries +# +def list_device_registries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::ListDeviceRegistriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::ListDeviceRegistriesRequest.new -# Call the list_device_registries method. -result = client.list_device_registries request + # Call the list_device_registries method. + result = client.list_device_registries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Iot::V1::DeviceRegistry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Iot::V1::DeviceRegistry. + p response + end end # [END cloudiot_v1_generated_DeviceManager_ListDeviceRegistries_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/list_device_states.rb b/google-cloud-iot-v1/snippets/device_manager/list_device_states.rb index 2c88414b758c..49c8b3cdd446 100755 --- a/google-cloud-iot-v1/snippets/device_manager/list_device_states.rb +++ b/google-cloud-iot-v1/snippets/device_manager/list_device_states.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_ListDeviceStates_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#list_device_states +# +def list_device_states + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::ListDeviceStatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::ListDeviceStatesRequest.new -# Call the list_device_states method. -result = client.list_device_states request + # Call the list_device_states method. + result = client.list_device_states request -# The returned object is of type Google::Cloud::Iot::V1::ListDeviceStatesResponse. -p result + # The returned object is of type Google::Cloud::Iot::V1::ListDeviceStatesResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_ListDeviceStates_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/list_devices.rb b/google-cloud-iot-v1/snippets/device_manager/list_devices.rb index 416fcfd2d72a..a139587b47fd 100755 --- a/google-cloud-iot-v1/snippets/device_manager/list_devices.rb +++ b/google-cloud-iot-v1/snippets/device_manager/list_devices.rb @@ -19,21 +19,27 @@ # [START cloudiot_v1_generated_DeviceManager_ListDevices_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#list_devices +# +def list_devices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::ListDevicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::ListDevicesRequest.new -# Call the list_devices method. -result = client.list_devices request + # Call the list_devices method. + result = client.list_devices request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Iot::V1::Device. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Iot::V1::Device. + p response + end end # [END cloudiot_v1_generated_DeviceManager_ListDevices_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/modify_cloud_to_device_config.rb b/google-cloud-iot-v1/snippets/device_manager/modify_cloud_to_device_config.rb index 0d333248bc08..71cba73f85d4 100755 --- a/google-cloud-iot-v1/snippets/device_manager/modify_cloud_to_device_config.rb +++ b/google-cloud-iot-v1/snippets/device_manager/modify_cloud_to_device_config.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_ModifyCloudToDeviceConfig_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#modify_cloud_to_device_config +# +def modify_cloud_to_device_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::ModifyCloudToDeviceConfigRequest.new -# Call the modify_cloud_to_device_config method. -result = client.modify_cloud_to_device_config request + # Call the modify_cloud_to_device_config method. + result = client.modify_cloud_to_device_config request -# The returned object is of type Google::Cloud::Iot::V1::DeviceConfig. -p result + # The returned object is of type Google::Cloud::Iot::V1::DeviceConfig. + p result +end # [END cloudiot_v1_generated_DeviceManager_ModifyCloudToDeviceConfig_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/send_command_to_device.rb b/google-cloud-iot-v1/snippets/device_manager/send_command_to_device.rb index 288047db6ac4..d6d194e07cce 100755 --- a/google-cloud-iot-v1/snippets/device_manager/send_command_to_device.rb +++ b/google-cloud-iot-v1/snippets/device_manager/send_command_to_device.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_SendCommandToDevice_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#send_command_to_device +# +def send_command_to_device + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::SendCommandToDeviceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::SendCommandToDeviceRequest.new -# Call the send_command_to_device method. -result = client.send_command_to_device request + # Call the send_command_to_device method. + result = client.send_command_to_device request -# The returned object is of type Google::Cloud::Iot::V1::SendCommandToDeviceResponse. -p result + # The returned object is of type Google::Cloud::Iot::V1::SendCommandToDeviceResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_SendCommandToDevice_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/set_iam_policy.rb b/google-cloud-iot-v1/snippets/device_manager/set_iam_policy.rb index 6c73dcd7d442..60f99bf80640 100755 --- a/google-cloud-iot-v1/snippets/device_manager/set_iam_policy.rb +++ b/google-cloud-iot-v1/snippets/device_manager/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_SetIamPolicy_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudiot_v1_generated_DeviceManager_SetIamPolicy_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/test_iam_permissions.rb b/google-cloud-iot-v1/snippets/device_manager/test_iam_permissions.rb index d941da10db2d..b937353e8657 100755 --- a/google-cloud-iot-v1/snippets/device_manager/test_iam_permissions.rb +++ b/google-cloud-iot-v1/snippets/device_manager/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_TestIamPermissions_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_TestIamPermissions_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/unbind_device_from_gateway.rb b/google-cloud-iot-v1/snippets/device_manager/unbind_device_from_gateway.rb index a190c7442e8d..036e160ca7ef 100755 --- a/google-cloud-iot-v1/snippets/device_manager/unbind_device_from_gateway.rb +++ b/google-cloud-iot-v1/snippets/device_manager/unbind_device_from_gateway.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_UnbindDeviceFromGateway_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#unbind_device_from_gateway +# +def unbind_device_from_gateway + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::UnbindDeviceFromGatewayRequest.new -# Call the unbind_device_from_gateway method. -result = client.unbind_device_from_gateway request + # Call the unbind_device_from_gateway method. + result = client.unbind_device_from_gateway request -# The returned object is of type Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse. -p result + # The returned object is of type Google::Cloud::Iot::V1::UnbindDeviceFromGatewayResponse. + p result +end # [END cloudiot_v1_generated_DeviceManager_UnbindDeviceFromGateway_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/update_device.rb b/google-cloud-iot-v1/snippets/device_manager/update_device.rb index 59590ecc821a..eba60a303372 100755 --- a/google-cloud-iot-v1/snippets/device_manager/update_device.rb +++ b/google-cloud-iot-v1/snippets/device_manager/update_device.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_UpdateDevice_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#update_device +# +def update_device + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::UpdateDeviceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::UpdateDeviceRequest.new -# Call the update_device method. -result = client.update_device request + # Call the update_device method. + result = client.update_device request -# The returned object is of type Google::Cloud::Iot::V1::Device. -p result + # The returned object is of type Google::Cloud::Iot::V1::Device. + p result +end # [END cloudiot_v1_generated_DeviceManager_UpdateDevice_sync] diff --git a/google-cloud-iot-v1/snippets/device_manager/update_device_registry.rb b/google-cloud-iot-v1/snippets/device_manager/update_device_registry.rb index 7bef2dcacc2a..2166cd5f5e8e 100755 --- a/google-cloud-iot-v1/snippets/device_manager/update_device_registry.rb +++ b/google-cloud-iot-v1/snippets/device_manager/update_device_registry.rb @@ -19,15 +19,21 @@ # [START cloudiot_v1_generated_DeviceManager_UpdateDeviceRegistry_sync] require "google/cloud/iot/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Iot::V1::DeviceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Iot::V1::DeviceManager::Client#update_device_registry +# +def update_device_registry + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Iot::V1::DeviceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Iot::V1::UpdateDeviceRegistryRequest.new -# Call the update_device_registry method. -result = client.update_device_registry request + # Call the update_device_registry method. + result = client.update_device_registry request -# The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. -p result + # The returned object is of type Google::Cloud::Iot::V1::DeviceRegistry. + p result +end # [END cloudiot_v1_generated_DeviceManager_UpdateDeviceRegistry_sync] diff --git a/google-cloud-iot-v1/snippets/snippet_metadata_google.cloud.iot.v1.json b/google-cloud-iot-v1/snippets/snippet_metadata_google.cloud.iot.v1.json index 80687fb2e1c5..12b6e7a0590f 100644 --- a/google-cloud-iot-v1/snippets/snippet_metadata_google.cloud.iot.v1.json +++ b/google-cloud-iot-v1/snippets/snippet_metadata_google.cloud.iot.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-kms-v1/.repo-metadata.json b/google-cloud-kms-v1/.repo-metadata.json index c33a7148ae3e..3f8dd5bba807 100644 --- a/google-cloud-kms-v1/.repo-metadata.json +++ b/google-cloud-kms-v1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Manages keys and performs cryptographic operations in a central cloud service, for direct use by other cloud resources and applications. Note that google-cloud-kms-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-kms instead. See the readme for more details.", "ruby-cloud-env-prefix": "KMS", "ruby-cloud-product-url": "https://cloud.google.com/kms", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-kms-v1/.rubocop.yml b/google-cloud-kms-v1/.rubocop.yml index 0a2667cf7fc7..7508e22a5467 100644 --- a/google-cloud-kms-v1/.rubocop.yml +++ b/google-cloud-kms-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-kms-v1.rb" diff --git a/google-cloud-kms-v1/snippets/Gemfile b/google-cloud-kms-v1/snippets/Gemfile index 426a016bb996..24619cee9c52 100755 --- a/google-cloud-kms-v1/snippets/Gemfile +++ b/google-cloud-kms-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb b/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb index 3a8435654c33..8f2df9a9b9bb 100644 --- a/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb +++ b/google-cloud-kms-v1/snippets/ekm_service/create_ekm_connection.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::EkmService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#create_ekm_connection +# +def create_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateEkmConnectionRequest.new -# Call the create_ekm_connection method. -result = client.create_ekm_connection request + # Call the create_ekm_connection method. + result = client.create_ekm_connection request -# The returned object is of type Google::Cloud::Kms::V1::EkmConnection. -p result + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end # [END cloudkms_v1_generated_EkmService_CreateEkmConnection_sync] diff --git a/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb b/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb index f2f99fc227ab..fbbd68d1f782 100644 --- a/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb +++ b/google-cloud-kms-v1/snippets/ekm_service/get_ekm_connection.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_EkmService_GetEkmConnection_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::EkmService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#get_ekm_connection +# +def get_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetEkmConnectionRequest.new -# Call the get_ekm_connection method. -result = client.get_ekm_connection request + # Call the get_ekm_connection method. + result = client.get_ekm_connection request -# The returned object is of type Google::Cloud::Kms::V1::EkmConnection. -p result + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end # [END cloudkms_v1_generated_EkmService_GetEkmConnection_sync] diff --git a/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb b/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb index d1b02dde5bb3..59caa8c87ea2 100644 --- a/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb +++ b/google-cloud-kms-v1/snippets/ekm_service/list_ekm_connections.rb @@ -19,21 +19,27 @@ # [START cloudkms_v1_generated_EkmService_ListEkmConnections_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::EkmService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#list_ekm_connections +# +def list_ekm_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListEkmConnectionsRequest.new -# Call the list_ekm_connections method. -result = client.list_ekm_connections request + # Call the list_ekm_connections method. + result = client.list_ekm_connections request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Kms::V1::EkmConnection. + p response + end end # [END cloudkms_v1_generated_EkmService_ListEkmConnections_sync] diff --git a/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb b/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb index 185e10491f81..eb84be77ebc1 100644 --- a/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb +++ b/google-cloud-kms-v1/snippets/ekm_service/update_ekm_connection.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::EkmService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::EkmService::Client#update_ekm_connection +# +def update_ekm_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::EkmService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateEkmConnectionRequest.new -# Call the update_ekm_connection method. -result = client.update_ekm_connection request + # Call the update_ekm_connection method. + result = client.update_ekm_connection request -# The returned object is of type Google::Cloud::Kms::V1::EkmConnection. -p result + # The returned object is of type Google::Cloud::Kms::V1::EkmConnection. + p result +end # [END cloudkms_v1_generated_EkmService_UpdateEkmConnection_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb b/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb index ea849dd5553e..29a293d2ab97 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/asymmetric_decrypt.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_decrypt +# +def asymmetric_decrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::AsymmetricDecryptRequest.new -# Call the asymmetric_decrypt method. -result = client.asymmetric_decrypt request + # Call the asymmetric_decrypt method. + result = client.asymmetric_decrypt request -# The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::AsymmetricDecryptResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_AsymmetricDecrypt_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb b/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb index 17c6cd2e1be0..45e36873fb78 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/asymmetric_sign.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#asymmetric_sign +# +def asymmetric_sign + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::AsymmetricSignRequest.new -# Call the asymmetric_sign method. -result = client.asymmetric_sign request + # Call the asymmetric_sign method. + result = client.asymmetric_sign request -# The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::AsymmetricSignResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_AsymmetricSign_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb b/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb index c0b39346dda2..ce69c1b5460c 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key +# +def create_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateCryptoKeyRequest.new -# Call the create_crypto_key method. -result = client.create_crypto_key request + # Call the create_crypto_key method. + result = client.create_crypto_key request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKey. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end # [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKey_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb index 302e55b1a6ae..eb57de56049c 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/create_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_crypto_key_version +# +def create_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateCryptoKeyVersionRequest.new -# Call the create_crypto_key_version method. -result = client.create_crypto_key_version request + # Call the create_crypto_key_version method. + result = client.create_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_CreateCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb b/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb index ea182538a518..886ff8db0f3d 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/create_import_job.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_import_job +# +def create_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::CreateImportJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateImportJobRequest.new -# Call the create_import_job method. -result = client.create_import_job request + # Call the create_import_job method. + result = client.create_import_job request -# The returned object is of type Google::Cloud::Kms::V1::ImportJob. -p result + # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + p result +end # [END cloudkms_v1_generated_KeyManagementService_CreateImportJob_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb b/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb index 0b3ec32e5bfe..d3c7916fc4db 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/create_key_ring.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#create_key_ring +# +def create_key_ring + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::CreateKeyRingRequest.new -# Call the create_key_ring method. -result = client.create_key_ring request + # Call the create_key_ring method. + result = client.create_key_ring request -# The returned object is of type Google::Cloud::Kms::V1::KeyRing. -p result + # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + p result +end # [END cloudkms_v1_generated_KeyManagementService_CreateKeyRing_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb b/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb index f7b7ba095841..2f91fd36a5c7 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/decrypt.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_Decrypt_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#decrypt +# +def decrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::DecryptRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DecryptRequest.new -# Call the decrypt method. -result = client.decrypt request + # Call the decrypt method. + result = client.decrypt request -# The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::DecryptResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_Decrypt_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb index 0cf27002287d..e4dfa7e76575 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/destroy_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#destroy_crypto_key_version +# +def destroy_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::DestroyCryptoKeyVersionRequest.new -# Call the destroy_crypto_key_version method. -result = client.destroy_crypto_key_version request + # Call the destroy_crypto_key_version method. + result = client.destroy_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_DestroyCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb b/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb index 82be85b6f42f..6406266a0137 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/encrypt.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_Encrypt_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#encrypt +# +def encrypt + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::EncryptRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::EncryptRequest.new -# Call the encrypt method. -result = client.encrypt request + # Call the encrypt method. + result = client.encrypt request -# The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::EncryptResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_Encrypt_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb b/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb index 526afa02993f..76a3481c0e3c 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/generate_random_bytes.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#generate_random_bytes +# +def generate_random_bytes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GenerateRandomBytesRequest.new -# Call the generate_random_bytes method. -result = client.generate_random_bytes request + # Call the generate_random_bytes method. + result = client.generate_random_bytes request -# The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::GenerateRandomBytesResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GenerateRandomBytes_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb b/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb index ed1475f78895..28df838df5a5 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key +# +def get_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetCryptoKeyRequest.new -# Call the get_crypto_key method. -result = client.get_crypto_key request + # Call the get_crypto_key method. + result = client.get_crypto_key request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKey. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GetCryptoKey_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb index c732803a2d8d..3d7632037109 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/get_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_crypto_key_version +# +def get_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetCryptoKeyVersionRequest.new -# Call the get_crypto_key_version method. -result = client.get_crypto_key_version request + # Call the get_crypto_key_version method. + result = client.get_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GetCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb b/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb index b654b1456fe7..abbe9226646c 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/get_import_job.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_import_job +# +def get_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetImportJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetImportJobRequest.new -# Call the get_import_job method. -result = client.get_import_job request + # Call the get_import_job method. + result = client.get_import_job request -# The returned object is of type Google::Cloud::Kms::V1::ImportJob. -p result + # The returned object is of type Google::Cloud::Kms::V1::ImportJob. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GetImportJob_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb b/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb index 5948447afde9..e8a0a7d56f0b 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/get_key_ring.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_key_ring +# +def get_key_ring + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetKeyRingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetKeyRingRequest.new -# Call the get_key_ring method. -result = client.get_key_ring request + # Call the get_key_ring method. + result = client.get_key_ring request -# The returned object is of type Google::Cloud::Kms::V1::KeyRing. -p result + # The returned object is of type Google::Cloud::Kms::V1::KeyRing. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GetKeyRing_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb b/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb index 0abc0fe048dd..80da5e1d0427 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/get_public_key.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#get_public_key +# +def get_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::GetPublicKeyRequest.new -# Call the get_public_key method. -result = client.get_public_key request + # Call the get_public_key method. + result = client.get_public_key request -# The returned object is of type Google::Cloud::Kms::V1::PublicKey. -p result + # The returned object is of type Google::Cloud::Kms::V1::PublicKey. + p result +end # [END cloudkms_v1_generated_KeyManagementService_GetPublicKey_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb index 4705ec5ecd06..9630664215eb 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/import_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#import_crypto_key_version +# +def import_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ImportCryptoKeyVersionRequest.new -# Call the import_crypto_key_version method. -result = client.import_crypto_key_version request + # Call the import_crypto_key_version method. + result = client.import_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_ImportCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb b/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb index 68b143caa661..2f5597fb7938 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/list_crypto_key_versions.rb @@ -19,21 +19,27 @@ # [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_key_versions +# +def list_crypto_key_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListCryptoKeyVersionsRequest.new -# Call the list_crypto_key_versions method. -result = client.list_crypto_key_versions request + # Call the list_crypto_key_versions method. + result = client.list_crypto_key_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Kms::V1::CryptoKeyVersion. + p response + end end # [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeyVersions_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb b/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb index a01d85a3a2a7..14edc0048a93 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/list_crypto_keys.rb @@ -19,21 +19,27 @@ # [START cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_crypto_keys +# +def list_crypto_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListCryptoKeysRequest.new -# Call the list_crypto_keys method. -result = client.list_crypto_keys request + # Call the list_crypto_keys method. + result = client.list_crypto_keys request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Kms::V1::CryptoKey. + p response + end end # [END cloudkms_v1_generated_KeyManagementService_ListCryptoKeys_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb b/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb index c7934cac18da..d610c3da1743 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/list_import_jobs.rb @@ -19,21 +19,27 @@ # [START cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_import_jobs +# +def list_import_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ListImportJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListImportJobsRequest.new -# Call the list_import_jobs method. -result = client.list_import_jobs request + # Call the list_import_jobs method. + result = client.list_import_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Kms::V1::ImportJob. + p response + end end # [END cloudkms_v1_generated_KeyManagementService_ListImportJobs_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb b/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb index 7467ef1d2157..8ac5ded4cf93 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/list_key_rings.rb @@ -19,21 +19,27 @@ # [START cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#list_key_rings +# +def list_key_rings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::ListKeyRingsRequest.new -# Call the list_key_rings method. -result = client.list_key_rings request + # Call the list_key_rings method. + result = client.list_key_rings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Kms::V1::KeyRing. + p response + end end # [END cloudkms_v1_generated_KeyManagementService_ListKeyRings_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb b/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb index 6fd6fc107d06..68a913d9d742 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/mac_sign.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_MacSign_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_sign +# +def mac_sign + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::MacSignRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::MacSignRequest.new -# Call the mac_sign method. -result = client.mac_sign request + # Call the mac_sign method. + result = client.mac_sign request -# The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::MacSignResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_MacSign_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb b/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb index d8c4d7c0f012..fb28f878ad11 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/mac_verify.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_MacVerify_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#mac_verify +# +def mac_verify + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::MacVerifyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::MacVerifyRequest.new -# Call the mac_verify method. -result = client.mac_verify request + # Call the mac_verify method. + result = client.mac_verify request -# The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. -p result + # The returned object is of type Google::Cloud::Kms::V1::MacVerifyResponse. + p result +end # [END cloudkms_v1_generated_KeyManagementService_MacVerify_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb index fe9df06f8432..4ec085a5bfb5 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/restore_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#restore_crypto_key_version +# +def restore_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::RestoreCryptoKeyVersionRequest.new -# Call the restore_crypto_key_version method. -result = client.restore_crypto_key_version request + # Call the restore_crypto_key_version method. + result = client.restore_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_RestoreCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb index c77d92b5c2b1..e173e453b945 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key +# +def update_crypto_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyRequest.new -# Call the update_crypto_key method. -result = client.update_crypto_key request + # Call the update_crypto_key method. + result = client.update_crypto_key request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKey. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end # [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKey_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb index cf3bdbb25eb8..f1305d7e2f74 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_primary_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_primary_version +# +def update_crypto_key_primary_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyPrimaryVersionRequest.new -# Call the update_crypto_key_primary_version method. -result = client.update_crypto_key_primary_version request + # Call the update_crypto_key_primary_version method. + result = client.update_crypto_key_primary_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKey. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKey. + p result +end # [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyPrimaryVersion_sync] diff --git a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb index 6ca81823a7b2..45745ebe1cfc 100755 --- a/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb +++ b/google-cloud-kms-v1/snippets/key_management_service/update_crypto_key_version.rb @@ -19,15 +19,21 @@ # [START cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] require "google/cloud/kms/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Kms::V1::KeyManagementService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Kms::V1::KeyManagementService::Client#update_crypto_key_version +# +def update_crypto_key_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Kms::V1::KeyManagementService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Kms::V1::UpdateCryptoKeyVersionRequest.new -# Call the update_crypto_key_version method. -result = client.update_crypto_key_version request + # Call the update_crypto_key_version method. + result = client.update_crypto_key_version request -# The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. -p result + # The returned object is of type Google::Cloud::Kms::V1::CryptoKeyVersion. + p result +end # [END cloudkms_v1_generated_KeyManagementService_UpdateCryptoKeyVersion_sync] diff --git a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json index cfb03b1d0345..c54ba62852a5 100644 --- a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json +++ b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-language-v1/.rubocop.yml b/google-cloud-language-v1/.rubocop.yml index 559bbb54f1e2..77a6ecd01a82 100644 --- a/google-cloud-language-v1/.rubocop.yml +++ b/google-cloud-language-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-language-v1.rb" diff --git a/google-cloud-language-v1/snippets/Gemfile b/google-cloud-language-v1/snippets/Gemfile index 3e3aca0f06ee..9495d083a636 100755 --- a/google-cloud-language-v1/snippets/Gemfile +++ b/google-cloud-language-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-language-v1/snippets/language_service/analyze_entities.rb b/google-cloud-language-v1/snippets/language_service/analyze_entities.rb index 23e06ba782ce..6d9f75d30534 100755 --- a/google-cloud-language-v1/snippets/language_service/analyze_entities.rb +++ b/google-cloud-language-v1/snippets/language_service/analyze_entities.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_AnalyzeEntities_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#analyze_entities +# +def analyze_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::AnalyzeEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::AnalyzeEntitiesRequest.new -# Call the analyze_entities method. -result = client.analyze_entities request + # Call the analyze_entities method. + result = client.analyze_entities request -# The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitiesResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitiesResponse. + p result +end # [END language_v1_generated_LanguageService_AnalyzeEntities_sync] diff --git a/google-cloud-language-v1/snippets/language_service/analyze_entity_sentiment.rb b/google-cloud-language-v1/snippets/language_service/analyze_entity_sentiment.rb index 8d281bb7b46b..1a024275f85e 100755 --- a/google-cloud-language-v1/snippets/language_service/analyze_entity_sentiment.rb +++ b/google-cloud-language-v1/snippets/language_service/analyze_entity_sentiment.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_AnalyzeEntitySentiment_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#analyze_entity_sentiment +# +def analyze_entity_sentiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::AnalyzeEntitySentimentRequest.new -# Call the analyze_entity_sentiment method. -result = client.analyze_entity_sentiment request + # Call the analyze_entity_sentiment method. + result = client.analyze_entity_sentiment request -# The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::AnalyzeEntitySentimentResponse. + p result +end # [END language_v1_generated_LanguageService_AnalyzeEntitySentiment_sync] diff --git a/google-cloud-language-v1/snippets/language_service/analyze_sentiment.rb b/google-cloud-language-v1/snippets/language_service/analyze_sentiment.rb index 3fa857f1b350..81753e015fc1 100755 --- a/google-cloud-language-v1/snippets/language_service/analyze_sentiment.rb +++ b/google-cloud-language-v1/snippets/language_service/analyze_sentiment.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_AnalyzeSentiment_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#analyze_sentiment +# +def analyze_sentiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::AnalyzeSentimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::AnalyzeSentimentRequest.new -# Call the analyze_sentiment method. -result = client.analyze_sentiment request + # Call the analyze_sentiment method. + result = client.analyze_sentiment request -# The returned object is of type Google::Cloud::Language::V1::AnalyzeSentimentResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::AnalyzeSentimentResponse. + p result +end # [END language_v1_generated_LanguageService_AnalyzeSentiment_sync] diff --git a/google-cloud-language-v1/snippets/language_service/analyze_syntax.rb b/google-cloud-language-v1/snippets/language_service/analyze_syntax.rb index eebad3f0e678..999d426dd6c3 100755 --- a/google-cloud-language-v1/snippets/language_service/analyze_syntax.rb +++ b/google-cloud-language-v1/snippets/language_service/analyze_syntax.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_AnalyzeSyntax_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#analyze_syntax +# +def analyze_syntax + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::AnalyzeSyntaxRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::AnalyzeSyntaxRequest.new -# Call the analyze_syntax method. -result = client.analyze_syntax request + # Call the analyze_syntax method. + result = client.analyze_syntax request -# The returned object is of type Google::Cloud::Language::V1::AnalyzeSyntaxResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::AnalyzeSyntaxResponse. + p result +end # [END language_v1_generated_LanguageService_AnalyzeSyntax_sync] diff --git a/google-cloud-language-v1/snippets/language_service/annotate_text.rb b/google-cloud-language-v1/snippets/language_service/annotate_text.rb index 8adcd32213d2..5288f30e6d34 100755 --- a/google-cloud-language-v1/snippets/language_service/annotate_text.rb +++ b/google-cloud-language-v1/snippets/language_service/annotate_text.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_AnnotateText_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#annotate_text +# +def annotate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::AnnotateTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::AnnotateTextRequest.new -# Call the annotate_text method. -result = client.annotate_text request + # Call the annotate_text method. + result = client.annotate_text request -# The returned object is of type Google::Cloud::Language::V1::AnnotateTextResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::AnnotateTextResponse. + p result +end # [END language_v1_generated_LanguageService_AnnotateText_sync] diff --git a/google-cloud-language-v1/snippets/language_service/classify_text.rb b/google-cloud-language-v1/snippets/language_service/classify_text.rb index f2062893a849..659dae513748 100755 --- a/google-cloud-language-v1/snippets/language_service/classify_text.rb +++ b/google-cloud-language-v1/snippets/language_service/classify_text.rb @@ -19,15 +19,21 @@ # [START language_v1_generated_LanguageService_ClassifyText_sync] require "google/cloud/language/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1::LanguageService::Client#classify_text +# +def classify_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1::ClassifyTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1::ClassifyTextRequest.new -# Call the classify_text method. -result = client.classify_text request + # Call the classify_text method. + result = client.classify_text request -# The returned object is of type Google::Cloud::Language::V1::ClassifyTextResponse. -p result + # The returned object is of type Google::Cloud::Language::V1::ClassifyTextResponse. + p result +end # [END language_v1_generated_LanguageService_ClassifyText_sync] diff --git a/google-cloud-language-v1/snippets/snippet_metadata_google.cloud.language.v1.json b/google-cloud-language-v1/snippets/snippet_metadata_google.cloud.language.v1.json index 3600f87dde0e..15465d3529d2 100644 --- a/google-cloud-language-v1/snippets/snippet_metadata_google.cloud.language.v1.json +++ b/google-cloud-language-v1/snippets/snippet_metadata_google.cloud.language.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-language-v1beta2/.rubocop.yml b/google-cloud-language-v1beta2/.rubocop.yml index 0b54a8a3b5ce..83e391712037 100644 --- a/google-cloud-language-v1beta2/.rubocop.yml +++ b/google-cloud-language-v1beta2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-language-v1beta2.rb" diff --git a/google-cloud-language-v1beta2/snippets/Gemfile b/google-cloud-language-v1beta2/snippets/Gemfile index 120b6df1705a..959100dc1cf9 100755 --- a/google-cloud-language-v1beta2/snippets/Gemfile +++ b/google-cloud-language-v1beta2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-language-v1beta2/snippets/language_service/analyze_entities.rb b/google-cloud-language-v1beta2/snippets/language_service/analyze_entities.rb index 2ec4e98058a4..2e426e0130cd 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/analyze_entities.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/analyze_entities.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_AnalyzeEntities_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_entities +# +def analyze_entities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::AnalyzeEntitiesRequest.new -# Call the analyze_entities method. -result = client.analyze_entities request + # Call the analyze_entities method. + result = client.analyze_entities request -# The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitiesResponse. + p result +end # [END language_v1beta2_generated_LanguageService_AnalyzeEntities_sync] diff --git a/google-cloud-language-v1beta2/snippets/language_service/analyze_entity_sentiment.rb b/google-cloud-language-v1beta2/snippets/language_service/analyze_entity_sentiment.rb index 171e91c7ab66..02ede612bac8 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/analyze_entity_sentiment.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/analyze_entity_sentiment.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_entity_sentiment +# +def analyze_entity_sentiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentRequest.new -# Call the analyze_entity_sentiment method. -result = client.analyze_entity_sentiment request + # Call the analyze_entity_sentiment method. + result = client.analyze_entity_sentiment request -# The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeEntitySentimentResponse. + p result +end # [END language_v1beta2_generated_LanguageService_AnalyzeEntitySentiment_sync] diff --git a/google-cloud-language-v1beta2/snippets/language_service/analyze_sentiment.rb b/google-cloud-language-v1beta2/snippets/language_service/analyze_sentiment.rb index d75597d23679..3c0f64426518 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/analyze_sentiment.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/analyze_sentiment.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_AnalyzeSentiment_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_sentiment +# +def analyze_sentiment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::AnalyzeSentimentRequest.new -# Call the analyze_sentiment method. -result = client.analyze_sentiment request + # Call the analyze_sentiment method. + result = client.analyze_sentiment request -# The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSentimentResponse. + p result +end # [END language_v1beta2_generated_LanguageService_AnalyzeSentiment_sync] diff --git a/google-cloud-language-v1beta2/snippets/language_service/analyze_syntax.rb b/google-cloud-language-v1beta2/snippets/language_service/analyze_syntax.rb index 4e6e31b39440..f16f374aa445 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/analyze_syntax.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/analyze_syntax.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_AnalyzeSyntax_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#analyze_syntax +# +def analyze_syntax + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::AnalyzeSyntaxRequest.new -# Call the analyze_syntax method. -result = client.analyze_syntax request + # Call the analyze_syntax method. + result = client.analyze_syntax request -# The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::AnalyzeSyntaxResponse. + p result +end # [END language_v1beta2_generated_LanguageService_AnalyzeSyntax_sync] diff --git a/google-cloud-language-v1beta2/snippets/language_service/annotate_text.rb b/google-cloud-language-v1beta2/snippets/language_service/annotate_text.rb index d22c6d0b3290..798ba273810e 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/annotate_text.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/annotate_text.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_AnnotateText_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#annotate_text +# +def annotate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::AnnotateTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::AnnotateTextRequest.new -# Call the annotate_text method. -result = client.annotate_text request + # Call the annotate_text method. + result = client.annotate_text request -# The returned object is of type Google::Cloud::Language::V1beta2::AnnotateTextResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::AnnotateTextResponse. + p result +end # [END language_v1beta2_generated_LanguageService_AnnotateText_sync] diff --git a/google-cloud-language-v1beta2/snippets/language_service/classify_text.rb b/google-cloud-language-v1beta2/snippets/language_service/classify_text.rb index 6e550fda3954..5a1fbb8d41b1 100755 --- a/google-cloud-language-v1beta2/snippets/language_service/classify_text.rb +++ b/google-cloud-language-v1beta2/snippets/language_service/classify_text.rb @@ -19,15 +19,21 @@ # [START language_v1beta2_generated_LanguageService_ClassifyText_sync] require "google/cloud/language/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Language::V1beta2::LanguageService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Language::V1beta2::LanguageService::Client#classify_text +# +def classify_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Language::V1beta2::LanguageService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Language::V1beta2::ClassifyTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Language::V1beta2::ClassifyTextRequest.new -# Call the classify_text method. -result = client.classify_text request + # Call the classify_text method. + result = client.classify_text request -# The returned object is of type Google::Cloud::Language::V1beta2::ClassifyTextResponse. -p result + # The returned object is of type Google::Cloud::Language::V1beta2::ClassifyTextResponse. + p result +end # [END language_v1beta2_generated_LanguageService_ClassifyText_sync] diff --git a/google-cloud-language-v1beta2/snippets/snippet_metadata_google.cloud.language.v1beta2.json b/google-cloud-language-v1beta2/snippets/snippet_metadata_google.cloud.language.v1beta2.json index cbb90b56fc11..0a373bb8d227 100644 --- a/google-cloud-language-v1beta2/snippets/snippet_metadata_google.cloud.language.v1beta2.json +++ b/google-cloud-language-v1beta2/snippets/snippet_metadata_google.cloud.language.v1beta2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-life_sciences-v2beta/.rubocop.yml b/google-cloud-life_sciences-v2beta/.rubocop.yml index b40c442b23ac..15d939207f95 100644 --- a/google-cloud-life_sciences-v2beta/.rubocop.yml +++ b/google-cloud-life_sciences-v2beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-life_sciences-v2beta.rb" diff --git a/google-cloud-life_sciences-v2beta/snippets/Gemfile b/google-cloud-life_sciences-v2beta/snippets/Gemfile index b5f7168c7385..a126f7fa0fd2 100755 --- a/google-cloud-life_sciences-v2beta/snippets/Gemfile +++ b/google-cloud-life_sciences-v2beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json b/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json index 79436c6fbef3..3613dfc7738f 100644 --- a/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json +++ b/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-life_sciences-v2beta/snippets/workflows_service/run_pipeline.rb b/google-cloud-life_sciences-v2beta/snippets/workflows_service/run_pipeline.rb index b9f7d6c4e029..25ff9994d09e 100755 --- a/google-cloud-life_sciences-v2beta/snippets/workflows_service/run_pipeline.rb +++ b/google-cloud-life_sciences-v2beta/snippets/workflows_service/run_pipeline.rb @@ -19,22 +19,28 @@ # [START lifesciences_v2beta_generated_WorkflowsService_RunPipeline_sync] require "google/cloud/life_sciences/v2beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client#run_pipeline +# +def run_pipeline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::LifeSciences::V2beta::WorkflowsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::LifeSciences::V2beta::RunPipelineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::LifeSciences::V2beta::RunPipelineRequest.new -# Call the run_pipeline method. -result = client.run_pipeline request + # Call the run_pipeline method. + result = client.run_pipeline request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END lifesciences_v2beta_generated_WorkflowsService_RunPipeline_sync] diff --git a/google-cloud-location/.repo-metadata.json b/google-cloud-location/.repo-metadata.json index 3fe3bb10d448..f01362509811 100644 --- a/google-cloud-location/.repo-metadata.json +++ b/google-cloud-location/.repo-metadata.json @@ -9,5 +9,5 @@ "repo": "googleapis/google-cloud-ruby", "requires_billing": true, "ruby-cloud-description": "An add-on interface used by some Google API clients to provide location management calls.", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } diff --git a/google-cloud-location/.rubocop.yml b/google-cloud-location/.rubocop.yml index b9aaf17e5097..69d68e58f9c3 100644 --- a/google-cloud-location/.rubocop.yml +++ b/google-cloud-location/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-location.rb" diff --git a/google-cloud-location/snippets/Gemfile b/google-cloud-location/snippets/Gemfile index 725c3e75895c..5845795bfc2d 100755 --- a/google-cloud-location/snippets/Gemfile +++ b/google-cloud-location/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-location/snippets/locations/get_location.rb b/google-cloud-location/snippets/locations/get_location.rb index 72aa2256ef42..310aa88b5ab3 100755 --- a/google-cloud-location/snippets/locations/get_location.rb +++ b/google-cloud-location/snippets/locations/get_location.rb @@ -19,15 +19,21 @@ # [START location_v0_generated_Locations_GetLocation_sync] require "google/cloud/location" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Location::Locations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Location::Locations::Client#get_location +# +def get_location + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Location::Locations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Location::GetLocationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Location::GetLocationRequest.new -# Call the get_location method. -result = client.get_location request + # Call the get_location method. + result = client.get_location request -# The returned object is of type Google::Cloud::Location::Location. -p result + # The returned object is of type Google::Cloud::Location::Location. + p result +end # [END location_v0_generated_Locations_GetLocation_sync] diff --git a/google-cloud-location/snippets/locations/list_locations.rb b/google-cloud-location/snippets/locations/list_locations.rb index f631278b82f0..715070651a55 100755 --- a/google-cloud-location/snippets/locations/list_locations.rb +++ b/google-cloud-location/snippets/locations/list_locations.rb @@ -19,21 +19,27 @@ # [START location_v0_generated_Locations_ListLocations_sync] require "google/cloud/location" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Location::Locations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Location::Locations::Client#list_locations +# +def list_locations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Location::Locations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Location::ListLocationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Location::ListLocationsRequest.new -# Call the list_locations method. -result = client.list_locations request + # Call the list_locations method. + result = client.list_locations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Location::Location. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Location::Location. + p response + end end # [END location_v0_generated_Locations_ListLocations_sync] diff --git a/google-cloud-location/snippets/snippet_metadata_google.cloud.location.json b/google-cloud-location/snippets/snippet_metadata_google.cloud.location.json index ad257d40782c..475fa354ae5c 100644 --- a/google-cloud-location/snippets/snippet_metadata_google.cloud.location.json +++ b/google-cloud-location/snippets/snippet_metadata_google.cloud.location.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-logging-v2/.rubocop.yml b/google-cloud-logging-v2/.rubocop.yml index 339a59d07df2..f994756f6c71 100644 --- a/google-cloud-logging-v2/.rubocop.yml +++ b/google-cloud-logging-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-logging-v2.rb" diff --git a/google-cloud-logging-v2/snippets/Gemfile b/google-cloud-logging-v2/snippets/Gemfile index 2d7f8fcf6ada..caa479667b18 100755 --- a/google-cloud-logging-v2/snippets/Gemfile +++ b/google-cloud-logging-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-logging-v2/snippets/config_service/copy_log_entries.rb b/google-cloud-logging-v2/snippets/config_service/copy_log_entries.rb index d0361701d04e..4a500a8c7a77 100644 --- a/google-cloud-logging-v2/snippets/config_service/copy_log_entries.rb +++ b/google-cloud-logging-v2/snippets/config_service/copy_log_entries.rb @@ -19,22 +19,28 @@ # [START logging_v2_generated_ConfigService_CopyLogEntries_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#copy_log_entries +# +def copy_log_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CopyLogEntriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CopyLogEntriesRequest.new -# Call the copy_log_entries method. -result = client.copy_log_entries request + # Call the copy_log_entries method. + result = client.copy_log_entries request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END logging_v2_generated_ConfigService_CopyLogEntries_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/create_bucket.rb b/google-cloud-logging-v2/snippets/config_service/create_bucket.rb index 7a862fb2044d..d55c8d785ad5 100755 --- a/google-cloud-logging-v2/snippets/config_service/create_bucket.rb +++ b/google-cloud-logging-v2/snippets/config_service/create_bucket.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_CreateBucket_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#create_bucket +# +def create_bucket + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CreateBucketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CreateBucketRequest.new -# Call the create_bucket method. -result = client.create_bucket request + # Call the create_bucket method. + result = client.create_bucket request -# The returned object is of type Google::Cloud::Logging::V2::LogBucket. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogBucket. + p result +end # [END logging_v2_generated_ConfigService_CreateBucket_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/create_exclusion.rb b/google-cloud-logging-v2/snippets/config_service/create_exclusion.rb index e8adc6cb4b25..ea1fec6f7b1e 100755 --- a/google-cloud-logging-v2/snippets/config_service/create_exclusion.rb +++ b/google-cloud-logging-v2/snippets/config_service/create_exclusion.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_CreateExclusion_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#create_exclusion +# +def create_exclusion + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CreateExclusionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CreateExclusionRequest.new -# Call the create_exclusion method. -result = client.create_exclusion request + # Call the create_exclusion method. + result = client.create_exclusion request -# The returned object is of type Google::Cloud::Logging::V2::LogExclusion. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. + p result +end # [END logging_v2_generated_ConfigService_CreateExclusion_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/create_sink.rb b/google-cloud-logging-v2/snippets/config_service/create_sink.rb index 0a5ccd86718b..d71178f0e575 100755 --- a/google-cloud-logging-v2/snippets/config_service/create_sink.rb +++ b/google-cloud-logging-v2/snippets/config_service/create_sink.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_CreateSink_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#create_sink +# +def create_sink + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CreateSinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CreateSinkRequest.new -# Call the create_sink method. -result = client.create_sink request + # Call the create_sink method. + result = client.create_sink request -# The returned object is of type Google::Cloud::Logging::V2::LogSink. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogSink. + p result +end # [END logging_v2_generated_ConfigService_CreateSink_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/create_view.rb b/google-cloud-logging-v2/snippets/config_service/create_view.rb index 2ea3019dc9d4..cf0157baffdd 100755 --- a/google-cloud-logging-v2/snippets/config_service/create_view.rb +++ b/google-cloud-logging-v2/snippets/config_service/create_view.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_CreateView_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#create_view +# +def create_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CreateViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CreateViewRequest.new -# Call the create_view method. -result = client.create_view request + # Call the create_view method. + result = client.create_view request -# The returned object is of type Google::Cloud::Logging::V2::LogView. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogView. + p result +end # [END logging_v2_generated_ConfigService_CreateView_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/delete_bucket.rb b/google-cloud-logging-v2/snippets/config_service/delete_bucket.rb index 06bcb3c5f668..a9ad3ef670f9 100755 --- a/google-cloud-logging-v2/snippets/config_service/delete_bucket.rb +++ b/google-cloud-logging-v2/snippets/config_service/delete_bucket.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_DeleteBucket_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#delete_bucket +# +def delete_bucket + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteBucketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteBucketRequest.new -# Call the delete_bucket method. -result = client.delete_bucket request + # Call the delete_bucket method. + result = client.delete_bucket request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_ConfigService_DeleteBucket_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/delete_exclusion.rb b/google-cloud-logging-v2/snippets/config_service/delete_exclusion.rb index 96682644a044..fcaa4d09f070 100755 --- a/google-cloud-logging-v2/snippets/config_service/delete_exclusion.rb +++ b/google-cloud-logging-v2/snippets/config_service/delete_exclusion.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_DeleteExclusion_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#delete_exclusion +# +def delete_exclusion + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new -# Call the delete_exclusion method. -result = client.delete_exclusion request + # Call the delete_exclusion method. + result = client.delete_exclusion request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_ConfigService_DeleteExclusion_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/delete_sink.rb b/google-cloud-logging-v2/snippets/config_service/delete_sink.rb index 638cd8b916fc..21ef72ad10c5 100755 --- a/google-cloud-logging-v2/snippets/config_service/delete_sink.rb +++ b/google-cloud-logging-v2/snippets/config_service/delete_sink.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_DeleteSink_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#delete_sink +# +def delete_sink + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteSinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteSinkRequest.new -# Call the delete_sink method. -result = client.delete_sink request + # Call the delete_sink method. + result = client.delete_sink request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_ConfigService_DeleteSink_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/delete_view.rb b/google-cloud-logging-v2/snippets/config_service/delete_view.rb index 383a0ac3662b..dfd29ce86cc8 100755 --- a/google-cloud-logging-v2/snippets/config_service/delete_view.rb +++ b/google-cloud-logging-v2/snippets/config_service/delete_view.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_DeleteView_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#delete_view +# +def delete_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteViewRequest.new -# Call the delete_view method. -result = client.delete_view request + # Call the delete_view method. + result = client.delete_view request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_ConfigService_DeleteView_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_bucket.rb b/google-cloud-logging-v2/snippets/config_service/get_bucket.rb index 334de10790aa..0a7207dbfa69 100755 --- a/google-cloud-logging-v2/snippets/config_service/get_bucket.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_bucket.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetBucket_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_bucket +# +def get_bucket + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetBucketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetBucketRequest.new -# Call the get_bucket method. -result = client.get_bucket request + # Call the get_bucket method. + result = client.get_bucket request -# The returned object is of type Google::Cloud::Logging::V2::LogBucket. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogBucket. + p result +end # [END logging_v2_generated_ConfigService_GetBucket_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_cmek_settings.rb b/google-cloud-logging-v2/snippets/config_service/get_cmek_settings.rb index e17ab641b3fd..cc12d9a57639 100755 --- a/google-cloud-logging-v2/snippets/config_service/get_cmek_settings.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_cmek_settings.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetCmekSettings_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_cmek_settings +# +def get_cmek_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new -# Call the get_cmek_settings method. -result = client.get_cmek_settings request + # Call the get_cmek_settings method. + result = client.get_cmek_settings request -# The returned object is of type Google::Cloud::Logging::V2::CmekSettings. -p result + # The returned object is of type Google::Cloud::Logging::V2::CmekSettings. + p result +end # [END logging_v2_generated_ConfigService_GetCmekSettings_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_exclusion.rb b/google-cloud-logging-v2/snippets/config_service/get_exclusion.rb index 8aa7bd3c6b5e..3304bd41c21a 100755 --- a/google-cloud-logging-v2/snippets/config_service/get_exclusion.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_exclusion.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetExclusion_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_exclusion +# +def get_exclusion + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetExclusionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetExclusionRequest.new -# Call the get_exclusion method. -result = client.get_exclusion request + # Call the get_exclusion method. + result = client.get_exclusion request -# The returned object is of type Google::Cloud::Logging::V2::LogExclusion. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. + p result +end # [END logging_v2_generated_ConfigService_GetExclusion_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_settings.rb b/google-cloud-logging-v2/snippets/config_service/get_settings.rb index d6972cf7eb0d..36bae943c97e 100644 --- a/google-cloud-logging-v2/snippets/config_service/get_settings.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_settings.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetSettings_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_settings +# +def get_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetSettingsRequest.new -# Call the get_settings method. -result = client.get_settings request + # Call the get_settings method. + result = client.get_settings request -# The returned object is of type Google::Cloud::Logging::V2::Settings. -p result + # The returned object is of type Google::Cloud::Logging::V2::Settings. + p result +end # [END logging_v2_generated_ConfigService_GetSettings_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_sink.rb b/google-cloud-logging-v2/snippets/config_service/get_sink.rb index 51feda5da306..779e22b5a4dd 100755 --- a/google-cloud-logging-v2/snippets/config_service/get_sink.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_sink.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetSink_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_sink +# +def get_sink + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetSinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetSinkRequest.new -# Call the get_sink method. -result = client.get_sink request + # Call the get_sink method. + result = client.get_sink request -# The returned object is of type Google::Cloud::Logging::V2::LogSink. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogSink. + p result +end # [END logging_v2_generated_ConfigService_GetSink_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/get_view.rb b/google-cloud-logging-v2/snippets/config_service/get_view.rb index 6fdaae0f2fc6..02a099e1ad04 100755 --- a/google-cloud-logging-v2/snippets/config_service/get_view.rb +++ b/google-cloud-logging-v2/snippets/config_service/get_view.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_GetView_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#get_view +# +def get_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetViewRequest.new -# Call the get_view method. -result = client.get_view request + # Call the get_view method. + result = client.get_view request -# The returned object is of type Google::Cloud::Logging::V2::LogView. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogView. + p result +end # [END logging_v2_generated_ConfigService_GetView_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/list_buckets.rb b/google-cloud-logging-v2/snippets/config_service/list_buckets.rb index 010e0030e906..431075a91863 100755 --- a/google-cloud-logging-v2/snippets/config_service/list_buckets.rb +++ b/google-cloud-logging-v2/snippets/config_service/list_buckets.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_ConfigService_ListBuckets_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#list_buckets +# +def list_buckets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListBucketsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListBucketsRequest.new -# Call the list_buckets method. -result = client.list_buckets request + # Call the list_buckets method. + result = client.list_buckets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogBucket. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogBucket. + p response + end end # [END logging_v2_generated_ConfigService_ListBuckets_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/list_exclusions.rb b/google-cloud-logging-v2/snippets/config_service/list_exclusions.rb index 5f9a537da1e3..127579e0f84c 100755 --- a/google-cloud-logging-v2/snippets/config_service/list_exclusions.rb +++ b/google-cloud-logging-v2/snippets/config_service/list_exclusions.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_ConfigService_ListExclusions_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#list_exclusions +# +def list_exclusions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListExclusionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListExclusionsRequest.new -# Call the list_exclusions method. -result = client.list_exclusions request + # Call the list_exclusions method. + result = client.list_exclusions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion. + p response + end end # [END logging_v2_generated_ConfigService_ListExclusions_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/list_sinks.rb b/google-cloud-logging-v2/snippets/config_service/list_sinks.rb index add6336635fb..42dd2cb6ae11 100755 --- a/google-cloud-logging-v2/snippets/config_service/list_sinks.rb +++ b/google-cloud-logging-v2/snippets/config_service/list_sinks.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_ConfigService_ListSinks_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#list_sinks +# +def list_sinks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListSinksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListSinksRequest.new -# Call the list_sinks method. -result = client.list_sinks request + # Call the list_sinks method. + result = client.list_sinks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogSink. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogSink. + p response + end end # [END logging_v2_generated_ConfigService_ListSinks_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/list_views.rb b/google-cloud-logging-v2/snippets/config_service/list_views.rb index bcd83202c8c3..79ab06fd0cd1 100755 --- a/google-cloud-logging-v2/snippets/config_service/list_views.rb +++ b/google-cloud-logging-v2/snippets/config_service/list_views.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_ConfigService_ListViews_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#list_views +# +def list_views + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListViewsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListViewsRequest.new -# Call the list_views method. -result = client.list_views request + # Call the list_views method. + result = client.list_views request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogView. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogView. + p response + end end # [END logging_v2_generated_ConfigService_ListViews_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/undelete_bucket.rb b/google-cloud-logging-v2/snippets/config_service/undelete_bucket.rb index 3e838b44e341..5a7d9e7be7fa 100755 --- a/google-cloud-logging-v2/snippets/config_service/undelete_bucket.rb +++ b/google-cloud-logging-v2/snippets/config_service/undelete_bucket.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UndeleteBucket_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#undelete_bucket +# +def undelete_bucket + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new -# Call the undelete_bucket method. -result = client.undelete_bucket request + # Call the undelete_bucket method. + result = client.undelete_bucket request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_ConfigService_UndeleteBucket_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_bucket.rb b/google-cloud-logging-v2/snippets/config_service/update_bucket.rb index afe3762ecab0..244d32ba8e3e 100755 --- a/google-cloud-logging-v2/snippets/config_service/update_bucket.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_bucket.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateBucket_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_bucket +# +def update_bucket + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateBucketRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateBucketRequest.new -# Call the update_bucket method. -result = client.update_bucket request + # Call the update_bucket method. + result = client.update_bucket request -# The returned object is of type Google::Cloud::Logging::V2::LogBucket. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogBucket. + p result +end # [END logging_v2_generated_ConfigService_UpdateBucket_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_cmek_settings.rb b/google-cloud-logging-v2/snippets/config_service/update_cmek_settings.rb index f8d7819fb15d..4ce2ec01dd0e 100755 --- a/google-cloud-logging-v2/snippets/config_service/update_cmek_settings.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_cmek_settings.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateCmekSettings_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_cmek_settings +# +def update_cmek_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new -# Call the update_cmek_settings method. -result = client.update_cmek_settings request + # Call the update_cmek_settings method. + result = client.update_cmek_settings request -# The returned object is of type Google::Cloud::Logging::V2::CmekSettings. -p result + # The returned object is of type Google::Cloud::Logging::V2::CmekSettings. + p result +end # [END logging_v2_generated_ConfigService_UpdateCmekSettings_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_exclusion.rb b/google-cloud-logging-v2/snippets/config_service/update_exclusion.rb index 0047c8fd93bc..d0f8a01c0e3d 100755 --- a/google-cloud-logging-v2/snippets/config_service/update_exclusion.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_exclusion.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateExclusion_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_exclusion +# +def update_exclusion + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new -# Call the update_exclusion method. -result = client.update_exclusion request + # Call the update_exclusion method. + result = client.update_exclusion request -# The returned object is of type Google::Cloud::Logging::V2::LogExclusion. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogExclusion. + p result +end # [END logging_v2_generated_ConfigService_UpdateExclusion_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_settings.rb b/google-cloud-logging-v2/snippets/config_service/update_settings.rb index 8b27f84478d6..8c1b5dc31db3 100644 --- a/google-cloud-logging-v2/snippets/config_service/update_settings.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_settings.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateSettings_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_settings +# +def update_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateSettingsRequest.new -# Call the update_settings method. -result = client.update_settings request + # Call the update_settings method. + result = client.update_settings request -# The returned object is of type Google::Cloud::Logging::V2::Settings. -p result + # The returned object is of type Google::Cloud::Logging::V2::Settings. + p result +end # [END logging_v2_generated_ConfigService_UpdateSettings_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_sink.rb b/google-cloud-logging-v2/snippets/config_service/update_sink.rb index 2794c15874ae..2514ce025870 100755 --- a/google-cloud-logging-v2/snippets/config_service/update_sink.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_sink.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateSink_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_sink +# +def update_sink + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateSinkRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateSinkRequest.new -# Call the update_sink method. -result = client.update_sink request + # Call the update_sink method. + result = client.update_sink request -# The returned object is of type Google::Cloud::Logging::V2::LogSink. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogSink. + p result +end # [END logging_v2_generated_ConfigService_UpdateSink_sync] diff --git a/google-cloud-logging-v2/snippets/config_service/update_view.rb b/google-cloud-logging-v2/snippets/config_service/update_view.rb index 548df8d566e5..4c19c147283c 100755 --- a/google-cloud-logging-v2/snippets/config_service/update_view.rb +++ b/google-cloud-logging-v2/snippets/config_service/update_view.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_ConfigService_UpdateView_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::ConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::ConfigService::Client#update_view +# +def update_view + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::ConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateViewRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateViewRequest.new -# Call the update_view method. -result = client.update_view request + # Call the update_view method. + result = client.update_view request -# The returned object is of type Google::Cloud::Logging::V2::LogView. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogView. + p result +end # [END logging_v2_generated_ConfigService_UpdateView_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/delete_log.rb b/google-cloud-logging-v2/snippets/logging_service/delete_log.rb index ff84baa44e80..714055b760df 100755 --- a/google-cloud-logging-v2/snippets/logging_service/delete_log.rb +++ b/google-cloud-logging-v2/snippets/logging_service/delete_log.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_LoggingService_DeleteLog_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#delete_log +# +def delete_log + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteLogRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteLogRequest.new -# Call the delete_log method. -result = client.delete_log request + # Call the delete_log method. + result = client.delete_log request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_LoggingService_DeleteLog_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/list_log_entries.rb b/google-cloud-logging-v2/snippets/logging_service/list_log_entries.rb index e5f3f2a12ff2..e17e4de5828e 100755 --- a/google-cloud-logging-v2/snippets/logging_service/list_log_entries.rb +++ b/google-cloud-logging-v2/snippets/logging_service/list_log_entries.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_LoggingService_ListLogEntries_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#list_log_entries +# +def list_log_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListLogEntriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListLogEntriesRequest.new -# Call the list_log_entries method. -result = client.list_log_entries request + # Call the list_log_entries method. + result = client.list_log_entries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogEntry. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogEntry. + p response + end end # [END logging_v2_generated_LoggingService_ListLogEntries_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/list_logs.rb b/google-cloud-logging-v2/snippets/logging_service/list_logs.rb index 398693a2405d..9963a3e38652 100755 --- a/google-cloud-logging-v2/snippets/logging_service/list_logs.rb +++ b/google-cloud-logging-v2/snippets/logging_service/list_logs.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_LoggingService_ListLogs_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#list_logs +# +def list_logs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListLogsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListLogsRequest.new -# Call the list_logs method. -result = client.list_logs request + # Call the list_logs method. + result = client.list_logs request -# The returned object is of type Google::Cloud::Logging::V2::ListLogsResponse. -p result + # The returned object is of type Google::Cloud::Logging::V2::ListLogsResponse. + p result +end # [END logging_v2_generated_LoggingService_ListLogs_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/list_monitored_resource_descriptors.rb b/google-cloud-logging-v2/snippets/logging_service/list_monitored_resource_descriptors.rb index 5aefec38a293..8a1241ed4b18 100755 --- a/google-cloud-logging-v2/snippets/logging_service/list_monitored_resource_descriptors.rb +++ b/google-cloud-logging-v2/snippets/logging_service/list_monitored_resource_descriptors.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_LoggingService_ListMonitoredResourceDescriptors_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#list_monitored_resource_descriptors +# +def list_monitored_resource_descriptors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest.new -# Call the list_monitored_resource_descriptors method. -result = client.list_monitored_resource_descriptors request + # Call the list_monitored_resource_descriptors method. + result = client.list_monitored_resource_descriptors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Api::MonitoredResourceDescriptor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Api::MonitoredResourceDescriptor. + p response + end end # [END logging_v2_generated_LoggingService_ListMonitoredResourceDescriptors_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/tail_log_entries.rb b/google-cloud-logging-v2/snippets/logging_service/tail_log_entries.rb index 9d77e39e6aaa..9807f4cf5a90 100755 --- a/google-cloud-logging-v2/snippets/logging_service/tail_log_entries.rb +++ b/google-cloud-logging-v2/snippets/logging_service/tail_log_entries.rb @@ -19,24 +19,30 @@ # [START logging_v2_generated_LoggingService_TailLogEntries_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the tail_log_entries method to start streaming. -output = client.tail_log_entries input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new -input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Logging::V2::TailLogEntriesResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#tail_log_entries +# +def tail_log_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the tail_log_entries method to start streaming. + output = client.tail_log_entries input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new + input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Logging::V2::TailLogEntriesResponse. + output.each do |response| + p response + end end # [END logging_v2_generated_LoggingService_TailLogEntries_sync] diff --git a/google-cloud-logging-v2/snippets/logging_service/write_log_entries.rb b/google-cloud-logging-v2/snippets/logging_service/write_log_entries.rb index 4b069f1c6d60..82e662ce659b 100755 --- a/google-cloud-logging-v2/snippets/logging_service/write_log_entries.rb +++ b/google-cloud-logging-v2/snippets/logging_service/write_log_entries.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_LoggingService_WriteLogEntries_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::LoggingService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::LoggingService::Client#write_log_entries +# +def write_log_entries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::LoggingService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::WriteLogEntriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::WriteLogEntriesRequest.new -# Call the write_log_entries method. -result = client.write_log_entries request + # Call the write_log_entries method. + result = client.write_log_entries request -# The returned object is of type Google::Cloud::Logging::V2::WriteLogEntriesResponse. -p result + # The returned object is of type Google::Cloud::Logging::V2::WriteLogEntriesResponse. + p result +end # [END logging_v2_generated_LoggingService_WriteLogEntries_sync] diff --git a/google-cloud-logging-v2/snippets/metrics_service/create_log_metric.rb b/google-cloud-logging-v2/snippets/metrics_service/create_log_metric.rb index b82275bc97d5..f0d1d871896f 100755 --- a/google-cloud-logging-v2/snippets/metrics_service/create_log_metric.rb +++ b/google-cloud-logging-v2/snippets/metrics_service/create_log_metric.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_MetricsService_CreateLogMetric_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::MetricsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::MetricsService::Client#create_log_metric +# +def create_log_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::MetricsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::CreateLogMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::CreateLogMetricRequest.new -# Call the create_log_metric method. -result = client.create_log_metric request + # Call the create_log_metric method. + result = client.create_log_metric request -# The returned object is of type Google::Cloud::Logging::V2::LogMetric. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogMetric. + p result +end # [END logging_v2_generated_MetricsService_CreateLogMetric_sync] diff --git a/google-cloud-logging-v2/snippets/metrics_service/delete_log_metric.rb b/google-cloud-logging-v2/snippets/metrics_service/delete_log_metric.rb index 500aa7676496..b0b6d42a32bd 100755 --- a/google-cloud-logging-v2/snippets/metrics_service/delete_log_metric.rb +++ b/google-cloud-logging-v2/snippets/metrics_service/delete_log_metric.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_MetricsService_DeleteLogMetric_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::MetricsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::MetricsService::Client#delete_log_metric +# +def delete_log_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::MetricsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::DeleteLogMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::DeleteLogMetricRequest.new -# Call the delete_log_metric method. -result = client.delete_log_metric request + # Call the delete_log_metric method. + result = client.delete_log_metric request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END logging_v2_generated_MetricsService_DeleteLogMetric_sync] diff --git a/google-cloud-logging-v2/snippets/metrics_service/get_log_metric.rb b/google-cloud-logging-v2/snippets/metrics_service/get_log_metric.rb index 1cb20e38e05a..595c184fe7fd 100755 --- a/google-cloud-logging-v2/snippets/metrics_service/get_log_metric.rb +++ b/google-cloud-logging-v2/snippets/metrics_service/get_log_metric.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_MetricsService_GetLogMetric_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::MetricsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::MetricsService::Client#get_log_metric +# +def get_log_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::MetricsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::GetLogMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::GetLogMetricRequest.new -# Call the get_log_metric method. -result = client.get_log_metric request + # Call the get_log_metric method. + result = client.get_log_metric request -# The returned object is of type Google::Cloud::Logging::V2::LogMetric. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogMetric. + p result +end # [END logging_v2_generated_MetricsService_GetLogMetric_sync] diff --git a/google-cloud-logging-v2/snippets/metrics_service/list_log_metrics.rb b/google-cloud-logging-v2/snippets/metrics_service/list_log_metrics.rb index 17d1fafd42ef..2f0baf0a1c95 100755 --- a/google-cloud-logging-v2/snippets/metrics_service/list_log_metrics.rb +++ b/google-cloud-logging-v2/snippets/metrics_service/list_log_metrics.rb @@ -19,21 +19,27 @@ # [START logging_v2_generated_MetricsService_ListLogMetrics_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::MetricsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::MetricsService::Client#list_log_metrics +# +def list_log_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::MetricsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::ListLogMetricsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::ListLogMetricsRequest.new -# Call the list_log_metrics method. -result = client.list_log_metrics request + # Call the list_log_metrics method. + result = client.list_log_metrics request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Logging::V2::LogMetric. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Logging::V2::LogMetric. + p response + end end # [END logging_v2_generated_MetricsService_ListLogMetrics_sync] diff --git a/google-cloud-logging-v2/snippets/metrics_service/update_log_metric.rb b/google-cloud-logging-v2/snippets/metrics_service/update_log_metric.rb index c697a20b503e..d0d59c28b3dc 100755 --- a/google-cloud-logging-v2/snippets/metrics_service/update_log_metric.rb +++ b/google-cloud-logging-v2/snippets/metrics_service/update_log_metric.rb @@ -19,15 +19,21 @@ # [START logging_v2_generated_MetricsService_UpdateLogMetric_sync] require "google/cloud/logging/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Logging::V2::MetricsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Logging::V2::MetricsService::Client#update_log_metric +# +def update_log_metric + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Logging::V2::MetricsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Logging::V2::UpdateLogMetricRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Logging::V2::UpdateLogMetricRequest.new -# Call the update_log_metric method. -result = client.update_log_metric request + # Call the update_log_metric method. + result = client.update_log_metric request -# The returned object is of type Google::Cloud::Logging::V2::LogMetric. -p result + # The returned object is of type Google::Cloud::Logging::V2::LogMetric. + p result +end # [END logging_v2_generated_MetricsService_UpdateLogMetric_sync] diff --git a/google-cloud-logging-v2/snippets/snippet_metadata_google.logging.v2.json b/google-cloud-logging-v2/snippets/snippet_metadata_google.logging.v2.json index 479ca810bd6a..b5c46ed65169 100644 --- a/google-cloud-logging-v2/snippets/snippet_metadata_google.logging.v2.json +++ b/google-cloud-logging-v2/snippets/snippet_metadata_google.logging.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-managed_identities-v1/.rubocop.yml b/google-cloud-managed_identities-v1/.rubocop.yml index 308d2b8a5119..203cf4946a36 100644 --- a/google-cloud-managed_identities-v1/.rubocop.yml +++ b/google-cloud-managed_identities-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-managed_identities-v1.rb" diff --git a/google-cloud-managed_identities-v1/snippets/Gemfile b/google-cloud-managed_identities-v1/snippets/Gemfile index 9cf6e7babfab..e72dc1b54b1d 100755 --- a/google-cloud-managed_identities-v1/snippets/Gemfile +++ b/google-cloud-managed_identities-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/attach_trust.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/attach_trust.rb index d64e79d48ce5..77bde0aa5032 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/attach_trust.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/attach_trust.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_AttachTrust_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#attach_trust +# +def attach_trust + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::AttachTrustRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::AttachTrustRequest.new -# Call the attach_trust method. -result = client.attach_trust request + # Call the attach_trust method. + result = client.attach_trust request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_AttachTrust_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/create_microsoft_ad_domain.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/create_microsoft_ad_domain.rb index 12810abf82d9..7a2b38a1ae11 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/create_microsoft_ad_domain.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/create_microsoft_ad_domain.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_CreateMicrosoftAdDomain_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#create_microsoft_ad_domain +# +def create_microsoft_ad_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::CreateMicrosoftAdDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::CreateMicrosoftAdDomainRequest.new -# Call the create_microsoft_ad_domain method. -result = client.create_microsoft_ad_domain request + # Call the create_microsoft_ad_domain method. + result = client.create_microsoft_ad_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_CreateMicrosoftAdDomain_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/delete_domain.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/delete_domain.rb index 6f1c4ccbba11..15d14a1b16c4 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/delete_domain.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/delete_domain.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#delete_domain +# +def delete_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::DeleteDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::DeleteDomainRequest.new -# Call the delete_domain method. -result = client.delete_domain request + # Call the delete_domain method. + result = client.delete_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_DeleteDomain_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/detach_trust.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/detach_trust.rb index 36bbec7f1896..118e3e673978 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/detach_trust.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/detach_trust.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_DetachTrust_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#detach_trust +# +def detach_trust + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::DetachTrustRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::DetachTrustRequest.new -# Call the detach_trust method. -result = client.detach_trust request + # Call the detach_trust method. + result = client.detach_trust request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_DetachTrust_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/get_domain.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/get_domain.rb index beedae28416f..4afd5672c4a8 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/get_domain.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/get_domain.rb @@ -19,15 +19,21 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_GetDomain_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#get_domain +# +def get_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::GetDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::GetDomainRequest.new -# Call the get_domain method. -result = client.get_domain request + # Call the get_domain method. + result = client.get_domain request -# The returned object is of type Google::Cloud::ManagedIdentities::V1::Domain. -p result + # The returned object is of type Google::Cloud::ManagedIdentities::V1::Domain. + p result +end # [END managedidentities_v1_generated_ManagedIdentitiesService_GetDomain_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/list_domains.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/list_domains.rb index 1061157e06f5..08e931fe628d 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/list_domains.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/list_domains.rb @@ -19,21 +19,27 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_ListDomains_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#list_domains +# +def list_domains + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::ListDomainsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::ListDomainsRequest.new -# Call the list_domains method. -result = client.list_domains request + # Call the list_domains method. + result = client.list_domains request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ManagedIdentities::V1::Domain. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ManagedIdentities::V1::Domain. + p response + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_ListDomains_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/reconfigure_trust.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/reconfigure_trust.rb index 43d913762dc1..e40e61afddd5 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/reconfigure_trust.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/reconfigure_trust.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_ReconfigureTrust_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#reconfigure_trust +# +def reconfigure_trust + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::ReconfigureTrustRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::ReconfigureTrustRequest.new -# Call the reconfigure_trust method. -result = client.reconfigure_trust request + # Call the reconfigure_trust method. + result = client.reconfigure_trust request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_ReconfigureTrust_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/reset_admin_password.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/reset_admin_password.rb index bee467fa9d7e..477a2974ecdb 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/reset_admin_password.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/reset_admin_password.rb @@ -19,15 +19,21 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_ResetAdminPassword_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#reset_admin_password +# +def reset_admin_password + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::ResetAdminPasswordRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::ResetAdminPasswordRequest.new -# Call the reset_admin_password method. -result = client.reset_admin_password request + # Call the reset_admin_password method. + result = client.reset_admin_password request -# The returned object is of type Google::Cloud::ManagedIdentities::V1::ResetAdminPasswordResponse. -p result + # The returned object is of type Google::Cloud::ManagedIdentities::V1::ResetAdminPasswordResponse. + p result +end # [END managedidentities_v1_generated_ManagedIdentitiesService_ResetAdminPassword_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/update_domain.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/update_domain.rb index 441108effd2e..e42c87dcb2ad 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/update_domain.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/update_domain.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_UpdateDomain_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#update_domain +# +def update_domain + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::UpdateDomainRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::UpdateDomainRequest.new -# Call the update_domain method. -result = client.update_domain request + # Call the update_domain method. + result = client.update_domain request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_UpdateDomain_sync] diff --git a/google-cloud-managed_identities-v1/snippets/managed_identities_service/validate_trust.rb b/google-cloud-managed_identities-v1/snippets/managed_identities_service/validate_trust.rb index c04a84e6085b..a0db4d30013d 100755 --- a/google-cloud-managed_identities-v1/snippets/managed_identities_service/validate_trust.rb +++ b/google-cloud-managed_identities-v1/snippets/managed_identities_service/validate_trust.rb @@ -19,22 +19,28 @@ # [START managedidentities_v1_generated_ManagedIdentitiesService_ValidateTrust_sync] require "google/cloud/managed_identities/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client#validate_trust +# +def validate_trust + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ManagedIdentities::V1::ManagedIdentitiesService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ManagedIdentities::V1::ValidateTrustRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ManagedIdentities::V1::ValidateTrustRequest.new -# Call the validate_trust method. -result = client.validate_trust request + # Call the validate_trust method. + result = client.validate_trust request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END managedidentities_v1_generated_ManagedIdentitiesService_ValidateTrust_sync] diff --git a/google-cloud-managed_identities-v1/snippets/snippet_metadata_google.cloud.managedidentities.v1.json b/google-cloud-managed_identities-v1/snippets/snippet_metadata_google.cloud.managedidentities.v1.json index 33e582990a21..e044bd416f96 100644 --- a/google-cloud-managed_identities-v1/snippets/snippet_metadata_google.cloud.managedidentities.v1.json +++ b/google-cloud-managed_identities-v1/snippets/snippet_metadata_google.cloud.managedidentities.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-media_translation-v1beta1/.rubocop.yml b/google-cloud-media_translation-v1beta1/.rubocop.yml index 8f460b31ebbb..c2f192dfe3c5 100644 --- a/google-cloud-media_translation-v1beta1/.rubocop.yml +++ b/google-cloud-media_translation-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-media_translation-v1beta1.rb" diff --git a/google-cloud-media_translation-v1beta1/snippets/Gemfile b/google-cloud-media_translation-v1beta1/snippets/Gemfile index b6cc4a2d2adc..6803e71a9194 100755 --- a/google-cloud-media_translation-v1beta1/snippets/Gemfile +++ b/google-cloud-media_translation-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-media_translation-v1beta1/snippets/snippet_metadata_google.cloud.mediatranslation.v1beta1.json b/google-cloud-media_translation-v1beta1/snippets/snippet_metadata_google.cloud.mediatranslation.v1beta1.json index 3f4dfa198283..dfce6b7aca94 100644 --- a/google-cloud-media_translation-v1beta1/snippets/snippet_metadata_google.cloud.mediatranslation.v1beta1.json +++ b/google-cloud-media_translation-v1beta1/snippets/snippet_metadata_google.cloud.mediatranslation.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] diff --git a/google-cloud-media_translation-v1beta1/snippets/speech_translation_service/streaming_translate_speech.rb b/google-cloud-media_translation-v1beta1/snippets/speech_translation_service/streaming_translate_speech.rb index 75932e095071..6b83e012816f 100755 --- a/google-cloud-media_translation-v1beta1/snippets/speech_translation_service/streaming_translate_speech.rb +++ b/google-cloud-media_translation-v1beta1/snippets/speech_translation_service/streaming_translate_speech.rb @@ -19,24 +19,30 @@ # [START mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_sync] require "google/cloud/media_translation/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_translate_speech method to start streaming. -output = client.streaming_translate_speech input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new -input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client#streaming_translate_speech +# +def streaming_translate_speech + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::MediaTranslation::V1beta1::SpeechTranslationService::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_translate_speech method to start streaming. + output = client.streaming_translate_speech input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new + input << Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::MediaTranslation::V1beta1::StreamingTranslateSpeechResponse. + output.each do |response| + p response + end end # [END mediatranslation_v1beta1_generated_SpeechTranslationService_StreamingTranslateSpeech_sync] diff --git a/google-cloud-memcache-v1/.rubocop.yml b/google-cloud-memcache-v1/.rubocop.yml index 3f61e5a38c01..d45d330d5ca8 100644 --- a/google-cloud-memcache-v1/.rubocop.yml +++ b/google-cloud-memcache-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-memcache-v1.rb" diff --git a/google-cloud-memcache-v1/snippets/Gemfile b/google-cloud-memcache-v1/snippets/Gemfile index 90691ec848c9..ea39b43d17c6 100755 --- a/google-cloud-memcache-v1/snippets/Gemfile +++ b/google-cloud-memcache-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/apply_parameters.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/apply_parameters.rb index 12fc87e59142..bb93f4027088 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/apply_parameters.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/apply_parameters.rb @@ -19,22 +19,28 @@ # [START memcache_v1_generated_CloudMemcache_ApplyParameters_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#apply_parameters +# +def apply_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::ApplyParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::ApplyParametersRequest.new -# Call the apply_parameters method. -result = client.apply_parameters request + # Call the apply_parameters method. + result = client.apply_parameters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1_generated_CloudMemcache_ApplyParameters_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/create_instance.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/create_instance.rb index ced8becf92c3..4587f16f133c 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/create_instance.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/create_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1_generated_CloudMemcache_CreateInstance_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1_generated_CloudMemcache_CreateInstance_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/delete_instance.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/delete_instance.rb index 010777c6df94..982c4cb47ab2 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/delete_instance.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/delete_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1_generated_CloudMemcache_DeleteInstance_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1_generated_CloudMemcache_DeleteInstance_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/get_instance.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/get_instance.rb index 73ecdbc15cc1..53c805a8322b 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/get_instance.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/get_instance.rb @@ -19,15 +19,21 @@ # [START memcache_v1_generated_CloudMemcache_GetInstance_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Memcache::V1::Instance. -p result + # The returned object is of type Google::Cloud::Memcache::V1::Instance. + p result +end # [END memcache_v1_generated_CloudMemcache_GetInstance_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/list_instances.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/list_instances.rb index 31e8c941c716..71d637a6cc55 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/list_instances.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/list_instances.rb @@ -19,21 +19,27 @@ # [START memcache_v1_generated_CloudMemcache_ListInstances_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Memcache::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Memcache::V1::Instance. + p response + end end # [END memcache_v1_generated_CloudMemcache_ListInstances_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/update_instance.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/update_instance.rb index 2bfc141bbcad..1a51e57a3ad0 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/update_instance.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/update_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1_generated_CloudMemcache_UpdateInstance_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1_generated_CloudMemcache_UpdateInstance_sync] diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/update_parameters.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/update_parameters.rb index 5570e7898a9b..3c41d44aeec9 100755 --- a/google-cloud-memcache-v1/snippets/cloud_memcache/update_parameters.rb +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/update_parameters.rb @@ -19,22 +19,28 @@ # [START memcache_v1_generated_CloudMemcache_UpdateParameters_sync] require "google/cloud/memcache/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#update_parameters +# +def update_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1::UpdateParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::UpdateParametersRequest.new -# Call the update_parameters method. -result = client.update_parameters request + # Call the update_parameters method. + result = client.update_parameters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1_generated_CloudMemcache_UpdateParameters_sync] diff --git a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json index 91fe134a0c77..3f5b653c99bc 100644 --- a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json +++ b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-memcache-v1beta2/.rubocop.yml b/google-cloud-memcache-v1beta2/.rubocop.yml index ac0509b837d2..53a375da9916 100644 --- a/google-cloud-memcache-v1beta2/.rubocop.yml +++ b/google-cloud-memcache-v1beta2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-memcache-v1beta2.rb" diff --git a/google-cloud-memcache-v1beta2/snippets/Gemfile b/google-cloud-memcache-v1beta2/snippets/Gemfile index 40c9cfdd1ff2..800872a038a8 100755 --- a/google-cloud-memcache-v1beta2/snippets/Gemfile +++ b/google-cloud-memcache-v1beta2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_parameters.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_parameters.rb index 196588f41151..20aa68021bb5 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_parameters.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_parameters.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_ApplyParameters_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#apply_parameters +# +def apply_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::ApplyParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::ApplyParametersRequest.new -# Call the apply_parameters method. -result = client.apply_parameters request + # Call the apply_parameters method. + result = client.apply_parameters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_ApplyParameters_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_software_update.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_software_update.rb index eddc98922cad..da606c585a3f 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_software_update.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/apply_software_update.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#apply_software_update +# +def apply_software_update + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::ApplySoftwareUpdateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::ApplySoftwareUpdateRequest.new -# Call the apply_software_update method. -result = client.apply_software_update request + # Call the apply_software_update method. + result = client.apply_software_update request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_ApplySoftwareUpdate_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/create_instance.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/create_instance.rb index 4716297d5959..8ab57882c13a 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/create_instance.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/create_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_CreateInstance_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_CreateInstance_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/delete_instance.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/delete_instance.rb index deabf52905b0..ef4a75af39c1 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/delete_instance.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/delete_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_DeleteInstance_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_DeleteInstance_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/get_instance.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/get_instance.rb index a48f3c6034e5..f9a454a1bfee 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/get_instance.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/get_instance.rb @@ -19,15 +19,21 @@ # [START memcache_v1beta2_generated_CloudMemcache_GetInstance_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Memcache::V1beta2::Instance. -p result + # The returned object is of type Google::Cloud::Memcache::V1beta2::Instance. + p result +end # [END memcache_v1beta2_generated_CloudMemcache_GetInstance_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/list_instances.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/list_instances.rb index ee14a62a7bde..033aa375708a 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/list_instances.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/list_instances.rb @@ -19,21 +19,27 @@ # [START memcache_v1beta2_generated_CloudMemcache_ListInstances_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Memcache::V1beta2::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Memcache::V1beta2::Instance. + p response + end end # [END memcache_v1beta2_generated_CloudMemcache_ListInstances_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_instance.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_instance.rb index 68fe44b0c632..36e326716b2b 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_instance.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_instance.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_UpdateInstance_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_UpdateInstance_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_parameters.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_parameters.rb index e5736c31b086..71c6c0a35967 100755 --- a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_parameters.rb +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/update_parameters.rb @@ -19,22 +19,28 @@ # [START memcache_v1beta2_generated_CloudMemcache_UpdateParameters_sync] require "google/cloud/memcache/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#update_parameters +# +def update_parameters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Memcache::V1beta2::UpdateParametersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::UpdateParametersRequest.new -# Call the update_parameters method. -result = client.update_parameters request + # Call the update_parameters method. + result = client.update_parameters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END memcache_v1beta2_generated_CloudMemcache_UpdateParameters_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json index b47fd35a0f73..af4976657c5c 100644 --- a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json +++ b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-metastore-v1/.rubocop.yml b/google-cloud-metastore-v1/.rubocop.yml index 4fba5e752e97..412ba7d513c9 100644 --- a/google-cloud-metastore-v1/.rubocop.yml +++ b/google-cloud-metastore-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-metastore-v1.rb" diff --git a/google-cloud-metastore-v1/snippets/Gemfile b/google-cloud-metastore-v1/snippets/Gemfile index c115456f6e66..d2f5fac021f6 100755 --- a/google-cloud-metastore-v1/snippets/Gemfile +++ b/google-cloud-metastore-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_backup.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_backup.rb index 8338f2fb0ae3..fbce90878040 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_backup.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_backup.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_CreateBackup_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_CreateBackup_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_metadata_import.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_metadata_import.rb index e2c5e2fc08c9..dd684fde8343 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_metadata_import.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_metadata_import.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_CreateMetadataImport_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#create_metadata_import +# +def create_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::CreateMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::CreateMetadataImportRequest.new -# Call the create_metadata_import method. -result = client.create_metadata_import request + # Call the create_metadata_import method. + result = client.create_metadata_import request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_CreateMetadataImport_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_service.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_service.rb index e2db852df0c4..54f9a026510d 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/create_service.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/create_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_CreateService_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_CreateService_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_backup.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_backup.rb index 20eca5958150..f90a11f3c089 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_backup.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_backup.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_DeleteBackup_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_DeleteBackup_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_service.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_service.rb index 20d0b928903f..7960c5add2e4 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_service.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/delete_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_DeleteService_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_DeleteService_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/export_metadata.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/export_metadata.rb index 547dac1a8cc9..623cc688bd35 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/export_metadata.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/export_metadata.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_ExportMetadata_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#export_metadata +# +def export_metadata + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::ExportMetadataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::ExportMetadataRequest.new -# Call the export_metadata method. -result = client.export_metadata request + # Call the export_metadata method. + result = client.export_metadata request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_ExportMetadata_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_backup.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_backup.rb index c001f80cf287..1efad876ae1e 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_backup.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_backup.rb @@ -19,15 +19,21 @@ # [START metastore_v1_generated_DataprocMetastore_GetBackup_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::Metastore::V1::Backup. -p result + # The returned object is of type Google::Cloud::Metastore::V1::Backup. + p result +end # [END metastore_v1_generated_DataprocMetastore_GetBackup_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_metadata_import.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_metadata_import.rb index 7e391d9f6a50..8d64fd84f214 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_metadata_import.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_metadata_import.rb @@ -19,15 +19,21 @@ # [START metastore_v1_generated_DataprocMetastore_GetMetadataImport_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#get_metadata_import +# +def get_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::GetMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::GetMetadataImportRequest.new -# Call the get_metadata_import method. -result = client.get_metadata_import request + # Call the get_metadata_import method. + result = client.get_metadata_import request -# The returned object is of type Google::Cloud::Metastore::V1::MetadataImport. -p result + # The returned object is of type Google::Cloud::Metastore::V1::MetadataImport. + p result +end # [END metastore_v1_generated_DataprocMetastore_GetMetadataImport_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_service.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_service.rb index 346a1eafd29f..c9e6677c25db 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/get_service.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/get_service.rb @@ -19,15 +19,21 @@ # [START metastore_v1_generated_DataprocMetastore_GetService_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::Metastore::V1::Service. -p result + # The returned object is of type Google::Cloud::Metastore::V1::Service. + p result +end # [END metastore_v1_generated_DataprocMetastore_GetService_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_backups.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_backups.rb index 6031649d2a8b..9d0faa05034b 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_backups.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_backups.rb @@ -19,21 +19,27 @@ # [START metastore_v1_generated_DataprocMetastore_ListBackups_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1::Backup. + p response + end end # [END metastore_v1_generated_DataprocMetastore_ListBackups_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_metadata_imports.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_metadata_imports.rb index 0fd111545bc9..4a00465d4df6 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_metadata_imports.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_metadata_imports.rb @@ -19,21 +19,27 @@ # [START metastore_v1_generated_DataprocMetastore_ListMetadataImports_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_metadata_imports +# +def list_metadata_imports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::ListMetadataImportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::ListMetadataImportsRequest.new -# Call the list_metadata_imports method. -result = client.list_metadata_imports request + # Call the list_metadata_imports method. + result = client.list_metadata_imports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1::MetadataImport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1::MetadataImport. + p response + end end # [END metastore_v1_generated_DataprocMetastore_ListMetadataImports_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_services.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_services.rb index c8705c479d59..577fd68d5c87 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/list_services.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/list_services.rb @@ -19,21 +19,27 @@ # [START metastore_v1_generated_DataprocMetastore_ListServices_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1::Service. + p response + end end # [END metastore_v1_generated_DataprocMetastore_ListServices_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/restore_service.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/restore_service.rb index 7781698ce5ab..f6793ea4c43f 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/restore_service.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/restore_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_RestoreService_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#restore_service +# +def restore_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::RestoreServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::RestoreServiceRequest.new -# Call the restore_service method. -result = client.restore_service request + # Call the restore_service method. + result = client.restore_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_RestoreService_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/update_metadata_import.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/update_metadata_import.rb index 6cdf08012ee6..a89c1fd13399 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/update_metadata_import.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/update_metadata_import.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_UpdateMetadataImport_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#update_metadata_import +# +def update_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::UpdateMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::UpdateMetadataImportRequest.new -# Call the update_metadata_import method. -result = client.update_metadata_import request + # Call the update_metadata_import method. + result = client.update_metadata_import request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_UpdateMetadataImport_sync] diff --git a/google-cloud-metastore-v1/snippets/dataproc_metastore/update_service.rb b/google-cloud-metastore-v1/snippets/dataproc_metastore/update_service.rb index 00ad6d77ae25..bcee8cc5fc39 100755 --- a/google-cloud-metastore-v1/snippets/dataproc_metastore/update_service.rb +++ b/google-cloud-metastore-v1/snippets/dataproc_metastore/update_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1_generated_DataprocMetastore_UpdateService_sync] require "google/cloud/metastore/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1::DataprocMetastore::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1_generated_DataprocMetastore_UpdateService_sync] diff --git a/google-cloud-metastore-v1/snippets/snippet_metadata_google.cloud.metastore.v1.json b/google-cloud-metastore-v1/snippets/snippet_metadata_google.cloud.metastore.v1.json index a8cffd7c984e..76308ef31ab4 100644 --- a/google-cloud-metastore-v1/snippets/snippet_metadata_google.cloud.metastore.v1.json +++ b/google-cloud-metastore-v1/snippets/snippet_metadata_google.cloud.metastore.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-metastore-v1beta/.rubocop.yml b/google-cloud-metastore-v1beta/.rubocop.yml index 73a5c4bac22e..91b7f6070044 100644 --- a/google-cloud-metastore-v1beta/.rubocop.yml +++ b/google-cloud-metastore-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-metastore-v1beta.rb" diff --git a/google-cloud-metastore-v1beta/snippets/Gemfile b/google-cloud-metastore-v1beta/snippets/Gemfile index f7e2fa5c32c1..ff231fe13aa1 100755 --- a/google-cloud-metastore-v1beta/snippets/Gemfile +++ b/google-cloud-metastore-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_backup.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_backup.rb index ba2072366770..48f81ca3b3af 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_backup.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_backup.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_CreateBackup_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_CreateBackup_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_metadata_import.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_metadata_import.rb index 9595602d63c2..9e7c3398eb08 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_metadata_import.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_metadata_import.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_CreateMetadataImport_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#create_metadata_import +# +def create_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::CreateMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::CreateMetadataImportRequest.new -# Call the create_metadata_import method. -result = client.create_metadata_import request + # Call the create_metadata_import method. + result = client.create_metadata_import request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_CreateMetadataImport_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_service.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_service.rb index 176b6273916e..0718f38c5e5d 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_service.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/create_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_CreateService_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_CreateService_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_backup.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_backup.rb index e05e470771fe..28f838e18be4 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_backup.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_backup.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_DeleteBackup_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_DeleteBackup_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_service.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_service.rb index 26b93bf049c8..46457bc18c47 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_service.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/delete_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_DeleteService_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_DeleteService_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/export_metadata.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/export_metadata.rb index 1a8982f5a418..c5392802365c 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/export_metadata.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/export_metadata.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_ExportMetadata_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#export_metadata +# +def export_metadata + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::ExportMetadataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::ExportMetadataRequest.new -# Call the export_metadata method. -result = client.export_metadata request + # Call the export_metadata method. + result = client.export_metadata request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_ExportMetadata_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_backup.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_backup.rb index 147abdbe9070..4ac8eb66d942 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_backup.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_backup.rb @@ -19,15 +19,21 @@ # [START metastore_v1beta_generated_DataprocMetastore_GetBackup_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::Metastore::V1beta::Backup. -p result + # The returned object is of type Google::Cloud::Metastore::V1beta::Backup. + p result +end # [END metastore_v1beta_generated_DataprocMetastore_GetBackup_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_metadata_import.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_metadata_import.rb index 6ef477813765..0bd2c84c322a 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_metadata_import.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_metadata_import.rb @@ -19,15 +19,21 @@ # [START metastore_v1beta_generated_DataprocMetastore_GetMetadataImport_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#get_metadata_import +# +def get_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::GetMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::GetMetadataImportRequest.new -# Call the get_metadata_import method. -result = client.get_metadata_import request + # Call the get_metadata_import method. + result = client.get_metadata_import request -# The returned object is of type Google::Cloud::Metastore::V1beta::MetadataImport. -p result + # The returned object is of type Google::Cloud::Metastore::V1beta::MetadataImport. + p result +end # [END metastore_v1beta_generated_DataprocMetastore_GetMetadataImport_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_service.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_service.rb index ada59eea750e..ddea388d2183 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_service.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/get_service.rb @@ -19,15 +19,21 @@ # [START metastore_v1beta_generated_DataprocMetastore_GetService_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::Metastore::V1beta::Service. -p result + # The returned object is of type Google::Cloud::Metastore::V1beta::Service. + p result +end # [END metastore_v1beta_generated_DataprocMetastore_GetService_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_backups.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_backups.rb index 5611375ef867..7e64a4e1e052 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_backups.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_backups.rb @@ -19,21 +19,27 @@ # [START metastore_v1beta_generated_DataprocMetastore_ListBackups_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1beta::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1beta::Backup. + p response + end end # [END metastore_v1beta_generated_DataprocMetastore_ListBackups_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_metadata_imports.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_metadata_imports.rb index e19b8e65d899..7b533225c8cc 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_metadata_imports.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_metadata_imports.rb @@ -19,21 +19,27 @@ # [START metastore_v1beta_generated_DataprocMetastore_ListMetadataImports_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#list_metadata_imports +# +def list_metadata_imports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::ListMetadataImportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::ListMetadataImportsRequest.new -# Call the list_metadata_imports method. -result = client.list_metadata_imports request + # Call the list_metadata_imports method. + result = client.list_metadata_imports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1beta::MetadataImport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1beta::MetadataImport. + p response + end end # [END metastore_v1beta_generated_DataprocMetastore_ListMetadataImports_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_services.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_services.rb index 7cc251b71b04..f78526f22fc3 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_services.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/list_services.rb @@ -19,21 +19,27 @@ # [START metastore_v1beta_generated_DataprocMetastore_ListServices_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Metastore::V1beta::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Metastore::V1beta::Service. + p response + end end # [END metastore_v1beta_generated_DataprocMetastore_ListServices_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/restore_service.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/restore_service.rb index 3f727af614bf..5c579cd1acfb 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/restore_service.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/restore_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_RestoreService_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#restore_service +# +def restore_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::RestoreServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::RestoreServiceRequest.new -# Call the restore_service method. -result = client.restore_service request + # Call the restore_service method. + result = client.restore_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_RestoreService_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_metadata_import.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_metadata_import.rb index c67e3d02e482..d51b3745d7d9 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_metadata_import.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_metadata_import.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_UpdateMetadataImport_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#update_metadata_import +# +def update_metadata_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::UpdateMetadataImportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::UpdateMetadataImportRequest.new -# Call the update_metadata_import method. -result = client.update_metadata_import request + # Call the update_metadata_import method. + result = client.update_metadata_import request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_UpdateMetadataImport_sync] diff --git a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_service.rb b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_service.rb index d457eaab82f7..c8eef183772d 100755 --- a/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_service.rb +++ b/google-cloud-metastore-v1beta/snippets/dataproc_metastore/update_service.rb @@ -19,22 +19,28 @@ # [START metastore_v1beta_generated_DataprocMetastore_UpdateService_sync] require "google/cloud/metastore/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Metastore::V1beta::DataprocMetastore::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Metastore::V1beta::DataprocMetastore::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Metastore::V1beta::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Metastore::V1beta::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END metastore_v1beta_generated_DataprocMetastore_UpdateService_sync] diff --git a/google-cloud-metastore-v1beta/snippets/snippet_metadata_google.cloud.metastore.v1beta.json b/google-cloud-metastore-v1beta/snippets/snippet_metadata_google.cloud.metastore.v1beta.json index ae47c012de5c..82558d82a87b 100644 --- a/google-cloud-metastore-v1beta/snippets/snippet_metadata_google.cloud.metastore.v1beta.json +++ b/google-cloud-metastore-v1beta/snippets/snippet_metadata_google.cloud.metastore.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-monitoring-dashboard-v1/.rubocop.yml b/google-cloud-monitoring-dashboard-v1/.rubocop.yml index 009110e6f2d7..0ff539a1bf5d 100644 --- a/google-cloud-monitoring-dashboard-v1/.rubocop.yml +++ b/google-cloud-monitoring-dashboard-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-monitoring-dashboard-v1.rb" diff --git a/google-cloud-monitoring-dashboard-v1/snippets/Gemfile b/google-cloud-monitoring-dashboard-v1/snippets/Gemfile index aae19dd6bd2b..aa6e38fea9da 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/Gemfile +++ b/google-cloud-monitoring-dashboard-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/create_dashboard.rb b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/create_dashboard.rb index 92d2c7e2cf70..1da6b5e120da 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/create_dashboard.rb +++ b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/create_dashboard.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_DashboardsService_CreateDashboard_sync] require "google/cloud/monitoring/dashboard/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client#create_dashboard +# +def create_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::Dashboard::V1::CreateDashboardRequest.new -# Call the create_dashboard method. -result = client.create_dashboard request + # Call the create_dashboard method. + result = client.create_dashboard request -# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. -p result + # The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. + p result +end # [END monitoring_v1_generated_DashboardsService_CreateDashboard_sync] diff --git a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/delete_dashboard.rb b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/delete_dashboard.rb index 4cb409d65133..1ffd26c85a63 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/delete_dashboard.rb +++ b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/delete_dashboard.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_DashboardsService_DeleteDashboard_sync] require "google/cloud/monitoring/dashboard/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client#delete_dashboard +# +def delete_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::Dashboard::V1::DeleteDashboardRequest.new -# Call the delete_dashboard method. -result = client.delete_dashboard request + # Call the delete_dashboard method. + result = client.delete_dashboard request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v1_generated_DashboardsService_DeleteDashboard_sync] diff --git a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/get_dashboard.rb b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/get_dashboard.rb index f07ecd533524..015568f5ed13 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/get_dashboard.rb +++ b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/get_dashboard.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_DashboardsService_GetDashboard_sync] require "google/cloud/monitoring/dashboard/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client#get_dashboard +# +def get_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::Dashboard::V1::GetDashboardRequest.new -# Call the get_dashboard method. -result = client.get_dashboard request + # Call the get_dashboard method. + result = client.get_dashboard request -# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. -p result + # The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. + p result +end # [END monitoring_v1_generated_DashboardsService_GetDashboard_sync] diff --git a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/list_dashboards.rb b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/list_dashboards.rb index 80cda5a0541b..206d228e2580 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/list_dashboards.rb +++ b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/list_dashboards.rb @@ -19,21 +19,27 @@ # [START monitoring_v1_generated_DashboardsService_ListDashboards_sync] require "google/cloud/monitoring/dashboard/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client#list_dashboards +# +def list_dashboards + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::Dashboard::V1::ListDashboardsRequest.new -# Call the list_dashboards method. -result = client.list_dashboards request + # Call the list_dashboards method. + result = client.list_dashboards request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::Dashboard::V1::Dashboard. + p response + end end # [END monitoring_v1_generated_DashboardsService_ListDashboards_sync] diff --git a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/update_dashboard.rb b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/update_dashboard.rb index 3d15acd93b64..1e271f82f7ca 100755 --- a/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/update_dashboard.rb +++ b/google-cloud-monitoring-dashboard-v1/snippets/dashboards_service/update_dashboard.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_DashboardsService_UpdateDashboard_sync] require "google/cloud/monitoring/dashboard/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client#update_dashboard +# +def update_dashboard + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::Dashboard::V1::UpdateDashboardRequest.new -# Call the update_dashboard method. -result = client.update_dashboard request + # Call the update_dashboard method. + result = client.update_dashboard request -# The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. -p result + # The returned object is of type Google::Cloud::Monitoring::Dashboard::V1::Dashboard. + p result +end # [END monitoring_v1_generated_DashboardsService_UpdateDashboard_sync] diff --git a/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json b/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json index 3f1338c570b5..d2c27845f808 100644 --- a/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json +++ b/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-monitoring-metrics_scope-v1/.rubocop.yml b/google-cloud-monitoring-metrics_scope-v1/.rubocop.yml index e803d7dfdf6a..2f9294578cd7 100644 --- a/google-cloud-monitoring-metrics_scope-v1/.rubocop.yml +++ b/google-cloud-monitoring-metrics_scope-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-monitoring-metrics_scope-v1.rb" diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/Gemfile b/google-cloud-monitoring-metrics_scope-v1/snippets/Gemfile index 810739fddcbb..7fd21a7beb47 100755 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/Gemfile +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/create_monitored_project.rb b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/create_monitored_project.rb index afe30cadf480..9aeb023320c5 100755 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/create_monitored_project.rb +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/create_monitored_project.rb @@ -19,22 +19,28 @@ # [START monitoring_v1_generated_MetricsScopes_CreateMonitoredProject_sync] require "google/cloud/monitoring/metrics_scope/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client#create_monitored_project +# +def create_monitored_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::MetricsScope::V1::CreateMonitoredProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::MetricsScope::V1::CreateMonitoredProjectRequest.new -# Call the create_monitored_project method. -result = client.create_monitored_project request + # Call the create_monitored_project method. + result = client.create_monitored_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END monitoring_v1_generated_MetricsScopes_CreateMonitoredProject_sync] diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/delete_monitored_project.rb b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/delete_monitored_project.rb index 1b25b7aecfc4..9d0e5effd925 100755 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/delete_monitored_project.rb +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/delete_monitored_project.rb @@ -19,22 +19,28 @@ # [START monitoring_v1_generated_MetricsScopes_DeleteMonitoredProject_sync] require "google/cloud/monitoring/metrics_scope/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client#delete_monitored_project +# +def delete_monitored_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::MetricsScope::V1::DeleteMonitoredProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::MetricsScope::V1::DeleteMonitoredProjectRequest.new -# Call the delete_monitored_project method. -result = client.delete_monitored_project request + # Call the delete_monitored_project method. + result = client.delete_monitored_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END monitoring_v1_generated_MetricsScopes_DeleteMonitoredProject_sync] diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/get_metrics_scope.rb b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/get_metrics_scope.rb index a52ae29d135a..d9a0c7c695c0 100755 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/get_metrics_scope.rb +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/get_metrics_scope.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_MetricsScopes_GetMetricsScope_sync] require "google/cloud/monitoring/metrics_scope/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client#get_metrics_scope +# +def get_metrics_scope + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::MetricsScope::V1::GetMetricsScopeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::MetricsScope::V1::GetMetricsScopeRequest.new -# Call the get_metrics_scope method. -result = client.get_metrics_scope request + # Call the get_metrics_scope method. + result = client.get_metrics_scope request -# The returned object is of type Google::Cloud::Monitoring::MetricsScope::V1::MetricsScope. -p result + # The returned object is of type Google::Cloud::Monitoring::MetricsScope::V1::MetricsScope. + p result +end # [END monitoring_v1_generated_MetricsScopes_GetMetricsScope_sync] diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/list_metrics_scopes_by_monitored_project.rb b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/list_metrics_scopes_by_monitored_project.rb index 3645af0040eb..202bc6851869 100755 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/list_metrics_scopes_by_monitored_project.rb +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/metrics_scopes/list_metrics_scopes_by_monitored_project.rb @@ -19,15 +19,21 @@ # [START monitoring_v1_generated_MetricsScopes_ListMetricsScopesByMonitoredProject_sync] require "google/cloud/monitoring/metrics_scope/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client#list_metrics_scopes_by_monitored_project +# +def list_metrics_scopes_by_monitored_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::MetricsScope::V1::MetricsScopes::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::MetricsScope::V1::ListMetricsScopesByMonitoredProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::MetricsScope::V1::ListMetricsScopesByMonitoredProjectRequest.new -# Call the list_metrics_scopes_by_monitored_project method. -result = client.list_metrics_scopes_by_monitored_project request + # Call the list_metrics_scopes_by_monitored_project method. + result = client.list_metrics_scopes_by_monitored_project request -# The returned object is of type Google::Cloud::Monitoring::MetricsScope::V1::ListMetricsScopesByMonitoredProjectResponse. -p result + # The returned object is of type Google::Cloud::Monitoring::MetricsScope::V1::ListMetricsScopesByMonitoredProjectResponse. + p result +end # [END monitoring_v1_generated_MetricsScopes_ListMetricsScopesByMonitoredProject_sync] diff --git a/google-cloud-monitoring-metrics_scope-v1/snippets/snippet_metadata_google.monitoring.metricsscope.v1.json b/google-cloud-monitoring-metrics_scope-v1/snippets/snippet_metadata_google.monitoring.metricsscope.v1.json index 661666c10f02..b8f6bc2cdadc 100644 --- a/google-cloud-monitoring-metrics_scope-v1/snippets/snippet_metadata_google.monitoring.metricsscope.v1.json +++ b/google-cloud-monitoring-metrics_scope-v1/snippets/snippet_metadata_google.monitoring.metricsscope.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-monitoring-v3/.rubocop.yml b/google-cloud-monitoring-v3/.rubocop.yml index 9ad10e4c13e8..10044cefa0e0 100644 --- a/google-cloud-monitoring-v3/.rubocop.yml +++ b/google-cloud-monitoring-v3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-monitoring-v3.rb" diff --git a/google-cloud-monitoring-v3/snippets/Gemfile b/google-cloud-monitoring-v3/snippets/Gemfile index e556f6d60501..42280ce4598c 100755 --- a/google-cloud-monitoring-v3/snippets/Gemfile +++ b/google-cloud-monitoring-v3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-monitoring-v3/snippets/alert_policy_service/create_alert_policy.rb b/google-cloud-monitoring-v3/snippets/alert_policy_service/create_alert_policy.rb index c9d2a4670209..4bf5db01bac0 100755 --- a/google-cloud-monitoring-v3/snippets/alert_policy_service/create_alert_policy.rb +++ b/google-cloud-monitoring-v3/snippets/alert_policy_service/create_alert_policy.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::AlertPolicyService::Client#create_alert_policy +# +def create_alert_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateAlertPolicyRequest.new -# Call the create_alert_policy method. -result = client.create_alert_policy request + # Call the create_alert_policy method. + result = client.create_alert_policy request -# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. + p result +end # [END monitoring_v3_generated_AlertPolicyService_CreateAlertPolicy_sync] diff --git a/google-cloud-monitoring-v3/snippets/alert_policy_service/delete_alert_policy.rb b/google-cloud-monitoring-v3/snippets/alert_policy_service/delete_alert_policy.rb index 4f3e7b8e7e17..3541aab1c9d7 100755 --- a/google-cloud-monitoring-v3/snippets/alert_policy_service/delete_alert_policy.rb +++ b/google-cloud-monitoring-v3/snippets/alert_policy_service/delete_alert_policy.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::AlertPolicyService::Client#delete_alert_policy +# +def delete_alert_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteAlertPolicyRequest.new -# Call the delete_alert_policy method. -result = client.delete_alert_policy request + # Call the delete_alert_policy method. + result = client.delete_alert_policy request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_AlertPolicyService_DeleteAlertPolicy_sync] diff --git a/google-cloud-monitoring-v3/snippets/alert_policy_service/get_alert_policy.rb b/google-cloud-monitoring-v3/snippets/alert_policy_service/get_alert_policy.rb index dceac1f65208..b3c91e862a76 100755 --- a/google-cloud-monitoring-v3/snippets/alert_policy_service/get_alert_policy.rb +++ b/google-cloud-monitoring-v3/snippets/alert_policy_service/get_alert_policy.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::AlertPolicyService::Client#get_alert_policy +# +def get_alert_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetAlertPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetAlertPolicyRequest.new -# Call the get_alert_policy method. -result = client.get_alert_policy request + # Call the get_alert_policy method. + result = client.get_alert_policy request -# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. + p result +end # [END monitoring_v3_generated_AlertPolicyService_GetAlertPolicy_sync] diff --git a/google-cloud-monitoring-v3/snippets/alert_policy_service/list_alert_policies.rb b/google-cloud-monitoring-v3/snippets/alert_policy_service/list_alert_policies.rb index c4f2b2679d2a..1280a05cd73f 100755 --- a/google-cloud-monitoring-v3/snippets/alert_policy_service/list_alert_policies.rb +++ b/google-cloud-monitoring-v3/snippets/alert_policy_service/list_alert_policies.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::AlertPolicyService::Client#list_alert_policies +# +def list_alert_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest.new -# Call the list_alert_policies method. -result = client.list_alert_policies request + # Call the list_alert_policies method. + result = client.list_alert_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::AlertPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::AlertPolicy. + p response + end end # [END monitoring_v3_generated_AlertPolicyService_ListAlertPolicies_sync] diff --git a/google-cloud-monitoring-v3/snippets/alert_policy_service/update_alert_policy.rb b/google-cloud-monitoring-v3/snippets/alert_policy_service/update_alert_policy.rb index aec74970afc6..aae5816b4ceb 100755 --- a/google-cloud-monitoring-v3/snippets/alert_policy_service/update_alert_policy.rb +++ b/google-cloud-monitoring-v3/snippets/alert_policy_service/update_alert_policy.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::AlertPolicyService::Client#update_alert_policy +# +def update_alert_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateAlertPolicyRequest.new -# Call the update_alert_policy method. -result = client.update_alert_policy request + # Call the update_alert_policy method. + result = client.update_alert_policy request -# The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::AlertPolicy. + p result +end # [END monitoring_v3_generated_AlertPolicyService_UpdateAlertPolicy_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/create_group.rb b/google-cloud-monitoring-v3/snippets/group_service/create_group.rb index 0f9eb8300baa..481258129284 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/create_group.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/create_group.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_GroupService_CreateGroup_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#create_group +# +def create_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateGroupRequest.new -# Call the create_group method. -result = client.create_group request + # Call the create_group method. + result = client.create_group request -# The returned object is of type Google::Cloud::Monitoring::V3::Group. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Group. + p result +end # [END monitoring_v3_generated_GroupService_CreateGroup_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/delete_group.rb b/google-cloud-monitoring-v3/snippets/group_service/delete_group.rb index d965179bb354..fa38a86d72fd 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/delete_group.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/delete_group.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_GroupService_DeleteGroup_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#delete_group +# +def delete_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteGroupRequest.new -# Call the delete_group method. -result = client.delete_group request + # Call the delete_group method. + result = client.delete_group request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_GroupService_DeleteGroup_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/get_group.rb b/google-cloud-monitoring-v3/snippets/group_service/get_group.rb index d04712382560..ede400a2987c 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/get_group.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/get_group.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_GroupService_GetGroup_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#get_group +# +def get_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetGroupRequest.new -# Call the get_group method. -result = client.get_group request + # Call the get_group method. + result = client.get_group request -# The returned object is of type Google::Cloud::Monitoring::V3::Group. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Group. + p result +end # [END monitoring_v3_generated_GroupService_GetGroup_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/list_group_members.rb b/google-cloud-monitoring-v3/snippets/group_service/list_group_members.rb index a78ba9cb269b..1b55820dbfa1 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/list_group_members.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/list_group_members.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_GroupService_ListGroupMembers_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#list_group_members +# +def list_group_members + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListGroupMembersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListGroupMembersRequest.new -# Call the list_group_members method. -result = client.list_group_members request + # Call the list_group_members method. + result = client.list_group_members request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Api::MonitoredResource. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Api::MonitoredResource. + p response + end end # [END monitoring_v3_generated_GroupService_ListGroupMembers_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/list_groups.rb b/google-cloud-monitoring-v3/snippets/group_service/list_groups.rb index 77379c9fc19d..26335e5a4924 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/list_groups.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/list_groups.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_GroupService_ListGroups_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#list_groups +# +def list_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListGroupsRequest.new -# Call the list_groups method. -result = client.list_groups request + # Call the list_groups method. + result = client.list_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::Group. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::Group. + p response + end end # [END monitoring_v3_generated_GroupService_ListGroups_sync] diff --git a/google-cloud-monitoring-v3/snippets/group_service/update_group.rb b/google-cloud-monitoring-v3/snippets/group_service/update_group.rb index 6399b3b744c0..46854af63e96 100755 --- a/google-cloud-monitoring-v3/snippets/group_service/update_group.rb +++ b/google-cloud-monitoring-v3/snippets/group_service/update_group.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_GroupService_UpdateGroup_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::GroupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::GroupService::Client#update_group +# +def update_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::GroupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateGroupRequest.new -# Call the update_group method. -result = client.update_group request + # Call the update_group method. + result = client.update_group request -# The returned object is of type Google::Cloud::Monitoring::V3::Group. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Group. + p result +end # [END monitoring_v3_generated_GroupService_UpdateGroup_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/create_metric_descriptor.rb b/google-cloud-monitoring-v3/snippets/metric_service/create_metric_descriptor.rb index 9fd7de4fc3bf..6a763debaaab 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/create_metric_descriptor.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/create_metric_descriptor.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#create_metric_descriptor +# +def create_metric_descriptor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest.new -# Call the create_metric_descriptor method. -result = client.create_metric_descriptor request + # Call the create_metric_descriptor method. + result = client.create_metric_descriptor request -# The returned object is of type Google::Api::MetricDescriptor. -p result + # The returned object is of type Google::Api::MetricDescriptor. + p result +end # [END monitoring_v3_generated_MetricService_CreateMetricDescriptor_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/create_service_time_series.rb b/google-cloud-monitoring-v3/snippets/metric_service/create_service_time_series.rb index 163f7fda91d0..0eaf6ccb1760 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/create_service_time_series.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/create_service_time_series.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#create_service_time_series +# +def create_service_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new -# Call the create_service_time_series method. -result = client.create_service_time_series request + # Call the create_service_time_series method. + result = client.create_service_time_series request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_MetricService_CreateServiceTimeSeries_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/create_time_series.rb b/google-cloud-monitoring-v3/snippets/metric_service/create_time_series.rb index f60c226e9b38..cae2fc9095ca 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/create_time_series.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/create_time_series.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_CreateTimeSeries_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#create_time_series +# +def create_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new -# Call the create_time_series method. -result = client.create_time_series request + # Call the create_time_series method. + result = client.create_time_series request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_MetricService_CreateTimeSeries_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/delete_metric_descriptor.rb b/google-cloud-monitoring-v3/snippets/metric_service/delete_metric_descriptor.rb index 39d10995afd3..5ce64aa6a811 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/delete_metric_descriptor.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/delete_metric_descriptor.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#delete_metric_descriptor +# +def delete_metric_descriptor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest.new -# Call the delete_metric_descriptor method. -result = client.delete_metric_descriptor request + # Call the delete_metric_descriptor method. + result = client.delete_metric_descriptor request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_MetricService_DeleteMetricDescriptor_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/get_metric_descriptor.rb b/google-cloud-monitoring-v3/snippets/metric_service/get_metric_descriptor.rb index a88ce30507ce..996ae89866b4 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/get_metric_descriptor.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/get_metric_descriptor.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#get_metric_descriptor +# +def get_metric_descriptor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest.new -# Call the get_metric_descriptor method. -result = client.get_metric_descriptor request + # Call the get_metric_descriptor method. + result = client.get_metric_descriptor request -# The returned object is of type Google::Api::MetricDescriptor. -p result + # The returned object is of type Google::Api::MetricDescriptor. + p result +end # [END monitoring_v3_generated_MetricService_GetMetricDescriptor_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/get_monitored_resource_descriptor.rb b/google-cloud-monitoring-v3/snippets/metric_service/get_monitored_resource_descriptor.rb index a4263a4cfc76..abe4859caf75 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/get_monitored_resource_descriptor.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/get_monitored_resource_descriptor.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#get_monitored_resource_descriptor +# +def get_monitored_resource_descriptor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest.new -# Call the get_monitored_resource_descriptor method. -result = client.get_monitored_resource_descriptor request + # Call the get_monitored_resource_descriptor method. + result = client.get_monitored_resource_descriptor request -# The returned object is of type Google::Api::MonitoredResourceDescriptor. -p result + # The returned object is of type Google::Api::MonitoredResourceDescriptor. + p result +end # [END monitoring_v3_generated_MetricService_GetMonitoredResourceDescriptor_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/list_metric_descriptors.rb b/google-cloud-monitoring-v3/snippets/metric_service/list_metric_descriptors.rb index 18f743d56de1..8f9982f51415 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/list_metric_descriptors.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/list_metric_descriptors.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#list_metric_descriptors +# +def list_metric_descriptors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest.new -# Call the list_metric_descriptors method. -result = client.list_metric_descriptors request + # Call the list_metric_descriptors method. + result = client.list_metric_descriptors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Api::MetricDescriptor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Api::MetricDescriptor. + p response + end end # [END monitoring_v3_generated_MetricService_ListMetricDescriptors_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/list_monitored_resource_descriptors.rb b/google-cloud-monitoring-v3/snippets/metric_service/list_monitored_resource_descriptors.rb index 4e285a89c247..01d6b6530839 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/list_monitored_resource_descriptors.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/list_monitored_resource_descriptors.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#list_monitored_resource_descriptors +# +def list_monitored_resource_descriptors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest.new -# Call the list_monitored_resource_descriptors method. -result = client.list_monitored_resource_descriptors request + # Call the list_monitored_resource_descriptors method. + result = client.list_monitored_resource_descriptors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Api::MonitoredResourceDescriptor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Api::MonitoredResourceDescriptor. + p response + end end # [END monitoring_v3_generated_MetricService_ListMonitoredResourceDescriptors_sync] diff --git a/google-cloud-monitoring-v3/snippets/metric_service/list_time_series.rb b/google-cloud-monitoring-v3/snippets/metric_service/list_time_series.rb index 0c06c8392ddc..9cd75f99595a 100755 --- a/google-cloud-monitoring-v3/snippets/metric_service/list_time_series.rb +++ b/google-cloud-monitoring-v3/snippets/metric_service/list_time_series.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_MetricService_ListTimeSeries_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::MetricService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::MetricService::Client#list_time_series +# +def list_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::MetricService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListTimeSeriesRequest.new -# Call the list_time_series method. -result = client.list_time_series request + # Call the list_time_series method. + result = client.list_time_series request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeries. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeries. + p response + end end # [END monitoring_v3_generated_MetricService_ListTimeSeries_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/create_notification_channel.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/create_notification_channel.rb index e431c32998dc..b91c37cbf1fb 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/create_notification_channel.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/create_notification_channel.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#create_notification_channel +# +def create_notification_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateNotificationChannelRequest.new -# Call the create_notification_channel method. -result = client.create_notification_channel request + # Call the create_notification_channel method. + result = client.create_notification_channel request -# The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. + p result +end # [END monitoring_v3_generated_NotificationChannelService_CreateNotificationChannel_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/delete_notification_channel.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/delete_notification_channel.rb index 1ad3759354db..7f930ec0f609 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/delete_notification_channel.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/delete_notification_channel.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#delete_notification_channel +# +def delete_notification_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteNotificationChannelRequest.new -# Call the delete_notification_channel method. -result = client.delete_notification_channel request + # Call the delete_notification_channel method. + result = client.delete_notification_channel request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_NotificationChannelService_DeleteNotificationChannel_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel.rb index 657564b9f7a3..f74ee08bfb89 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel +# +def get_notification_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetNotificationChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetNotificationChannelRequest.new -# Call the get_notification_channel method. -result = client.get_notification_channel request + # Call the get_notification_channel method. + result = client.get_notification_channel request -# The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. + p result +end # [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannel_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_descriptor.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_descriptor.rb index 2f5a2aac4790..79856179079a 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_descriptor.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_descriptor.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel_descriptor +# +def get_notification_channel_descriptor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetNotificationChannelDescriptorRequest.new -# Call the get_notification_channel_descriptor method. -result = client.get_notification_channel_descriptor request + # Call the get_notification_channel_descriptor method. + result = client.get_notification_channel_descriptor request -# The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannelDescriptor. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannelDescriptor. + p result +end # [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelDescriptor_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_verification_code.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_verification_code.rb index ca1d9dabc84f..1e0f05908506 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_verification_code.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/get_notification_channel_verification_code.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#get_notification_channel_verification_code +# +def get_notification_channel_verification_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeRequest.new -# Call the get_notification_channel_verification_code method. -result = client.get_notification_channel_verification_code request + # Call the get_notification_channel_verification_code method. + result = client.get_notification_channel_verification_code request -# The returned object is of type Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::GetNotificationChannelVerificationCodeResponse. + p result +end # [END monitoring_v3_generated_NotificationChannelService_GetNotificationChannelVerificationCode_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channel_descriptors.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channel_descriptors.rb index 632a2bbe3c9e..bfdbcea42328 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channel_descriptors.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channel_descriptors.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#list_notification_channel_descriptors +# +def list_notification_channel_descriptors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListNotificationChannelDescriptorsRequest.new -# Call the list_notification_channel_descriptors method. -result = client.list_notification_channel_descriptors request + # Call the list_notification_channel_descriptors method. + result = client.list_notification_channel_descriptors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannelDescriptor. + p response + end end # [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannelDescriptors_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channels.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channels.rb index fcccfd78cf0d..48bd982ebbc8 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channels.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/list_notification_channels.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#list_notification_channels +# +def list_notification_channels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListNotificationChannelsRequest.new -# Call the list_notification_channels method. -result = client.list_notification_channels request + # Call the list_notification_channels method. + result = client.list_notification_channels request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannel. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::NotificationChannel. + p response + end end # [END monitoring_v3_generated_NotificationChannelService_ListNotificationChannels_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/send_notification_channel_verification_code.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/send_notification_channel_verification_code.rb index f26cf61bbe87..4f46e2a9e8b3 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/send_notification_channel_verification_code.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/send_notification_channel_verification_code.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#send_notification_channel_verification_code +# +def send_notification_channel_verification_code + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::SendNotificationChannelVerificationCodeRequest.new -# Call the send_notification_channel_verification_code method. -result = client.send_notification_channel_verification_code request + # Call the send_notification_channel_verification_code method. + result = client.send_notification_channel_verification_code request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_NotificationChannelService_SendNotificationChannelVerificationCode_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/update_notification_channel.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/update_notification_channel.rb index bda0923e9c25..57a74dd642ec 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/update_notification_channel.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/update_notification_channel.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#update_notification_channel +# +def update_notification_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateNotificationChannelRequest.new -# Call the update_notification_channel method. -result = client.update_notification_channel request + # Call the update_notification_channel method. + result = client.update_notification_channel request -# The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. + p result +end # [END monitoring_v3_generated_NotificationChannelService_UpdateNotificationChannel_sync] diff --git a/google-cloud-monitoring-v3/snippets/notification_channel_service/verify_notification_channel.rb b/google-cloud-monitoring-v3/snippets/notification_channel_service/verify_notification_channel.rb index f627968c7170..4ed58896cef6 100755 --- a/google-cloud-monitoring-v3/snippets/notification_channel_service/verify_notification_channel.rb +++ b/google-cloud-monitoring-v3/snippets/notification_channel_service/verify_notification_channel.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::NotificationChannelService::Client#verify_notification_channel +# +def verify_notification_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::NotificationChannelService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::VerifyNotificationChannelRequest.new -# Call the verify_notification_channel method. -result = client.verify_notification_channel request + # Call the verify_notification_channel method. + result = client.verify_notification_channel request -# The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::NotificationChannel. + p result +end # [END monitoring_v3_generated_NotificationChannelService_VerifyNotificationChannel_sync] diff --git a/google-cloud-monitoring-v3/snippets/query_service/query_time_series.rb b/google-cloud-monitoring-v3/snippets/query_service/query_time_series.rb index cc1a24a70f3e..09e7ad2a6c2c 100755 --- a/google-cloud-monitoring-v3/snippets/query_service/query_time_series.rb +++ b/google-cloud-monitoring-v3/snippets/query_service/query_time_series.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_QueryService_QueryTimeSeries_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::QueryService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::QueryService::Client#query_time_series +# +def query_time_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::QueryService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::QueryTimeSeriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::QueryTimeSeriesRequest.new -# Call the query_time_series method. -result = client.query_time_series request + # Call the query_time_series method. + result = client.query_time_series request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeriesData. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeriesData. + p response + end end # [END monitoring_v3_generated_QueryService_QueryTimeSeries_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service.rb index bde4df183b39..78009ba486d2 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Google::Cloud::Monitoring::V3::Service. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Service. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_CreateService_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service_level_objective.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service_level_objective.rb index 8145eebad0ca..cf7f054c9835 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service_level_objective.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/create_service_level_objective.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#create_service_level_objective +# +def create_service_level_objective + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateServiceLevelObjectiveRequest.new -# Call the create_service_level_objective method. -result = client.create_service_level_objective request + # Call the create_service_level_objective method. + result = client.create_service_level_objective request -# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_CreateServiceLevelObjective_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service.rb index 1686c6331a7c..9286aa771d6f 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_DeleteService_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service_level_objective.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service_level_objective.rb index f2a87d1aaea9..011677ad5508 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service_level_objective.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/delete_service_level_objective.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#delete_service_level_objective +# +def delete_service_level_objective + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteServiceLevelObjectiveRequest.new -# Call the delete_service_level_objective method. -result = client.delete_service_level_objective request + # Call the delete_service_level_objective method. + result = client.delete_service_level_objective request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_DeleteServiceLevelObjective_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service.rb index bfdabc82bf64..6d2bfab1f3f6 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_GetService_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::Monitoring::V3::Service. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Service. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_GetService_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service_level_objective.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service_level_objective.rb index f60d726c72bd..5c8b109c87b7 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service_level_objective.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/get_service_level_objective.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#get_service_level_objective +# +def get_service_level_objective + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetServiceLevelObjectiveRequest.new -# Call the get_service_level_objective method. -result = client.get_service_level_objective request + # Call the get_service_level_objective method. + result = client.get_service_level_objective request -# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_GetServiceLevelObjective_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_service_level_objectives.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_service_level_objectives.rb index ae6ae7be0537..73660a7496c4 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_service_level_objectives.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_service_level_objectives.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#list_service_level_objectives +# +def list_service_level_objectives + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListServiceLevelObjectivesRequest.new -# Call the list_service_level_objectives method. -result = client.list_service_level_objectives request + # Call the list_service_level_objectives method. + result = client.list_service_level_objectives request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::ServiceLevelObjective. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::ServiceLevelObjective. + p response + end end # [END monitoring_v3_generated_ServiceMonitoringService_ListServiceLevelObjectives_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_services.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_services.rb index 028d317eb962..5de3ea17646f 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_services.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/list_services.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::Service. + p response + end end # [END monitoring_v3_generated_ServiceMonitoringService_ListServices_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service.rb index 77bdc1d8eb69..92ca78812605 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Google::Cloud::Monitoring::V3::Service. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::Service. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_UpdateService_sync] diff --git a/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service_level_objective.rb b/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service_level_objective.rb index 392814f36404..ad254f0fe13b 100755 --- a/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service_level_objective.rb +++ b/google-cloud-monitoring-v3/snippets/service_monitoring_service/update_service_level_objective.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client#update_service_level_objective +# +def update_service_level_objective + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::ServiceMonitoringService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateServiceLevelObjectiveRequest.new -# Call the update_service_level_objective method. -result = client.update_service_level_objective request + # Call the update_service_level_objective method. + result = client.update_service_level_objective request -# The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::ServiceLevelObjective. + p result +end # [END monitoring_v3_generated_ServiceMonitoringService_UpdateServiceLevelObjective_sync] diff --git a/google-cloud-monitoring-v3/snippets/snippet_metadata_google.monitoring.v3.json b/google-cloud-monitoring-v3/snippets/snippet_metadata_google.monitoring.v3.json index e614883df490..6dd67e472bb0 100644 --- a/google-cloud-monitoring-v3/snippets/snippet_metadata_google.monitoring.v3.json +++ b/google-cloud-monitoring-v3/snippets/snippet_metadata_google.monitoring.v3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1886,7 +1886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/create_uptime_check_config.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/create_uptime_check_config.rb index 9153095c6910..ad6354bbccd5 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/create_uptime_check_config.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/create_uptime_check_config.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#create_uptime_check_config +# +def create_uptime_check_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::CreateUptimeCheckConfigRequest.new -# Call the create_uptime_check_config method. -result = client.create_uptime_check_config request + # Call the create_uptime_check_config method. + result = client.create_uptime_check_config request -# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. + p result +end # [END monitoring_v3_generated_UptimeCheckService_CreateUptimeCheckConfig_sync] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/delete_uptime_check_config.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/delete_uptime_check_config.rb index 9d90189b1343..c0816d48ae8a 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/delete_uptime_check_config.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/delete_uptime_check_config.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#delete_uptime_check_config +# +def delete_uptime_check_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::DeleteUptimeCheckConfigRequest.new -# Call the delete_uptime_check_config method. -result = client.delete_uptime_check_config request + # Call the delete_uptime_check_config method. + result = client.delete_uptime_check_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END monitoring_v3_generated_UptimeCheckService_DeleteUptimeCheckConfig_sync] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/get_uptime_check_config.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/get_uptime_check_config.rb index 338ee6313739..1d71ccf5f5a8 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/get_uptime_check_config.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/get_uptime_check_config.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#get_uptime_check_config +# +def get_uptime_check_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::GetUptimeCheckConfigRequest.new -# Call the get_uptime_check_config method. -result = client.get_uptime_check_config request + # Call the get_uptime_check_config method. + result = client.get_uptime_check_config request -# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. + p result +end # [END monitoring_v3_generated_UptimeCheckService_GetUptimeCheckConfig_sync] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_configs.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_configs.rb index 735f496e06d3..3c41d2209da3 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_configs.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_configs.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#list_uptime_check_configs +# +def list_uptime_check_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListUptimeCheckConfigsRequest.new -# Call the list_uptime_check_configs method. -result = client.list_uptime_check_configs request + # Call the list_uptime_check_configs method. + result = client.list_uptime_check_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::UptimeCheckConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::UptimeCheckConfig. + p response + end end # [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckConfigs_sync] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_ips.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_ips.rb index 29c72511c47e..57f2e95550aa 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_ips.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/list_uptime_check_ips.rb @@ -19,21 +19,27 @@ # [START monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#list_uptime_check_ips +# +def list_uptime_check_ips + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::ListUptimeCheckIpsRequest.new -# Call the list_uptime_check_ips method. -result = client.list_uptime_check_ips request + # Call the list_uptime_check_ips method. + result = client.list_uptime_check_ips request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Monitoring::V3::UptimeCheckIp. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Monitoring::V3::UptimeCheckIp. + p response + end end # [END monitoring_v3_generated_UptimeCheckService_ListUptimeCheckIps_sync] diff --git a/google-cloud-monitoring-v3/snippets/uptime_check_service/update_uptime_check_config.rb b/google-cloud-monitoring-v3/snippets/uptime_check_service/update_uptime_check_config.rb index 5c410e208ebe..95729948dfde 100755 --- a/google-cloud-monitoring-v3/snippets/uptime_check_service/update_uptime_check_config.rb +++ b/google-cloud-monitoring-v3/snippets/uptime_check_service/update_uptime_check_config.rb @@ -19,15 +19,21 @@ # [START monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] require "google/cloud/monitoring/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Monitoring::V3::UptimeCheckService::Client#update_uptime_check_config +# +def update_uptime_check_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Monitoring::V3::UptimeCheckService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Monitoring::V3::UpdateUptimeCheckConfigRequest.new -# Call the update_uptime_check_config method. -result = client.update_uptime_check_config request + # Call the update_uptime_check_config method. + result = client.update_uptime_check_config request -# The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. -p result + # The returned object is of type Google::Cloud::Monitoring::V3::UptimeCheckConfig. + p result +end # [END monitoring_v3_generated_UptimeCheckService_UpdateUptimeCheckConfig_sync] diff --git a/google-cloud-network_connectivity-v1/.rubocop.yml b/google-cloud-network_connectivity-v1/.rubocop.yml index aeadbbc60d1d..a57a0b7c351f 100644 --- a/google-cloud-network_connectivity-v1/.rubocop.yml +++ b/google-cloud-network_connectivity-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-network_connectivity-v1.rb" diff --git a/google-cloud-network_connectivity-v1/snippets/Gemfile b/google-cloud-network_connectivity-v1/snippets/Gemfile index 19d11aeeb9c0..2f1e906b4a1d 100755 --- a/google-cloud-network_connectivity-v1/snippets/Gemfile +++ b/google-cloud-network_connectivity-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/create_hub.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/create_hub.rb index 28eea7034271..3c0f333980d7 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/create_hub.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/create_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_CreateHub_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_hub +# +def create_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::CreateHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::CreateHubRequest.new -# Call the create_hub method. -result = client.create_hub request + # Call the create_hub method. + result = client.create_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_CreateHub_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/create_spoke.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/create_spoke.rb index fa07be5acf02..677caf616636 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/create_spoke.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/create_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_CreateSpoke_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_spoke +# +def create_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest.new -# Call the create_spoke method. -result = client.create_spoke request + # Call the create_spoke method. + result = client.create_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_CreateSpoke_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/delete_hub.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/delete_hub.rb index 21bd6d57a8d5..72a95add7c72 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/delete_hub.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/delete_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_DeleteHub_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_hub +# +def delete_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest.new -# Call the delete_hub method. -result = client.delete_hub request + # Call the delete_hub method. + result = client.delete_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_DeleteHub_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/delete_spoke.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/delete_spoke.rb index dd7fef38197d..37dd4780b40e 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/delete_spoke.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/delete_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_DeleteSpoke_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_spoke +# +def delete_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest.new -# Call the delete_spoke method. -result = client.delete_spoke request + # Call the delete_spoke method. + result = client.delete_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_DeleteSpoke_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/get_hub.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/get_hub.rb index afe288ae1763..b5264e85e3e6 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/get_hub.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/get_hub.rb @@ -19,15 +19,21 @@ # [START networkconnectivity_v1_generated_HubService_GetHub_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_hub +# +def get_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::GetHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::GetHubRequest.new -# Call the get_hub method. -result = client.get_hub request + # Call the get_hub method. + result = client.get_hub request -# The returned object is of type Google::Cloud::NetworkConnectivity::V1::Hub. -p result + # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Hub. + p result +end # [END networkconnectivity_v1_generated_HubService_GetHub_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/get_spoke.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/get_spoke.rb index beca49d6e7db..1a2bfd51ceec 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/get_spoke.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/get_spoke.rb @@ -19,15 +19,21 @@ # [START networkconnectivity_v1_generated_HubService_GetSpoke_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_spoke +# +def get_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest.new -# Call the get_spoke method. -result = client.get_spoke request + # Call the get_spoke method. + result = client.get_spoke request -# The returned object is of type Google::Cloud::NetworkConnectivity::V1::Spoke. -p result + # The returned object is of type Google::Cloud::NetworkConnectivity::V1::Spoke. + p result +end # [END networkconnectivity_v1_generated_HubService_GetSpoke_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/list_hubs.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/list_hubs.rb index 65e313ce211e..0f373223ddc8 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/list_hubs.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/list_hubs.rb @@ -19,21 +19,27 @@ # [START networkconnectivity_v1_generated_HubService_ListHubs_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_hubs +# +def list_hubs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::ListHubsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::ListHubsRequest.new -# Call the list_hubs method. -result = client.list_hubs request + # Call the list_hubs method. + result = client.list_hubs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Hub. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Hub. + p response + end end # [END networkconnectivity_v1_generated_HubService_ListHubs_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/list_spokes.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/list_spokes.rb index e89f0b114714..69808d6287c7 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/list_spokes.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/list_spokes.rb @@ -19,21 +19,27 @@ # [START networkconnectivity_v1_generated_HubService_ListSpokes_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_spokes +# +def list_spokes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest.new -# Call the list_spokes method. -result = client.list_spokes request + # Call the list_spokes method. + result = client.list_spokes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Spoke. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::Spoke. + p response + end end # [END networkconnectivity_v1_generated_HubService_ListSpokes_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/update_hub.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/update_hub.rb index d33f8614e317..283a8b325ea7 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/update_hub.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/update_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_UpdateHub_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_hub +# +def update_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest.new -# Call the update_hub method. -result = client.update_hub request + # Call the update_hub method. + result = client.update_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_UpdateHub_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/hub_service/update_spoke.rb b/google-cloud-network_connectivity-v1/snippets/hub_service/update_spoke.rb index cf50ca0e6707..eaaf835a47f8 100755 --- a/google-cloud-network_connectivity-v1/snippets/hub_service/update_spoke.rb +++ b/google-cloud-network_connectivity-v1/snippets/hub_service/update_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1_generated_HubService_UpdateSpoke_sync] require "google/cloud/network_connectivity/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_spoke +# +def update_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest.new -# Call the update_spoke method. -result = client.update_spoke request + # Call the update_spoke method. + result = client.update_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1_generated_HubService_UpdateSpoke_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json index 09ef088ed375..354098850a28 100644 --- a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-network_connectivity-v1alpha1/.rubocop.yml b/google-cloud-network_connectivity-v1alpha1/.rubocop.yml index cc930541b9ca..e318ac609fdf 100644 --- a/google-cloud-network_connectivity-v1alpha1/.rubocop.yml +++ b/google-cloud-network_connectivity-v1alpha1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-network_connectivity-v1alpha1.rb" diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/Gemfile b/google-cloud-network_connectivity-v1alpha1/snippets/Gemfile index 346601f6e079..3f7df3b71e35 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/Gemfile +++ b/google-cloud-network_connectivity-v1alpha1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_hub.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_hub.rb index 3792c3aff82b..046078254d1f 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_hub.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_CreateHub_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#create_hub +# +def create_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest.new -# Call the create_hub method. -result = client.create_hub request + # Call the create_hub method. + result = client.create_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_CreateHub_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_spoke.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_spoke.rb index 88ec8f65ac47..ef5226cf0262 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_spoke.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/create_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_CreateSpoke_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#create_spoke +# +def create_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest.new -# Call the create_spoke method. -result = client.create_spoke request + # Call the create_spoke method. + result = client.create_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_CreateSpoke_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_hub.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_hub.rb index 14406a8fb7ab..d820bbdd13ee 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_hub.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_DeleteHub_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#delete_hub +# +def delete_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest.new -# Call the delete_hub method. -result = client.delete_hub request + # Call the delete_hub method. + result = client.delete_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_DeleteHub_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_spoke.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_spoke.rb index 7a4297ab173b..7baf4a937bca 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_spoke.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/delete_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_DeleteSpoke_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#delete_spoke +# +def delete_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest.new -# Call the delete_spoke method. -result = client.delete_spoke request + # Call the delete_spoke method. + result = client.delete_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_DeleteSpoke_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_hub.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_hub.rb index b2524ad7751a..04e77b05c80d 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_hub.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_hub.rb @@ -19,15 +19,21 @@ # [START networkconnectivity_v1alpha1_generated_HubService_GetHub_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#get_hub +# +def get_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest.new -# Call the get_hub method. -result = client.get_hub request + # Call the get_hub method. + result = client.get_hub request -# The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Hub. -p result + # The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Hub. + p result +end # [END networkconnectivity_v1alpha1_generated_HubService_GetHub_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_spoke.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_spoke.rb index d88dd4cd5b0e..eaa4ef561723 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_spoke.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/get_spoke.rb @@ -19,15 +19,21 @@ # [START networkconnectivity_v1alpha1_generated_HubService_GetSpoke_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#get_spoke +# +def get_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest.new -# Call the get_spoke method. -result = client.get_spoke request + # Call the get_spoke method. + result = client.get_spoke request -# The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Spoke. -p result + # The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Spoke. + p result +end # [END networkconnectivity_v1alpha1_generated_HubService_GetSpoke_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_hubs.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_hubs.rb index 63ab625f4cfe..4ef1969ef3c3 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_hubs.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_hubs.rb @@ -19,21 +19,27 @@ # [START networkconnectivity_v1alpha1_generated_HubService_ListHubs_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#list_hubs +# +def list_hubs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest.new -# Call the list_hubs method. -result = client.list_hubs request + # Call the list_hubs method. + result = client.list_hubs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub. + p response + end end # [END networkconnectivity_v1alpha1_generated_HubService_ListHubs_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_spokes.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_spokes.rb index f73e04d96bb8..65eb07e470ef 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_spokes.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/list_spokes.rb @@ -19,21 +19,27 @@ # [START networkconnectivity_v1alpha1_generated_HubService_ListSpokes_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#list_spokes +# +def list_spokes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest.new -# Call the list_spokes method. -result = client.list_spokes request + # Call the list_spokes method. + result = client.list_spokes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke. + p response + end end # [END networkconnectivity_v1alpha1_generated_HubService_ListSpokes_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_hub.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_hub.rb index 53ce074a9e1a..28aeb5e12d63 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_hub.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_hub.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_UpdateHub_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#update_hub +# +def update_hub + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest.new -# Call the update_hub method. -result = client.update_hub request + # Call the update_hub method. + result = client.update_hub request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_UpdateHub_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_spoke.rb b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_spoke.rb index 07d4949da2d5..81650778b19a 100755 --- a/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_spoke.rb +++ b/google-cloud-network_connectivity-v1alpha1/snippets/hub_service/update_spoke.rb @@ -19,22 +19,28 @@ # [START networkconnectivity_v1alpha1_generated_HubService_UpdateSpoke_sync] require "google/cloud/network_connectivity/v1alpha1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client#update_spoke +# +def update_spoke + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest.new -# Call the update_spoke method. -result = client.update_spoke request + # Call the update_spoke method. + result = client.update_spoke request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkconnectivity_v1alpha1_generated_HubService_UpdateSpoke_sync] diff --git a/google-cloud-network_connectivity-v1alpha1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json b/google-cloud-network_connectivity-v1alpha1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json index d593818f1f10..e7132a223ada 100644 --- a/google-cloud-network_connectivity-v1alpha1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json +++ b/google-cloud-network_connectivity-v1alpha1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1alpha1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-network_management-v1/.rubocop.yml b/google-cloud-network_management-v1/.rubocop.yml index 6fb39de745b4..d9210d1d63c6 100644 --- a/google-cloud-network_management-v1/.rubocop.yml +++ b/google-cloud-network_management-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-network_management-v1.rb" diff --git a/google-cloud-network_management-v1/snippets/Gemfile b/google-cloud-network_management-v1/snippets/Gemfile index 9b00229bd9f6..cc1c9f5b33af 100755 --- a/google-cloud-network_management-v1/snippets/Gemfile +++ b/google-cloud-network_management-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-network_management-v1/snippets/reachability_service/create_connectivity_test.rb b/google-cloud-network_management-v1/snippets/reachability_service/create_connectivity_test.rb index 775a9b241728..0835927e1f1b 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/create_connectivity_test.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/create_connectivity_test.rb @@ -19,22 +19,28 @@ # [START networkmanagement_v1_generated_ReachabilityService_CreateConnectivityTest_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#create_connectivity_test +# +def create_connectivity_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::CreateConnectivityTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::CreateConnectivityTestRequest.new -# Call the create_connectivity_test method. -result = client.create_connectivity_test request + # Call the create_connectivity_test method. + result = client.create_connectivity_test request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkmanagement_v1_generated_ReachabilityService_CreateConnectivityTest_sync] diff --git a/google-cloud-network_management-v1/snippets/reachability_service/delete_connectivity_test.rb b/google-cloud-network_management-v1/snippets/reachability_service/delete_connectivity_test.rb index 0b6729ecddf0..8c49a3db4a50 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/delete_connectivity_test.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/delete_connectivity_test.rb @@ -19,22 +19,28 @@ # [START networkmanagement_v1_generated_ReachabilityService_DeleteConnectivityTest_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#delete_connectivity_test +# +def delete_connectivity_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::DeleteConnectivityTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::DeleteConnectivityTestRequest.new -# Call the delete_connectivity_test method. -result = client.delete_connectivity_test request + # Call the delete_connectivity_test method. + result = client.delete_connectivity_test request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkmanagement_v1_generated_ReachabilityService_DeleteConnectivityTest_sync] diff --git a/google-cloud-network_management-v1/snippets/reachability_service/get_connectivity_test.rb b/google-cloud-network_management-v1/snippets/reachability_service/get_connectivity_test.rb index 852e50834853..58724d1e54fd 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/get_connectivity_test.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/get_connectivity_test.rb @@ -19,15 +19,21 @@ # [START networkmanagement_v1_generated_ReachabilityService_GetConnectivityTest_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#get_connectivity_test +# +def get_connectivity_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::GetConnectivityTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::GetConnectivityTestRequest.new -# Call the get_connectivity_test method. -result = client.get_connectivity_test request + # Call the get_connectivity_test method. + result = client.get_connectivity_test request -# The returned object is of type Google::Cloud::NetworkManagement::V1::ConnectivityTest. -p result + # The returned object is of type Google::Cloud::NetworkManagement::V1::ConnectivityTest. + p result +end # [END networkmanagement_v1_generated_ReachabilityService_GetConnectivityTest_sync] diff --git a/google-cloud-network_management-v1/snippets/reachability_service/list_connectivity_tests.rb b/google-cloud-network_management-v1/snippets/reachability_service/list_connectivity_tests.rb index 65ba06d8d24a..dd402c1653d0 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/list_connectivity_tests.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/list_connectivity_tests.rb @@ -19,21 +19,27 @@ # [START networkmanagement_v1_generated_ReachabilityService_ListConnectivityTests_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#list_connectivity_tests +# +def list_connectivity_tests + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::ListConnectivityTestsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::ListConnectivityTestsRequest.new -# Call the list_connectivity_tests method. -result = client.list_connectivity_tests request + # Call the list_connectivity_tests method. + result = client.list_connectivity_tests request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkManagement::V1::ConnectivityTest. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkManagement::V1::ConnectivityTest. + p response + end end # [END networkmanagement_v1_generated_ReachabilityService_ListConnectivityTests_sync] diff --git a/google-cloud-network_management-v1/snippets/reachability_service/rerun_connectivity_test.rb b/google-cloud-network_management-v1/snippets/reachability_service/rerun_connectivity_test.rb index 46069cd8efc7..59e754f80968 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/rerun_connectivity_test.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/rerun_connectivity_test.rb @@ -19,22 +19,28 @@ # [START networkmanagement_v1_generated_ReachabilityService_RerunConnectivityTest_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#rerun_connectivity_test +# +def rerun_connectivity_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::RerunConnectivityTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::RerunConnectivityTestRequest.new -# Call the rerun_connectivity_test method. -result = client.rerun_connectivity_test request + # Call the rerun_connectivity_test method. + result = client.rerun_connectivity_test request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkmanagement_v1_generated_ReachabilityService_RerunConnectivityTest_sync] diff --git a/google-cloud-network_management-v1/snippets/reachability_service/update_connectivity_test.rb b/google-cloud-network_management-v1/snippets/reachability_service/update_connectivity_test.rb index 97cffa2be5ef..a2320fc8f649 100755 --- a/google-cloud-network_management-v1/snippets/reachability_service/update_connectivity_test.rb +++ b/google-cloud-network_management-v1/snippets/reachability_service/update_connectivity_test.rb @@ -19,22 +19,28 @@ # [START networkmanagement_v1_generated_ReachabilityService_UpdateConnectivityTest_sync] require "google/cloud/network_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkManagement::V1::ReachabilityService::Client#update_connectivity_test +# +def update_connectivity_test + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkManagement::V1::ReachabilityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkManagement::V1::UpdateConnectivityTestRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkManagement::V1::UpdateConnectivityTestRequest.new -# Call the update_connectivity_test method. -result = client.update_connectivity_test request + # Call the update_connectivity_test method. + result = client.update_connectivity_test request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networkmanagement_v1_generated_ReachabilityService_UpdateConnectivityTest_sync] diff --git a/google-cloud-network_management-v1/snippets/snippet_metadata_google.cloud.networkmanagement.v1.json b/google-cloud-network_management-v1/snippets/snippet_metadata_google.cloud.networkmanagement.v1.json index ae737f7c0321..78f4d56e2bd7 100644 --- a/google-cloud-network_management-v1/snippets/snippet_metadata_google.cloud.networkmanagement.v1.json +++ b/google-cloud-network_management-v1/snippets/snippet_metadata_google.cloud.networkmanagement.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-network_security-v1beta1/.rubocop.yml b/google-cloud-network_security-v1beta1/.rubocop.yml index 6ef73803b023..d5bb5721dd9a 100644 --- a/google-cloud-network_security-v1beta1/.rubocop.yml +++ b/google-cloud-network_security-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-network_security-v1beta1.rb" diff --git a/google-cloud-network_security-v1beta1/snippets/Gemfile b/google-cloud-network_security-v1beta1/snippets/Gemfile index 3455ab5d8a0b..63707954cb02 100755 --- a/google-cloud-network_security-v1beta1/snippets/Gemfile +++ b/google-cloud-network_security-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/create_authorization_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/create_authorization_policy.rb index b046ca480fd6..f3efba46a1b3 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/create_authorization_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/create_authorization_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_CreateAuthorizationPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#create_authorization_policy +# +def create_authorization_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::CreateAuthorizationPolicyRequest.new -# Call the create_authorization_policy method. -result = client.create_authorization_policy request + # Call the create_authorization_policy method. + result = client.create_authorization_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_CreateAuthorizationPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/create_client_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/create_client_tls_policy.rb index 5e866992e1cb..3e3f57ee718e 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/create_client_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/create_client_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_CreateClientTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#create_client_tls_policy +# +def create_client_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::CreateClientTlsPolicyRequest.new -# Call the create_client_tls_policy method. -result = client.create_client_tls_policy request + # Call the create_client_tls_policy method. + result = client.create_client_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_CreateClientTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/create_server_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/create_server_tls_policy.rb index 7e292800b8a0..b1240d835988 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/create_server_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/create_server_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_CreateServerTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#create_server_tls_policy +# +def create_server_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::CreateServerTlsPolicyRequest.new -# Call the create_server_tls_policy method. -result = client.create_server_tls_policy request + # Call the create_server_tls_policy method. + result = client.create_server_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_CreateServerTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/delete_authorization_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/delete_authorization_policy.rb index 3bec5ceb0f61..ceb6c52d5417 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/delete_authorization_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/delete_authorization_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_DeleteAuthorizationPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#delete_authorization_policy +# +def delete_authorization_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::DeleteAuthorizationPolicyRequest.new -# Call the delete_authorization_policy method. -result = client.delete_authorization_policy request + # Call the delete_authorization_policy method. + result = client.delete_authorization_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_DeleteAuthorizationPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/delete_client_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/delete_client_tls_policy.rb index d76bd87e7e64..e35f487a68a5 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/delete_client_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/delete_client_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_DeleteClientTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#delete_client_tls_policy +# +def delete_client_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::DeleteClientTlsPolicyRequest.new -# Call the delete_client_tls_policy method. -result = client.delete_client_tls_policy request + # Call the delete_client_tls_policy method. + result = client.delete_client_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_DeleteClientTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/delete_server_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/delete_server_tls_policy.rb index 85652bac8d7a..3d387e6fc797 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/delete_server_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/delete_server_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_DeleteServerTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#delete_server_tls_policy +# +def delete_server_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::DeleteServerTlsPolicyRequest.new -# Call the delete_server_tls_policy method. -result = client.delete_server_tls_policy request + # Call the delete_server_tls_policy method. + result = client.delete_server_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_DeleteServerTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/get_authorization_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/get_authorization_policy.rb index c45ba788808c..3b78c01724ed 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/get_authorization_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/get_authorization_policy.rb @@ -19,15 +19,21 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_GetAuthorizationPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#get_authorization_policy +# +def get_authorization_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::GetAuthorizationPolicyRequest.new -# Call the get_authorization_policy method. -result = client.get_authorization_policy request + # Call the get_authorization_policy method. + result = client.get_authorization_policy request -# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy. -p result + # The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy. + p result +end # [END networksecurity_v1beta1_generated_NetworkSecurity_GetAuthorizationPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/get_client_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/get_client_tls_policy.rb index 3f10c1f6888c..ba2f274293e1 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/get_client_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/get_client_tls_policy.rb @@ -19,15 +19,21 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_GetClientTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#get_client_tls_policy +# +def get_client_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::GetClientTlsPolicyRequest.new -# Call the get_client_tls_policy method. -result = client.get_client_tls_policy request + # Call the get_client_tls_policy method. + result = client.get_client_tls_policy request -# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy. -p result + # The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy. + p result +end # [END networksecurity_v1beta1_generated_NetworkSecurity_GetClientTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/get_server_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/get_server_tls_policy.rb index d2fbd008d4e5..593a1af3e425 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/get_server_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/get_server_tls_policy.rb @@ -19,15 +19,21 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_GetServerTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#get_server_tls_policy +# +def get_server_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::GetServerTlsPolicyRequest.new -# Call the get_server_tls_policy method. -result = client.get_server_tls_policy request + # Call the get_server_tls_policy method. + result = client.get_server_tls_policy request -# The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy. -p result + # The returned object is of type Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy. + p result +end # [END networksecurity_v1beta1_generated_NetworkSecurity_GetServerTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/list_authorization_policies.rb b/google-cloud-network_security-v1beta1/snippets/network_security/list_authorization_policies.rb index 0c22362d0de1..4d3c37a39c5d 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/list_authorization_policies.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/list_authorization_policies.rb @@ -19,21 +19,27 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_ListAuthorizationPolicies_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#list_authorization_policies +# +def list_authorization_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::ListAuthorizationPoliciesRequest.new -# Call the list_authorization_policies method. -result = client.list_authorization_policies request + # Call the list_authorization_policies method. + result = client.list_authorization_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::AuthorizationPolicy. + p response + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_ListAuthorizationPolicies_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/list_client_tls_policies.rb b/google-cloud-network_security-v1beta1/snippets/network_security/list_client_tls_policies.rb index 446e3b8932d9..0f0bbd9adc4d 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/list_client_tls_policies.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/list_client_tls_policies.rb @@ -19,21 +19,27 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_ListClientTlsPolicies_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#list_client_tls_policies +# +def list_client_tls_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::ListClientTlsPoliciesRequest.new -# Call the list_client_tls_policies method. -result = client.list_client_tls_policies request + # Call the list_client_tls_policies method. + result = client.list_client_tls_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ClientTlsPolicy. + p response + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_ListClientTlsPolicies_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/list_server_tls_policies.rb b/google-cloud-network_security-v1beta1/snippets/network_security/list_server_tls_policies.rb index 1fff3815f84c..c22df83770e2 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/list_server_tls_policies.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/list_server_tls_policies.rb @@ -19,21 +19,27 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_ListServerTlsPolicies_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#list_server_tls_policies +# +def list_server_tls_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::ListServerTlsPoliciesRequest.new -# Call the list_server_tls_policies method. -result = client.list_server_tls_policies request + # Call the list_server_tls_policies method. + result = client.list_server_tls_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkSecurity::V1beta1::ServerTlsPolicy. + p response + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_ListServerTlsPolicies_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/update_authorization_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/update_authorization_policy.rb index 1a541d390805..0c728cccda0d 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/update_authorization_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/update_authorization_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_UpdateAuthorizationPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#update_authorization_policy +# +def update_authorization_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::UpdateAuthorizationPolicyRequest.new -# Call the update_authorization_policy method. -result = client.update_authorization_policy request + # Call the update_authorization_policy method. + result = client.update_authorization_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_UpdateAuthorizationPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/update_client_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/update_client_tls_policy.rb index d56bea932d77..63001469d108 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/update_client_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/update_client_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_UpdateClientTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#update_client_tls_policy +# +def update_client_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::UpdateClientTlsPolicyRequest.new -# Call the update_client_tls_policy method. -result = client.update_client_tls_policy request + # Call the update_client_tls_policy method. + result = client.update_client_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_UpdateClientTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/network_security/update_server_tls_policy.rb b/google-cloud-network_security-v1beta1/snippets/network_security/update_server_tls_policy.rb index 4c5b401a1b20..bd2be8137717 100755 --- a/google-cloud-network_security-v1beta1/snippets/network_security/update_server_tls_policy.rb +++ b/google-cloud-network_security-v1beta1/snippets/network_security/update_server_tls_policy.rb @@ -19,22 +19,28 @@ # [START networksecurity_v1beta1_generated_NetworkSecurity_UpdateServerTlsPolicy_sync] require "google/cloud/network_security/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client#update_server_tls_policy +# +def update_server_tls_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkSecurity::V1beta1::NetworkSecurity::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkSecurity::V1beta1::UpdateServerTlsPolicyRequest.new -# Call the update_server_tls_policy method. -result = client.update_server_tls_policy request + # Call the update_server_tls_policy method. + result = client.update_server_tls_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END networksecurity_v1beta1_generated_NetworkSecurity_UpdateServerTlsPolicy_sync] diff --git a/google-cloud-network_security-v1beta1/snippets/snippet_metadata_google.cloud.networksecurity.v1beta1.json b/google-cloud-network_security-v1beta1/snippets/snippet_metadata_google.cloud.networksecurity.v1beta1.json index 80fdd06ff112..0ab0f480d457 100644 --- a/google-cloud-network_security-v1beta1/snippets/snippet_metadata_google.cloud.networksecurity.v1beta1.json +++ b/google-cloud-network_security-v1beta1/snippets/snippet_metadata_google.cloud.networksecurity.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-notebooks-v1/.rubocop.yml b/google-cloud-notebooks-v1/.rubocop.yml index 97e0a7e51bfa..f58da6a20d9d 100644 --- a/google-cloud-notebooks-v1/.rubocop.yml +++ b/google-cloud-notebooks-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-notebooks-v1.rb" diff --git a/google-cloud-notebooks-v1/snippets/Gemfile b/google-cloud-notebooks-v1/snippets/Gemfile index bccdfac6327b..7bd4a0fb6640 100644 --- a/google-cloud-notebooks-v1/snippets/Gemfile +++ b/google-cloud-notebooks-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/create_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/create_runtime.rb index b1f844a8a2aa..22e5985dd11b 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/create_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/create_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_CreateRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#create_runtime +# +def create_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::CreateRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::CreateRuntimeRequest.new -# Call the create_runtime method. -result = client.create_runtime request + # Call the create_runtime method. + result = client.create_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_CreateRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/delete_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/delete_runtime.rb index 6dad04ab4bb2..4facdfbc12ec 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/delete_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/delete_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_DeleteRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#delete_runtime +# +def delete_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::DeleteRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DeleteRuntimeRequest.new -# Call the delete_runtime method. -result = client.delete_runtime request + # Call the delete_runtime method. + result = client.delete_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_DeleteRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/get_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/get_runtime.rb index b2498e8c72ff..17635732d392 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/get_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/get_runtime.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_ManagedNotebookService_GetRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#get_runtime +# +def get_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetRuntimeRequest.new -# Call the get_runtime method. -result = client.get_runtime request + # Call the get_runtime method. + result = client.get_runtime request -# The returned object is of type Google::Cloud::Notebooks::V1::Runtime. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::Runtime. + p result +end # [END notebooks_v1_generated_ManagedNotebookService_GetRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/list_runtimes.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/list_runtimes.rb index f0049ecde4dd..6bd6885567d9 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/list_runtimes.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/list_runtimes.rb @@ -19,21 +19,27 @@ # [START notebooks_v1_generated_ManagedNotebookService_ListRuntimes_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#list_runtimes +# +def list_runtimes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ListRuntimesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ListRuntimesRequest.new -# Call the list_runtimes method. -result = client.list_runtimes request + # Call the list_runtimes method. + result = client.list_runtimes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1::Runtime. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1::Runtime. + p response + end end # [END notebooks_v1_generated_ManagedNotebookService_ListRuntimes_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/refresh_runtime_token_internal.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/refresh_runtime_token_internal.rb index c922127d62dc..76b2a042710a 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/refresh_runtime_token_internal.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/refresh_runtime_token_internal.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_ManagedNotebookService_RefreshRuntimeTokenInternal_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#refresh_runtime_token_internal +# +def refresh_runtime_token_internal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest.new -# Call the refresh_runtime_token_internal method. -result = client.refresh_runtime_token_internal request + # Call the refresh_runtime_token_internal method. + result = client.refresh_runtime_token_internal request -# The returned object is of type Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse. + p result +end # [END notebooks_v1_generated_ManagedNotebookService_RefreshRuntimeTokenInternal_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/report_runtime_event.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/report_runtime_event.rb index 300c5eb88eb3..11a5ac76c6cf 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/report_runtime_event.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/report_runtime_event.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_ReportRuntimeEvent_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#report_runtime_event +# +def report_runtime_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest.new -# Call the report_runtime_event method. -result = client.report_runtime_event request + # Call the report_runtime_event method. + result = client.report_runtime_event request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_ReportRuntimeEvent_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/reset_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/reset_runtime.rb index 38b45c8ed6d2..5518f9ec228a 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/reset_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/reset_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_ResetRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#reset_runtime +# +def reset_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ResetRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ResetRuntimeRequest.new -# Call the reset_runtime method. -result = client.reset_runtime request + # Call the reset_runtime method. + result = client.reset_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_ResetRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/start_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/start_runtime.rb index 8bd3253288e9..423bdc3c1374 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/start_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/start_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_StartRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#start_runtime +# +def start_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::StartRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::StartRuntimeRequest.new -# Call the start_runtime method. -result = client.start_runtime request + # Call the start_runtime method. + result = client.start_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_StartRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/stop_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/stop_runtime.rb index 5f841babdaca..a0dcf70872c2 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/stop_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/stop_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_StopRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#stop_runtime +# +def stop_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::StopRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::StopRuntimeRequest.new -# Call the stop_runtime method. -result = client.stop_runtime request + # Call the stop_runtime method. + result = client.stop_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_StopRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/switch_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/switch_runtime.rb index 2d527e85b69c..17a5f361800a 100644 --- a/google-cloud-notebooks-v1/snippets/managed_notebook_service/switch_runtime.rb +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/switch_runtime.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_ManagedNotebookService_SwitchRuntime_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#switch_runtime +# +def switch_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::SwitchRuntimeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::SwitchRuntimeRequest.new -# Call the switch_runtime method. -result = client.switch_runtime request + # Call the switch_runtime method. + result = client.switch_runtime request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_ManagedNotebookService_SwitchRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/create_environment.rb b/google-cloud-notebooks-v1/snippets/notebook_service/create_environment.rb index 55cb23b147af..30e852561221 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/create_environment.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/create_environment.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_CreateEnvironment_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_CreateEnvironment_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/create_execution.rb b/google-cloud-notebooks-v1/snippets/notebook_service/create_execution.rb index 209310bdb06e..570d6e7193a6 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/create_execution.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/create_execution.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_CreateExecution_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#create_execution +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::CreateExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::CreateExecutionRequest.new -# Call the create_execution method. -result = client.create_execution request + # Call the create_execution method. + result = client.create_execution request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_CreateExecution_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/create_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/create_instance.rb index edf223b5fd90..90374b88afad 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/create_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/create_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_CreateInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_CreateInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/create_schedule.rb b/google-cloud-notebooks-v1/snippets/notebook_service/create_schedule.rb index 1521b21d13e2..21775774341e 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/create_schedule.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/create_schedule.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_CreateSchedule_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#create_schedule +# +def create_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::CreateScheduleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::CreateScheduleRequest.new -# Call the create_schedule method. -result = client.create_schedule request + # Call the create_schedule method. + result = client.create_schedule request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_CreateSchedule_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/delete_environment.rb b/google-cloud-notebooks-v1/snippets/notebook_service/delete_environment.rb index 238d659585a5..e2d224bdcf21 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/delete_environment.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/delete_environment.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_DeleteEnvironment_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_DeleteEnvironment_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/delete_execution.rb b/google-cloud-notebooks-v1/snippets/notebook_service/delete_execution.rb index 6a5c300071d0..edb265e148ca 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/delete_execution.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/delete_execution.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_DeleteExecution_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#delete_execution +# +def delete_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::DeleteExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DeleteExecutionRequest.new -# Call the delete_execution method. -result = client.delete_execution request + # Call the delete_execution method. + result = client.delete_execution request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_DeleteExecution_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/delete_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/delete_instance.rb index 009747f0938a..b3a31d20f21f 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/delete_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/delete_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_DeleteInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_DeleteInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/delete_schedule.rb b/google-cloud-notebooks-v1/snippets/notebook_service/delete_schedule.rb index 9b7d1e5d0214..060d4256062b 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/delete_schedule.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/delete_schedule.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_DeleteSchedule_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#delete_schedule +# +def delete_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::DeleteScheduleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DeleteScheduleRequest.new -# Call the delete_schedule method. -result = client.delete_schedule request + # Call the delete_schedule method. + result = client.delete_schedule request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_DeleteSchedule_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/get_environment.rb b/google-cloud-notebooks-v1/snippets/notebook_service/get_environment.rb index 7928fe82ee47..9d2cdf0c7494 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/get_environment.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/get_environment.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_GetEnvironment_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Notebooks::V1::Environment. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::Environment. + p result +end # [END notebooks_v1_generated_NotebookService_GetEnvironment_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/get_execution.rb b/google-cloud-notebooks-v1/snippets/notebook_service/get_execution.rb index e8ab1b5eac9c..16fed1c058e8 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/get_execution.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/get_execution.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_GetExecution_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#get_execution +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetExecutionRequest.new -# Call the get_execution method. -result = client.get_execution request + # Call the get_execution method. + result = client.get_execution request -# The returned object is of type Google::Cloud::Notebooks::V1::Execution. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::Execution. + p result +end # [END notebooks_v1_generated_NotebookService_GetExecution_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/get_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/get_instance.rb index 22c11c317c55..fb3d0bd5e740 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/get_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/get_instance.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_GetInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Notebooks::V1::Instance. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::Instance. + p result +end # [END notebooks_v1_generated_NotebookService_GetInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/get_instance_health.rb b/google-cloud-notebooks-v1/snippets/notebook_service/get_instance_health.rb index e84d0231ee41..6a0f085dd403 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/get_instance_health.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/get_instance_health.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_GetInstanceHealth_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#get_instance_health +# +def get_instance_health + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetInstanceHealthRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetInstanceHealthRequest.new -# Call the get_instance_health method. -result = client.get_instance_health request + # Call the get_instance_health method. + result = client.get_instance_health request -# The returned object is of type Google::Cloud::Notebooks::V1::GetInstanceHealthResponse. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::GetInstanceHealthResponse. + p result +end # [END notebooks_v1_generated_NotebookService_GetInstanceHealth_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/get_schedule.rb b/google-cloud-notebooks-v1/snippets/notebook_service/get_schedule.rb index bf1103fdb448..2075ddf2b8f0 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/get_schedule.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/get_schedule.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_GetSchedule_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#get_schedule +# +def get_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::GetScheduleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::GetScheduleRequest.new -# Call the get_schedule method. -result = client.get_schedule request + # Call the get_schedule method. + result = client.get_schedule request -# The returned object is of type Google::Cloud::Notebooks::V1::Schedule. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::Schedule. + p result +end # [END notebooks_v1_generated_NotebookService_GetSchedule_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/is_instance_upgradeable.rb b/google-cloud-notebooks-v1/snippets/notebook_service/is_instance_upgradeable.rb index f5f0eceb873f..7c2b6e8a2c2a 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/is_instance_upgradeable.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/is_instance_upgradeable.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_IsInstanceUpgradeable_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#is_instance_upgradeable +# +def is_instance_upgradeable + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::IsInstanceUpgradeableRequest.new -# Call the is_instance_upgradeable method. -result = client.is_instance_upgradeable request + # Call the is_instance_upgradeable method. + result = client.is_instance_upgradeable request -# The returned object is of type Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::IsInstanceUpgradeableResponse. + p result +end # [END notebooks_v1_generated_NotebookService_IsInstanceUpgradeable_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/list_environments.rb b/google-cloud-notebooks-v1/snippets/notebook_service/list_environments.rb index 5656d869b86c..9f9183d32e10 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/list_environments.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/list_environments.rb @@ -19,21 +19,27 @@ # [START notebooks_v1_generated_NotebookService_ListEnvironments_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1::Environment. + p response + end end # [END notebooks_v1_generated_NotebookService_ListEnvironments_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/list_executions.rb b/google-cloud-notebooks-v1/snippets/notebook_service/list_executions.rb index 128430d62f3f..236179313c4e 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/list_executions.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/list_executions.rb @@ -19,21 +19,27 @@ # [START notebooks_v1_generated_NotebookService_ListExecutions_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#list_executions +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ListExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ListExecutionsRequest.new -# Call the list_executions method. -result = client.list_executions request + # Call the list_executions method. + result = client.list_executions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1::Execution. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1::Execution. + p response + end end # [END notebooks_v1_generated_NotebookService_ListExecutions_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/list_instances.rb b/google-cloud-notebooks-v1/snippets/notebook_service/list_instances.rb index cfad2ca2e04c..09ee2da5d39b 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/list_instances.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/list_instances.rb @@ -19,21 +19,27 @@ # [START notebooks_v1_generated_NotebookService_ListInstances_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1::Instance. + p response + end end # [END notebooks_v1_generated_NotebookService_ListInstances_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/list_schedules.rb b/google-cloud-notebooks-v1/snippets/notebook_service/list_schedules.rb index ece3c49d3f40..a650a0d34d38 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/list_schedules.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/list_schedules.rb @@ -19,21 +19,27 @@ # [START notebooks_v1_generated_NotebookService_ListSchedules_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#list_schedules +# +def list_schedules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ListSchedulesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ListSchedulesRequest.new -# Call the list_schedules method. -result = client.list_schedules request + # Call the list_schedules method. + result = client.list_schedules request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1::Schedule. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1::Schedule. + p response + end end # [END notebooks_v1_generated_NotebookService_ListSchedules_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/register_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/register_instance.rb index 4c158abdd763..c1b1342f8484 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/register_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/register_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_RegisterInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#register_instance +# +def register_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::RegisterInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::RegisterInstanceRequest.new -# Call the register_instance method. -result = client.register_instance request + # Call the register_instance method. + result = client.register_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_RegisterInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/report_instance_info.rb b/google-cloud-notebooks-v1/snippets/notebook_service/report_instance_info.rb index eabf10758974..71c4abcdf539 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/report_instance_info.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/report_instance_info.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_ReportInstanceInfo_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#report_instance_info +# +def report_instance_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ReportInstanceInfoRequest.new -# Call the report_instance_info method. -result = client.report_instance_info request + # Call the report_instance_info method. + result = client.report_instance_info request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_ReportInstanceInfo_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/reset_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/reset_instance.rb index c95738997f7f..731260293de3 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/reset_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/reset_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_ResetInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#reset_instance +# +def reset_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::ResetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::ResetInstanceRequest.new -# Call the reset_instance method. -result = client.reset_instance request + # Call the reset_instance method. + result = client.reset_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_ResetInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/rollback_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/rollback_instance.rb index ab2ceb63cdcb..161adfa0c1a0 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/rollback_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/rollback_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_RollbackInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#rollback_instance +# +def rollback_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::RollbackInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::RollbackInstanceRequest.new -# Call the rollback_instance method. -result = client.rollback_instance request + # Call the rollback_instance method. + result = client.rollback_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_RollbackInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_accelerator.rb b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_accelerator.rb index cbe89708bc22..94a5dc556d1e 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_accelerator.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_accelerator.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_SetInstanceAccelerator_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#set_instance_accelerator +# +def set_instance_accelerator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::SetInstanceAcceleratorRequest.new -# Call the set_instance_accelerator method. -result = client.set_instance_accelerator request + # Call the set_instance_accelerator method. + result = client.set_instance_accelerator request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_SetInstanceAccelerator_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_labels.rb b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_labels.rb index 7f0161e23336..574a80a9760c 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_labels.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_labels.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_SetInstanceLabels_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#set_instance_labels +# +def set_instance_labels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::SetInstanceLabelsRequest.new -# Call the set_instance_labels method. -result = client.set_instance_labels request + # Call the set_instance_labels method. + result = client.set_instance_labels request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_SetInstanceLabels_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_machine_type.rb b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_machine_type.rb index 0e95cb2b5710..461499010e2e 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_machine_type.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/set_instance_machine_type.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_SetInstanceMachineType_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#set_instance_machine_type +# +def set_instance_machine_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::SetInstanceMachineTypeRequest.new -# Call the set_instance_machine_type method. -result = client.set_instance_machine_type request + # Call the set_instance_machine_type method. + result = client.set_instance_machine_type request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_SetInstanceMachineType_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/start_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/start_instance.rb index e647fab4bf7f..37f2267b9b69 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/start_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/start_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_StartInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#start_instance +# +def start_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::StartInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::StartInstanceRequest.new -# Call the start_instance method. -result = client.start_instance request + # Call the start_instance method. + result = client.start_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_StartInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/stop_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/stop_instance.rb index 57917fd6965a..66f0e363f5b3 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/stop_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/stop_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_StopInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#stop_instance +# +def stop_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::StopInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::StopInstanceRequest.new -# Call the stop_instance method. -result = client.stop_instance request + # Call the stop_instance method. + result = client.stop_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_StopInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/trigger_schedule.rb b/google-cloud-notebooks-v1/snippets/notebook_service/trigger_schedule.rb index 867b0d74dbb1..671aad05517f 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/trigger_schedule.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/trigger_schedule.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_TriggerSchedule_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#trigger_schedule +# +def trigger_schedule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::TriggerScheduleRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::TriggerScheduleRequest.new -# Call the trigger_schedule method. -result = client.trigger_schedule request + # Call the trigger_schedule method. + result = client.trigger_schedule request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_TriggerSchedule_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_config.rb b/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_config.rb index 2914876ba957..ce197a0e393e 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_config.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_config.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_UpdateInstanceConfig_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#update_instance_config +# +def update_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpdateInstanceConfigRequest.new -# Call the update_instance_config method. -result = client.update_instance_config request + # Call the update_instance_config method. + result = client.update_instance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_UpdateInstanceConfig_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_metadata_items.rb b/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_metadata_items.rb index 493da9d019f5..d037e17eaf32 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_metadata_items.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/update_instance_metadata_items.rb @@ -19,15 +19,21 @@ # [START notebooks_v1_generated_NotebookService_UpdateInstanceMetadataItems_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#update_instance_metadata_items +# +def update_instance_metadata_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsRequest.new -# Call the update_instance_metadata_items method. -result = client.update_instance_metadata_items request + # Call the update_instance_metadata_items method. + result = client.update_instance_metadata_items request -# The returned object is of type Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse. -p result + # The returned object is of type Google::Cloud::Notebooks::V1::UpdateInstanceMetadataItemsResponse. + p result +end # [END notebooks_v1_generated_NotebookService_UpdateInstanceMetadataItems_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/update_shielded_instance_config.rb b/google-cloud-notebooks-v1/snippets/notebook_service/update_shielded_instance_config.rb index e618cb1dda85..636b5615b7d3 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/update_shielded_instance_config.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/update_shielded_instance_config.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_UpdateShieldedInstanceConfig_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#update_shielded_instance_config +# +def update_shielded_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpdateShieldedInstanceConfigRequest.new -# Call the update_shielded_instance_config method. -result = client.update_shielded_instance_config request + # Call the update_shielded_instance_config method. + result = client.update_shielded_instance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_UpdateShieldedInstanceConfig_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance.rb index 4d4498b98c13..90d6345b49cf 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_UpgradeInstance_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#upgrade_instance +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::UpgradeInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpgradeInstanceRequest.new -# Call the upgrade_instance method. -result = client.upgrade_instance request + # Call the upgrade_instance method. + result = client.upgrade_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_UpgradeInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance_internal.rb b/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance_internal.rb index 87572a46143a..7db60deaf3b6 100644 --- a/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance_internal.rb +++ b/google-cloud-notebooks-v1/snippets/notebook_service/upgrade_instance_internal.rb @@ -19,22 +19,28 @@ # [START notebooks_v1_generated_NotebookService_UpgradeInstanceInternal_sync] require "google/cloud/notebooks/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#upgrade_instance_internal +# +def upgrade_instance_internal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest.new -# Call the upgrade_instance_internal method. -result = client.upgrade_instance_internal request + # Call the upgrade_instance_internal method. + result = client.upgrade_instance_internal request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1_generated_NotebookService_UpgradeInstanceInternal_sync] diff --git a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json index a760e20cb2cf..ccd67521ff78 100644 --- a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json +++ b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-notebooks-v1beta1/.rubocop.yml b/google-cloud-notebooks-v1beta1/.rubocop.yml index 114aeb5e489c..ff6df987da85 100644 --- a/google-cloud-notebooks-v1beta1/.rubocop.yml +++ b/google-cloud-notebooks-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-notebooks-v1beta1.rb" diff --git a/google-cloud-notebooks-v1beta1/snippets/Gemfile b/google-cloud-notebooks-v1beta1/snippets/Gemfile index eb6309fe9afc..df05cd9e316f 100755 --- a/google-cloud-notebooks-v1beta1/snippets/Gemfile +++ b/google-cloud-notebooks-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_environment.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_environment.rb index 368b0f80e151..bcbda81dddf6 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_environment.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_environment.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_CreateEnvironment_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_CreateEnvironment_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_instance.rb index e2b2acbf9e24..63a199c96500 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/create_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_CreateInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_CreateInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_environment.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_environment.rb index b1f5361bb181..dd36aabd1201 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_environment.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_environment.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_DeleteEnvironment_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_DeleteEnvironment_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_instance.rb index f0b958621419..820eac734284 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/delete_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_DeleteInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_DeleteInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_environment.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_environment.rb index eb4f111898e5..eff80600c823 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_environment.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_environment.rb @@ -19,15 +19,21 @@ # [START notebooks_v1beta1_generated_NotebookService_GetEnvironment_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Notebooks::V1beta1::Environment. -p result + # The returned object is of type Google::Cloud::Notebooks::V1beta1::Environment. + p result +end # [END notebooks_v1beta1_generated_NotebookService_GetEnvironment_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_instance.rb index 360b62fd01dc..b1a8b0383762 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/get_instance.rb @@ -19,15 +19,21 @@ # [START notebooks_v1beta1_generated_NotebookService_GetInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Notebooks::V1beta1::Instance. -p result + # The returned object is of type Google::Cloud::Notebooks::V1beta1::Instance. + p result +end # [END notebooks_v1beta1_generated_NotebookService_GetInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/is_instance_upgradeable.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/is_instance_upgradeable.rb index 12edf9376a94..d19d8a2080d3 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/is_instance_upgradeable.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/is_instance_upgradeable.rb @@ -19,15 +19,21 @@ # [START notebooks_v1beta1_generated_NotebookService_IsInstanceUpgradeable_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#is_instance_upgradeable +# +def is_instance_upgradeable + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableRequest.new -# Call the is_instance_upgradeable method. -result = client.is_instance_upgradeable request + # Call the is_instance_upgradeable method. + result = client.is_instance_upgradeable request -# The returned object is of type Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse. -p result + # The returned object is of type Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse. + p result +end # [END notebooks_v1beta1_generated_NotebookService_IsInstanceUpgradeable_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_environments.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_environments.rb index 67f0a5a4d6b0..6527d829afab 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_environments.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_environments.rb @@ -19,21 +19,27 @@ # [START notebooks_v1beta1_generated_NotebookService_ListEnvironments_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Environment. + p response + end end # [END notebooks_v1beta1_generated_NotebookService_ListEnvironments_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_instances.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_instances.rb index d0b543e92332..a5d7a4ab15f1 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_instances.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/list_instances.rb @@ -19,21 +19,27 @@ # [START notebooks_v1beta1_generated_NotebookService_ListInstances_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Notebooks::V1beta1::Instance. + p response + end end # [END notebooks_v1beta1_generated_NotebookService_ListInstances_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/register_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/register_instance.rb index 77a7f7af7a52..76fc28986799 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/register_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/register_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_RegisterInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#register_instance +# +def register_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::RegisterInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::RegisterInstanceRequest.new -# Call the register_instance method. -result = client.register_instance request + # Call the register_instance method. + result = client.register_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_RegisterInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/report_instance_info.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/report_instance_info.rb index a7bf8c92d961..18f5d9d3d099 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/report_instance_info.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/report_instance_info.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_ReportInstanceInfo_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#report_instance_info +# +def report_instance_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::ReportInstanceInfoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::ReportInstanceInfoRequest.new -# Call the report_instance_info method. -result = client.report_instance_info request + # Call the report_instance_info method. + result = client.report_instance_info request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_ReportInstanceInfo_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/reset_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/reset_instance.rb index 58db40bfbb0e..dd8acf5f5aa7 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/reset_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/reset_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_ResetInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#reset_instance +# +def reset_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::ResetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::ResetInstanceRequest.new -# Call the reset_instance method. -result = client.reset_instance request + # Call the reset_instance method. + result = client.reset_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_ResetInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_accelerator.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_accelerator.rb index e1bb41ce966d..bd9f57761fd6 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_accelerator.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_accelerator.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_SetInstanceAccelerator_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#set_instance_accelerator +# +def set_instance_accelerator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::SetInstanceAcceleratorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::SetInstanceAcceleratorRequest.new -# Call the set_instance_accelerator method. -result = client.set_instance_accelerator request + # Call the set_instance_accelerator method. + result = client.set_instance_accelerator request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_SetInstanceAccelerator_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_labels.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_labels.rb index 431a174b7baa..4b32d1766919 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_labels.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_labels.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_SetInstanceLabels_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#set_instance_labels +# +def set_instance_labels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::SetInstanceLabelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::SetInstanceLabelsRequest.new -# Call the set_instance_labels method. -result = client.set_instance_labels request + # Call the set_instance_labels method. + result = client.set_instance_labels request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_SetInstanceLabels_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_machine_type.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_machine_type.rb index 011e35400659..0bb48c7fc019 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_machine_type.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/set_instance_machine_type.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_SetInstanceMachineType_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#set_instance_machine_type +# +def set_instance_machine_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::SetInstanceMachineTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::SetInstanceMachineTypeRequest.new -# Call the set_instance_machine_type method. -result = client.set_instance_machine_type request + # Call the set_instance_machine_type method. + result = client.set_instance_machine_type request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_SetInstanceMachineType_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/start_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/start_instance.rb index e0abbe259856..0a51df5faf59 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/start_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/start_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_StartInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#start_instance +# +def start_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::StartInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::StartInstanceRequest.new -# Call the start_instance method. -result = client.start_instance request + # Call the start_instance method. + result = client.start_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_StartInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/stop_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/stop_instance.rb index c4e2d6473103..9eb4f4942419 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/stop_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/stop_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_StopInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#stop_instance +# +def stop_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::StopInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::StopInstanceRequest.new -# Call the stop_instance method. -result = client.stop_instance request + # Call the stop_instance method. + result = client.stop_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_StopInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance.rb index 1e51edcff18b..842ce4526f4a 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_UpgradeInstance_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#upgrade_instance +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceRequest.new -# Call the upgrade_instance method. -result = client.upgrade_instance request + # Call the upgrade_instance method. + result = client.upgrade_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_UpgradeInstance_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance_internal.rb b/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance_internal.rb index 16599e949539..0ee2ef1c4863 100755 --- a/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance_internal.rb +++ b/google-cloud-notebooks-v1beta1/snippets/notebook_service/upgrade_instance_internal.rb @@ -19,22 +19,28 @@ # [START notebooks_v1beta1_generated_NotebookService_UpgradeInstanceInternal_sync] require "google/cloud/notebooks/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1beta1::NotebookService::Client#upgrade_instance_internal +# +def upgrade_instance_internal + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1beta1::NotebookService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceInternalRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1beta1::UpgradeInstanceInternalRequest.new -# Call the upgrade_instance_internal method. -result = client.upgrade_instance_internal request + # Call the upgrade_instance_internal method. + result = client.upgrade_instance_internal request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END notebooks_v1beta1_generated_NotebookService_UpgradeInstanceInternal_sync] diff --git a/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json b/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json index 2a3ca8741053..aebe0bb806f2 100644 --- a/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json +++ b/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-optimization-v1/.rubocop.yml b/google-cloud-optimization-v1/.rubocop.yml index 2f36a21f95ef..54149478330d 100644 --- a/google-cloud-optimization-v1/.rubocop.yml +++ b/google-cloud-optimization-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-optimization-v1.rb" diff --git a/google-cloud-optimization-v1/snippets/Gemfile b/google-cloud-optimization-v1/snippets/Gemfile index 4daa04b309ea..84185f2f4f80 100644 --- a/google-cloud-optimization-v1/snippets/Gemfile +++ b/google-cloud-optimization-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-optimization-v1/snippets/fleet_routing/batch_optimize_tours.rb b/google-cloud-optimization-v1/snippets/fleet_routing/batch_optimize_tours.rb index 8488f09928b5..1ed295685589 100644 --- a/google-cloud-optimization-v1/snippets/fleet_routing/batch_optimize_tours.rb +++ b/google-cloud-optimization-v1/snippets/fleet_routing/batch_optimize_tours.rb @@ -19,22 +19,28 @@ # [START cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_sync] require "google/cloud/optimization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Optimization::V1::FleetRouting::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Optimization::V1::FleetRouting::Client#batch_optimize_tours +# +def batch_optimize_tours + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Optimization::V1::FleetRouting::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Optimization::V1::BatchOptimizeToursRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Optimization::V1::BatchOptimizeToursRequest.new -# Call the batch_optimize_tours method. -result = client.batch_optimize_tours request + # Call the batch_optimize_tours method. + result = client.batch_optimize_tours request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudoptimization_v1_generated_FleetRouting_BatchOptimizeTours_sync] diff --git a/google-cloud-optimization-v1/snippets/fleet_routing/optimize_tours.rb b/google-cloud-optimization-v1/snippets/fleet_routing/optimize_tours.rb index 777b3c6462ea..122e1a1b63f3 100644 --- a/google-cloud-optimization-v1/snippets/fleet_routing/optimize_tours.rb +++ b/google-cloud-optimization-v1/snippets/fleet_routing/optimize_tours.rb @@ -19,15 +19,21 @@ # [START cloudoptimization_v1_generated_FleetRouting_OptimizeTours_sync] require "google/cloud/optimization/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Optimization::V1::FleetRouting::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Optimization::V1::FleetRouting::Client#optimize_tours +# +def optimize_tours + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Optimization::V1::FleetRouting::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Optimization::V1::OptimizeToursRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Optimization::V1::OptimizeToursRequest.new -# Call the optimize_tours method. -result = client.optimize_tours request + # Call the optimize_tours method. + result = client.optimize_tours request -# The returned object is of type Google::Cloud::Optimization::V1::OptimizeToursResponse. -p result + # The returned object is of type Google::Cloud::Optimization::V1::OptimizeToursResponse. + p result +end # [END cloudoptimization_v1_generated_FleetRouting_OptimizeTours_sync] diff --git a/google-cloud-optimization-v1/snippets/snippet_metadata_google.cloud.optimization.v1.json b/google-cloud-optimization-v1/snippets/snippet_metadata_google.cloud.optimization.v1.json index 93bfb509ec97..890cb7fba0d9 100644 --- a/google-cloud-optimization-v1/snippets/snippet_metadata_google.cloud.optimization.v1.json +++ b/google-cloud-optimization-v1/snippets/snippet_metadata_google.cloud.optimization.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-orchestration-airflow-service-v1/.rubocop.yml b/google-cloud-orchestration-airflow-service-v1/.rubocop.yml index bd28ed524eb1..1bfc4a324b6d 100644 --- a/google-cloud-orchestration-airflow-service-v1/.rubocop.yml +++ b/google-cloud-orchestration-airflow-service-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-orchestration-airflow-service-v1.rb" diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/Gemfile b/google-cloud-orchestration-airflow-service-v1/snippets/Gemfile index e18c184f3aa1..80cefb3ed624 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/Gemfile +++ b/google-cloud-orchestration-airflow-service-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/environments/create_environment.rb b/google-cloud-orchestration-airflow-service-v1/snippets/environments/create_environment.rb index d5df6d50a823..63cefe006b1d 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/environments/create_environment.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/environments/create_environment.rb @@ -19,22 +19,28 @@ # [START composer_v1_generated_Environments_CreateEnvironment_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client#create_environment +# +def create_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest.new -# Call the create_environment method. -result = client.create_environment request + # Call the create_environment method. + result = client.create_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END composer_v1_generated_Environments_CreateEnvironment_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/environments/delete_environment.rb b/google-cloud-orchestration-airflow-service-v1/snippets/environments/delete_environment.rb index 047167815f96..56df42140c44 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/environments/delete_environment.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/environments/delete_environment.rb @@ -19,22 +19,28 @@ # [START composer_v1_generated_Environments_DeleteEnvironment_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client#delete_environment +# +def delete_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest.new -# Call the delete_environment method. -result = client.delete_environment request + # Call the delete_environment method. + result = client.delete_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END composer_v1_generated_Environments_DeleteEnvironment_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/environments/get_environment.rb b/google-cloud-orchestration-airflow-service-v1/snippets/environments/get_environment.rb index 7157be7a6ddd..f8b125306588 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/environments/get_environment.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/environments/get_environment.rb @@ -19,15 +19,21 @@ # [START composer_v1_generated_Environments_GetEnvironment_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::Environment. -p result + # The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::Environment. + p result +end # [END composer_v1_generated_Environments_GetEnvironment_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/environments/list_environments.rb b/google-cloud-orchestration-airflow-service-v1/snippets/environments/list_environments.rb index 4f1a045e497d..b0877601e4a3 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/environments/list_environments.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/environments/list_environments.rb @@ -19,21 +19,27 @@ # [START composer_v1_generated_Environments_ListEnvironments_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client#list_environments +# +def list_environments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest.new -# Call the list_environments method. -result = client.list_environments request + # Call the list_environments method. + result = client.list_environments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment. + p response + end end # [END composer_v1_generated_Environments_ListEnvironments_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/environments/update_environment.rb b/google-cloud-orchestration-airflow-service-v1/snippets/environments/update_environment.rb index 2e951b0fff0d..f82f61d9aaa0 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/environments/update_environment.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/environments/update_environment.rb @@ -19,22 +19,28 @@ # [START composer_v1_generated_Environments_UpdateEnvironment_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client#update_environment +# +def update_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest.new -# Call the update_environment method. -result = client.update_environment request + # Call the update_environment method. + result = client.update_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END composer_v1_generated_Environments_UpdateEnvironment_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/image_versions/list_image_versions.rb b/google-cloud-orchestration-airflow-service-v1/snippets/image_versions/list_image_versions.rb index 0f87641a21f8..1638f83fada8 100755 --- a/google-cloud-orchestration-airflow-service-v1/snippets/image_versions/list_image_versions.rb +++ b/google-cloud-orchestration-airflow-service-v1/snippets/image_versions/list_image_versions.rb @@ -19,21 +19,27 @@ # [START composer_v1_generated_ImageVersions_ListImageVersions_sync] require "google/cloud/orchestration/airflow/service/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Client#list_image_versions +# +def list_image_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Orchestration::Airflow::Service::V1::ListImageVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Orchestration::Airflow::Service::V1::ListImageVersionsRequest.new -# Call the list_image_versions method. -result = client.list_image_versions request + # Call the list_image_versions method. + result = client.list_image_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersion. + p response + end end # [END composer_v1_generated_ImageVersions_ListImageVersions_sync] diff --git a/google-cloud-orchestration-airflow-service-v1/snippets/snippet_metadata_google.cloud.orchestration.airflow.service.v1.json b/google-cloud-orchestration-airflow-service-v1/snippets/snippet_metadata_google.cloud.orchestration.airflow.service.v1.json index 5cbbded71f0a..5efef5064b1c 100644 --- a/google-cloud-orchestration-airflow-service-v1/snippets/snippet_metadata_google.cloud.orchestration.airflow.service.v1.json +++ b/google-cloud-orchestration-airflow-service-v1/snippets/snippet_metadata_google.cloud.orchestration.airflow.service.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-org_policy-v2/.rubocop.yml b/google-cloud-org_policy-v2/.rubocop.yml index 13b63d2f505f..b55b52787a0d 100644 --- a/google-cloud-org_policy-v2/.rubocop.yml +++ b/google-cloud-org_policy-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-org_policy-v2.rb" diff --git a/google-cloud-org_policy-v2/snippets/Gemfile b/google-cloud-org_policy-v2/snippets/Gemfile index 2eb4f110da78..cf9a399bac54 100755 --- a/google-cloud-org_policy-v2/snippets/Gemfile +++ b/google-cloud-org_policy-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-org_policy-v2/snippets/org_policy/create_policy.rb b/google-cloud-org_policy-v2/snippets/org_policy/create_policy.rb index 9717651a3684..c230e2fe46f6 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/create_policy.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/create_policy.rb @@ -19,15 +19,21 @@ # [START orgpolicy_v2_generated_OrgPolicy_CreatePolicy_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#create_policy +# +def create_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::CreatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::CreatePolicyRequest.new -# Call the create_policy method. -result = client.create_policy request + # Call the create_policy method. + result = client.create_policy request -# The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. -p result + # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. + p result +end # [END orgpolicy_v2_generated_OrgPolicy_CreatePolicy_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/delete_policy.rb b/google-cloud-org_policy-v2/snippets/org_policy/delete_policy.rb index 2fe951b4e5cc..c35edc3089b9 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/delete_policy.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/delete_policy.rb @@ -19,15 +19,21 @@ # [START orgpolicy_v2_generated_OrgPolicy_DeletePolicy_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#delete_policy +# +def delete_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::DeletePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::DeletePolicyRequest.new -# Call the delete_policy method. -result = client.delete_policy request + # Call the delete_policy method. + result = client.delete_policy request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END orgpolicy_v2_generated_OrgPolicy_DeletePolicy_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/get_effective_policy.rb b/google-cloud-org_policy-v2/snippets/org_policy/get_effective_policy.rb index 014c699a52ea..9214ed56b1b9 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/get_effective_policy.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/get_effective_policy.rb @@ -19,15 +19,21 @@ # [START orgpolicy_v2_generated_OrgPolicy_GetEffectivePolicy_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#get_effective_policy +# +def get_effective_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::GetEffectivePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::GetEffectivePolicyRequest.new -# Call the get_effective_policy method. -result = client.get_effective_policy request + # Call the get_effective_policy method. + result = client.get_effective_policy request -# The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. -p result + # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. + p result +end # [END orgpolicy_v2_generated_OrgPolicy_GetEffectivePolicy_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/get_policy.rb b/google-cloud-org_policy-v2/snippets/org_policy/get_policy.rb index 5b40e22313b7..25573e44587c 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/get_policy.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/get_policy.rb @@ -19,15 +19,21 @@ # [START orgpolicy_v2_generated_OrgPolicy_GetPolicy_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#get_policy +# +def get_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::GetPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::GetPolicyRequest.new -# Call the get_policy method. -result = client.get_policy request + # Call the get_policy method. + result = client.get_policy request -# The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. -p result + # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. + p result +end # [END orgpolicy_v2_generated_OrgPolicy_GetPolicy_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/list_constraints.rb b/google-cloud-org_policy-v2/snippets/org_policy/list_constraints.rb index c1b6fda3c41e..fde9327b867c 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/list_constraints.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/list_constraints.rb @@ -19,21 +19,27 @@ # [START orgpolicy_v2_generated_OrgPolicy_ListConstraints_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#list_constraints +# +def list_constraints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::ListConstraintsRequest.new -# Call the list_constraints method. -result = client.list_constraints request + # Call the list_constraints method. + result = client.list_constraints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OrgPolicy::V2::Constraint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OrgPolicy::V2::Constraint. + p response + end end # [END orgpolicy_v2_generated_OrgPolicy_ListConstraints_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/list_policies.rb b/google-cloud-org_policy-v2/snippets/org_policy/list_policies.rb index 30dff6cb93d0..9aa33419e388 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/list_policies.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/list_policies.rb @@ -19,21 +19,27 @@ # [START orgpolicy_v2_generated_OrgPolicy_ListPolicies_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#list_policies +# +def list_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::ListPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::ListPoliciesRequest.new -# Call the list_policies method. -result = client.list_policies request + # Call the list_policies method. + result = client.list_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OrgPolicy::V2::Policy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OrgPolicy::V2::Policy. + p response + end end # [END orgpolicy_v2_generated_OrgPolicy_ListPolicies_sync] diff --git a/google-cloud-org_policy-v2/snippets/org_policy/update_policy.rb b/google-cloud-org_policy-v2/snippets/org_policy/update_policy.rb index 815da34ed424..9fda27990a05 100755 --- a/google-cloud-org_policy-v2/snippets/org_policy/update_policy.rb +++ b/google-cloud-org_policy-v2/snippets/org_policy/update_policy.rb @@ -19,15 +19,21 @@ # [START orgpolicy_v2_generated_OrgPolicy_UpdatePolicy_sync] require "google/cloud/org_policy/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OrgPolicy::V2::OrgPolicy::Client#update_policy +# +def update_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OrgPolicy::V2::OrgPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OrgPolicy::V2::UpdatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OrgPolicy::V2::UpdatePolicyRequest.new -# Call the update_policy method. -result = client.update_policy request + # Call the update_policy method. + result = client.update_policy request -# The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. -p result + # The returned object is of type Google::Cloud::OrgPolicy::V2::Policy. + p result +end # [END orgpolicy_v2_generated_OrgPolicy_UpdatePolicy_sync] diff --git a/google-cloud-org_policy-v2/snippets/snippet_metadata_google.cloud.orgpolicy.v2.json b/google-cloud-org_policy-v2/snippets/snippet_metadata_google.cloud.orgpolicy.v2.json index 965992218c56..52f2e49bd68f 100644 --- a/google-cloud-org_policy-v2/snippets/snippet_metadata_google.cloud.orgpolicy.v2.json +++ b/google-cloud-org_policy-v2/snippets/snippet_metadata_google.cloud.orgpolicy.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-os_config-v1/.rubocop.yml b/google-cloud-os_config-v1/.rubocop.yml index 17e80f6de9f7..4661986876bc 100644 --- a/google-cloud-os_config-v1/.rubocop.yml +++ b/google-cloud-os_config-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-os_config-v1.rb" diff --git a/google-cloud-os_config-v1/snippets/Gemfile b/google-cloud-os_config-v1/snippets/Gemfile index 2896a766ffc4..e9346e8bb87c 100755 --- a/google-cloud-os_config-v1/snippets/Gemfile +++ b/google-cloud-os_config-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-os_config-v1/snippets/os_config_service/cancel_patch_job.rb b/google-cloud-os_config-v1/snippets/os_config_service/cancel_patch_job.rb index e34f9f487634..571e017b8d06 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/cancel_patch_job.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/cancel_patch_job.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_CancelPatchJob_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#cancel_patch_job +# +def cancel_patch_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::CancelPatchJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::CancelPatchJobRequest.new -# Call the cancel_patch_job method. -result = client.cancel_patch_job request + # Call the cancel_patch_job method. + result = client.cancel_patch_job request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. + p result +end # [END osconfig_v1_generated_OsConfigService_CancelPatchJob_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/create_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/create_patch_deployment.rb index 22f8aed3bc1c..239cabe4a164 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/create_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/create_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_CreatePatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#create_patch_deployment +# +def create_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::CreatePatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::CreatePatchDeploymentRequest.new -# Call the create_patch_deployment method. -result = client.create_patch_deployment request + # Call the create_patch_deployment method. + result = client.create_patch_deployment request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. + p result +end # [END osconfig_v1_generated_OsConfigService_CreatePatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/delete_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/delete_patch_deployment.rb index 528988dd3852..3805adee788d 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/delete_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/delete_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_DeletePatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#delete_patch_deployment +# +def delete_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::DeletePatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::DeletePatchDeploymentRequest.new -# Call the delete_patch_deployment method. -result = client.delete_patch_deployment request + # Call the delete_patch_deployment method. + result = client.delete_patch_deployment request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END osconfig_v1_generated_OsConfigService_DeletePatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/execute_patch_job.rb b/google-cloud-os_config-v1/snippets/os_config_service/execute_patch_job.rb index ee3e639cdd10..2fafee2aba4a 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/execute_patch_job.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/execute_patch_job.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_ExecutePatchJob_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#execute_patch_job +# +def execute_patch_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ExecutePatchJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ExecutePatchJobRequest.new -# Call the execute_patch_job method. -result = client.execute_patch_job request + # Call the execute_patch_job method. + result = client.execute_patch_job request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. + p result +end # [END osconfig_v1_generated_OsConfigService_ExecutePatchJob_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/get_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/get_patch_deployment.rb index 275f69a5f617..934ac2782851 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/get_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/get_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_GetPatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#get_patch_deployment +# +def get_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetPatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetPatchDeploymentRequest.new -# Call the get_patch_deployment method. -result = client.get_patch_deployment request + # Call the get_patch_deployment method. + result = client.get_patch_deployment request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. + p result +end # [END osconfig_v1_generated_OsConfigService_GetPatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/get_patch_job.rb b/google-cloud-os_config-v1/snippets/os_config_service/get_patch_job.rb index 2d6781b5c07e..006b82d9c6a5 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/get_patch_job.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/get_patch_job.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_GetPatchJob_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#get_patch_job +# +def get_patch_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetPatchJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetPatchJobRequest.new -# Call the get_patch_job method. -result = client.get_patch_job request + # Call the get_patch_job method. + result = client.get_patch_job request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchJob. + p result +end # [END osconfig_v1_generated_OsConfigService_GetPatchJob_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_deployments.rb b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_deployments.rb index 0343d6cdcb2e..9cc55ef4280c 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_deployments.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_deployments.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigService_ListPatchDeployments_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#list_patch_deployments +# +def list_patch_deployments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListPatchDeploymentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListPatchDeploymentsRequest.new -# Call the list_patch_deployments method. -result = client.list_patch_deployments request + # Call the list_patch_deployments method. + result = client.list_patch_deployments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::PatchDeployment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::PatchDeployment. + p response + end end # [END osconfig_v1_generated_OsConfigService_ListPatchDeployments_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_job_instance_details.rb b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_job_instance_details.rb index fa28d99b1a0b..5d4acfb1a8da 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_job_instance_details.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_job_instance_details.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#list_patch_job_instance_details +# +def list_patch_job_instance_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListPatchJobInstanceDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListPatchJobInstanceDetailsRequest.new -# Call the list_patch_job_instance_details method. -result = client.list_patch_job_instance_details request + # Call the list_patch_job_instance_details method. + result = client.list_patch_job_instance_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::PatchJobInstanceDetails. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::PatchJobInstanceDetails. + p response + end end # [END osconfig_v1_generated_OsConfigService_ListPatchJobInstanceDetails_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_jobs.rb b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_jobs.rb index 10b2510c786a..7313068baffb 100755 --- a/google-cloud-os_config-v1/snippets/os_config_service/list_patch_jobs.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/list_patch_jobs.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigService_ListPatchJobs_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#list_patch_jobs +# +def list_patch_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListPatchJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListPatchJobsRequest.new -# Call the list_patch_jobs method. -result = client.list_patch_jobs request + # Call the list_patch_jobs method. + result = client.list_patch_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::PatchJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::PatchJob. + p response + end end # [END osconfig_v1_generated_OsConfigService_ListPatchJobs_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/pause_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/pause_patch_deployment.rb index c56262fe0f0e..c0db4d5ed411 100644 --- a/google-cloud-os_config-v1/snippets/os_config_service/pause_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/pause_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_PausePatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#pause_patch_deployment +# +def pause_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::PausePatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::PausePatchDeploymentRequest.new -# Call the pause_patch_deployment method. -result = client.pause_patch_deployment request + # Call the pause_patch_deployment method. + result = client.pause_patch_deployment request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. + p result +end # [END osconfig_v1_generated_OsConfigService_PausePatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/resume_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/resume_patch_deployment.rb index 7e1dc85a7e5f..b100fbc6acd9 100644 --- a/google-cloud-os_config-v1/snippets/os_config_service/resume_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/resume_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_ResumePatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#resume_patch_deployment +# +def resume_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ResumePatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ResumePatchDeploymentRequest.new -# Call the resume_patch_deployment method. -result = client.resume_patch_deployment request + # Call the resume_patch_deployment method. + result = client.resume_patch_deployment request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. + p result +end # [END osconfig_v1_generated_OsConfigService_ResumePatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_service/update_patch_deployment.rb b/google-cloud-os_config-v1/snippets/os_config_service/update_patch_deployment.rb index 3d5909ac10d0..a216154b4367 100644 --- a/google-cloud-os_config-v1/snippets/os_config_service/update_patch_deployment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_service/update_patch_deployment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigService::Client#update_patch_deployment +# +def update_patch_deployment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::UpdatePatchDeploymentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::UpdatePatchDeploymentRequest.new -# Call the update_patch_deployment method. -result = client.update_patch_deployment request + # Call the update_patch_deployment method. + result = client.update_patch_deployment request -# The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::PatchDeployment. + p result +end # [END osconfig_v1_generated_OsConfigService_UpdatePatchDeployment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/create_os_policy_assignment.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/create_os_policy_assignment.rb index d4b5ae748f1a..21a349a91f70 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/create_os_policy_assignment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/create_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#create_os_policy_assignment +# +def create_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::CreateOSPolicyAssignmentRequest.new -# Call the create_os_policy_assignment method. -result = client.create_os_policy_assignment request + # Call the create_os_policy_assignment method. + result = client.create_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/delete_os_policy_assignment.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/delete_os_policy_assignment.rb index 7fa9159efe6a..e34a99943ee0 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/delete_os_policy_assignment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/delete_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#delete_os_policy_assignment +# +def delete_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::DeleteOSPolicyAssignmentRequest.new -# Call the delete_os_policy_assignment method. -result = client.delete_os_policy_assignment request + # Call the delete_os_policy_assignment method. + result = client.delete_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_inventory.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_inventory.rb index 64cd2ba4263a..f5f93164551d 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_inventory.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_inventory.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigZonalService_GetInventory_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#get_inventory +# +def get_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetInventoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetInventoryRequest.new -# Call the get_inventory method. -result = client.get_inventory request + # Call the get_inventory method. + result = client.get_inventory request -# The returned object is of type Google::Cloud::OsConfig::V1::Inventory. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::Inventory. + p result +end # [END osconfig_v1_generated_OsConfigZonalService_GetInventory_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment.rb index 09ad4eefae72..570d5f1c4cbd 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#get_os_policy_assignment +# +def get_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentRequest.new -# Call the get_os_policy_assignment method. -result = client.get_os_policy_assignment request + # Call the get_os_policy_assignment method. + result = client.get_os_policy_assignment request -# The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignment. + p result +end # [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb index 546d74d84ce8..f0123fa62ae6 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#get_os_policy_assignment_report +# +def get_os_policy_assignment_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetOSPolicyAssignmentReportRequest.new -# Call the get_os_policy_assignment_report method. -result = client.get_os_policy_assignment_report request + # Call the get_os_policy_assignment_report method. + result = client.get_os_policy_assignment_report request -# The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport. + p result +end # [END osconfig_v1_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_vulnerability_report.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_vulnerability_report.rb index 2fc690215911..d1a825157079 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_vulnerability_report.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/get_vulnerability_report.rb @@ -19,15 +19,21 @@ # [START osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#get_vulnerability_report +# +def get_vulnerability_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::GetVulnerabilityReportRequest.new -# Call the get_vulnerability_report method. -result = client.get_vulnerability_report request + # Call the get_vulnerability_report method. + result = client.get_vulnerability_report request -# The returned object is of type Google::Cloud::OsConfig::V1::VulnerabilityReport. -p result + # The returned object is of type Google::Cloud::OsConfig::V1::VulnerabilityReport. + p result +end # [END osconfig_v1_generated_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_inventories.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_inventories.rb index fcde528dbfe3..ec404d05c6c8 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_inventories.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_inventories.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigZonalService_ListInventories_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#list_inventories +# +def list_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListInventoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListInventoriesRequest.new -# Call the list_inventories method. -result = client.list_inventories request + # Call the list_inventories method. + result = client.list_inventories request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::Inventory. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::Inventory. + p response + end end # [END osconfig_v1_generated_OsConfigZonalService_ListInventories_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb index bede659854b5..a4b3f3f57d5a 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#list_os_policy_assignment_reports +# +def list_os_policy_assignment_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentReportsRequest.new -# Call the list_os_policy_assignment_reports method. -result = client.list_os_policy_assignment_reports request + # Call the list_os_policy_assignment_reports method. + result = client.list_os_policy_assignment_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignmentReport. + p response + end end # [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb index b9fa7f9c6fb6..930ef78ab946 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#list_os_policy_assignment_revisions +# +def list_os_policy_assignment_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentRevisionsRequest.new -# Call the list_os_policy_assignment_revisions method. -result = client.list_os_policy_assignment_revisions request + # Call the list_os_policy_assignment_revisions method. + result = client.list_os_policy_assignment_revisions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment. + p response + end end # [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignments.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignments.rb index 1af90db64d17..4c77fb22ba91 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignments.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_os_policy_assignments.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#list_os_policy_assignments +# +def list_os_policy_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListOSPolicyAssignmentsRequest.new -# Call the list_os_policy_assignments method. -result = client.list_os_policy_assignments request + # Call the list_os_policy_assignments method. + result = client.list_os_policy_assignments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::OSPolicyAssignment. + p response + end end # [END osconfig_v1_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_vulnerability_reports.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_vulnerability_reports.rb index b5099bf43fbe..96d1ae388bb2 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_vulnerability_reports.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/list_vulnerability_reports.rb @@ -19,21 +19,27 @@ # [START osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#list_vulnerability_reports +# +def list_vulnerability_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::ListVulnerabilityReportsRequest.new -# Call the list_vulnerability_reports method. -result = client.list_vulnerability_reports request + # Call the list_vulnerability_reports method. + result = client.list_vulnerability_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1::VulnerabilityReport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1::VulnerabilityReport. + p response + end end # [END osconfig_v1_generated_OsConfigZonalService_ListVulnerabilityReports_sync] diff --git a/google-cloud-os_config-v1/snippets/os_config_zonal_service/update_os_policy_assignment.rb b/google-cloud-os_config-v1/snippets/os_config_zonal_service/update_os_policy_assignment.rb index 23d70144a84e..ba6b0d5d47b6 100755 --- a/google-cloud-os_config-v1/snippets/os_config_zonal_service/update_os_policy_assignment.rb +++ b/google-cloud-os_config-v1/snippets/os_config_zonal_service/update_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] require "google/cloud/os_config/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1::OsConfigZonalService::Client#update_os_policy_assignment +# +def update_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1::UpdateOSPolicyAssignmentRequest.new -# Call the update_os_policy_assignment method. -result = client.update_os_policy_assignment request + # Call the update_os_policy_assignment method. + result = client.update_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1/snippets/snippet_metadata_google.cloud.osconfig.v1.json b/google-cloud-os_config-v1/snippets/snippet_metadata_google.cloud.osconfig.v1.json index 8802e1f35782..09f49a249ff5 100644 --- a/google-cloud-os_config-v1/snippets/snippet_metadata_google.cloud.osconfig.v1.json +++ b/google-cloud-os_config-v1/snippets/snippet_metadata_google.cloud.osconfig.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-os_config-v1alpha/.rubocop.yml b/google-cloud-os_config-v1alpha/.rubocop.yml index f4fce61927e4..bd7232da783b 100644 --- a/google-cloud-os_config-v1alpha/.rubocop.yml +++ b/google-cloud-os_config-v1alpha/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-os_config-v1alpha.rb" diff --git a/google-cloud-os_config-v1alpha/snippets/Gemfile b/google-cloud-os_config-v1alpha/snippets/Gemfile index 3858e5f6e916..e45928820bdb 100755 --- a/google-cloud-os_config-v1alpha/snippets/Gemfile +++ b/google-cloud-os_config-v1alpha/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/create_os_policy_assignment.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/create_os_policy_assignment.rb index ef2cbf6c9862..096131f08209 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/create_os_policy_assignment.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/create_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#create_os_policy_assignment +# +def create_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::CreateOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::CreateOSPolicyAssignmentRequest.new -# Call the create_os_policy_assignment method. -result = client.create_os_policy_assignment request + # Call the create_os_policy_assignment method. + result = client.create_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_CreateOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/delete_os_policy_assignment.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/delete_os_policy_assignment.rb index 5f9e74b58d19..b16bfbb51de0 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/delete_os_policy_assignment.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/delete_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#delete_os_policy_assignment +# +def delete_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::DeleteOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::DeleteOSPolicyAssignmentRequest.new -# Call the delete_os_policy_assignment method. -result = client.delete_os_policy_assignment request + # Call the delete_os_policy_assignment method. + result = client.delete_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_DeleteOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_instance_os_policies_compliance.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_instance_os_policies_compliance.rb index eef2097a456a..c2677c23f24a 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_instance_os_policies_compliance.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_instance_os_policies_compliance.rb @@ -19,15 +19,21 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#get_instance_os_policies_compliance +# +def get_instance_os_policies_compliance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::GetInstanceOSPoliciesComplianceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::GetInstanceOSPoliciesComplianceRequest.new -# Call the get_instance_os_policies_compliance method. -result = client.get_instance_os_policies_compliance request + # Call the get_instance_os_policies_compliance method. + result = client.get_instance_os_policies_compliance request -# The returned object is of type Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance. -p result + # The returned object is of type Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance. + p result +end # [END osconfig_v1alpha_generated_OsConfigZonalService_GetInstanceOSPoliciesCompliance_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_inventory.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_inventory.rb index d996dead668c..ca259c7d4b2e 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_inventory.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_inventory.rb @@ -19,15 +19,21 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#get_inventory +# +def get_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::GetInventoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::GetInventoryRequest.new -# Call the get_inventory method. -result = client.get_inventory request + # Call the get_inventory method. + result = client.get_inventory request -# The returned object is of type Google::Cloud::OsConfig::V1alpha::Inventory. -p result + # The returned object is of type Google::Cloud::OsConfig::V1alpha::Inventory. + p result +end # [END osconfig_v1alpha_generated_OsConfigZonalService_GetInventory_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment.rb index 048db3d5186c..fb417b58af76 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment.rb @@ -19,15 +19,21 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#get_os_policy_assignment +# +def get_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::GetOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::GetOSPolicyAssignmentRequest.new -# Call the get_os_policy_assignment method. -result = client.get_os_policy_assignment request + # Call the get_os_policy_assignment method. + result = client.get_os_policy_assignment request -# The returned object is of type Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. -p result + # The returned object is of type Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. + p result +end # [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb index 1cf9b0dc4a8b..1b6c22cfdc01 100644 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_os_policy_assignment_report.rb @@ -19,15 +19,21 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#get_os_policy_assignment_report +# +def get_os_policy_assignment_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::GetOSPolicyAssignmentReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::GetOSPolicyAssignmentReportRequest.new -# Call the get_os_policy_assignment_report method. -result = client.get_os_policy_assignment_report request + # Call the get_os_policy_assignment_report method. + result = client.get_os_policy_assignment_report request -# The returned object is of type Google::Cloud::OsConfig::V1alpha::OSPolicyAssignmentReport. -p result + # The returned object is of type Google::Cloud::OsConfig::V1alpha::OSPolicyAssignmentReport. + p result +end # [END osconfig_v1alpha_generated_OsConfigZonalService_GetOSPolicyAssignmentReport_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_vulnerability_report.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_vulnerability_report.rb index 4cc5402ab410..00265bce1268 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_vulnerability_report.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/get_vulnerability_report.rb @@ -19,15 +19,21 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#get_vulnerability_report +# +def get_vulnerability_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::GetVulnerabilityReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::GetVulnerabilityReportRequest.new -# Call the get_vulnerability_report method. -result = client.get_vulnerability_report request + # Call the get_vulnerability_report method. + result = client.get_vulnerability_report request -# The returned object is of type Google::Cloud::OsConfig::V1alpha::VulnerabilityReport. -p result + # The returned object is of type Google::Cloud::OsConfig::V1alpha::VulnerabilityReport. + p result +end # [END osconfig_v1alpha_generated_OsConfigZonalService_GetVulnerabilityReport_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_instance_os_policies_compliances.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_instance_os_policies_compliances.rb index a086206a83bf..f00972cbc691 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_instance_os_policies_compliances.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_instance_os_policies_compliances.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_instance_os_policies_compliances +# +def list_instance_os_policies_compliances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListInstanceOSPoliciesCompliancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListInstanceOSPoliciesCompliancesRequest.new -# Call the list_instance_os_policies_compliances method. -result = client.list_instance_os_policies_compliances request + # Call the list_instance_os_policies_compliances method. + result = client.list_instance_os_policies_compliances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::InstanceOSPoliciesCompliance. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListInstanceOSPoliciesCompliances_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_inventories.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_inventories.rb index a23e5d42f799..fb2160c7cc7b 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_inventories.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_inventories.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_inventories +# +def list_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListInventoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListInventoriesRequest.new -# Call the list_inventories method. -result = client.list_inventories request + # Call the list_inventories method. + result = client.list_inventories request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::Inventory. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::Inventory. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListInventories_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb index 1c8b6eed424b..3c67bc60d11f 100644 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_reports.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_os_policy_assignment_reports +# +def list_os_policy_assignment_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentReportsRequest.new -# Call the list_os_policy_assignment_reports method. -result = client.list_os_policy_assignment_reports request + # Call the list_os_policy_assignment_reports method. + result = client.list_os_policy_assignment_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignmentReport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignmentReport. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentReports_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb index 3cd782e76af1..62f0e994ffa1 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignment_revisions.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_os_policy_assignment_revisions +# +def list_os_policy_assignment_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentRevisionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentRevisionsRequest.new -# Call the list_os_policy_assignment_revisions method. -result = client.list_os_policy_assignment_revisions request + # Call the list_os_policy_assignment_revisions method. + result = client.list_os_policy_assignment_revisions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignmentRevisions_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignments.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignments.rb index 6296eaed0c6a..46717f7134f3 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignments.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_os_policy_assignments.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_os_policy_assignments +# +def list_os_policy_assignments + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListOSPolicyAssignmentsRequest.new -# Call the list_os_policy_assignments method. -result = client.list_os_policy_assignments request + # Call the list_os_policy_assignments method. + result = client.list_os_policy_assignments request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::OSPolicyAssignment. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListOSPolicyAssignments_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_vulnerability_reports.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_vulnerability_reports.rb index 3fa36c8554b2..bfa210a90380 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_vulnerability_reports.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/list_vulnerability_reports.rb @@ -19,21 +19,27 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#list_vulnerability_reports +# +def list_vulnerability_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::ListVulnerabilityReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::ListVulnerabilityReportsRequest.new -# Call the list_vulnerability_reports method. -result = client.list_vulnerability_reports request + # Call the list_vulnerability_reports method. + result = client.list_vulnerability_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::OsConfig::V1alpha::VulnerabilityReport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::OsConfig::V1alpha::VulnerabilityReport. + p response + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_ListVulnerabilityReports_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/update_os_policy_assignment.rb b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/update_os_policy_assignment.rb index cfefa877ef45..18cd023c9f1d 100755 --- a/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/update_os_policy_assignment.rb +++ b/google-cloud-os_config-v1alpha/snippets/os_config_zonal_service/update_os_policy_assignment.rb @@ -19,22 +19,28 @@ # [START osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] require "google/cloud/os_config/v1alpha" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client#update_os_policy_assignment +# +def update_os_policy_assignment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsConfig::V1alpha::OsConfigZonalService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsConfig::V1alpha::UpdateOSPolicyAssignmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsConfig::V1alpha::UpdateOSPolicyAssignmentRequest.new -# Call the update_os_policy_assignment method. -result = client.update_os_policy_assignment request + # Call the update_os_policy_assignment method. + result = client.update_os_policy_assignment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END osconfig_v1alpha_generated_OsConfigZonalService_UpdateOSPolicyAssignment_sync] diff --git a/google-cloud-os_config-v1alpha/snippets/snippet_metadata_google.cloud.osconfig.v1alpha.json b/google-cloud-os_config-v1alpha/snippets/snippet_metadata_google.cloud.osconfig.v1alpha.json index 496c9612d420..78836b6b6f69 100644 --- a/google-cloud-os_config-v1alpha/snippets/snippet_metadata_google.cloud.osconfig.v1alpha.json +++ b/google-cloud-os_config-v1alpha/snippets/snippet_metadata_google.cloud.osconfig.v1alpha.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-os_login-v1/.rubocop.yml b/google-cloud-os_login-v1/.rubocop.yml index 653d226d1395..ae081f669341 100644 --- a/google-cloud-os_login-v1/.rubocop.yml +++ b/google-cloud-os_login-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-os_login-v1.rb" diff --git a/google-cloud-os_login-v1/snippets/Gemfile b/google-cloud-os_login-v1/snippets/Gemfile index 6be594aefbe1..d8a8559bef73 100755 --- a/google-cloud-os_login-v1/snippets/Gemfile +++ b/google-cloud-os_login-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-os_login-v1/snippets/os_login_service/delete_posix_account.rb b/google-cloud-os_login-v1/snippets/os_login_service/delete_posix_account.rb index 7fc5a8018083..4804805b4ce4 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/delete_posix_account.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/delete_posix_account.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_DeletePosixAccount_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#delete_posix_account +# +def delete_posix_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::DeletePosixAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::DeletePosixAccountRequest.new -# Call the delete_posix_account method. -result = client.delete_posix_account request + # Call the delete_posix_account method. + result = client.delete_posix_account request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END oslogin_v1_generated_OsLoginService_DeletePosixAccount_sync] diff --git a/google-cloud-os_login-v1/snippets/os_login_service/delete_ssh_public_key.rb b/google-cloud-os_login-v1/snippets/os_login_service/delete_ssh_public_key.rb index b4a71dd4aa76..2c5f8cac9d67 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/delete_ssh_public_key.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/delete_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#delete_ssh_public_key +# +def delete_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::DeleteSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::DeleteSshPublicKeyRequest.new -# Call the delete_ssh_public_key method. -result = client.delete_ssh_public_key request + # Call the delete_ssh_public_key method. + result = client.delete_ssh_public_key request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END oslogin_v1_generated_OsLoginService_DeleteSshPublicKey_sync] diff --git a/google-cloud-os_login-v1/snippets/os_login_service/get_login_profile.rb b/google-cloud-os_login-v1/snippets/os_login_service/get_login_profile.rb index 0a3d31a6ffe3..f1cb068b0d7c 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/get_login_profile.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/get_login_profile.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_GetLoginProfile_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#get_login_profile +# +def get_login_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::GetLoginProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::GetLoginProfileRequest.new -# Call the get_login_profile method. -result = client.get_login_profile request + # Call the get_login_profile method. + result = client.get_login_profile request -# The returned object is of type Google::Cloud::OsLogin::V1::LoginProfile. -p result + # The returned object is of type Google::Cloud::OsLogin::V1::LoginProfile. + p result +end # [END oslogin_v1_generated_OsLoginService_GetLoginProfile_sync] diff --git a/google-cloud-os_login-v1/snippets/os_login_service/get_ssh_public_key.rb b/google-cloud-os_login-v1/snippets/os_login_service/get_ssh_public_key.rb index e015c0454602..806f48064384 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/get_ssh_public_key.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/get_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_GetSshPublicKey_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#get_ssh_public_key +# +def get_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::GetSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::GetSshPublicKeyRequest.new -# Call the get_ssh_public_key method. -result = client.get_ssh_public_key request + # Call the get_ssh_public_key method. + result = client.get_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. -p result + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end # [END oslogin_v1_generated_OsLoginService_GetSshPublicKey_sync] diff --git a/google-cloud-os_login-v1/snippets/os_login_service/import_ssh_public_key.rb b/google-cloud-os_login-v1/snippets/os_login_service/import_ssh_public_key.rb index 21382662aae8..0e0826fc98c7 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/import_ssh_public_key.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/import_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_ImportSshPublicKey_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#import_ssh_public_key +# +def import_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::ImportSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::ImportSshPublicKeyRequest.new -# Call the import_ssh_public_key method. -result = client.import_ssh_public_key request + # Call the import_ssh_public_key method. + result = client.import_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::V1::ImportSshPublicKeyResponse. -p result + # The returned object is of type Google::Cloud::OsLogin::V1::ImportSshPublicKeyResponse. + p result +end # [END oslogin_v1_generated_OsLoginService_ImportSshPublicKey_sync] diff --git a/google-cloud-os_login-v1/snippets/os_login_service/update_ssh_public_key.rb b/google-cloud-os_login-v1/snippets/os_login_service/update_ssh_public_key.rb index ce504adb695a..ca4136ad4708 100755 --- a/google-cloud-os_login-v1/snippets/os_login_service/update_ssh_public_key.rb +++ b/google-cloud-os_login-v1/snippets/os_login_service/update_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_sync] require "google/cloud/os_login/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#update_ssh_public_key +# +def update_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1::UpdateSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::UpdateSshPublicKeyRequest.new -# Call the update_ssh_public_key method. -result = client.update_ssh_public_key request + # Call the update_ssh_public_key method. + result = client.update_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. -p result + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end # [END oslogin_v1_generated_OsLoginService_UpdateSshPublicKey_sync] diff --git a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json index 32ee0170b534..3e444844773d 100644 --- a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json +++ b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-os_login-v1beta/.rubocop.yml b/google-cloud-os_login-v1beta/.rubocop.yml index 3ecd5fa12440..3ab7a924f286 100644 --- a/google-cloud-os_login-v1beta/.rubocop.yml +++ b/google-cloud-os_login-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-os_login-v1beta.rb" diff --git a/google-cloud-os_login-v1beta/snippets/Gemfile b/google-cloud-os_login-v1beta/snippets/Gemfile index cc90116c2c5a..66406f8c963b 100755 --- a/google-cloud-os_login-v1beta/snippets/Gemfile +++ b/google-cloud-os_login-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/delete_posix_account.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/delete_posix_account.rb index 166ba0c1e243..7087495e0a4d 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/delete_posix_account.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/delete_posix_account.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#delete_posix_account +# +def delete_posix_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest.new -# Call the delete_posix_account method. -result = client.delete_posix_account request + # Call the delete_posix_account method. + result = client.delete_posix_account request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_sync] diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/delete_ssh_public_key.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/delete_ssh_public_key.rb index e14d4ef45264..6e8c3b550cfc 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/delete_ssh_public_key.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/delete_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#delete_ssh_public_key +# +def delete_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::DeleteSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::DeleteSshPublicKeyRequest.new -# Call the delete_ssh_public_key method. -result = client.delete_ssh_public_key request + # Call the delete_ssh_public_key method. + result = client.delete_ssh_public_key request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END oslogin_v1beta_generated_OsLoginService_DeleteSshPublicKey_sync] diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/get_login_profile.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/get_login_profile.rb index 471fea7bdb6b..1eb0d842b17b 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/get_login_profile.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/get_login_profile.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_GetLoginProfile_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#get_login_profile +# +def get_login_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new -# Call the get_login_profile method. -result = client.get_login_profile request + # Call the get_login_profile method. + result = client.get_login_profile request -# The returned object is of type Google::Cloud::OsLogin::V1beta::LoginProfile. -p result + # The returned object is of type Google::Cloud::OsLogin::V1beta::LoginProfile. + p result +end # [END oslogin_v1beta_generated_OsLoginService_GetLoginProfile_sync] diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/get_ssh_public_key.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/get_ssh_public_key.rb index 204dc338213e..2c6a1676033a 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/get_ssh_public_key.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/get_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#get_ssh_public_key +# +def get_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::GetSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::GetSshPublicKeyRequest.new -# Call the get_ssh_public_key method. -result = client.get_ssh_public_key request + # Call the get_ssh_public_key method. + result = client.get_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. -p result + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end # [END oslogin_v1beta_generated_OsLoginService_GetSshPublicKey_sync] diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/import_ssh_public_key.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/import_ssh_public_key.rb index 50701ec5b2ad..b67e5d8ad0d8 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/import_ssh_public_key.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/import_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#import_ssh_public_key +# +def import_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new -# Call the import_ssh_public_key method. -result = client.import_ssh_public_key request + # Call the import_ssh_public_key method. + result = client.import_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse. -p result + # The returned object is of type Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse. + p result +end # [END oslogin_v1beta_generated_OsLoginService_ImportSshPublicKey_sync] diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/update_ssh_public_key.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/update_ssh_public_key.rb index ede6c1718f4a..bb096fc58603 100755 --- a/google-cloud-os_login-v1beta/snippets/os_login_service/update_ssh_public_key.rb +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/update_ssh_public_key.rb @@ -19,15 +19,21 @@ # [START oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_sync] require "google/cloud/os_login/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#update_ssh_public_key +# +def update_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::OsLogin::V1beta::UpdateSshPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::UpdateSshPublicKeyRequest.new -# Call the update_ssh_public_key method. -result = client.update_ssh_public_key request + # Call the update_ssh_public_key method. + result = client.update_ssh_public_key request -# The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. -p result + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end # [END oslogin_v1beta_generated_OsLoginService_UpdateSshPublicKey_sync] diff --git a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json index 0c75e4c96f5e..65eda8abbd6e 100644 --- a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json +++ b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-phishing_protection-v1beta1/.rubocop.yml b/google-cloud-phishing_protection-v1beta1/.rubocop.yml index 94bf99d7eabb..203615472b54 100644 --- a/google-cloud-phishing_protection-v1beta1/.rubocop.yml +++ b/google-cloud-phishing_protection-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-phishing_protection-v1beta1.rb" diff --git a/google-cloud-phishing_protection-v1beta1/snippets/Gemfile b/google-cloud-phishing_protection-v1beta1/snippets/Gemfile index 64b0d8398fa4..f15fabb28d2e 100755 --- a/google-cloud-phishing_protection-v1beta1/snippets/Gemfile +++ b/google-cloud-phishing_protection-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-phishing_protection-v1beta1/snippets/phishing_protection_service/report_phishing.rb b/google-cloud-phishing_protection-v1beta1/snippets/phishing_protection_service/report_phishing.rb index 2e8e0765ce45..2cd471bd49c3 100755 --- a/google-cloud-phishing_protection-v1beta1/snippets/phishing_protection_service/report_phishing.rb +++ b/google-cloud-phishing_protection-v1beta1/snippets/phishing_protection_service/report_phishing.rb @@ -19,15 +19,21 @@ # [START phishingprotection_v1beta1_generated_PhishingProtectionService_ReportPhishing_sync] require "google/cloud/phishing_protection/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client#report_phishing +# +def report_phishing + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest.new -# Call the report_phishing method. -result = client.report_phishing request + # Call the report_phishing method. + result = client.report_phishing request -# The returned object is of type Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse. -p result + # The returned object is of type Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse. + p result +end # [END phishingprotection_v1beta1_generated_PhishingProtectionService_ReportPhishing_sync] diff --git a/google-cloud-phishing_protection-v1beta1/snippets/snippet_metadata_google.cloud.phishingprotection.v1beta1.json b/google-cloud-phishing_protection-v1beta1/snippets/snippet_metadata_google.cloud.phishingprotection.v1beta1.json index bfdd143f800c..87ba2492ed6d 100644 --- a/google-cloud-phishing_protection-v1beta1/snippets/snippet_metadata_google.cloud.phishingprotection.v1beta1.json +++ b/google-cloud-phishing_protection-v1beta1/snippets/snippet_metadata_google.cloud.phishingprotection.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-policy_troubleshooter-v1/.rubocop.yml b/google-cloud-policy_troubleshooter-v1/.rubocop.yml index 4d4ffa42e62d..ac23e0ef14cf 100644 --- a/google-cloud-policy_troubleshooter-v1/.rubocop.yml +++ b/google-cloud-policy_troubleshooter-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-policy_troubleshooter-v1.rb" diff --git a/google-cloud-policy_troubleshooter-v1/snippets/Gemfile b/google-cloud-policy_troubleshooter-v1/snippets/Gemfile index 01aecc2413b2..e1af92405fa9 100755 --- a/google-cloud-policy_troubleshooter-v1/snippets/Gemfile +++ b/google-cloud-policy_troubleshooter-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb b/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb index dcc4d6f6a3a6..3e1b152a91e3 100755 --- a/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb +++ b/google-cloud-policy_troubleshooter-v1/snippets/iam_checker/troubleshoot_iam_policy.rb @@ -19,15 +19,21 @@ # [START policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] require "google/cloud/policy_troubleshooter/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client#troubleshoot_iam_policy +# +def troubleshoot_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PolicyTroubleshooter::V1::IamChecker::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyRequest.new -# Call the troubleshoot_iam_policy method. -result = client.troubleshoot_iam_policy request + # Call the troubleshoot_iam_policy method. + result = client.troubleshoot_iam_policy request -# The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. -p result + # The returned object is of type Google::Cloud::PolicyTroubleshooter::V1::TroubleshootIamPolicyResponse. + p result +end # [END policytroubleshooter_v1_generated_IamChecker_TroubleshootIamPolicy_sync] diff --git a/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json b/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json index 4f75a0a8d82c..960ce9da432b 100644 --- a/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json +++ b/google-cloud-policy_troubleshooter-v1/snippets/snippet_metadata_google.cloud.policytroubleshooter.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-private_catalog-v1beta1/.rubocop.yml b/google-cloud-private_catalog-v1beta1/.rubocop.yml index 2a3ce654e32f..709811bdd0ab 100644 --- a/google-cloud-private_catalog-v1beta1/.rubocop.yml +++ b/google-cloud-private_catalog-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-private_catalog-v1beta1.rb" diff --git a/google-cloud-private_catalog-v1beta1/snippets/Gemfile b/google-cloud-private_catalog-v1beta1/snippets/Gemfile index 2bdcf77a1b4a..5b9ce5a6adba 100755 --- a/google-cloud-private_catalog-v1beta1/snippets/Gemfile +++ b/google-cloud-private_catalog-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb index 35ebaeb5d4f3..aeb6e07de35b 100755 --- a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb +++ b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_catalogs.rb @@ -19,21 +19,27 @@ # [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] require "google/cloud/private_catalog/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_catalogs +# +def search_catalogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchCatalogsRequest.new -# Call the search_catalogs method. -result = client.search_catalogs request + # Call the search_catalogs method. + result = client.search_catalogs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Catalog. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Catalog. + p response + end end # [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchCatalogs_sync] diff --git a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb index b452d81d055e..75ea9738846e 100755 --- a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb +++ b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_products.rb @@ -19,21 +19,27 @@ # [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] require "google/cloud/private_catalog/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_products +# +def search_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchProductsRequest.new -# Call the search_products method. -result = client.search_products request + # Call the search_products method. + result = client.search_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Product. + p response + end end # [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchProducts_sync] diff --git a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb index 7cf54964dc92..8cff5cdbe5c3 100755 --- a/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb +++ b/google-cloud-private_catalog-v1beta1/snippets/private_catalog/search_versions.rb @@ -19,21 +19,27 @@ # [START cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] require "google/cloud/private_catalog/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client#search_versions +# +def search_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PrivateCatalog::V1beta1::PrivateCatalog::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PrivateCatalog::V1beta1::SearchVersionsRequest.new -# Call the search_versions method. -result = client.search_versions request + # Call the search_versions method. + result = client.search_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Version. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PrivateCatalog::V1beta1::Version. + p response + end end # [END cloudprivatecatalog_v1beta1_generated_PrivateCatalog_SearchVersions_sync] diff --git a/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json b/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json index 304849747c93..e22f4f52f78d 100644 --- a/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json +++ b/google-cloud-private_catalog-v1beta1/snippets/snippet_metadata_google.cloud.privatecatalog.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-profiler-v2/.rubocop.yml b/google-cloud-profiler-v2/.rubocop.yml index 0de65a634140..ffdeb25bb180 100644 --- a/google-cloud-profiler-v2/.rubocop.yml +++ b/google-cloud-profiler-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-profiler-v2.rb" diff --git a/google-cloud-profiler-v2/snippets/Gemfile b/google-cloud-profiler-v2/snippets/Gemfile index baeea65fe831..e1aa636e708a 100755 --- a/google-cloud-profiler-v2/snippets/Gemfile +++ b/google-cloud-profiler-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb b/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb index acb4acd8e7da..5498e0693317 100755 --- a/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb +++ b/google-cloud-profiler-v2/snippets/profiler_service/create_offline_profile.rb @@ -19,15 +19,21 @@ # [START cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] require "google/cloud/profiler/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Profiler::V2::ProfilerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#create_offline_profile +# +def create_offline_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new -# Call the create_offline_profile method. -result = client.create_offline_profile request + # Call the create_offline_profile method. + result = client.create_offline_profile request -# The returned object is of type Google::Cloud::Profiler::V2::Profile. -p result + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end # [END cloudprofiler_v2_generated_ProfilerService_CreateOfflineProfile_sync] diff --git a/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb b/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb index 51e40fc8e302..40d8c7773f05 100755 --- a/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb +++ b/google-cloud-profiler-v2/snippets/profiler_service/create_profile.rb @@ -19,15 +19,21 @@ # [START cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] require "google/cloud/profiler/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Profiler::V2::ProfilerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#create_profile +# +def create_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Profiler::V2::CreateProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::CreateProfileRequest.new -# Call the create_profile method. -result = client.create_profile request + # Call the create_profile method. + result = client.create_profile request -# The returned object is of type Google::Cloud::Profiler::V2::Profile. -p result + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end # [END cloudprofiler_v2_generated_ProfilerService_CreateProfile_sync] diff --git a/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb b/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb index efbc9d4f76ff..864a6e7b7324 100755 --- a/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb +++ b/google-cloud-profiler-v2/snippets/profiler_service/update_profile.rb @@ -19,15 +19,21 @@ # [START cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] require "google/cloud/profiler/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Profiler::V2::ProfilerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Profiler::V2::ProfilerService::Client#update_profile +# +def update_profile + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Profiler::V2::ProfilerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new -# Call the update_profile method. -result = client.update_profile request + # Call the update_profile method. + result = client.update_profile request -# The returned object is of type Google::Cloud::Profiler::V2::Profile. -p result + # The returned object is of type Google::Cloud::Profiler::V2::Profile. + p result +end # [END cloudprofiler_v2_generated_ProfilerService_UpdateProfile_sync] diff --git a/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json b/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json index a1d2904b90c4..5e4a79d51d3a 100644 --- a/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json +++ b/google-cloud-profiler-v2/snippets/snippet_metadata_google.devtools.cloudprofiler.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-pubsub-v1/.repo-metadata.json b/google-cloud-pubsub-v1/.repo-metadata.json index a46d1d37f328..c57c9a728e25 100644 --- a/google-cloud-pubsub-v1/.repo-metadata.json +++ b/google-cloud-pubsub-v1/.repo-metadata.json @@ -16,5 +16,5 @@ "ruby-cloud-product-url": "https://cloud.google.com/pubsub", "ruby-cloud-path-override": "pub_sub=pubsub", "ruby-cloud-namespace-override": "Pubsub=PubSub", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-pubsub-v1/.rubocop.yml b/google-cloud-pubsub-v1/.rubocop.yml index 05eff8f0b4d8..3c1a114c840b 100644 --- a/google-cloud-pubsub-v1/.rubocop.yml +++ b/google-cloud-pubsub-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-pubsub-v1.rb" diff --git a/google-cloud-pubsub-v1/snippets/Gemfile b/google-cloud-pubsub-v1/snippets/Gemfile index 6ff00c58bcd6..cd1c162c130d 100755 --- a/google-cloud-pubsub-v1/snippets/Gemfile +++ b/google-cloud-pubsub-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb b/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb index c261e1634795..511e1b2495dc 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/create_topic.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_CreateTopic_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#create_topic +# +def create_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::Topic.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::Topic.new -# Call the create_topic method. -result = client.create_topic request + # Call the create_topic method. + result = client.create_topic request -# The returned object is of type Google::Cloud::PubSub::V1::Topic. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end # [END pubsub_v1_generated_Publisher_CreateTopic_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb b/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb index c58e26255f25..bab6aadf68d5 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/delete_topic.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_DeleteTopic_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#delete_topic +# +def delete_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteTopicRequest.new -# Call the delete_topic method. -result = client.delete_topic request + # Call the delete_topic method. + result = client.delete_topic request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Publisher_DeleteTopic_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb b/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb index 0bf1f492add7..2eafdb1948be 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/detach_subscription.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_DetachSubscription_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#detach_subscription +# +def detach_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DetachSubscriptionRequest.new -# Call the detach_subscription method. -result = client.detach_subscription request + # Call the detach_subscription method. + result = client.detach_subscription request -# The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::DetachSubscriptionResponse. + p result +end # [END pubsub_v1_generated_Publisher_DetachSubscription_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb b/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb index 9e131f7d7f0e..0b5aa96590c8 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/get_topic.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_GetTopic_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#get_topic +# +def get_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::GetTopicRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetTopicRequest.new -# Call the get_topic method. -result = client.get_topic request + # Call the get_topic method. + result = client.get_topic request -# The returned object is of type Google::Cloud::PubSub::V1::Topic. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end # [END pubsub_v1_generated_Publisher_GetTopic_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb b/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb index d614263385ac..de997f8e091a 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/list_topic_snapshots.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_snapshots +# +def list_topic_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicSnapshotsRequest.new -# Call the list_topic_snapshots method. -result = client.list_topic_snapshots request + # Call the list_topic_snapshots method. + result = client.list_topic_snapshots request -# The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSnapshotsResponse. + p result +end # [END pubsub_v1_generated_Publisher_ListTopicSnapshots_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb b/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb index 3035f1ec4427..08b3828f23dc 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/list_topic_subscriptions.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topic_subscriptions +# +def list_topic_subscriptions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicSubscriptionsRequest.new -# Call the list_topic_subscriptions method. -result = client.list_topic_subscriptions request + # Call the list_topic_subscriptions method. + result = client.list_topic_subscriptions request -# The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::ListTopicSubscriptionsResponse. + p result +end # [END pubsub_v1_generated_Publisher_ListTopicSubscriptions_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb b/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb index 3a1722e7b759..7c9da22bf0f1 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/list_topics.rb @@ -19,21 +19,27 @@ # [START pubsub_v1_generated_Publisher_ListTopics_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#list_topics +# +def list_topics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListTopicsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListTopicsRequest.new -# Call the list_topics method. -result = client.list_topics request + # Call the list_topics method. + result = client.list_topics request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PubSub::V1::Topic. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PubSub::V1::Topic. + p response + end end # [END pubsub_v1_generated_Publisher_ListTopics_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/publish.rb b/google-cloud-pubsub-v1/snippets/publisher/publish.rb index eade93aa1817..14af1e5219f7 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/publish.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/publish.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_Publish_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#publish +# +def publish + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::PublishRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::PublishRequest.new -# Call the publish method. -result = client.publish request + # Call the publish method. + result = client.publish request -# The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::PublishResponse. + p result +end # [END pubsub_v1_generated_Publisher_Publish_sync] diff --git a/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb b/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb index 4168529cc14c..fba3a8cd3eaf 100755 --- a/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb +++ b/google-cloud-pubsub-v1/snippets/publisher/update_topic.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Publisher_UpdateTopic_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Publisher::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Publisher::Client#update_topic +# +def update_topic + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Publisher::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateTopicRequest.new -# Call the update_topic method. -result = client.update_topic request + # Call the update_topic method. + result = client.update_topic request -# The returned object is of type Google::Cloud::PubSub::V1::Topic. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Topic. + p result +end # [END pubsub_v1_generated_Publisher_UpdateTopic_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb b/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb index 1c1fde30238d..60de87197ce1 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/create_schema.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_SchemaService_CreateSchema_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#create_schema +# +def create_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::CreateSchemaRequest.new -# Call the create_schema method. -result = client.create_schema request + # Call the create_schema method. + result = client.create_schema request -# The returned object is of type Google::Cloud::PubSub::V1::Schema. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end # [END pubsub_v1_generated_SchemaService_CreateSchema_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb b/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb index 31845785864a..11949894bd35 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/delete_schema.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_SchemaService_DeleteSchema_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#delete_schema +# +def delete_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSchemaRequest.new -# Call the delete_schema method. -result = client.delete_schema request + # Call the delete_schema method. + result = client.delete_schema request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_SchemaService_DeleteSchema_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb b/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb index 7a84fe0cd9a8..9dcf27920565 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/get_schema.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_SchemaService_GetSchema_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#get_schema +# +def get_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::GetSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSchemaRequest.new -# Call the get_schema method. -result = client.get_schema request + # Call the get_schema method. + result = client.get_schema request -# The returned object is of type Google::Cloud::PubSub::V1::Schema. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Schema. + p result +end # [END pubsub_v1_generated_SchemaService_GetSchema_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb b/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb index b0318ffde996..daaa6af7a3a2 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/list_schemas.rb @@ -19,21 +19,27 @@ # [START pubsub_v1_generated_SchemaService_ListSchemas_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#list_schemas +# +def list_schemas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListSchemasRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSchemasRequest.new -# Call the list_schemas method. -result = client.list_schemas request + # Call the list_schemas method. + result = client.list_schemas request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PubSub::V1::Schema. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PubSub::V1::Schema. + p response + end end # [END pubsub_v1_generated_SchemaService_ListSchemas_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb b/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb index 4f24d2035f12..c1b6330953bf 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/validate_message.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_SchemaService_ValidateMessage_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#validate_message +# +def validate_message + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ValidateMessageRequest.new -# Call the validate_message method. -result = client.validate_message request + # Call the validate_message method. + result = client.validate_message request -# The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::ValidateMessageResponse. + p result +end # [END pubsub_v1_generated_SchemaService_ValidateMessage_sync] diff --git a/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb b/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb index c75a78bf60e1..5de447562f58 100755 --- a/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb +++ b/google-cloud-pubsub-v1/snippets/schema_service/validate_schema.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_SchemaService_ValidateSchema_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::SchemaService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::SchemaService::Client#validate_schema +# +def validate_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::SchemaService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ValidateSchemaRequest.new -# Call the validate_schema method. -result = client.validate_schema request + # Call the validate_schema method. + result = client.validate_schema request -# The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::ValidateSchemaResponse. + p result +end # [END pubsub_v1_generated_SchemaService_ValidateSchema_sync] diff --git a/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json b/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json index 3309d41cf675..f5ebaa31a1a8 100644 --- a/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json +++ b/google-cloud-pubsub-v1/snippets/snippet_metadata_google.pubsub.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb b/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb index 434655c1c9cb..c12f605757e9 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/acknowledge.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_Acknowledge_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#acknowledge +# +def acknowledge + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::AcknowledgeRequest.new -# Call the acknowledge method. -result = client.acknowledge request + # Call the acknowledge method. + result = client.acknowledge request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Subscriber_Acknowledge_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb b/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb index 0f12bd78134f..37853423fa5a 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/create_snapshot.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_CreateSnapshot_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#create_snapshot +# +def create_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::CreateSnapshotRequest.new -# Call the create_snapshot method. -result = client.create_snapshot request + # Call the create_snapshot method. + result = client.create_snapshot request -# The returned object is of type Google::Cloud::PubSub::V1::Snapshot. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end # [END pubsub_v1_generated_Subscriber_CreateSnapshot_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb b/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb index 79b556ad3d25..2e8d6c72ec29 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/create_subscription.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_CreateSubscription_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#create_subscription +# +def create_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::Subscription.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::Subscription.new -# Call the create_subscription method. -result = client.create_subscription request + # Call the create_subscription method. + result = client.create_subscription request -# The returned object is of type Google::Cloud::PubSub::V1::Subscription. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end # [END pubsub_v1_generated_Subscriber_CreateSubscription_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb b/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb index 3b2a31476fa5..2a526d986f01 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/delete_snapshot.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#delete_snapshot +# +def delete_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSnapshotRequest.new -# Call the delete_snapshot method. -result = client.delete_snapshot request + # Call the delete_snapshot method. + result = client.delete_snapshot request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Subscriber_DeleteSnapshot_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb b/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb index d19080e094b4..234c920ec111 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/delete_subscription.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_DeleteSubscription_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#delete_subscription +# +def delete_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::DeleteSubscriptionRequest.new -# Call the delete_subscription method. -result = client.delete_subscription request + # Call the delete_subscription method. + result = client.delete_subscription request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Subscriber_DeleteSubscription_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb b/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb index 166885f7d56b..7a5931b4c329 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/get_snapshot.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_GetSnapshot_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#get_snapshot +# +def get_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSnapshotRequest.new -# Call the get_snapshot method. -result = client.get_snapshot request + # Call the get_snapshot method. + result = client.get_snapshot request -# The returned object is of type Google::Cloud::PubSub::V1::Snapshot. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end # [END pubsub_v1_generated_Subscriber_GetSnapshot_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb b/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb index db5634adf764..b23f06f77e0f 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/get_subscription.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_GetSubscription_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#get_subscription +# +def get_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::GetSubscriptionRequest.new -# Call the get_subscription method. -result = client.get_subscription request + # Call the get_subscription method. + result = client.get_subscription request -# The returned object is of type Google::Cloud::PubSub::V1::Subscription. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end # [END pubsub_v1_generated_Subscriber_GetSubscription_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb b/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb index 8271af08a1e2..4d06ceac78d3 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/list_snapshots.rb @@ -19,21 +19,27 @@ # [START pubsub_v1_generated_Subscriber_ListSnapshots_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#list_snapshots +# +def list_snapshots + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSnapshotsRequest.new -# Call the list_snapshots method. -result = client.list_snapshots request + # Call the list_snapshots method. + result = client.list_snapshots request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PubSub::V1::Snapshot. + p response + end end # [END pubsub_v1_generated_Subscriber_ListSnapshots_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb b/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb index edaecc05f1f9..e29900d48d69 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/list_subscriptions.rb @@ -19,21 +19,27 @@ # [START pubsub_v1_generated_Subscriber_ListSubscriptions_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#list_subscriptions +# +def list_subscriptions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ListSubscriptionsRequest.new -# Call the list_subscriptions method. -result = client.list_subscriptions request + # Call the list_subscriptions method. + result = client.list_subscriptions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::PubSub::V1::Subscription. + p response + end end # [END pubsub_v1_generated_Subscriber_ListSubscriptions_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb b/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb index a38c9c445b7d..2cb14903b6ef 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/modify_ack_deadline.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#modify_ack_deadline +# +def modify_ack_deadline + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ModifyAckDeadlineRequest.new -# Call the modify_ack_deadline method. -result = client.modify_ack_deadline request + # Call the modify_ack_deadline method. + result = client.modify_ack_deadline request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Subscriber_ModifyAckDeadline_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb b/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb index d9f789cb1f8f..4dbae49e3139 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/modify_push_config.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#modify_push_config +# +def modify_push_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::ModifyPushConfigRequest.new -# Call the modify_push_config method. -result = client.modify_push_config request + # Call the modify_push_config method. + result = client.modify_push_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END pubsub_v1_generated_Subscriber_ModifyPushConfig_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/pull.rb b/google-cloud-pubsub-v1/snippets/subscriber/pull.rb index 360e5dc1bdd0..3b08d8b3ec2c 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/pull.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/pull.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_Pull_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#pull +# +def pull + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::PullRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::PullRequest.new -# Call the pull method. -result = client.pull request + # Call the pull method. + result = client.pull request -# The returned object is of type Google::Cloud::PubSub::V1::PullResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::PullResponse. + p result +end # [END pubsub_v1_generated_Subscriber_Pull_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/seek.rb b/google-cloud-pubsub-v1/snippets/subscriber/seek.rb index 94d3b8f8869d..9a0bb6e7693f 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/seek.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/seek.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_Seek_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#seek +# +def seek + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::SeekRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::SeekRequest.new -# Call the seek method. -result = client.seek request + # Call the seek method. + result = client.seek request -# The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. -p result + # The returned object is of type Google::Cloud::PubSub::V1::SeekResponse. + p result +end # [END pubsub_v1_generated_Subscriber_Seek_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb b/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb index eb3037236058..631abcd069ed 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/streaming_pull.rb @@ -19,24 +19,30 @@ # [START pubsub_v1_generated_Subscriber_StreamingPull_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_pull method to start streaming. -output = client.streaming_pull input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::PubSub::V1::StreamingPullRequest.new -input << Google::Cloud::PubSub::V1::StreamingPullRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::PubSub::V1::StreamingPullResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#streaming_pull +# +def streaming_pull + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_pull method to start streaming. + output = client.streaming_pull input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + input << Google::Cloud::PubSub::V1::StreamingPullRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::PubSub::V1::StreamingPullResponse. + output.each do |response| + p response + end end # [END pubsub_v1_generated_Subscriber_StreamingPull_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb b/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb index 723c16685221..34016dd10544 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/update_snapshot.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#update_snapshot +# +def update_snapshot + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateSnapshotRequest.new -# Call the update_snapshot method. -result = client.update_snapshot request + # Call the update_snapshot method. + result = client.update_snapshot request -# The returned object is of type Google::Cloud::PubSub::V1::Snapshot. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Snapshot. + p result +end # [END pubsub_v1_generated_Subscriber_UpdateSnapshot_sync] diff --git a/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb b/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb index 8603286775da..e812203bce20 100755 --- a/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb +++ b/google-cloud-pubsub-v1/snippets/subscriber/update_subscription.rb @@ -19,15 +19,21 @@ # [START pubsub_v1_generated_Subscriber_UpdateSubscription_sync] require "google/cloud/pubsub/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::PubSub::V1::Subscriber::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::PubSub::V1::Subscriber::Client#update_subscription +# +def update_subscription + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::PubSub::V1::Subscriber::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::PubSub::V1::UpdateSubscriptionRequest.new -# Call the update_subscription method. -result = client.update_subscription request + # Call the update_subscription method. + result = client.update_subscription request -# The returned object is of type Google::Cloud::PubSub::V1::Subscription. -p result + # The returned object is of type Google::Cloud::PubSub::V1::Subscription. + p result +end # [END pubsub_v1_generated_Subscriber_UpdateSubscription_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/.rubocop.yml b/google-cloud-recaptcha_enterprise-v1/.rubocop.yml index 407bcc2cc3e8..8ef5ef06ddf8 100644 --- a/google-cloud-recaptcha_enterprise-v1/.rubocop.yml +++ b/google-cloud-recaptcha_enterprise-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-recaptcha_enterprise-v1.rb" diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile b/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile index f40d0281ac30..ed8fb2c0d293 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile +++ b/google-cloud-recaptcha_enterprise-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb index 5378a0aed265..7355bec240af 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/annotate_assessment.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#annotate_assessment +# +def annotate_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest.new -# Call the annotate_assessment method. -result = client.annotate_assessment request + # Call the annotate_assessment method. + result = client.annotate_assessment request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb index 7c4e1292181b..2ef2a1e2e10e 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_assessment.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_assessment +# +def create_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new -# Call the create_assessment method. -result = client.create_assessment request + # Call the create_assessment method. + result = client.create_assessment request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Assessment. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb index 5ecba9338b83..1f03295d97b2 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/create_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#create_key +# +def create_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest.new -# Call the create_key method. -result = client.create_key request + # Call the create_key method. + result = client.create_key request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_CreateKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb index 51d4d50a5a23..f12d8ca03398 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/delete_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#delete_key +# +def delete_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest.new -# Call the delete_key method. -result = client.delete_key request + # Call the delete_key method. + result = client.delete_key request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_DeleteKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb index 620173562ce4..88b689c88895 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_key +# +def get_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest.new -# Call the get_key method. -result = client.get_key request + # Call the get_key method. + result = client.get_key request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb index bd86ea2941db..a8ea76809d2a 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/get_metrics.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#get_metrics +# +def get_metrics + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest.new -# Call the get_metrics method. -result = client.get_metrics request + # Call the get_metrics method. + result = client.get_metrics request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_GetMetrics_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb index a6234f93263e..fd83e0e33955 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_keys.rb @@ -19,21 +19,27 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_keys +# +def list_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest.new -# Call the list_keys method. -result = client.list_keys request + # Call the list_keys method. + result = client.list_keys request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::Key. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::Key. + p response + end end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListKeys_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb index 0051d576b790..340b45e1bf8f 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_group_memberships.rb @@ -19,21 +19,27 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_group_memberships +# +def list_related_account_group_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest.new -# Call the list_related_account_group_memberships method. -result = client.list_related_account_group_memberships request + # Call the list_related_account_group_memberships method. + result = client.list_related_account_group_memberships request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + p response + end end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroupMemberships_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb index ea5e259e62c3..5bfd518f65ae 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/list_related_account_groups.rb @@ -19,21 +19,27 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#list_related_account_groups +# +def list_related_account_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest.new -# Call the list_related_account_groups method. -result = client.list_related_account_groups request + # Call the list_related_account_groups method. + result = client.list_related_account_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup. + p response + end end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_ListRelatedAccountGroups_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb index 62c85f756cc1..f8b86f8d8c28 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/migrate_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#migrate_key +# +def migrate_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest.new -# Call the migrate_key method. -result = client.migrate_key request + # Call the migrate_key method. + result = client.migrate_key request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_MigrateKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb index e79d31b0c37e..33c8207843e0 100644 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/retrieve_legacy_secret_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#retrieve_legacy_secret_key +# +def retrieve_legacy_secret_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest.new -# Call the retrieve_legacy_secret_key method. -result = client.retrieve_legacy_secret_key request + # Call the retrieve_legacy_secret_key method. + result = client.retrieve_legacy_secret_key request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_RetrieveLegacySecretKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb index 353fa25fb64c..c4daaaea99ee 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/search_related_account_group_memberships.rb @@ -19,21 +19,27 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#search_related_account_group_memberships +# +def search_related_account_group_memberships + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest.new -# Call the search_related_account_group_memberships method. -result = client.search_related_account_group_memberships request + # Call the search_related_account_group_memberships method. + result = client.search_related_account_group_memberships request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership. + p response + end end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_SearchRelatedAccountGroupMemberships_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb index a7b2767a7cc3..e09b56480fcd 100755 --- a/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb +++ b/google-cloud-recaptcha_enterprise-v1/snippets/recaptcha_enterprise_service/update_key.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] require "google/cloud/recaptcha_enterprise/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client#update_key +# +def update_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest.new -# Call the update_key method. -result = client.update_key request + # Call the update_key method. + result = client.update_key request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Key. + p result +end # [END recaptchaenterprise_v1_generated_RecaptchaEnterpriseService_UpdateKey_sync] diff --git a/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json b/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json index 9d202432c8e9..47b5cadd4a7f 100644 --- a/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json +++ b/google-cloud-recaptcha_enterprise-v1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml b/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml index 7a923c5445f4..9a1ea4dffbc4 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml +++ b/google-cloud-recaptcha_enterprise-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-recaptcha_enterprise-v1beta1.rb" diff --git a/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile b/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile index f5f7b399222b..1b6632167eaa 100755 --- a/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile +++ b/google-cloud-recaptcha_enterprise-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb b/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb index 6981220434f5..9b5e858330a6 100755 --- a/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/annotate_assessment.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] require "google/cloud/recaptcha_enterprise/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#annotate_assessment +# +def annotate_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new -# Call the annotate_assessment method. -result = client.annotate_assessment request + # Call the annotate_assessment method. + result = client.annotate_assessment request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse. + p result +end # [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_AnnotateAssessment_sync] diff --git a/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb b/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb index e55f54828ceb..d52458d901c5 100755 --- a/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb +++ b/google-cloud-recaptcha_enterprise-v1beta1/snippets/recaptcha_enterprise_service/create_assessment.rb @@ -19,15 +19,21 @@ # [START recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] require "google/cloud/recaptcha_enterprise/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client#create_assessment +# +def create_assessment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new -# Call the create_assessment method. -result = client.create_assessment request + # Call the create_assessment method. + result = client.create_assessment request -# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. -p result + # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment. + p result +end # [END recaptchaenterprise_v1beta1_generated_RecaptchaEnterpriseService_CreateAssessment_sync] diff --git a/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json b/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json index 386dee9d1c61..74ac6f3c2cd8 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json +++ b/google-cloud-recaptcha_enterprise-v1beta1/snippets/snippet_metadata_google.cloud.recaptchaenterprise.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-recommendation_engine-v1beta1/.rubocop.yml b/google-cloud-recommendation_engine-v1beta1/.rubocop.yml index 4dcdeef1c4c7..7c6a49f34f55 100644 --- a/google-cloud-recommendation_engine-v1beta1/.rubocop.yml +++ b/google-cloud-recommendation_engine-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-recommendation_engine-v1beta1.rb" diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile b/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile index 9f22bea1a383..f1befae2e702 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile +++ b/google-cloud-recommendation_engine-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb index 731cf030cfbd..d2d776b38fce 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/create_catalog_item.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#create_catalog_item +# +def create_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new -# Call the create_catalog_item method. -result = client.create_catalog_item request + # Call the create_catalog_item method. + result = client.create_catalog_item request -# The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. -p result + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end # [END recommendationengine_v1beta1_generated_CatalogService_CreateCatalogItem_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb index 6e5bccaf762d..1cb6976d67cc 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/delete_catalog_item.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#delete_catalog_item +# +def delete_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new -# Call the delete_catalog_item method. -result = client.delete_catalog_item request + # Call the delete_catalog_item method. + result = client.delete_catalog_item request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END recommendationengine_v1beta1_generated_CatalogService_DeleteCatalogItem_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb index 8fb91121b7df..af56d602bb8c 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/get_catalog_item.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#get_catalog_item +# +def get_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new -# Call the get_catalog_item method. -result = client.get_catalog_item request + # Call the get_catalog_item method. + result = client.get_catalog_item request -# The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. -p result + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end # [END recommendationengine_v1beta1_generated_CatalogService_GetCatalogItem_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb index 78cab81e9e72..ae4db347ea38 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/import_catalog_items.rb @@ -19,22 +19,28 @@ # [START recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#import_catalog_items +# +def import_catalog_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new -# Call the import_catalog_items method. -result = client.import_catalog_items request + # Call the import_catalog_items method. + result = client.import_catalog_items request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END recommendationengine_v1beta1_generated_CatalogService_ImportCatalogItems_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb index 873686b8275a..71b5a9e29f5e 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/list_catalog_items.rb @@ -19,21 +19,27 @@ # [START recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#list_catalog_items +# +def list_catalog_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new -# Call the list_catalog_items method. -result = client.list_catalog_items request + # Call the list_catalog_items method. + result = client.list_catalog_items request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p response + end end # [END recommendationengine_v1beta1_generated_CatalogService_ListCatalogItems_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb index 92e84d8b3e2b..af133cde4c04 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/catalog_service/update_catalog_item.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client#update_catalog_item +# +def update_catalog_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new -# Call the update_catalog_item method. -result = client.update_catalog_item request + # Call the update_catalog_item method. + result = client.update_catalog_item request -# The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. -p result + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem. + p result +end # [END recommendationengine_v1beta1_generated_CatalogService_UpdateCatalogItem_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb index 4cf4ac0d2191..bb338f6984e4 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/create_prediction_api_key_registration.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#create_prediction_api_key_registration +# +def create_prediction_api_key_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new -# Call the create_prediction_api_key_registration method. -result = client.create_prediction_api_key_registration request + # Call the create_prediction_api_key_registration method. + result = client.create_prediction_api_key_registration request -# The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. -p result + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + p result +end # [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_CreatePredictionApiKeyRegistration_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb index 01d824e9ee41..61d31c245711 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/delete_prediction_api_key_registration.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#delete_prediction_api_key_registration +# +def delete_prediction_api_key_registration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new -# Call the delete_prediction_api_key_registration method. -result = client.delete_prediction_api_key_registration request + # Call the delete_prediction_api_key_registration method. + result = client.delete_prediction_api_key_registration request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_DeletePredictionApiKeyRegistration_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb index cd7220a7f29b..2ebb9eb196ca 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_api_key_registry/list_prediction_api_key_registrations.rb @@ -19,21 +19,27 @@ # [START recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client#list_prediction_api_key_registrations +# +def list_prediction_api_key_registrations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new -# Call the list_prediction_api_key_registrations method. -result = client.list_prediction_api_key_registrations request + # Call the list_prediction_api_key_registrations method. + result = client.list_prediction_api_key_registrations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration. + p response + end end # [END recommendationengine_v1beta1_generated_PredictionApiKeyRegistry_ListPredictionApiKeyRegistrations_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb index 4ad9385cb198..d3d06c966c06 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/prediction_service/predict.rb @@ -19,21 +19,27 @@ # [START recommendationengine_v1beta1_generated_PredictionService_Predict_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client#predict +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::PredictRequest.new -# Call the predict method. -result = client.predict request + # Call the predict method. + result = client.predict request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictResponse::PredictionResult. + p response + end end # [END recommendationengine_v1beta1_generated_PredictionService_Predict_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json b/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json index bf9ea4656ffd..0c2cf1dcac88 100644 --- a/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json +++ b/google-cloud-recommendation_engine-v1beta1/snippets/snippet_metadata_google.cloud.recommendationengine.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb index 46527286a3b7..7cde9b9b88bf 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/collect_user_event.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#collect_user_event +# +def collect_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::CollectUserEventRequest.new -# Call the collect_user_event method. -result = client.collect_user_event request + # Call the collect_user_event method. + result = client.collect_user_event request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END recommendationengine_v1beta1_generated_UserEventService_CollectUserEvent_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb index 6710148ac7b1..61c3b03abe87 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/import_user_events.rb @@ -19,22 +19,28 @@ # [START recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#import_user_events +# +def import_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ImportUserEventsRequest.new -# Call the import_user_events method. -result = client.import_user_events request + # Call the import_user_events method. + result = client.import_user_events request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END recommendationengine_v1beta1_generated_UserEventService_ImportUserEvents_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb index 062d3ef1351f..19b59c7f1cb3 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/list_user_events.rb @@ -19,21 +19,27 @@ # [START recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#list_user_events +# +def list_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::ListUserEventsRequest.new -# Call the list_user_events method. -result = client.list_user_events request + # Call the list_user_events method. + result = client.list_user_events request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + p response + end end # [END recommendationengine_v1beta1_generated_UserEventService_ListUserEvents_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb index 8a0541cc7707..dc320e5d75c9 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/purge_user_events.rb @@ -19,22 +19,28 @@ # [START recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#purge_user_events +# +def purge_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::PurgeUserEventsRequest.new -# Call the purge_user_events method. -result = client.purge_user_events request + # Call the purge_user_events method. + result = client.purge_user_events request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END recommendationengine_v1beta1_generated_UserEventService_PurgeUserEvents_sync] diff --git a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb index 7df261045ef8..50aee7dd2633 100755 --- a/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb +++ b/google-cloud-recommendation_engine-v1beta1/snippets/user_event_service/write_user_event.rb @@ -19,15 +19,21 @@ # [START recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] require "google/cloud/recommendation_engine/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client#write_user_event +# +def write_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::RecommendationEngine::V1beta1::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::RecommendationEngine::V1beta1::WriteUserEventRequest.new -# Call the write_user_event method. -result = client.write_user_event request + # Call the write_user_event method. + result = client.write_user_event request -# The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::UserEvent. -p result + # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::UserEvent. + p result +end # [END recommendationengine_v1beta1_generated_UserEventService_WriteUserEvent_sync] diff --git a/google-cloud-recommender-v1/.rubocop.yml b/google-cloud-recommender-v1/.rubocop.yml index d4e56874d8c7..5cc4c15130f9 100644 --- a/google-cloud-recommender-v1/.rubocop.yml +++ b/google-cloud-recommender-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-recommender-v1.rb" diff --git a/google-cloud-recommender-v1/snippets/Gemfile b/google-cloud-recommender-v1/snippets/Gemfile index 3979e2812e90..96a4ce4e4f98 100755 --- a/google-cloud-recommender-v1/snippets/Gemfile +++ b/google-cloud-recommender-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-recommender-v1/snippets/recommender/get_insight.rb b/google-cloud-recommender-v1/snippets/recommender/get_insight.rb index beecb7fd2715..001e636c8ce2 100755 --- a/google-cloud-recommender-v1/snippets/recommender/get_insight.rb +++ b/google-cloud-recommender-v1/snippets/recommender/get_insight.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_GetInsight_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_insight +# +def get_insight + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::GetInsightRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetInsightRequest.new -# Call the get_insight method. -result = client.get_insight request + # Call the get_insight method. + result = client.get_insight request -# The returned object is of type Google::Cloud::Recommender::V1::Insight. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Insight. + p result +end # [END recommender_v1_generated_Recommender_GetInsight_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb b/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb index 15b4edf7d65e..7c040f4c6d36 100644 --- a/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb +++ b/google-cloud-recommender-v1/snippets/recommender/get_insight_type_config.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_insight_type_config +# +def get_insight_type_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetInsightTypeConfigRequest.new -# Call the get_insight_type_config method. -result = client.get_insight_type_config request + # Call the get_insight_type_config method. + result = client.get_insight_type_config request -# The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. -p result + # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + p result +end # [END recommender_v1_generated_Recommender_GetInsightTypeConfig_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb b/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb index 0a2e57b82bd0..2e8884b4ac74 100755 --- a/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb +++ b/google-cloud-recommender-v1/snippets/recommender/get_recommendation.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_GetRecommendation_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_recommendation +# +def get_recommendation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetRecommendationRequest.new -# Call the get_recommendation method. -result = client.get_recommendation request + # Call the get_recommendation method. + result = client.get_recommendation request -# The returned object is of type Google::Cloud::Recommender::V1::Recommendation. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end # [END recommender_v1_generated_Recommender_GetRecommendation_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb b/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb index 576a9eb7ec4f..0d496fe02469 100644 --- a/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb +++ b/google-cloud-recommender-v1/snippets/recommender/get_recommender_config.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_GetRecommenderConfig_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#get_recommender_config +# +def get_recommender_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::GetRecommenderConfigRequest.new -# Call the get_recommender_config method. -result = client.get_recommender_config request + # Call the get_recommender_config method. + result = client.get_recommender_config request -# The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. -p result + # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + p result +end # [END recommender_v1_generated_Recommender_GetRecommenderConfig_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/list_insights.rb b/google-cloud-recommender-v1/snippets/recommender/list_insights.rb index a8bed56afcf0..4c84e8c253df 100755 --- a/google-cloud-recommender-v1/snippets/recommender/list_insights.rb +++ b/google-cloud-recommender-v1/snippets/recommender/list_insights.rb @@ -19,21 +19,27 @@ # [START recommender_v1_generated_Recommender_ListInsights_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#list_insights +# +def list_insights + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::ListInsightsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::ListInsightsRequest.new -# Call the list_insights method. -result = client.list_insights request + # Call the list_insights method. + result = client.list_insights request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Recommender::V1::Insight. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Recommender::V1::Insight. + p response + end end # [END recommender_v1_generated_Recommender_ListInsights_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb b/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb index 8eaba280e810..6b848ecaef74 100755 --- a/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb +++ b/google-cloud-recommender-v1/snippets/recommender/list_recommendations.rb @@ -19,21 +19,27 @@ # [START recommender_v1_generated_Recommender_ListRecommendations_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#list_recommendations +# +def list_recommendations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::ListRecommendationsRequest.new -# Call the list_recommendations method. -result = client.list_recommendations request + # Call the list_recommendations method. + result = client.list_recommendations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Recommender::V1::Recommendation. + p response + end end # [END recommender_v1_generated_Recommender_ListRecommendations_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb b/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb index 3b428caa18d6..198bb86ce2fe 100755 --- a/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb +++ b/google-cloud-recommender-v1/snippets/recommender/mark_insight_accepted.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_MarkInsightAccepted_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_insight_accepted +# +def mark_insight_accepted + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkInsightAcceptedRequest.new -# Call the mark_insight_accepted method. -result = client.mark_insight_accepted request + # Call the mark_insight_accepted method. + result = client.mark_insight_accepted request -# The returned object is of type Google::Cloud::Recommender::V1::Insight. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Insight. + p result +end # [END recommender_v1_generated_Recommender_MarkInsightAccepted_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb index d5fd2cd4c9cf..bba0e46531d8 100755 --- a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb +++ b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_claimed.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_claimed +# +def mark_recommendation_claimed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationClaimedRequest.new -# Call the mark_recommendation_claimed method. -result = client.mark_recommendation_claimed request + # Call the mark_recommendation_claimed method. + result = client.mark_recommendation_claimed request -# The returned object is of type Google::Cloud::Recommender::V1::Recommendation. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end # [END recommender_v1_generated_Recommender_MarkRecommendationClaimed_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb index 3dd55dd27edd..61ff4b9e269e 100755 --- a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb +++ b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_failed.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_failed +# +def mark_recommendation_failed + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationFailedRequest.new -# Call the mark_recommendation_failed method. -result = client.mark_recommendation_failed request + # Call the mark_recommendation_failed method. + result = client.mark_recommendation_failed request -# The returned object is of type Google::Cloud::Recommender::V1::Recommendation. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end # [END recommender_v1_generated_Recommender_MarkRecommendationFailed_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb index 798325649e7a..78fd403b0652 100755 --- a/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb +++ b/google-cloud-recommender-v1/snippets/recommender/mark_recommendation_succeeded.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#mark_recommendation_succeeded +# +def mark_recommendation_succeeded + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::MarkRecommendationSucceededRequest.new -# Call the mark_recommendation_succeeded method. -result = client.mark_recommendation_succeeded request + # Call the mark_recommendation_succeeded method. + result = client.mark_recommendation_succeeded request -# The returned object is of type Google::Cloud::Recommender::V1::Recommendation. -p result + # The returned object is of type Google::Cloud::Recommender::V1::Recommendation. + p result +end # [END recommender_v1_generated_Recommender_MarkRecommendationSucceeded_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb b/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb index 1c6a3ffa4247..97dcc9533eac 100644 --- a/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb +++ b/google-cloud-recommender-v1/snippets/recommender/update_insight_type_config.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#update_insight_type_config +# +def update_insight_type_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::UpdateInsightTypeConfigRequest.new -# Call the update_insight_type_config method. -result = client.update_insight_type_config request + # Call the update_insight_type_config method. + result = client.update_insight_type_config request -# The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. -p result + # The returned object is of type Google::Cloud::Recommender::V1::InsightTypeConfig. + p result +end # [END recommender_v1_generated_Recommender_UpdateInsightTypeConfig_sync] diff --git a/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb b/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb index 212ca97af53e..624af6af5a1b 100644 --- a/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb +++ b/google-cloud-recommender-v1/snippets/recommender/update_recommender_config.rb @@ -19,15 +19,21 @@ # [START recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] require "google/cloud/recommender/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Recommender::V1::Recommender::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Recommender::V1::Recommender::Client#update_recommender_config +# +def update_recommender_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Recommender::V1::Recommender::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Recommender::V1::UpdateRecommenderConfigRequest.new -# Call the update_recommender_config method. -result = client.update_recommender_config request + # Call the update_recommender_config method. + result = client.update_recommender_config request -# The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. -p result + # The returned object is of type Google::Cloud::Recommender::V1::RecommenderConfig. + p result +end # [END recommender_v1_generated_Recommender_UpdateRecommenderConfig_sync] diff --git a/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json b/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json index c91fae0e4c94..67b4178b0aaf 100644 --- a/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json +++ b/google-cloud-recommender-v1/snippets/snippet_metadata_google.cloud.recommender.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-redis-v1/.rubocop.yml b/google-cloud-redis-v1/.rubocop.yml index 9821fe80b3e8..b21553825e68 100644 --- a/google-cloud-redis-v1/.rubocop.yml +++ b/google-cloud-redis-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-redis-v1.rb" diff --git a/google-cloud-redis-v1/snippets/Gemfile b/google-cloud-redis-v1/snippets/Gemfile index f37eed5b2ed2..bd9a7e60b0a6 100755 --- a/google-cloud-redis-v1/snippets/Gemfile +++ b/google-cloud-redis-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb index ede6b40bba2e..1b0787e771d4 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/create_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_CreateInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_CreateInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb index 1206449c8c7b..e94a11a7ee17 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/delete_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_DeleteInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_DeleteInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb index 1993a670d28c..69d1fdf1d495 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/export_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_ExportInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#export_instance +# +def export_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::ExportInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ExportInstanceRequest.new -# Call the export_instance method. -result = client.export_instance request + # Call the export_instance method. + result = client.export_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_ExportInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb index 68ac6fddc058..33ccc8e689d2 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/failover_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_FailoverInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#failover_instance +# +def failover_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::FailoverInstanceRequest.new -# Call the failover_instance method. -result = client.failover_instance request + # Call the failover_instance method. + result = client.failover_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_FailoverInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb index 5f527766ae0f..6f2a40f03e83 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/get_instance.rb @@ -19,15 +19,21 @@ # [START redis_v1_generated_CloudRedis_GetInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Redis::V1::Instance. -p result + # The returned object is of type Google::Cloud::Redis::V1::Instance. + p result +end # [END redis_v1_generated_CloudRedis_GetInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb b/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb index 0d42facaef82..60642a9fbe34 100644 --- a/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/get_instance_auth_string.rb @@ -19,15 +19,21 @@ # [START redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#get_instance_auth_string +# +def get_instance_auth_string + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::GetInstanceAuthStringRequest.new -# Call the get_instance_auth_string method. -result = client.get_instance_auth_string request + # Call the get_instance_auth_string method. + result = client.get_instance_auth_string request -# The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. -p result + # The returned object is of type Google::Cloud::Redis::V1::InstanceAuthString. + p result +end # [END redis_v1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb index bc77ca1f3676..271e7c360cef 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/import_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_ImportInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#import_instance +# +def import_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::ImportInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ImportInstanceRequest.new -# Call the import_instance method. -result = client.import_instance request + # Call the import_instance method. + result = client.import_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_ImportInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb b/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb index 9fb92255a479..16d358a4dc9a 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/list_instances.rb @@ -19,21 +19,27 @@ # [START redis_v1_generated_CloudRedis_ListInstances_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Redis::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Redis::V1::Instance. + p response + end end # [END redis_v1_generated_CloudRedis_ListInstances_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb b/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb index 4d89bdca784c..ad43cfc8ba6c 100644 --- a/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/reschedule_maintenance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#reschedule_maintenance +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::RescheduleMaintenanceRequest.new -# Call the reschedule_maintenance method. -result = client.reschedule_maintenance request + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb index 994617257d0e..87a5fc3c74ab 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/update_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_UpdateInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_UpdateInstance_sync] diff --git a/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb b/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb index 26568654bf51..86af21842118 100755 --- a/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb +++ b/google-cloud-redis-v1/snippets/cloud_redis/upgrade_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1_generated_CloudRedis_UpgradeInstance_sync] require "google/cloud/redis/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1::CloudRedis::Client#upgrade_instance +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1::UpgradeInstanceRequest.new -# Call the upgrade_instance method. -result = client.upgrade_instance request + # Call the upgrade_instance method. + result = client.upgrade_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json b/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json index 4aa08e45aaf4..cae5dcbda651 100644 --- a/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json +++ b/google-cloud-redis-v1/snippets/snippet_metadata_google.cloud.redis.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-redis-v1beta1/.rubocop.yml b/google-cloud-redis-v1beta1/.rubocop.yml index dcbafaa60060..a11ddc031cc8 100644 --- a/google-cloud-redis-v1beta1/.rubocop.yml +++ b/google-cloud-redis-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-redis-v1beta1.rb" diff --git a/google-cloud-redis-v1beta1/snippets/Gemfile b/google-cloud-redis-v1beta1/snippets/Gemfile index 69c9caab009d..dfbe27d96019 100755 --- a/google-cloud-redis-v1beta1/snippets/Gemfile +++ b/google-cloud-redis-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb index 5af48dd095f3..3c4a02a43958 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/create_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_CreateInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_CreateInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb index 0c487a36f093..78409070296e 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/delete_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_DeleteInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb index 19ccd7b8c284..4d33348a5671 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/export_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_ExportInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#export_instance +# +def export_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ExportInstanceRequest.new -# Call the export_instance method. -result = client.export_instance request + # Call the export_instance method. + result = client.export_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_ExportInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb index 43f96bc42364..1d16f804f3c6 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/failover_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#failover_instance +# +def failover_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::FailoverInstanceRequest.new -# Call the failover_instance method. -result = client.failover_instance request + # Call the failover_instance method. + result = client.failover_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_FailoverInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb index b16a404920d5..9572b610a42d 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance.rb @@ -19,15 +19,21 @@ # [START redis_v1beta1_generated_CloudRedis_GetInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Redis::V1beta1::Instance. -p result + # The returned object is of type Google::Cloud::Redis::V1beta1::Instance. + p result +end # [END redis_v1beta1_generated_CloudRedis_GetInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb index e9a4b31032b4..c683b98c416f 100644 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/get_instance_auth_string.rb @@ -19,15 +19,21 @@ # [START redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#get_instance_auth_string +# +def get_instance_auth_string + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::GetInstanceAuthStringRequest.new -# Call the get_instance_auth_string method. -result = client.get_instance_auth_string request + # Call the get_instance_auth_string method. + result = client.get_instance_auth_string request -# The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. -p result + # The returned object is of type Google::Cloud::Redis::V1beta1::InstanceAuthString. + p result +end # [END redis_v1beta1_generated_CloudRedis_GetInstanceAuthString_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb index b51a0e70ddcb..a2aed477b2ee 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/import_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_ImportInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#import_instance +# +def import_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ImportInstanceRequest.new -# Call the import_instance method. -result = client.import_instance request + # Call the import_instance method. + result = client.import_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_ImportInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb index d18792f6156c..f29e5c2fbd12 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/list_instances.rb @@ -19,21 +19,27 @@ # [START redis_v1beta1_generated_CloudRedis_ListInstances_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Redis::V1beta1::Instance. + p response + end end # [END redis_v1beta1_generated_CloudRedis_ListInstances_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb index 77f7381afb5e..d75fd6f08517 100644 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/reschedule_maintenance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#reschedule_maintenance +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::RescheduleMaintenanceRequest.new -# Call the reschedule_maintenance method. -result = client.reschedule_maintenance request + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_RescheduleMaintenance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb index 07dee2aab141..214a00baea74 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/update_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_UpdateInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb b/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb index 2f7602bb816c..96326881a70b 100755 --- a/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb +++ b/google-cloud-redis-v1beta1/snippets/cloud_redis/upgrade_instance.rb @@ -19,22 +19,28 @@ # [START redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] require "google/cloud/redis/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Redis::V1beta1::CloudRedis::Client#upgrade_instance +# +def upgrade_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Redis::V1beta1::CloudRedis::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Redis::V1beta1::UpgradeInstanceRequest.new -# Call the upgrade_instance method. -result = client.upgrade_instance request + # Call the upgrade_instance method. + result = client.upgrade_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END redis_v1beta1_generated_CloudRedis_UpgradeInstance_sync] diff --git a/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json b/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json index 8eefcaa19482..5d03a742544a 100644 --- a/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json +++ b/google-cloud-redis-v1beta1/snippets/snippet_metadata_google.cloud.redis.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-resource_manager-v3/.rubocop.yml b/google-cloud-resource_manager-v3/.rubocop.yml index 908a079ef812..f8826ca0a722 100644 --- a/google-cloud-resource_manager-v3/.rubocop.yml +++ b/google-cloud-resource_manager-v3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-resource_manager-v3.rb" diff --git a/google-cloud-resource_manager-v3/snippets/Gemfile b/google-cloud-resource_manager-v3/snippets/Gemfile index 22aa3a2969a4..e6656e3d3963 100755 --- a/google-cloud-resource_manager-v3/snippets/Gemfile +++ b/google-cloud-resource_manager-v3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb index 7318b8bd754f..651baa4dbb60 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/create_folder.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#create_folder +# +def create_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateFolderRequest.new -# Call the create_folder method. -result = client.create_folder request + # Call the create_folder method. + result = client.create_folder request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Folders_CreateFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb index 605fa7bd7c5d..1fe4b862b785 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/delete_folder.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#delete_folder +# +def delete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteFolderRequest.new -# Call the delete_folder method. -result = client.delete_folder request + # Call the delete_folder method. + result = client.delete_folder request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Folders_DeleteFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb index 92f8889651b0..77767dff1378 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/get_folder.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Folders_GetFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#get_folder +# +def get_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetFolderRequest.new -# Call the get_folder method. -result = client.get_folder request + # Call the get_folder method. + result = client.get_folder request -# The returned object is of type Google::Cloud::ResourceManager::V3::Folder. -p result + # The returned object is of type Google::Cloud::ResourceManager::V3::Folder. + p result +end # [END cloudresourcemanager_v3_generated_Folders_GetFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb index e725cffbdd66..3bfbbfb93b67 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Folders_GetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb b/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb index 8e3874121555..9eac6ce25278 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/list_folders.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_Folders_ListFolders_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#list_folders +# +def list_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListFoldersRequest.new -# Call the list_folders method. -result = client.list_folders request + # Call the list_folders method. + result = client.list_folders request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + p response + end end # [END cloudresourcemanager_v3_generated_Folders_ListFolders_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb index ff4d54576510..9652300dadb6 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/move_folder.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#move_folder +# +def move_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::MoveFolderRequest.new -# Call the move_folder method. -result = client.move_folder request + # Call the move_folder method. + result = client.move_folder request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Folders_MoveFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb b/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb index 0039136fd515..5a58512e2a2e 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/search_folders.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#search_folders +# +def search_folders + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchFoldersRequest.new -# Call the search_folders method. -result = client.search_folders request + # Call the search_folders method. + result = client.search_folders request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Folder. + p response + end end # [END cloudresourcemanager_v3_generated_Folders_SearchFolders_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb index c1012695cf71..e79567602669 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Folders_SetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb b/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb index 943f482d07bf..950a1c78ac35 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudresourcemanager_v3_generated_Folders_TestIamPermissions_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb index bd48b727cf7a..3fada7dd3fca 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/undelete_folder.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#undelete_folder +# +def undelete_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UndeleteFolderRequest.new -# Call the undelete_folder method. -result = client.undelete_folder request + # Call the undelete_folder method. + result = client.undelete_folder request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Folders_UndeleteFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb b/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb index 6b22fd4ac568..336b6645e88a 100755 --- a/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb +++ b/google-cloud-resource_manager-v3/snippets/folders/update_folder.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Folders::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Folders::Client#update_folder +# +def update_folder + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Folders::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateFolderRequest.new -# Call the update_folder method. -result = client.update_folder request + # Call the update_folder method. + result = client.update_folder request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Folders_UpdateFolder_sync] diff --git a/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb index b68401876348..6bd7a20ca3a5 100755 --- a/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/organizations/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Organizations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Organizations_GetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb b/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb index 52de9974bd5b..6acc0511e213 100755 --- a/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb +++ b/google-cloud-resource_manager-v3/snippets/organizations/get_organization.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Organizations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#get_organization +# +def get_organization + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetOrganizationRequest.new -# Call the get_organization method. -result = client.get_organization request + # Call the get_organization method. + result = client.get_organization request -# The returned object is of type Google::Cloud::ResourceManager::V3::Organization. -p result + # The returned object is of type Google::Cloud::ResourceManager::V3::Organization. + p result +end # [END cloudresourcemanager_v3_generated_Organizations_GetOrganization_sync] diff --git a/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb b/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb index 94fe3970d7eb..68ac4b345781 100755 --- a/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb +++ b/google-cloud-resource_manager-v3/snippets/organizations/search_organizations.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Organizations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#search_organizations +# +def search_organizations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchOrganizationsRequest.new -# Call the search_organizations method. -result = client.search_organizations request + # Call the search_organizations method. + result = client.search_organizations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Organization. + p response + end end # [END cloudresourcemanager_v3_generated_Organizations_SearchOrganizations_sync] diff --git a/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb index 30c8233b5fc4..2088271e6403 100755 --- a/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/organizations/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Organizations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Organizations_SetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb b/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb index 7de86c0c73ec..bef8673e543d 100755 --- a/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb +++ b/google-cloud-resource_manager-v3/snippets/organizations/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Organizations::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Organizations::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Organizations::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudresourcemanager_v3_generated_Organizations_TestIamPermissions_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/create_project.rb b/google-cloud-resource_manager-v3/snippets/projects/create_project.rb index 3dbb2eec7c28..1c1a4de29a60 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/create_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/create_project.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Projects_CreateProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#create_project +# +def create_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateProjectRequest.new -# Call the create_project method. -result = client.create_project request + # Call the create_project method. + result = client.create_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Projects_CreateProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb b/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb index 38d1ac1f3162..074eddc9c883 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/delete_project.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#delete_project +# +def delete_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteProjectRequest.new -# Call the delete_project method. -result = client.delete_project request + # Call the delete_project method. + result = client.delete_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Projects_DeleteProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb index 4c57db485ff6..590381bb193d 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Projects_GetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/get_project.rb b/google-cloud-resource_manager-v3/snippets/projects/get_project.rb index a3c3b855bd8f..63973136853a 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/get_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/get_project.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Projects_GetProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#get_project +# +def get_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetProjectRequest.new -# Call the get_project method. -result = client.get_project request + # Call the get_project method. + result = client.get_project request -# The returned object is of type Google::Cloud::ResourceManager::V3::Project. -p result + # The returned object is of type Google::Cloud::ResourceManager::V3::Project. + p result +end # [END cloudresourcemanager_v3_generated_Projects_GetProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb b/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb index 4ac0b64ca866..2d2ff51c01d6 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/list_projects.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_Projects_ListProjects_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#list_projects +# +def list_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListProjectsRequest.new -# Call the list_projects method. -result = client.list_projects request + # Call the list_projects method. + result = client.list_projects request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + p response + end end # [END cloudresourcemanager_v3_generated_Projects_ListProjects_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/move_project.rb b/google-cloud-resource_manager-v3/snippets/projects/move_project.rb index 1372300f8b52..8072d045bc99 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/move_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/move_project.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Projects_MoveProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#move_project +# +def move_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::MoveProjectRequest.new -# Call the move_project method. -result = client.move_project request + # Call the move_project method. + result = client.move_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Projects_MoveProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb b/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb index 03155df9fcbd..f1db4f7ccd87 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/search_projects.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#search_projects +# +def search_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::SearchProjectsRequest.new -# Call the search_projects method. -result = client.search_projects request + # Call the search_projects method. + result = client.search_projects request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::Project. + p response + end end # [END cloudresourcemanager_v3_generated_Projects_SearchProjects_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb index 34900479485f..fcb54ed2c817 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_Projects_SetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb b/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb index 3e49189e0236..8639d535faa9 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudresourcemanager_v3_generated_Projects_TestIamPermissions_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb b/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb index f62176532239..031db6f5d909 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/undelete_project.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#undelete_project +# +def undelete_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UndeleteProjectRequest.new -# Call the undelete_project method. -result = client.undelete_project request + # Call the undelete_project method. + result = client.undelete_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Projects_UndeleteProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/projects/update_project.rb b/google-cloud-resource_manager-v3/snippets/projects/update_project.rb index c9d8ba699848..9ad00d09e18a 100755 --- a/google-cloud-resource_manager-v3/snippets/projects/update_project.rb +++ b/google-cloud-resource_manager-v3/snippets/projects/update_project.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::Projects::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::Projects::Client#update_project +# +def update_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::Projects::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateProjectRequest.new -# Call the update_project method. -result = client.update_project request + # Call the update_project method. + result = client.update_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_Projects_UpdateProject_sync] diff --git a/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json b/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json index 81bc21d127f1..ff809b0329b4 100644 --- a/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json +++ b/google-cloud-resource_manager-v3/snippets/snippet_metadata_google.cloud.resourcemanager.v3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1806,7 +1806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1846,7 +1846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb b/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb index ad3662109318..8ec04d0d67d1 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_bindings/create_tag_binding.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#create_tag_binding +# +def create_tag_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagBindingRequest.new -# Call the create_tag_binding method. -result = client.create_tag_binding request + # Call the create_tag_binding method. + result = client.create_tag_binding request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagBindings_CreateTagBinding_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb b/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb index 8577d280bfe2..6622eb2dae57 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_bindings/delete_tag_binding.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#delete_tag_binding +# +def delete_tag_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagBindingRequest.new -# Call the delete_tag_binding method. -result = client.delete_tag_binding request + # Call the delete_tag_binding method. + result = client.delete_tag_binding request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagBindings_DeleteTagBinding_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb b/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb index 4af75408a8d2..986a91fa0a5d 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_bindings/list_tag_bindings.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagBindings::Client#list_tag_bindings +# +def list_tag_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagBindings::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagBindingsRequest.new -# Call the list_tag_bindings method. -result = client.list_tag_bindings request + # Call the list_tag_bindings method. + result = client.list_tag_bindings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagBinding. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagBinding. + p response + end end # [END cloudresourcemanager_v3_generated_TagBindings_ListTagBindings_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb index cd3e8497b99b..59c3e6957b0f 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/create_tag_key.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#create_tag_key +# +def create_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagKeyRequest.new -# Call the create_tag_key method. -result = client.create_tag_key request + # Call the create_tag_key method. + result = client.create_tag_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagKeys_CreateTagKey_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb index 5dacec88b620..98c90926b847 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/delete_tag_key.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#delete_tag_key +# +def delete_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagKeyRequest.new -# Call the delete_tag_key method. -result = client.delete_tag_key request + # Call the delete_tag_key method. + result = client.delete_tag_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagKeys_DeleteTagKey_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb index 6ee8b39a8d01..fdcd7a113be0 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_TagKeys_GetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb index 0d43d590566d..bf2a47dfa710 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/get_tag_key.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#get_tag_key +# +def get_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetTagKeyRequest.new -# Call the get_tag_key method. -result = client.get_tag_key request + # Call the get_tag_key method. + result = client.get_tag_key request -# The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. -p result + # The returned object is of type Google::Cloud::ResourceManager::V3::TagKey. + p result +end # [END cloudresourcemanager_v3_generated_TagKeys_GetTagKey_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb index e1643ae923e1..4b01278e4583 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/list_tag_keys.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#list_tag_keys +# +def list_tag_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagKeysRequest.new -# Call the list_tag_keys method. -result = client.list_tag_keys request + # Call the list_tag_keys method. + result = client.list_tag_keys request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagKey. + p response + end end # [END cloudresourcemanager_v3_generated_TagKeys_ListTagKeys_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb index e82c36e438a2..5e36121b11a7 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_TagKeys_SetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb index 46bf8caa8d70..fa40e50de5f8 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudresourcemanager_v3_generated_TagKeys_TestIamPermissions_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb b/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb index e3f1b707bd21..68d9d3e75840 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_keys/update_tag_key.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagKeys::Client#update_tag_key +# +def update_tag_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagKeys::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateTagKeyRequest.new -# Call the update_tag_key method. -result = client.update_tag_key request + # Call the update_tag_key method. + result = client.update_tag_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagKeys_UpdateTagKey_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb b/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb index a481ce431561..1f3cdde67215 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/create_tag_value.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#create_tag_value +# +def create_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::CreateTagValueRequest.new -# Call the create_tag_value method. -result = client.create_tag_value request + # Call the create_tag_value method. + result = client.create_tag_value request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagValues_CreateTagValue_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb b/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb index 47eb4804eee3..0c4ab72c188d 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/delete_tag_value.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#delete_tag_value +# +def delete_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::DeleteTagValueRequest.new -# Call the delete_tag_value method. -result = client.delete_tag_value request + # Call the delete_tag_value method. + result = client.delete_tag_value request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagValues_DeleteTagValue_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb index 820a0b7f5067..1f382c62f913 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_TagValues_GetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb b/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb index 3a8bb2c6a75d..821e6098e78a 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/get_tag_value.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#get_tag_value +# +def get_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::GetTagValueRequest.new -# Call the get_tag_value method. -result = client.get_tag_value request + # Call the get_tag_value method. + result = client.get_tag_value request -# The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. -p result + # The returned object is of type Google::Cloud::ResourceManager::V3::TagValue. + p result +end # [END cloudresourcemanager_v3_generated_TagValues_GetTagValue_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb b/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb index d4944f110f6a..deed2246592d 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/list_tag_values.rb @@ -19,21 +19,27 @@ # [START cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#list_tag_values +# +def list_tag_values + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::ListTagValuesRequest.new -# Call the list_tag_values method. -result = client.list_tag_values request + # Call the list_tag_values method. + result = client.list_tag_values request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceManager::V3::TagValue. + p response + end end # [END cloudresourcemanager_v3_generated_TagValues_ListTagValues_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb b/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb index 40e9a775bb43..edb57cda30ae 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudresourcemanager_v3_generated_TagValues_SetIamPolicy_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb b/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb index e4e8d99eb700..2d6f09b5c023 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudresourcemanager_v3_generated_TagValues_TestIamPermissions_sync] diff --git a/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb b/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb index 5ae974e06844..22dc229b046d 100755 --- a/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb +++ b/google-cloud-resource_manager-v3/snippets/tag_values/update_tag_value.rb @@ -19,22 +19,28 @@ # [START cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] require "google/cloud/resource_manager/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceManager::V3::TagValues::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceManager::V3::TagValues::Client#update_tag_value +# +def update_tag_value + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceManager::V3::TagValues::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceManager::V3::UpdateTagValueRequest.new -# Call the update_tag_value method. -result = client.update_tag_value request + # Call the update_tag_value method. + result = client.update_tag_value request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudresourcemanager_v3_generated_TagValues_UpdateTagValue_sync] diff --git a/google-cloud-resource_settings-v1/.rubocop.yml b/google-cloud-resource_settings-v1/.rubocop.yml index e996ef7f1c43..d61a024077b4 100644 --- a/google-cloud-resource_settings-v1/.rubocop.yml +++ b/google-cloud-resource_settings-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-resource_settings-v1.rb" diff --git a/google-cloud-resource_settings-v1/snippets/Gemfile b/google-cloud-resource_settings-v1/snippets/Gemfile index d60ed770d5c8..edb26a52c4ec 100755 --- a/google-cloud-resource_settings-v1/snippets/Gemfile +++ b/google-cloud-resource_settings-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-resource_settings-v1/snippets/resource_settings_service/get_setting.rb b/google-cloud-resource_settings-v1/snippets/resource_settings_service/get_setting.rb index 3ade66791fa2..33da0b44feb8 100755 --- a/google-cloud-resource_settings-v1/snippets/resource_settings_service/get_setting.rb +++ b/google-cloud-resource_settings-v1/snippets/resource_settings_service/get_setting.rb @@ -19,15 +19,21 @@ # [START resourcesettings_v1_generated_ResourceSettingsService_GetSetting_sync] require "google/cloud/resource_settings/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client#get_setting +# +def get_setting + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceSettings::V1::GetSettingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceSettings::V1::GetSettingRequest.new -# Call the get_setting method. -result = client.get_setting request + # Call the get_setting method. + result = client.get_setting request -# The returned object is of type Google::Cloud::ResourceSettings::V1::Setting. -p result + # The returned object is of type Google::Cloud::ResourceSettings::V1::Setting. + p result +end # [END resourcesettings_v1_generated_ResourceSettingsService_GetSetting_sync] diff --git a/google-cloud-resource_settings-v1/snippets/resource_settings_service/list_settings.rb b/google-cloud-resource_settings-v1/snippets/resource_settings_service/list_settings.rb index 404cf8a86107..647af8d379a5 100755 --- a/google-cloud-resource_settings-v1/snippets/resource_settings_service/list_settings.rb +++ b/google-cloud-resource_settings-v1/snippets/resource_settings_service/list_settings.rb @@ -19,21 +19,27 @@ # [START resourcesettings_v1_generated_ResourceSettingsService_ListSettings_sync] require "google/cloud/resource_settings/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client#list_settings +# +def list_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceSettings::V1::ListSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceSettings::V1::ListSettingsRequest.new -# Call the list_settings method. -result = client.list_settings request + # Call the list_settings method. + result = client.list_settings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ResourceSettings::V1::Setting. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ResourceSettings::V1::Setting. + p response + end end # [END resourcesettings_v1_generated_ResourceSettingsService_ListSettings_sync] diff --git a/google-cloud-resource_settings-v1/snippets/resource_settings_service/update_setting.rb b/google-cloud-resource_settings-v1/snippets/resource_settings_service/update_setting.rb index 8048bc1a15cc..8dfa2ef61d33 100755 --- a/google-cloud-resource_settings-v1/snippets/resource_settings_service/update_setting.rb +++ b/google-cloud-resource_settings-v1/snippets/resource_settings_service/update_setting.rb @@ -19,15 +19,21 @@ # [START resourcesettings_v1_generated_ResourceSettingsService_UpdateSetting_sync] require "google/cloud/resource_settings/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client#update_setting +# +def update_setting + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ResourceSettings::V1::ResourceSettingsService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ResourceSettings::V1::UpdateSettingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ResourceSettings::V1::UpdateSettingRequest.new -# Call the update_setting method. -result = client.update_setting request + # Call the update_setting method. + result = client.update_setting request -# The returned object is of type Google::Cloud::ResourceSettings::V1::Setting. -p result + # The returned object is of type Google::Cloud::ResourceSettings::V1::Setting. + p result +end # [END resourcesettings_v1_generated_ResourceSettingsService_UpdateSetting_sync] diff --git a/google-cloud-resource_settings-v1/snippets/snippet_metadata_google.cloud.resourcesettings.v1.json b/google-cloud-resource_settings-v1/snippets/snippet_metadata_google.cloud.resourcesettings.v1.json index 9c8fba443a4e..e31778314ff4 100644 --- a/google-cloud-resource_settings-v1/snippets/snippet_metadata_google.cloud.resourcesettings.v1.json +++ b/google-cloud-resource_settings-v1/snippets/snippet_metadata_google.cloud.resourcesettings.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-retail-v2/.rubocop.yml b/google-cloud-retail-v2/.rubocop.yml index 29edecf82103..def961aa4ee5 100644 --- a/google-cloud-retail-v2/.rubocop.yml +++ b/google-cloud-retail-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-retail-v2.rb" diff --git a/google-cloud-retail-v2/snippets/Gemfile b/google-cloud-retail-v2/snippets/Gemfile index 738c8a8780b7..2829239b01e7 100755 --- a/google-cloud-retail-v2/snippets/Gemfile +++ b/google-cloud-retail-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb b/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb index a52963bb8f3c..e8b7df328eb1 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/add_catalog_attribute.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_AddCatalogAttribute_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#add_catalog_attribute +# +def add_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddCatalogAttributeRequest.new -# Call the add_catalog_attribute method. -result = client.add_catalog_attribute request + # Call the add_catalog_attribute method. + result = client.add_catalog_attribute request -# The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end # [END retail_v2_generated_CatalogService_AddCatalogAttribute_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb b/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb index df9e17d20acd..3d568ef18ed1 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/get_attributes_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_GetAttributesConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_attributes_config +# +def get_attributes_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetAttributesConfigRequest.new -# Call the get_attributes_config method. -result = client.get_attributes_config request + # Call the get_attributes_config method. + result = client.get_attributes_config request -# The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end # [END retail_v2_generated_CatalogService_GetAttributesConfig_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb b/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb index 89aa8add11a9..dbd5a0c82ed2 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/get_completion_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_GetCompletionConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_completion_config +# +def get_completion_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetCompletionConfigRequest.new -# Call the get_completion_config method. -result = client.get_completion_config request + # Call the get_completion_config method. + result = client.get_completion_config request -# The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + p result +end # [END retail_v2_generated_CatalogService_GetCompletionConfig_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb b/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb index a45d6c5b3711..891d13064d5e 100755 --- a/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/get_default_branch.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_GetDefaultBranch_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#get_default_branch +# +def get_default_branch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new -# Call the get_default_branch method. -result = client.get_default_branch request + # Call the get_default_branch method. + result = client.get_default_branch request -# The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. -p result + # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse. + p result +end # [END retail_v2_generated_CatalogService_GetDefaultBranch_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb b/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb index 036106da5d7c..6aabaf4cbc1d 100755 --- a/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/list_catalogs.rb @@ -19,21 +19,27 @@ # [START retail_v2_generated_CatalogService_ListCatalogs_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#list_catalogs +# +def list_catalogs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ListCatalogsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListCatalogsRequest.new -# Call the list_catalogs method. -result = client.list_catalogs request + # Call the list_catalogs method. + result = client.list_catalogs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Retail::V2::Catalog. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Retail::V2::Catalog. + p response + end end # [END retail_v2_generated_CatalogService_ListCatalogs_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb b/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb index 6f3a41c82d6d..43516f4bf857 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/remove_catalog_attribute.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#remove_catalog_attribute +# +def remove_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveCatalogAttributeRequest.new -# Call the remove_catalog_attribute method. -result = client.remove_catalog_attribute request + # Call the remove_catalog_attribute method. + result = client.remove_catalog_attribute request -# The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end # [END retail_v2_generated_CatalogService_RemoveCatalogAttribute_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb b/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb index 7d8c05402c53..948141e37e30 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/replace_catalog_attribute.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#replace_catalog_attribute +# +def replace_catalog_attribute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ReplaceCatalogAttributeRequest.new -# Call the replace_catalog_attribute method. -result = client.replace_catalog_attribute request + # Call the replace_catalog_attribute method. + result = client.replace_catalog_attribute request -# The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end # [END retail_v2_generated_CatalogService_ReplaceCatalogAttribute_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb b/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb index 2641196a6590..6e74e1efb2c9 100755 --- a/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/set_default_branch.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_SetDefaultBranch_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#set_default_branch +# +def set_default_branch + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new -# Call the set_default_branch method. -result = client.set_default_branch request + # Call the set_default_branch method. + result = client.set_default_branch request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END retail_v2_generated_CatalogService_SetDefaultBranch_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb b/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb index 2d51fb055ccc..7590359612cb 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/update_attributes_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_attributes_config +# +def update_attributes_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateAttributesConfigRequest.new -# Call the update_attributes_config method. -result = client.update_attributes_config request + # Call the update_attributes_config method. + result = client.update_attributes_config request -# The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::AttributesConfig. + p result +end # [END retail_v2_generated_CatalogService_UpdateAttributesConfig_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb b/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb index a01e4c632df3..d033535d954f 100755 --- a/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/update_catalog.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_UpdateCatalog_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_catalog +# +def update_catalog + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new -# Call the update_catalog method. -result = client.update_catalog request + # Call the update_catalog method. + result = client.update_catalog request -# The returned object is of type Google::Cloud::Retail::V2::Catalog. -p result + # The returned object is of type Google::Cloud::Retail::V2::Catalog. + p result +end # [END retail_v2_generated_CatalogService_UpdateCatalog_sync] diff --git a/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb b/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb index bcf5779cf8fe..b8c476c25edc 100644 --- a/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb +++ b/google-cloud-retail-v2/snippets/catalog_service/update_completion_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CatalogService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CatalogService::Client#update_completion_config +# +def update_completion_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CatalogService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateCompletionConfigRequest.new -# Call the update_completion_config method. -result = client.update_completion_config request + # Call the update_completion_config method. + result = client.update_completion_config request -# The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::CompletionConfig. + p result +end # [END retail_v2_generated_CatalogService_UpdateCompletionConfig_sync] diff --git a/google-cloud-retail-v2/snippets/completion_service/complete_query.rb b/google-cloud-retail-v2/snippets/completion_service/complete_query.rb index 6724be4c41a4..be94bb139ab4 100755 --- a/google-cloud-retail-v2/snippets/completion_service/complete_query.rb +++ b/google-cloud-retail-v2/snippets/completion_service/complete_query.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_CompletionService_CompleteQuery_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CompletionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CompletionService::Client#complete_query +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CompletionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::CompleteQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CompleteQueryRequest.new -# Call the complete_query method. -result = client.complete_query request + # Call the complete_query method. + result = client.complete_query request -# The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. -p result + # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse. + p result +end # [END retail_v2_generated_CompletionService_CompleteQuery_sync] diff --git a/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb b/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb index 2eb8536ab183..2157fdcfa42a 100755 --- a/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb +++ b/google-cloud-retail-v2/snippets/completion_service/import_completion_data.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_CompletionService_ImportCompletionData_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::CompletionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::CompletionService::Client#import_completion_data +# +def import_completion_data + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::CompletionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new -# Call the import_completion_data method. -result = client.import_completion_data request + # Call the import_completion_data method. + result = client.import_completion_data request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_CompletionService_ImportCompletionData_sync] diff --git a/google-cloud-retail-v2/snippets/control_service/create_control.rb b/google-cloud-retail-v2/snippets/control_service/create_control.rb index d733adecc7d8..f2e9ee0764c3 100644 --- a/google-cloud-retail-v2/snippets/control_service/create_control.rb +++ b/google-cloud-retail-v2/snippets/control_service/create_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ControlService_CreateControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ControlService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#create_control +# +def create_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::CreateControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateControlRequest.new -# Call the create_control method. -result = client.create_control request + # Call the create_control method. + result = client.create_control request -# The returned object is of type Google::Cloud::Retail::V2::Control. -p result + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end # [END retail_v2_generated_ControlService_CreateControl_sync] diff --git a/google-cloud-retail-v2/snippets/control_service/delete_control.rb b/google-cloud-retail-v2/snippets/control_service/delete_control.rb index 93c6c908e2f8..d4a1239494cc 100644 --- a/google-cloud-retail-v2/snippets/control_service/delete_control.rb +++ b/google-cloud-retail-v2/snippets/control_service/delete_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ControlService_DeleteControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ControlService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#delete_control +# +def delete_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::DeleteControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteControlRequest.new -# Call the delete_control method. -result = client.delete_control request + # Call the delete_control method. + result = client.delete_control request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END retail_v2_generated_ControlService_DeleteControl_sync] diff --git a/google-cloud-retail-v2/snippets/control_service/get_control.rb b/google-cloud-retail-v2/snippets/control_service/get_control.rb index 16af98cad73a..81bf7c281b57 100644 --- a/google-cloud-retail-v2/snippets/control_service/get_control.rb +++ b/google-cloud-retail-v2/snippets/control_service/get_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ControlService_GetControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ControlService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#get_control +# +def get_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetControlRequest.new -# Call the get_control method. -result = client.get_control request + # Call the get_control method. + result = client.get_control request -# The returned object is of type Google::Cloud::Retail::V2::Control. -p result + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end # [END retail_v2_generated_ControlService_GetControl_sync] diff --git a/google-cloud-retail-v2/snippets/control_service/list_controls.rb b/google-cloud-retail-v2/snippets/control_service/list_controls.rb index 2bf7816349d0..0e814d32512e 100644 --- a/google-cloud-retail-v2/snippets/control_service/list_controls.rb +++ b/google-cloud-retail-v2/snippets/control_service/list_controls.rb @@ -19,21 +19,27 @@ # [START retail_v2_generated_ControlService_ListControls_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ControlService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#list_controls +# +def list_controls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ListControlsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListControlsRequest.new -# Call the list_controls method. -result = client.list_controls request + # Call the list_controls method. + result = client.list_controls request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Retail::V2::Control. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Retail::V2::Control. + p response + end end # [END retail_v2_generated_ControlService_ListControls_sync] diff --git a/google-cloud-retail-v2/snippets/control_service/update_control.rb b/google-cloud-retail-v2/snippets/control_service/update_control.rb index 6180bda1e7ec..778f943640d3 100644 --- a/google-cloud-retail-v2/snippets/control_service/update_control.rb +++ b/google-cloud-retail-v2/snippets/control_service/update_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ControlService_UpdateControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ControlService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ControlService::Client#update_control +# +def update_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ControlService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateControlRequest.new -# Call the update_control method. -result = client.update_control request + # Call the update_control method. + result = client.update_control request -# The returned object is of type Google::Cloud::Retail::V2::Control. -p result + # The returned object is of type Google::Cloud::Retail::V2::Control. + p result +end # [END retail_v2_generated_ControlService_UpdateControl_sync] diff --git a/google-cloud-retail-v2/snippets/prediction_service/predict.rb b/google-cloud-retail-v2/snippets/prediction_service/predict.rb index 22de234841d1..d65834a67371 100755 --- a/google-cloud-retail-v2/snippets/prediction_service/predict.rb +++ b/google-cloud-retail-v2/snippets/prediction_service/predict.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_PredictionService_Predict_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::PredictionService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::PredictionService::Client#predict +# +def predict + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::PredictionService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::PredictRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PredictRequest.new -# Call the predict method. -result = client.predict request + # Call the predict method. + result = client.predict request -# The returned object is of type Google::Cloud::Retail::V2::PredictResponse. -p result + # The returned object is of type Google::Cloud::Retail::V2::PredictResponse. + p result +end # [END retail_v2_generated_PredictionService_Predict_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb b/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb index 40194ac5100b..34d400da06b2 100755 --- a/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb +++ b/google-cloud-retail-v2/snippets/product_service/add_fulfillment_places.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#add_fulfillment_places +# +def add_fulfillment_places + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new -# Call the add_fulfillment_places method. -result = client.add_fulfillment_places request + # Call the add_fulfillment_places method. + result = client.add_fulfillment_places request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_AddFulfillmentPlaces_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb b/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb index 136233076a93..e9a68a3bb62a 100644 --- a/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb +++ b/google-cloud-retail-v2/snippets/product_service/add_local_inventories.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_AddLocalInventories_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#add_local_inventories +# +def add_local_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddLocalInventoriesRequest.new -# Call the add_local_inventories method. -result = client.add_local_inventories request + # Call the add_local_inventories method. + result = client.add_local_inventories request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_AddLocalInventories_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/create_product.rb b/google-cloud-retail-v2/snippets/product_service/create_product.rb index 2ef2cf24d628..2ada0f8a0fe7 100755 --- a/google-cloud-retail-v2/snippets/product_service/create_product.rb +++ b/google-cloud-retail-v2/snippets/product_service/create_product.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ProductService_CreateProduct_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#create_product +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::CreateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateProductRequest.new -# Call the create_product method. -result = client.create_product request + # Call the create_product method. + result = client.create_product request -# The returned object is of type Google::Cloud::Retail::V2::Product. -p result + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end # [END retail_v2_generated_ProductService_CreateProduct_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/delete_product.rb b/google-cloud-retail-v2/snippets/product_service/delete_product.rb index 0e8f845cc516..3c8a96f86b3d 100755 --- a/google-cloud-retail-v2/snippets/product_service/delete_product.rb +++ b/google-cloud-retail-v2/snippets/product_service/delete_product.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ProductService_DeleteProduct_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#delete_product +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::DeleteProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteProductRequest.new -# Call the delete_product method. -result = client.delete_product request + # Call the delete_product method. + result = client.delete_product request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END retail_v2_generated_ProductService_DeleteProduct_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/get_product.rb b/google-cloud-retail-v2/snippets/product_service/get_product.rb index 4d653fbb1b75..a3181ae00a57 100755 --- a/google-cloud-retail-v2/snippets/product_service/get_product.rb +++ b/google-cloud-retail-v2/snippets/product_service/get_product.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ProductService_GetProduct_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#get_product +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetProductRequest.new -# Call the get_product method. -result = client.get_product request + # Call the get_product method. + result = client.get_product request -# The returned object is of type Google::Cloud::Retail::V2::Product. -p result + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end # [END retail_v2_generated_ProductService_GetProduct_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/import_products.rb b/google-cloud-retail-v2/snippets/product_service/import_products.rb index 4e27aea2a090..47640259cbdd 100755 --- a/google-cloud-retail-v2/snippets/product_service/import_products.rb +++ b/google-cloud-retail-v2/snippets/product_service/import_products.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_ImportProducts_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#import_products +# +def import_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ImportProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportProductsRequest.new -# Call the import_products method. -result = client.import_products request + # Call the import_products method. + result = client.import_products request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_ImportProducts_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/list_products.rb b/google-cloud-retail-v2/snippets/product_service/list_products.rb index d06c38f8f99c..f5c7e885b87c 100755 --- a/google-cloud-retail-v2/snippets/product_service/list_products.rb +++ b/google-cloud-retail-v2/snippets/product_service/list_products.rb @@ -19,21 +19,27 @@ # [START retail_v2_generated_ProductService_ListProducts_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#list_products +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ListProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListProductsRequest.new -# Call the list_products method. -result = client.list_products request + # Call the list_products method. + result = client.list_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Retail::V2::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Retail::V2::Product. + p response + end end # [END retail_v2_generated_ProductService_ListProducts_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb b/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb index bd92b9bd3b27..05a8bbe3d3f3 100755 --- a/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb +++ b/google-cloud-retail-v2/snippets/product_service/remove_fulfillment_places.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#remove_fulfillment_places +# +def remove_fulfillment_places + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new -# Call the remove_fulfillment_places method. -result = client.remove_fulfillment_places request + # Call the remove_fulfillment_places method. + result = client.remove_fulfillment_places request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_RemoveFulfillmentPlaces_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb b/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb index 55e3701a19c6..bf9c86541c9d 100644 --- a/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb +++ b/google-cloud-retail-v2/snippets/product_service/remove_local_inventories.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_RemoveLocalInventories_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#remove_local_inventories +# +def remove_local_inventories + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveLocalInventoriesRequest.new -# Call the remove_local_inventories method. -result = client.remove_local_inventories request + # Call the remove_local_inventories method. + result = client.remove_local_inventories request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_RemoveLocalInventories_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/set_inventory.rb b/google-cloud-retail-v2/snippets/product_service/set_inventory.rb index b8ea87dc8ce1..6011a7fd5397 100755 --- a/google-cloud-retail-v2/snippets/product_service/set_inventory.rb +++ b/google-cloud-retail-v2/snippets/product_service/set_inventory.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_ProductService_SetInventory_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#set_inventory +# +def set_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::SetInventoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SetInventoryRequest.new -# Call the set_inventory method. -result = client.set_inventory request + # Call the set_inventory method. + result = client.set_inventory request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_ProductService_SetInventory_sync] diff --git a/google-cloud-retail-v2/snippets/product_service/update_product.rb b/google-cloud-retail-v2/snippets/product_service/update_product.rb index 20eda7bd9e4f..12d0632a367d 100755 --- a/google-cloud-retail-v2/snippets/product_service/update_product.rb +++ b/google-cloud-retail-v2/snippets/product_service/update_product.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ProductService_UpdateProduct_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ProductService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ProductService::Client#update_product +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ProductService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateProductRequest.new -# Call the update_product method. -result = client.update_product request + # Call the update_product method. + result = client.update_product request -# The returned object is of type Google::Cloud::Retail::V2::Product. -p result + # The returned object is of type Google::Cloud::Retail::V2::Product. + p result +end # [END retail_v2_generated_ProductService_UpdateProduct_sync] diff --git a/google-cloud-retail-v2/snippets/search_service/search.rb b/google-cloud-retail-v2/snippets/search_service/search.rb index b7c701198392..58380328adcb 100755 --- a/google-cloud-retail-v2/snippets/search_service/search.rb +++ b/google-cloud-retail-v2/snippets/search_service/search.rb @@ -19,21 +19,27 @@ # [START retail_v2_generated_SearchService_Search_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::SearchService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::SearchService::Client#search +# +def search + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::SearchService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::SearchRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::SearchRequest.new -# Call the search method. -result = client.search request + # Call the search method. + result = client.search request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Retail::V2::SearchResponse::SearchResult. + p response + end end # [END retail_v2_generated_SearchService_Search_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb b/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb index dfde4b7aafff..a07a439e4a93 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/add_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_AddControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#add_control +# +def add_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::AddControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::AddControlRequest.new -# Call the add_control method. -result = client.add_control request + # Call the add_control method. + result = client.add_control request -# The returned object is of type Google::Cloud::Retail::V2::ServingConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end # [END retail_v2_generated_ServingConfigService_AddControl_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb b/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb index e4f57263b1d4..48a4abcf0a5f 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/create_serving_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_CreateServingConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#create_serving_config +# +def create_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CreateServingConfigRequest.new -# Call the create_serving_config method. -result = client.create_serving_config request + # Call the create_serving_config method. + result = client.create_serving_config request -# The returned object is of type Google::Cloud::Retail::V2::ServingConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end # [END retail_v2_generated_ServingConfigService_CreateServingConfig_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb b/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb index 0ec7a5758b07..9be841095e81 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/delete_serving_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#delete_serving_config +# +def delete_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::DeleteServingConfigRequest.new -# Call the delete_serving_config method. -result = client.delete_serving_config request + # Call the delete_serving_config method. + result = client.delete_serving_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END retail_v2_generated_ServingConfigService_DeleteServingConfig_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb b/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb index 09cd98492cc7..56143be51f91 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/get_serving_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_GetServingConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#get_serving_config +# +def get_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::GetServingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::GetServingConfigRequest.new -# Call the get_serving_config method. -result = client.get_serving_config request + # Call the get_serving_config method. + result = client.get_serving_config request -# The returned object is of type Google::Cloud::Retail::V2::ServingConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end # [END retail_v2_generated_ServingConfigService_GetServingConfig_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb b/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb index 34c202fd7e75..00cd74d55d71 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/list_serving_configs.rb @@ -19,21 +19,27 @@ # [START retail_v2_generated_ServingConfigService_ListServingConfigs_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#list_serving_configs +# +def list_serving_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ListServingConfigsRequest.new -# Call the list_serving_configs method. -result = client.list_serving_configs request + # Call the list_serving_configs method. + result = client.list_serving_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Retail::V2::ServingConfig. + p response + end end # [END retail_v2_generated_ServingConfigService_ListServingConfigs_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb b/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb index 86d0062bc062..7316b1cde7cf 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/remove_control.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_RemoveControl_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#remove_control +# +def remove_control + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::RemoveControlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RemoveControlRequest.new -# Call the remove_control method. -result = client.remove_control request + # Call the remove_control method. + result = client.remove_control request -# The returned object is of type Google::Cloud::Retail::V2::ServingConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end # [END retail_v2_generated_ServingConfigService_RemoveControl_sync] diff --git a/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb b/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb index e5768035b2b9..4928748824df 100644 --- a/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb +++ b/google-cloud-retail-v2/snippets/serving_config_service/update_serving_config.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::ServingConfigService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::ServingConfigService::Client#update_serving_config +# +def update_serving_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::ServingConfigService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::UpdateServingConfigRequest.new -# Call the update_serving_config method. -result = client.update_serving_config request + # Call the update_serving_config method. + result = client.update_serving_config request -# The returned object is of type Google::Cloud::Retail::V2::ServingConfig. -p result + # The returned object is of type Google::Cloud::Retail::V2::ServingConfig. + p result +end # [END retail_v2_generated_ServingConfigService_UpdateServingConfig_sync] diff --git a/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json b/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json index 052df03f738f..656605cb6cef 100644 --- a/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json +++ b/google-cloud-retail-v2/snippets/snippet_metadata_google.cloud.retail.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb b/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb index 51765878de63..1ba4794a4a0c 100755 --- a/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb +++ b/google-cloud-retail-v2/snippets/user_event_service/collect_user_event.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_UserEventService_CollectUserEvent_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#collect_user_event +# +def collect_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::CollectUserEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::CollectUserEventRequest.new -# Call the collect_user_event method. -result = client.collect_user_event request + # Call the collect_user_event method. + result = client.collect_user_event request -# The returned object is of type Google::Api::HttpBody. -p result + # The returned object is of type Google::Api::HttpBody. + p result +end # [END retail_v2_generated_UserEventService_CollectUserEvent_sync] diff --git a/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb b/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb index bd1a60e866ec..ed8e4c32a185 100755 --- a/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb +++ b/google-cloud-retail-v2/snippets/user_event_service/import_user_events.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_UserEventService_ImportUserEvents_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#import_user_events +# +def import_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::ImportUserEventsRequest.new -# Call the import_user_events method. -result = client.import_user_events request + # Call the import_user_events method. + result = client.import_user_events request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_UserEventService_ImportUserEvents_sync] diff --git a/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb b/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb index 6ae9f3290808..da4566c0e330 100755 --- a/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb +++ b/google-cloud-retail-v2/snippets/user_event_service/purge_user_events.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_UserEventService_PurgeUserEvents_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#purge_user_events +# +def purge_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::PurgeUserEventsRequest.new -# Call the purge_user_events method. -result = client.purge_user_events request + # Call the purge_user_events method. + result = client.purge_user_events request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_UserEventService_PurgeUserEvents_sync] diff --git a/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb b/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb index e0016f09d3db..83991bcc4a98 100755 --- a/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb +++ b/google-cloud-retail-v2/snippets/user_event_service/rejoin_user_events.rb @@ -19,22 +19,28 @@ # [START retail_v2_generated_UserEventService_RejoinUserEvents_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#rejoin_user_events +# +def rejoin_user_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::RejoinUserEventsRequest.new -# Call the rejoin_user_events method. -result = client.rejoin_user_events request + # Call the rejoin_user_events method. + result = client.rejoin_user_events request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END retail_v2_generated_UserEventService_RejoinUserEvents_sync] diff --git a/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb b/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb index 7cfede9d0876..507d6940fdfb 100755 --- a/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb +++ b/google-cloud-retail-v2/snippets/user_event_service/write_user_event.rb @@ -19,15 +19,21 @@ # [START retail_v2_generated_UserEventService_WriteUserEvent_sync] require "google/cloud/retail/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Retail::V2::UserEventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Retail::V2::UserEventService::Client#write_user_event +# +def write_user_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Retail::V2::UserEventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Retail::V2::WriteUserEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Retail::V2::WriteUserEventRequest.new -# Call the write_user_event method. -result = client.write_user_event request + # Call the write_user_event method. + result = client.write_user_event request -# The returned object is of type Google::Cloud::Retail::V2::UserEvent. -p result + # The returned object is of type Google::Cloud::Retail::V2::UserEvent. + p result +end # [END retail_v2_generated_UserEventService_WriteUserEvent_sync] diff --git a/google-cloud-run-v2/.rubocop.yml b/google-cloud-run-v2/.rubocop.yml index 3e8d9088a2fc..03fff95e8da1 100644 --- a/google-cloud-run-v2/.rubocop.yml +++ b/google-cloud-run-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-run-v2.rb" diff --git a/google-cloud-run-v2/snippets/Gemfile b/google-cloud-run-v2/snippets/Gemfile index 7870aec74021..b942d0119b52 100644 --- a/google-cloud-run-v2/snippets/Gemfile +++ b/google-cloud-run-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-run-v2/snippets/revisions/delete_revision.rb b/google-cloud-run-v2/snippets/revisions/delete_revision.rb index 09d7d2eb4611..1adef3c8b5f2 100644 --- a/google-cloud-run-v2/snippets/revisions/delete_revision.rb +++ b/google-cloud-run-v2/snippets/revisions/delete_revision.rb @@ -19,22 +19,28 @@ # [START run_v2_generated_Revisions_DeleteRevision_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Revisions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Revisions::Client#delete_revision +# +def delete_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Revisions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::DeleteRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::DeleteRevisionRequest.new -# Call the delete_revision method. -result = client.delete_revision request + # Call the delete_revision method. + result = client.delete_revision request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END run_v2_generated_Revisions_DeleteRevision_sync] diff --git a/google-cloud-run-v2/snippets/revisions/get_revision.rb b/google-cloud-run-v2/snippets/revisions/get_revision.rb index 438f4b4a205b..61b1bdc72dfb 100644 --- a/google-cloud-run-v2/snippets/revisions/get_revision.rb +++ b/google-cloud-run-v2/snippets/revisions/get_revision.rb @@ -19,15 +19,21 @@ # [START run_v2_generated_Revisions_GetRevision_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Revisions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Revisions::Client#get_revision +# +def get_revision + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Revisions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::GetRevisionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::GetRevisionRequest.new -# Call the get_revision method. -result = client.get_revision request + # Call the get_revision method. + result = client.get_revision request -# The returned object is of type Google::Cloud::Run::V2::Revision. -p result + # The returned object is of type Google::Cloud::Run::V2::Revision. + p result +end # [END run_v2_generated_Revisions_GetRevision_sync] diff --git a/google-cloud-run-v2/snippets/revisions/list_revisions.rb b/google-cloud-run-v2/snippets/revisions/list_revisions.rb index 4fd0e346c7b6..081b8fa63a1a 100644 --- a/google-cloud-run-v2/snippets/revisions/list_revisions.rb +++ b/google-cloud-run-v2/snippets/revisions/list_revisions.rb @@ -19,21 +19,27 @@ # [START run_v2_generated_Revisions_ListRevisions_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Revisions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Revisions::Client#list_revisions +# +def list_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Revisions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::ListRevisionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::ListRevisionsRequest.new -# Call the list_revisions method. -result = client.list_revisions request + # Call the list_revisions method. + result = client.list_revisions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Run::V2::Revision. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Run::V2::Revision. + p response + end end # [END run_v2_generated_Revisions_ListRevisions_sync] diff --git a/google-cloud-run-v2/snippets/services/create_service.rb b/google-cloud-run-v2/snippets/services/create_service.rb index f63feeac6b46..055f4a6b8fd7 100644 --- a/google-cloud-run-v2/snippets/services/create_service.rb +++ b/google-cloud-run-v2/snippets/services/create_service.rb @@ -19,22 +19,28 @@ # [START run_v2_generated_Services_CreateService_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END run_v2_generated_Services_CreateService_sync] diff --git a/google-cloud-run-v2/snippets/services/delete_service.rb b/google-cloud-run-v2/snippets/services/delete_service.rb index 89a59a387e69..2ccbc559cc84 100644 --- a/google-cloud-run-v2/snippets/services/delete_service.rb +++ b/google-cloud-run-v2/snippets/services/delete_service.rb @@ -19,22 +19,28 @@ # [START run_v2_generated_Services_DeleteService_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END run_v2_generated_Services_DeleteService_sync] diff --git a/google-cloud-run-v2/snippets/services/get_iam_policy.rb b/google-cloud-run-v2/snippets/services/get_iam_policy.rb index f57a24c58609..f92ebafbdf37 100644 --- a/google-cloud-run-v2/snippets/services/get_iam_policy.rb +++ b/google-cloud-run-v2/snippets/services/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START run_v2_generated_Services_GetIamPolicy_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END run_v2_generated_Services_GetIamPolicy_sync] diff --git a/google-cloud-run-v2/snippets/services/get_service.rb b/google-cloud-run-v2/snippets/services/get_service.rb index 228f49507a07..5c2627de938f 100644 --- a/google-cloud-run-v2/snippets/services/get_service.rb +++ b/google-cloud-run-v2/snippets/services/get_service.rb @@ -19,15 +19,21 @@ # [START run_v2_generated_Services_GetService_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::Run::V2::Service. -p result + # The returned object is of type Google::Cloud::Run::V2::Service. + p result +end # [END run_v2_generated_Services_GetService_sync] diff --git a/google-cloud-run-v2/snippets/services/list_services.rb b/google-cloud-run-v2/snippets/services/list_services.rb index c00ac6eaf286..1de5dfa251d1 100644 --- a/google-cloud-run-v2/snippets/services/list_services.rb +++ b/google-cloud-run-v2/snippets/services/list_services.rb @@ -19,21 +19,27 @@ # [START run_v2_generated_Services_ListServices_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Run::V2::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Run::V2::Service. + p response + end end # [END run_v2_generated_Services_ListServices_sync] diff --git a/google-cloud-run-v2/snippets/services/set_iam_policy.rb b/google-cloud-run-v2/snippets/services/set_iam_policy.rb index 6800229c7ed4..360faa897bf7 100644 --- a/google-cloud-run-v2/snippets/services/set_iam_policy.rb +++ b/google-cloud-run-v2/snippets/services/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START run_v2_generated_Services_SetIamPolicy_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END run_v2_generated_Services_SetIamPolicy_sync] diff --git a/google-cloud-run-v2/snippets/services/test_iam_permissions.rb b/google-cloud-run-v2/snippets/services/test_iam_permissions.rb index a6cf15df50fb..e66c040f8643 100644 --- a/google-cloud-run-v2/snippets/services/test_iam_permissions.rb +++ b/google-cloud-run-v2/snippets/services/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START run_v2_generated_Services_TestIamPermissions_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END run_v2_generated_Services_TestIamPermissions_sync] diff --git a/google-cloud-run-v2/snippets/services/update_service.rb b/google-cloud-run-v2/snippets/services/update_service.rb index 87ff7919780b..fda40fbd28ec 100644 --- a/google-cloud-run-v2/snippets/services/update_service.rb +++ b/google-cloud-run-v2/snippets/services/update_service.rb @@ -19,22 +19,28 @@ # [START run_v2_generated_Services_UpdateService_sync] require "google/cloud/run/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Run::V2::Services::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Services::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Services::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Run::V2::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END run_v2_generated_Services_UpdateService_sync] diff --git a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json index 7171338770d1..da23b2e24c8f 100644 --- a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json +++ b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-scheduler-v1/.rubocop.yml b/google-cloud-scheduler-v1/.rubocop.yml index 823abe72284d..1aa300a65945 100644 --- a/google-cloud-scheduler-v1/.rubocop.yml +++ b/google-cloud-scheduler-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-scheduler-v1.rb" diff --git a/google-cloud-scheduler-v1/snippets/Gemfile b/google-cloud-scheduler-v1/snippets/Gemfile index 33b935043d0f..800007e9fd6c 100755 --- a/google-cloud-scheduler-v1/snippets/Gemfile +++ b/google-cloud-scheduler-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb index 282439bfa777..88ad99062752 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/create_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_CreateJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb index 66eb518cf3fa..11cdf717f78f 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/delete_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_DeleteJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb index 090df994eebd..089b0f2f248f 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/get_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_GetJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb index 594b691112b7..843b2cff1f62 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/list_jobs.rb @@ -19,21 +19,27 @@ # [START cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Scheduler::V1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Scheduler::V1::Job. + p response + end end # [END cloudscheduler_v1_generated_CloudScheduler_ListJobs_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb index 9f88bb9cd28f..9eccf3b7dd6f 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/pause_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#pause_job +# +def pause_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::PauseJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::PauseJobRequest.new -# Call the pause_job method. -result = client.pause_job request + # Call the pause_job method. + result = client.pause_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_PauseJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb index 47538dd7421c..af084427b8e7 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/resume_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#resume_job +# +def resume_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::ResumeJobRequest.new -# Call the resume_job method. -result = client.resume_job request + # Call the resume_job method. + result = client.resume_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_ResumeJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb index c9e861d14f21..a291643bd825 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/run_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#run_job +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::RunJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::RunJobRequest.new -# Call the run_job method. -result = client.run_job request + # Call the run_job method. + result = client.run_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_RunJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb b/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb index 6ec3818ec12d..bf3ff83efad4 100755 --- a/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb +++ b/google-cloud-scheduler-v1/snippets/cloud_scheduler/update_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] require "google/cloud/scheduler/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1::CloudScheduler::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Scheduler::V1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1::Job. + p result +end # [END cloudscheduler_v1_generated_CloudScheduler_UpdateJob_sync] diff --git a/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json b/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json index d017d4b25f08..ad42f80e01e0 100644 --- a/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json +++ b/google-cloud-scheduler-v1/snippets/snippet_metadata_google.cloud.scheduler.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-scheduler-v1beta1/.rubocop.yml b/google-cloud-scheduler-v1beta1/.rubocop.yml index ba86128f3f71..ea48b9fe0f26 100644 --- a/google-cloud-scheduler-v1beta1/.rubocop.yml +++ b/google-cloud-scheduler-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-scheduler-v1beta1.rb" diff --git a/google-cloud-scheduler-v1beta1/snippets/Gemfile b/google-cloud-scheduler-v1beta1/snippets/Gemfile index ffaf307c60da..350c1a7c3d4e 100755 --- a/google-cloud-scheduler-v1beta1/snippets/Gemfile +++ b/google-cloud-scheduler-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb index 778bfbe62ab5..0b4bc666a644 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/create_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_CreateJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb index 3db22c063bf5..d1f242b16855 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/delete_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_DeleteJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb index 7526e1cf0d64..f4b4d57bff2c 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/get_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_GetJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb index 323b47ed0140..b359155a0e27 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/list_jobs.rb @@ -19,21 +19,27 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Scheduler::V1beta1::Job. + p response + end end # [END cloudscheduler_v1beta1_generated_CloudScheduler_ListJobs_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb index 6b13873538ac..472936dfd31d 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/pause_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#pause_job +# +def pause_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::PauseJobRequest.new -# Call the pause_job method. -result = client.pause_job request + # Call the pause_job method. + result = client.pause_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_PauseJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb index 0969d210518c..7eeb9a011ebd 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/resume_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#resume_job +# +def resume_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::ResumeJobRequest.new -# Call the resume_job method. -result = client.resume_job request + # Call the resume_job method. + result = client.resume_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_ResumeJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb index 13f0e661ea81..379ff80c9616 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/run_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#run_job +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::RunJobRequest.new -# Call the run_job method. -result = client.run_job request + # Call the run_job method. + result = client.run_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_RunJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb index 0616e6988ab8..2ebd2bc9ba3a 100755 --- a/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb +++ b/google-cloud-scheduler-v1beta1/snippets/cloud_scheduler/update_job.rb @@ -19,15 +19,21 @@ # [START cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] require "google/cloud/scheduler/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Scheduler::V1beta1::CloudScheduler::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Scheduler::V1beta1::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. -p result + # The returned object is of type Google::Cloud::Scheduler::V1beta1::Job. + p result +end # [END cloudscheduler_v1beta1_generated_CloudScheduler_UpdateJob_sync] diff --git a/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json b/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json index 5d71b1eb26d1..4f7a76bc3176 100644 --- a/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json +++ b/google-cloud-scheduler-v1beta1/snippets/snippet_metadata_google.cloud.scheduler.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-secret_manager-v1/.rubocop.yml b/google-cloud-secret_manager-v1/.rubocop.yml index 728462b98b69..2600ed75e42a 100644 --- a/google-cloud-secret_manager-v1/.rubocop.yml +++ b/google-cloud-secret_manager-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-secret_manager-v1.rb" diff --git a/google-cloud-secret_manager-v1/snippets/Gemfile b/google-cloud-secret_manager-v1/snippets/Gemfile index e365479c355d..39becb046c03 100755 --- a/google-cloud-secret_manager-v1/snippets/Gemfile +++ b/google-cloud-secret_manager-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb index dd4e33af1902..3b0d4d9266cb 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/access_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#access_secret_version +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AccessSecretVersionRequest.new -# Call the access_secret_version method. -result = client.access_secret_version request + # Call the access_secret_version method. + result = client.access_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::AccessSecretVersionResponse. + p result +end # [END secretmanager_v1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb index 6a98b528ec08..85ad7dfb6a9c 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/add_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#add_secret_version +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::AddSecretVersionRequest.new -# Call the add_secret_version method. -result = client.add_secret_version request + # Call the add_secret_version method. + result = client.add_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end # [END secretmanager_v1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb index 5942e9eb3c2f..01ac5f954250 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/create_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#create_secret +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::CreateSecretRequest.new -# Call the create_secret method. -result = client.create_secret request + # Call the create_secret method. + result = client.create_secret request -# The returned object is of type Google::Cloud::SecretManager::V1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end # [END secretmanager_v1_generated_SecretManagerService_CreateSecret_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb index ade9b9ff61fb..0193aa8cd51c 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/delete_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#delete_secret +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DeleteSecretRequest.new -# Call the delete_secret method. -result = client.delete_secret request + # Call the delete_secret method. + result = client.delete_secret request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END secretmanager_v1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb index 55f19a344af6..1862a8ca9dfc 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/destroy_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#destroy_secret_version +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DestroySecretVersionRequest.new -# Call the destroy_secret_version method. -result = client.destroy_secret_version request + # Call the destroy_secret_version method. + result = client.destroy_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end # [END secretmanager_v1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb index a2d8380e1f92..77c467a90f16 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/disable_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#disable_secret_version +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::DisableSecretVersionRequest.new -# Call the disable_secret_version method. -result = client.disable_secret_version request + # Call the disable_secret_version method. + result = client.disable_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end # [END secretmanager_v1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb index f6f059884a96..59ff5fe247df 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/enable_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#enable_secret_version +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::EnableSecretVersionRequest.new -# Call the enable_secret_version method. -result = client.enable_secret_version request + # Call the enable_secret_version method. + result = client.enable_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end # [END secretmanager_v1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb index a4b963881b43..08f54e0c3e9e 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END secretmanager_v1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb index 3df74fe55529..0971987be74d 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_GetSecret_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::GetSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretRequest.new -# Call the get_secret method. -result = client.get_secret request + # Call the get_secret method. + result = client.get_secret request -# The returned object is of type Google::Cloud::SecretManager::V1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end # [END secretmanager_v1_generated_SecretManagerService_GetSecret_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb index 9751fa2b413c..73c443d8388d 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/get_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#get_secret_version +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::GetSecretVersionRequest.new -# Call the get_secret_version method. -result = client.get_secret_version request + # Call the get_secret_version method. + result = client.get_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::SecretVersion. + p result +end # [END secretmanager_v1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb index d3646637dd42..61642f28a650 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secret_versions.rb @@ -19,21 +19,27 @@ # [START secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secret_versions +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretVersionsRequest.new -# Call the list_secret_versions method. -result = client.list_secret_versions request + # Call the list_secret_versions method. + result = client.list_secret_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecretManager::V1::SecretVersion. + p response + end end # [END secretmanager_v1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb index cfd14b18a3dc..e9607387c863 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/list_secrets.rb @@ -19,21 +19,27 @@ # [START secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#list_secrets +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::ListSecretsRequest.new -# Call the list_secrets method. -result = client.list_secrets request + # Call the list_secrets method. + result = client.list_secrets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecretManager::V1::Secret. + p response + end end # [END secretmanager_v1_generated_SecretManagerService_ListSecrets_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb index 34169d1bf483..c51f39c6a249 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END secretmanager_v1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb index f1fdee5886a6..5efc84276896 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END secretmanager_v1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb b/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb index fb3edfe5cd39..b88a3bb0d3b8 100755 --- a/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb +++ b/google-cloud-secret_manager-v1/snippets/secret_manager_service/update_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] require "google/cloud/secret_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1::SecretManagerService::Client#update_secret +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1::UpdateSecretRequest.new -# Call the update_secret method. -result = client.update_secret request + # Call the update_secret method. + result = client.update_secret request -# The returned object is of type Google::Cloud::SecretManager::V1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1::Secret. + p result +end # [END secretmanager_v1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json b/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json index b8e0af015754..168967055d35 100644 --- a/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json +++ b/google-cloud-secret_manager-v1/snippets/snippet_metadata_google.cloud.secretmanager.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-secret_manager-v1beta1/.rubocop.yml b/google-cloud-secret_manager-v1beta1/.rubocop.yml index b77f08bf594f..7f3f3a64f5cf 100644 --- a/google-cloud-secret_manager-v1beta1/.rubocop.yml +++ b/google-cloud-secret_manager-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-secret_manager-v1beta1.rb" diff --git a/google-cloud-secret_manager-v1beta1/snippets/Gemfile b/google-cloud-secret_manager-v1beta1/snippets/Gemfile index 2be0a5c4ba62..b73972233266 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/Gemfile +++ b/google-cloud-secret_manager-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb index 17ccceca611d..02c68e8fb026 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/access_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#access_secret_version +# +def access_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::AccessSecretVersionRequest.new -# Call the access_secret_version method. -result = client.access_secret_version request + # Call the access_secret_version method. + result = client.access_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::AccessSecretVersionResponse. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_AccessSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb index 7013c6fff34c..d6466fa9e782 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/add_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#add_secret_version +# +def add_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::AddSecretVersionRequest.new -# Call the add_secret_version method. -result = client.add_secret_version request + # Call the add_secret_version method. + result = client.add_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_AddSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb index a0074aefbb58..af9bc6153a6e 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/create_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#create_secret +# +def create_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::CreateSecretRequest.new -# Call the create_secret method. -result = client.create_secret request + # Call the create_secret method. + result = client.create_secret request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_CreateSecret_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb index 3aeeb7d50483..4d89d39457db 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/delete_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#delete_secret +# +def delete_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DeleteSecretRequest.new -# Call the delete_secret method. -result = client.delete_secret request + # Call the delete_secret method. + result = client.delete_secret request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_DeleteSecret_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb index cee05765b772..857938239e6a 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/destroy_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#destroy_secret_version +# +def destroy_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DestroySecretVersionRequest.new -# Call the destroy_secret_version method. -result = client.destroy_secret_version request + # Call the destroy_secret_version method. + result = client.destroy_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_DestroySecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb index f71ccd3d8987..3cd16fbda5da 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/disable_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#disable_secret_version +# +def disable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::DisableSecretVersionRequest.new -# Call the disable_secret_version method. -result = client.disable_secret_version request + # Call the disable_secret_version method. + result = client.disable_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_DisableSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb index 7007f6b033bb..e0681d390bb1 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/enable_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#enable_secret_version +# +def enable_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::EnableSecretVersionRequest.new -# Call the enable_secret_version method. -result = client.enable_secret_version request + # Call the enable_secret_version method. + result = client.enable_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_EnableSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb index 43e7c59e9267..07776d4e7aec 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_GetIamPolicy_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb index e6605f41a0cd..2e6cf6ca8d9c 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret +# +def get_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::GetSecretRequest.new -# Call the get_secret method. -result = client.get_secret request + # Call the get_secret method. + result = client.get_secret request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_GetSecret_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb index 8aecdc9e78ed..3399a0b72abc 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/get_secret_version.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#get_secret_version +# +def get_secret_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::GetSecretVersionRequest.new -# Call the get_secret_version method. -result = client.get_secret_version request + # Call the get_secret_version method. + result = client.get_secret_version request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::SecretVersion. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_GetSecretVersion_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb index ddd4dd2a30c3..08f9551118ca 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secret_versions.rb @@ -19,21 +19,27 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secret_versions +# +def list_secret_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::ListSecretVersionsRequest.new -# Call the list_secret_versions method. -result = client.list_secret_versions request + # Call the list_secret_versions method. + result = client.list_secret_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecretManager::V1beta1::SecretVersion. + p response + end end # [END secretmanager_v1beta1_generated_SecretManagerService_ListSecretVersions_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb index ad87aa887b4f..ef234e77d6e4 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/list_secrets.rb @@ -19,21 +19,27 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#list_secrets +# +def list_secrets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::ListSecretsRequest.new -# Call the list_secrets method. -result = client.list_secrets request + # Call the list_secrets method. + result = client.list_secrets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecretManager::V1beta1::Secret. + p response + end end # [END secretmanager_v1beta1_generated_SecretManagerService_ListSecrets_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb index 20fa0a52ae38..eeb85c9a4de3 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_SetIamPolicy_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb index 66c86f76b939..21ea19930673 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_TestIamPermissions_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb index 497f9dfe3dd1..a8758b6ffb6d 100755 --- a/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb +++ b/google-cloud-secret_manager-v1beta1/snippets/secret_manager_service/update_secret.rb @@ -19,15 +19,21 @@ # [START secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] require "google/cloud/secret_manager/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client#update_secret +# +def update_secret + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecretManager::V1beta1::SecretManagerService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecretManager::V1beta1::UpdateSecretRequest.new -# Call the update_secret method. -result = client.update_secret request + # Call the update_secret method. + result = client.update_secret request -# The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. -p result + # The returned object is of type Google::Cloud::SecretManager::V1beta1::Secret. + p result +end # [END secretmanager_v1beta1_generated_SecretManagerService_UpdateSecret_sync] diff --git a/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json b/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json index 30a3f30137ce..2b2ec93595c8 100644 --- a/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json +++ b/google-cloud-secret_manager-v1beta1/snippets/snippet_metadata_google.cloud.secrets.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-security-private_ca-v1/.rubocop.yml b/google-cloud-security-private_ca-v1/.rubocop.yml index b20a01e5f1c7..f143186a635f 100644 --- a/google-cloud-security-private_ca-v1/.rubocop.yml +++ b/google-cloud-security-private_ca-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-security-private_ca-v1.rb" diff --git a/google-cloud-security-private_ca-v1/snippets/Gemfile b/google-cloud-security-private_ca-v1/snippets/Gemfile index 67292d66e635..6af5f874c548 100755 --- a/google-cloud-security-private_ca-v1/snippets/Gemfile +++ b/google-cloud-security-private_ca-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb index 6a3b83e340b2..96a9aed820fd 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/activate_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#activate_certificate_authority +# +def activate_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ActivateCertificateAuthorityRequest.new -# Call the activate_certificate_authority method. -result = client.activate_certificate_authority request + # Call the activate_certificate_authority method. + result = client.activate_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb index 1c6735829141..31fdd7ebd557 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_ca_pool.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_ca_pool +# +def create_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCaPoolRequest.new -# Call the create_ca_pool method. -result = client.create_ca_pool request + # Call the create_ca_pool method. + result = client.create_ca_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_CreateCaPool_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb index 3e5fb961f7c1..b38894b3d0d1 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate +# +def create_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateRequest.new -# Call the create_certificate method. -result = client.create_certificate request + # Call the create_certificate method. + result = client.create_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb index 2c89b300e29a..2b24592d7319 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_authority +# +def create_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateAuthorityRequest.new -# Call the create_certificate_authority method. -result = client.create_certificate_authority request + # Call the create_certificate_authority method. + result = client.create_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb index a28ab89d80ed..b264ffdc3edd 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/create_certificate_template.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#create_certificate_template +# +def create_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::CreateCertificateTemplateRequest.new -# Call the create_certificate_template method. -result = client.create_certificate_template request + # Call the create_certificate_template method. + result = client.create_certificate_template request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_CreateCertificateTemplate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb index 05e1071370a8..0079ce5a6326 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_ca_pool.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_ca_pool +# +def delete_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCaPoolRequest.new -# Call the delete_ca_pool method. -result = client.delete_ca_pool request + # Call the delete_ca_pool method. + result = client.delete_ca_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_DeleteCaPool_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb index f8a13dfbc8f8..66b393768c4e 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_authority +# +def delete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateAuthorityRequest.new -# Call the delete_certificate_authority method. -result = client.delete_certificate_authority request + # Call the delete_certificate_authority method. + result = client.delete_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb index ed532a578bea..0e0b4aaa3d41 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/delete_certificate_template.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#delete_certificate_template +# +def delete_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DeleteCertificateTemplateRequest.new -# Call the delete_certificate_template method. -result = client.delete_certificate_template request + # Call the delete_certificate_template method. + result = client.delete_certificate_template request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_DeleteCertificateTemplate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb index d0b9e778d060..62ab076a9fe8 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/disable_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#disable_certificate_authority +# +def disable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::DisableCertificateAuthorityRequest.new -# Call the disable_certificate_authority method. -result = client.disable_certificate_authority request + # Call the disable_certificate_authority method. + result = client.disable_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb index 1a2bcb92999a..91d7e7573d9a 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/enable_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#enable_certificate_authority +# +def enable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::EnableCertificateAuthorityRequest.new -# Call the enable_certificate_authority method. -result = client.enable_certificate_authority request + # Call the enable_certificate_authority method. + result = client.enable_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb index b8a890879c67..daf6e799ca67 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_ca_certs.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_ca_certs +# +def fetch_ca_certs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::FetchCaCertsRequest.new -# Call the fetch_ca_certs method. -result = client.fetch_ca_certs request + # Call the fetch_ca_certs method. + result = client.fetch_ca_certs request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCaCertsResponse. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_FetchCaCerts_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb index 1a24dfd00289..38221cfaa39c 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#fetch_certificate_authority_csr +# +def fetch_certificate_authority_csr + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrRequest.new -# Call the fetch_certificate_authority_csr method. -result = client.fetch_certificate_authority_csr request + # Call the fetch_certificate_authority_csr method. + result = client.fetch_certificate_authority_csr request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::FetchCertificateAuthorityCsrResponse. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb index 07cb5729424a..87ca4a5478c7 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_ca_pool.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_ca_pool +# +def get_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCaPoolRequest.new -# Call the get_ca_pool method. -result = client.get_ca_pool request + # Call the get_ca_pool method. + result = client.get_ca_pool request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CaPool. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_GetCaPool_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb index a4cc2253d687..69470f660a87 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate +# +def get_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRequest.new -# Call the get_certificate method. -result = client.get_certificate request + # Call the get_certificate method. + result = client.get_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb index 3b6e948f0015..f2d9bf2f6911 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_authority.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_authority +# +def get_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateAuthorityRequest.new -# Call the get_certificate_authority method. -result = client.get_certificate_authority request + # Call the get_certificate_authority method. + result = client.get_certificate_authority request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb index 084a1eb69113..7576a6c36e96 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_revocation_list.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_revocation_list +# +def get_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateRevocationListRequest.new -# Call the get_certificate_revocation_list method. -result = client.get_certificate_revocation_list request + # Call the get_certificate_revocation_list method. + result = client.get_certificate_revocation_list request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb index 2b0ac0c022f2..c9de1f6bf133 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/get_certificate_template.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#get_certificate_template +# +def get_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::GetCertificateTemplateRequest.new -# Call the get_certificate_template method. -result = client.get_certificate_template request + # Call the get_certificate_template method. + result = client.get_certificate_template request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_GetCertificateTemplate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb index ada3cc7c1dc4..f3cdd7f89c73 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_ca_pools.rb @@ -19,21 +19,27 @@ # [START privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_ca_pools +# +def list_ca_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCaPoolsRequest.new -# Call the list_ca_pools method. -result = client.list_ca_pools request + # Call the list_ca_pools method. + result = client.list_ca_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CaPool. + p response + end end # [END privateca_v1_generated_CertificateAuthorityService_ListCaPools_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb index 75830871785f..5e779ea1a5a9 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_authorities.rb @@ -19,21 +19,27 @@ # [START privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_authorities +# +def list_certificate_authorities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateAuthoritiesRequest.new -# Call the list_certificate_authorities method. -result = client.list_certificate_authorities request + # Call the list_certificate_authorities method. + result = client.list_certificate_authorities request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateAuthority. + p response + end end # [END privateca_v1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb index 4e008e4faba1..5c7a5bcbb4a1 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb @@ -19,21 +19,27 @@ # [START privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_revocation_lists +# +def list_certificate_revocation_lists + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateRevocationListsRequest.new -# Call the list_certificate_revocation_lists method. -result = client.list_certificate_revocation_lists request + # Call the list_certificate_revocation_lists method. + result = client.list_certificate_revocation_lists request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateRevocationList. + p response + end end # [END privateca_v1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb index 971575825575..4efd01510819 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificate_templates.rb @@ -19,21 +19,27 @@ # [START privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificate_templates +# +def list_certificate_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificateTemplatesRequest.new -# Call the list_certificate_templates method. -result = client.list_certificate_templates request + # Call the list_certificate_templates method. + result = client.list_certificate_templates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::CertificateTemplate. + p response + end end # [END privateca_v1_generated_CertificateAuthorityService_ListCertificateTemplates_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb index dd2dd7773bfd..c819e1b3426b 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/list_certificates.rb @@ -19,21 +19,27 @@ # [START privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#list_certificates +# +def list_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::ListCertificatesRequest.new -# Call the list_certificates method. -result = client.list_certificates request + # Call the list_certificates method. + result = client.list_certificates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1::Certificate. + p response + end end # [END privateca_v1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb index d48402913eef..7c8f776151a6 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/revoke_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#revoke_certificate +# +def revoke_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::RevokeCertificateRequest.new -# Call the revoke_certificate method. -result = client.revoke_certificate request + # Call the revoke_certificate method. + result = client.revoke_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb index 0fe8b7a3b2d2..e0c8317a8995 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/undelete_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#undelete_certificate_authority +# +def undelete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UndeleteCertificateAuthorityRequest.new -# Call the undelete_certificate_authority method. -result = client.undelete_certificate_authority request + # Call the undelete_certificate_authority method. + result = client.undelete_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_UndeleteCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb index e68fb5b497e6..5ac3d042def6 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_ca_pool.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_ca_pool +# +def update_ca_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCaPoolRequest.new -# Call the update_ca_pool method. -result = client.update_ca_pool request + # Call the update_ca_pool method. + result = client.update_ca_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_UpdateCaPool_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb index 2275a0d70eb9..404e418c63da 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate +# +def update_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRequest.new -# Call the update_certificate method. -result = client.update_certificate request + # Call the update_certificate method. + result = client.update_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1::Certificate. + p result +end # [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb index aa6f48fdb7a0..6bdb46c3cc67 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_authority +# +def update_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateAuthorityRequest.new -# Call the update_certificate_authority method. -result = client.update_certificate_authority request + # Call the update_certificate_authority method. + result = client.update_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb index ef808ab3840c..c9b78b26707a 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_revocation_list.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_revocation_list +# +def update_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateRevocationListRequest.new -# Call the update_certificate_revocation_list method. -result = client.update_certificate_revocation_list request + # Call the update_certificate_revocation_list method. + result = client.update_certificate_revocation_list request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb index 1f9550350fa9..b8d7b7f200b0 100755 --- a/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb +++ b/google-cloud-security-private_ca-v1/snippets/certificate_authority_service/update_certificate_template.rb @@ -19,22 +19,28 @@ # [START privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] require "google/cloud/security/private_ca/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client#update_certificate_template +# +def update_certificate_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1::UpdateCertificateTemplateRequest.new -# Call the update_certificate_template method. -result = client.update_certificate_template request + # Call the update_certificate_template method. + result = client.update_certificate_template request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1_generated_CertificateAuthorityService_UpdateCertificateTemplate_sync] diff --git a/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json b/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json index 03133d37a9ed..01510364c421 100644 --- a/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json +++ b/google-cloud-security-private_ca-v1/snippets/snippet_metadata_google.cloud.security.privateca.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-security-private_ca-v1beta1/.rubocop.yml b/google-cloud-security-private_ca-v1beta1/.rubocop.yml index 30d5851abbf3..fd09dadd27e7 100644 --- a/google-cloud-security-private_ca-v1beta1/.rubocop.yml +++ b/google-cloud-security-private_ca-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-security-private_ca-v1beta1.rb" diff --git a/google-cloud-security-private_ca-v1beta1/snippets/Gemfile b/google-cloud-security-private_ca-v1beta1/snippets/Gemfile index c374eb1ccccf..ba622338f7f9 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/Gemfile +++ b/google-cloud-security-private_ca-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb index 8a30aef77e76..59e585e31249 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/activate_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#activate_certificate_authority +# +def activate_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ActivateCertificateAuthorityRequest.new -# Call the activate_certificate_authority method. -result = client.activate_certificate_authority request + # Call the activate_certificate_authority method. + result = client.activate_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ActivateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb index eb3c583ea191..762206a6b566 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate +# +def create_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateRequest.new -# Call the create_certificate method. -result = client.create_certificate request + # Call the create_certificate method. + result = client.create_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificate_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb index 0c1e3b2b2a65..1e9e13dbe7bf 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/create_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#create_certificate_authority +# +def create_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::CreateCertificateAuthorityRequest.new -# Call the create_certificate_authority method. -result = client.create_certificate_authority request + # Call the create_certificate_authority method. + result = client.create_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_CreateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb index 94cabd7884d0..ac4de637d291 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/disable_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#disable_certificate_authority +# +def disable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::DisableCertificateAuthorityRequest.new -# Call the disable_certificate_authority method. -result = client.disable_certificate_authority request + # Call the disable_certificate_authority method. + result = client.disable_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_DisableCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb index 45bbf8cd0f48..dc2d4f9973e1 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/enable_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#enable_certificate_authority +# +def enable_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::EnableCertificateAuthorityRequest.new -# Call the enable_certificate_authority method. -result = client.enable_certificate_authority request + # Call the enable_certificate_authority method. + result = client.enable_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_EnableCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb index e68048d1f162..e7f4fd17a8ce 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/fetch_certificate_authority_csr.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#fetch_certificate_authority_csr +# +def fetch_certificate_authority_csr + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrRequest.new -# Call the fetch_certificate_authority_csr method. -result = client.fetch_certificate_authority_csr request + # Call the fetch_certificate_authority_csr method. + result = client.fetch_certificate_authority_csr request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::FetchCertificateAuthorityCsrResponse. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_FetchCertificateAuthorityCsr_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb index 90f37a2ea604..57d0df5155bb 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate +# +def get_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRequest.new -# Call the get_certificate method. -result = client.get_certificate request + # Call the get_certificate method. + result = client.get_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificate_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb index a3230bd79a4b..7480fd619fb2 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_authority.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_authority +# +def get_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateAuthorityRequest.new -# Call the get_certificate_authority method. -result = client.get_certificate_authority request + # Call the get_certificate_authority method. + result = client.get_certificate_authority request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb index dd3c974fb68d..2fb74ba583a7 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_certificate_revocation_list.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_certificate_revocation_list +# +def get_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetCertificateRevocationListRequest.new -# Call the get_certificate_revocation_list method. -result = client.get_certificate_revocation_list request + # Call the get_certificate_revocation_list method. + result = client.get_certificate_revocation_list request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_GetCertificateRevocationList_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb index 3e5f99e0b63c..dc5aa615e440 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/get_reusable_config.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#get_reusable_config +# +def get_reusable_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::GetReusableConfigRequest.new -# Call the get_reusable_config method. -result = client.get_reusable_config request + # Call the get_reusable_config method. + result = client.get_reusable_config request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_GetReusableConfig_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb index 7ab1d11b310f..71ef49459026 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_authorities.rb @@ -19,21 +19,27 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_authorities +# +def list_certificate_authorities + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateAuthoritiesRequest.new -# Call the list_certificate_authorities method. -result = client.list_certificate_authorities request + # Call the list_certificate_authorities method. + result = client.list_certificate_authorities request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthority. + p response + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateAuthorities_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb index 8e8a792a585f..754f7dcaccf0 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificate_revocation_lists.rb @@ -19,21 +19,27 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificate_revocation_lists +# +def list_certificate_revocation_lists + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificateRevocationListsRequest.new -# Call the list_certificate_revocation_lists method. -result = client.list_certificate_revocation_lists request + # Call the list_certificate_revocation_lists method. + result = client.list_certificate_revocation_lists request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::CertificateRevocationList. + p response + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificateRevocationLists_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb index 055b6b90234e..8009232ba6d5 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_certificates.rb @@ -19,21 +19,27 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_certificates +# +def list_certificates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListCertificatesRequest.new -# Call the list_certificates method. -result = client.list_certificates request + # Call the list_certificates method. + result = client.list_certificates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p response + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ListCertificates_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb index 0931a6dabe00..81e2d04142d8 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/list_reusable_configs.rb @@ -19,21 +19,27 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#list_reusable_configs +# +def list_reusable_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ListReusableConfigsRequest.new -# Call the list_reusable_configs method. -result = client.list_reusable_configs request + # Call the list_reusable_configs method. + result = client.list_reusable_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Security::PrivateCA::V1beta1::ReusableConfig. + p response + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ListReusableConfigs_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb index bccbfdfffe4c..267943aa61f4 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/restore_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#restore_certificate_authority +# +def restore_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::RestoreCertificateAuthorityRequest.new -# Call the restore_certificate_authority method. -result = client.restore_certificate_authority request + # Call the restore_certificate_authority method. + result = client.restore_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_RestoreCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb index ffb325f834db..542eebeaf97d 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/revoke_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#revoke_certificate +# +def revoke_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::RevokeCertificateRequest.new -# Call the revoke_certificate method. -result = client.revoke_certificate request + # Call the revoke_certificate method. + result = client.revoke_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_RevokeCertificate_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb index 017fdf736198..5eb8c82a8fc7 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/schedule_delete_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#schedule_delete_certificate_authority +# +def schedule_delete_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::ScheduleDeleteCertificateAuthorityRequest.new -# Call the schedule_delete_certificate_authority method. -result = client.schedule_delete_certificate_authority request + # Call the schedule_delete_certificate_authority method. + result = client.schedule_delete_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_ScheduleDeleteCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb index b9bc64c48665..468b609d152b 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate.rb @@ -19,15 +19,21 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate +# +def update_certificate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRequest.new -# Call the update_certificate method. -result = client.update_certificate request + # Call the update_certificate method. + result = client.update_certificate request -# The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. -p result + # The returned object is of type Google::Cloud::Security::PrivateCA::V1beta1::Certificate. + p result +end # [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificate_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb index 3f6e6bfd47f0..a63fed937f17 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_authority.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_authority +# +def update_certificate_authority + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateAuthorityRequest.new -# Call the update_certificate_authority method. -result = client.update_certificate_authority request + # Call the update_certificate_authority method. + result = client.update_certificate_authority request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateAuthority_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb index d12084bde8e1..535fd9119a57 100755 --- a/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb +++ b/google-cloud-security-private_ca-v1beta1/snippets/certificate_authority_service/update_certificate_revocation_list.rb @@ -19,22 +19,28 @@ # [START privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] require "google/cloud/security/private_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client#update_certificate_revocation_list +# +def update_certificate_revocation_list + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PrivateCA::V1beta1::CertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PrivateCA::V1beta1::UpdateCertificateRevocationListRequest.new -# Call the update_certificate_revocation_list method. -result = client.update_certificate_revocation_list request + # Call the update_certificate_revocation_list method. + result = client.update_certificate_revocation_list request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END privateca_v1beta1_generated_CertificateAuthorityService_UpdateCertificateRevocationList_sync] diff --git a/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json b/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json index 47fa19ea39c1..6dc5dad25a59 100644 --- a/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json +++ b/google-cloud-security-private_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.privateca.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-security-public_ca-v1beta1/.rubocop.yml b/google-cloud-security-public_ca-v1beta1/.rubocop.yml index 7551fbcdbba6..a101e8d603d8 100644 --- a/google-cloud-security-public_ca-v1beta1/.rubocop.yml +++ b/google-cloud-security-public_ca-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-security-public_ca-v1beta1.rb" diff --git a/google-cloud-security-public_ca-v1beta1/snippets/Gemfile b/google-cloud-security-public_ca-v1beta1/snippets/Gemfile index bf3b8187b817..742a6989fefe 100644 --- a/google-cloud-security-public_ca-v1beta1/snippets/Gemfile +++ b/google-cloud-security-public_ca-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb b/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb index d6c651d0cff5..2a6de17f8025 100644 --- a/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb +++ b/google-cloud-security-public_ca-v1beta1/snippets/public_certificate_authority_service/create_external_account_key.rb @@ -19,15 +19,21 @@ # [START publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] require "google/cloud/security/public_ca/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client#create_external_account_key +# +def create_external_account_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Security::PublicCA::V1beta1::PublicCertificateAuthorityService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Security::PublicCA::V1beta1::CreateExternalAccountKeyRequest.new -# Call the create_external_account_key method. -result = client.create_external_account_key request + # Call the create_external_account_key method. + result = client.create_external_account_key request -# The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. -p result + # The returned object is of type Google::Cloud::Security::PublicCA::V1beta1::ExternalAccountKey. + p result +end # [END publicca_v1beta1_generated_PublicCertificateAuthorityService_CreateExternalAccountKey_sync] diff --git a/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json b/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json index 3a95088ac3c4..7a099a65b2bf 100644 --- a/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json +++ b/google-cloud-security-public_ca-v1beta1/snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-security_center-v1/.rubocop.yml b/google-cloud-security_center-v1/.rubocop.yml index 0fb3df6a7c12..cd91eea56b45 100644 --- a/google-cloud-security_center-v1/.rubocop.yml +++ b/google-cloud-security_center-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-security_center-v1.rb" diff --git a/google-cloud-security_center-v1/snippets/Gemfile b/google-cloud-security_center-v1/snippets/Gemfile index 52ccd9427689..3ed5b027a461 100755 --- a/google-cloud-security_center-v1/snippets/Gemfile +++ b/google-cloud-security_center-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb b/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb index 298eb9b2e951..7018544b6154 100644 --- a/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb +++ b/google-cloud-security_center-v1/snippets/security_center/bulk_mute_findings.rb @@ -19,22 +19,28 @@ # [START securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#bulk_mute_findings +# +def bulk_mute_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::BulkMuteFindingsRequest.new -# Call the bulk_mute_findings method. -result = client.bulk_mute_findings request + # Call the bulk_mute_findings method. + result = client.bulk_mute_findings request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END securitycenter_v1_generated_SecurityCenter_BulkMuteFindings_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb b/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb index b15d3b9282b9..3ec6af1b8e37 100644 --- a/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb +++ b/google-cloud-security_center-v1/snippets/security_center/create_big_query_export.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_big_query_export +# +def create_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateBigQueryExportRequest.new -# Call the create_big_query_export method. -result = client.create_big_query_export request + # Call the create_big_query_export method. + result = client.create_big_query_export request -# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end # [END securitycenter_v1_generated_SecurityCenter_CreateBigQueryExport_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/create_finding.rb b/google-cloud-security_center-v1/snippets/security_center/create_finding.rb index e1cd0f9851b0..e41800f3b1e0 100755 --- a/google-cloud-security_center-v1/snippets/security_center/create_finding.rb +++ b/google-cloud-security_center-v1/snippets/security_center/create_finding.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_finding +# +def create_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateFindingRequest.new -# Call the create_finding method. -result = client.create_finding request + # Call the create_finding method. + result = client.create_finding request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end # [END securitycenter_v1_generated_SecurityCenter_CreateFinding_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb b/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb index 70ba25fa67a0..ed5192480457 100644 --- a/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/create_mute_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_mute_config +# +def create_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateMuteConfigRequest.new -# Call the create_mute_config method. -result = client.create_mute_config request + # Call the create_mute_config method. + result = client.create_mute_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_CreateMuteConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb b/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb index e5879e520eb1..42d7314d5d4a 100755 --- a/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/create_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_notification_config +# +def create_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateNotificationConfigRequest.new -# Call the create_notification_config method. -result = client.create_notification_config request + # Call the create_notification_config method. + result = client.create_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/create_source.rb b/google-cloud-security_center-v1/snippets/security_center/create_source.rb index fd6a8ac11c6e..434df3095181 100755 --- a/google-cloud-security_center-v1/snippets/security_center/create_source.rb +++ b/google-cloud-security_center-v1/snippets/security_center/create_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_CreateSource_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#create_source +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::CreateSourceRequest.new -# Call the create_source method. -result = client.create_source request + # Call the create_source method. + result = client.create_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end # [END securitycenter_v1_generated_SecurityCenter_CreateSource_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb b/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb index 711aa4da43d2..3f191a0545cb 100644 --- a/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb +++ b/google-cloud-security_center-v1/snippets/security_center/delete_big_query_export.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_big_query_export +# +def delete_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteBigQueryExportRequest.new -# Call the delete_big_query_export method. -result = client.delete_big_query_export request + # Call the delete_big_query_export method. + result = client.delete_big_query_export request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END securitycenter_v1_generated_SecurityCenter_DeleteBigQueryExport_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb b/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb index 9bdd25346962..979ad1ef4f63 100644 --- a/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/delete_mute_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_mute_config +# +def delete_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteMuteConfigRequest.new -# Call the delete_mute_config method. -result = client.delete_mute_config request + # Call the delete_mute_config method. + result = client.delete_mute_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END securitycenter_v1_generated_SecurityCenter_DeleteMuteConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb b/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb index d53131a365f4..7f15c0cf7ba6 100755 --- a/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/delete_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#delete_notification_config +# +def delete_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::DeleteNotificationConfigRequest.new -# Call the delete_notification_config method. -result = client.delete_notification_config request + # Call the delete_notification_config method. + result = client.delete_notification_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END securitycenter_v1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb b/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb index 51096b3d576a..f13ce9a49cc2 100644 --- a/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_big_query_export.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_big_query_export +# +def get_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetBigQueryExportRequest.new -# Call the get_big_query_export method. -result = client.get_big_query_export request + # Call the get_big_query_export method. + result = client.get_big_query_export request -# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetBigQueryExport_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb b/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb index 39a8e3d8fb9d..bca789ac2768 100755 --- a/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb b/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb index 402489fcf625..a6870cbcb075 100644 --- a/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_mute_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_mute_config +# +def get_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetMuteConfigRequest.new -# Call the get_mute_config method. -result = client.get_mute_config request + # Call the get_mute_config method. + result = client.get_mute_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetMuteConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb b/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb index e19e3d144302..f8d1da65ad91 100755 --- a/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_notification_config +# +def get_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetNotificationConfigRequest.new -# Call the get_notification_config method. -result = client.get_notification_config request + # Call the get_notification_config method. + result = client.get_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb b/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb index faa58f740fca..d23a1baa3911 100755 --- a/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_organization_settings.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_organization_settings +# +def get_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetOrganizationSettingsRequest.new -# Call the get_organization_settings method. -result = client.get_organization_settings request + # Call the get_organization_settings method. + result = client.get_organization_settings request -# The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/get_source.rb b/google-cloud-security_center-v1/snippets/security_center/get_source.rb index 4ea97679bc71..c655a2f70617 100755 --- a/google-cloud-security_center-v1/snippets/security_center/get_source.rb +++ b/google-cloud-security_center-v1/snippets/security_center/get_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_GetSource_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#get_source +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GetSourceRequest.new -# Call the get_source method. -result = client.get_source request + # Call the get_source method. + result = client.get_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end # [END securitycenter_v1_generated_SecurityCenter_GetSource_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/group_assets.rb b/google-cloud-security_center-v1/snippets/security_center/group_assets.rb index bbd3c1e70f1e..77e43d8abc89 100755 --- a/google-cloud-security_center-v1/snippets/security_center/group_assets.rb +++ b/google-cloud-security_center-v1/snippets/security_center/group_assets.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_assets +# +def group_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GroupAssetsRequest.new -# Call the group_assets method. -result = client.group_assets request + # Call the group_assets method. + result = client.group_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_GroupAssets_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/group_findings.rb b/google-cloud-security_center-v1/snippets/security_center/group_findings.rb index cad8bfab5751..992ca7e9a3e5 100755 --- a/google-cloud-security_center-v1/snippets/security_center/group_findings.rb +++ b/google-cloud-security_center-v1/snippets/security_center/group_findings.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#group_findings +# +def group_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::GroupFindingsRequest.new -# Call the group_findings method. -result = client.group_findings request + # Call the group_findings method. + result = client.group_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::GroupResult. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_GroupFindings_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_assets.rb b/google-cloud-security_center-v1/snippets/security_center/list_assets.rb index 2ad09152af95..d161a1c2e8d7 100755 --- a/google-cloud-security_center-v1/snippets/security_center/list_assets.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_assets.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListAssets_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_assets +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListAssetsRequest.new -# Call the list_assets method. -result = client.list_assets request + # Call the list_assets method. + result = client.list_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListAssetsResponse::ListAssetsResult. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListAssets_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb b/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb index 49703d5e14e0..189acdd7ca0d 100644 --- a/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_big_query_exports.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_big_query_exports +# +def list_big_query_exports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListBigQueryExportsRequest.new -# Call the list_big_query_exports method. -result = client.list_big_query_exports request + # Call the list_big_query_exports method. + result = client.list_big_query_exports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::BigQueryExport. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListBigQueryExports_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_findings.rb b/google-cloud-security_center-v1/snippets/security_center/list_findings.rb index 30c5e07e282d..2b2965eee8c2 100755 --- a/google-cloud-security_center-v1/snippets/security_center/list_findings.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_findings.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListFindings_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_findings +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListFindingsRequest.new -# Call the list_findings method. -result = client.list_findings request + # Call the list_findings method. + result = client.list_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::ListFindingsResponse::ListFindingsResult. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListFindings_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb b/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb index 2231e8e6f5ed..953a5b889df6 100644 --- a/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_mute_configs.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_mute_configs +# +def list_mute_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListMuteConfigsRequest.new -# Call the list_mute_configs method. -result = client.list_mute_configs request + # Call the list_mute_configs method. + result = client.list_mute_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::MuteConfig. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListMuteConfigs_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb b/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb index 452f079287c2..c221be46c40c 100755 --- a/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_notification_configs.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_notification_configs +# +def list_notification_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListNotificationConfigsRequest.new -# Call the list_notification_configs method. -result = client.list_notification_configs request + # Call the list_notification_configs method. + result = client.list_notification_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::NotificationConfig. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/list_sources.rb b/google-cloud-security_center-v1/snippets/security_center/list_sources.rb index a50e5c8585eb..c5666a0d6aa3 100755 --- a/google-cloud-security_center-v1/snippets/security_center/list_sources.rb +++ b/google-cloud-security_center-v1/snippets/security_center/list_sources.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1_generated_SecurityCenter_ListSources_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#list_sources +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::ListSourcesRequest.new -# Call the list_sources method. -result = client.list_sources request + # Call the list_sources method. + result = client.list_sources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1::Source. + p response + end end # [END securitycenter_v1_generated_SecurityCenter_ListSources_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb b/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb index 602b85ff66aa..67153c229547 100755 --- a/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb +++ b/google-cloud-security_center-v1/snippets/security_center/run_asset_discovery.rb @@ -19,22 +19,28 @@ # [START securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#run_asset_discovery +# +def run_asset_discovery + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::RunAssetDiscoveryRequest.new -# Call the run_asset_discovery method. -result = client.run_asset_discovery request + # Call the run_asset_discovery method. + result = client.run_asset_discovery request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END securitycenter_v1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb b/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb index 0ec4fb50a45a..534a3ac6cbf4 100755 --- a/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb +++ b/google-cloud-security_center-v1/snippets/security_center/set_finding_state.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_finding_state +# +def set_finding_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::SetFindingStateRequest.new -# Call the set_finding_state method. -result = client.set_finding_state request + # Call the set_finding_state method. + result = client.set_finding_state request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end # [END securitycenter_v1_generated_SecurityCenter_SetFindingState_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb b/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb index 7321b528bee2..b3278c077336 100755 --- a/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb +++ b/google-cloud-security_center-v1/snippets/security_center/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END securitycenter_v1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/set_mute.rb b/google-cloud-security_center-v1/snippets/security_center/set_mute.rb index 944afdc2fabe..6d8f4a4398aa 100644 --- a/google-cloud-security_center-v1/snippets/security_center/set_mute.rb +++ b/google-cloud-security_center-v1/snippets/security_center/set_mute.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_SetMute_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#set_mute +# +def set_mute + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::SetMuteRequest.new -# Call the set_mute method. -result = client.set_mute request + # Call the set_mute method. + result = client.set_mute request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end # [END securitycenter_v1_generated_SecurityCenter_SetMute_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb b/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb index eb51902f9905..110380816a00 100755 --- a/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb +++ b/google-cloud-security_center-v1/snippets/security_center/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END securitycenter_v1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb b/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb index d73289b6db7c..e5edf4666c2e 100644 --- a/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_big_query_export.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_big_query_export +# +def update_big_query_export + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateBigQueryExportRequest.new -# Call the update_big_query_export method. -result = client.update_big_query_export request + # Call the update_big_query_export method. + result = client.update_big_query_export request -# The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::BigQueryExport. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateBigQueryExport_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb b/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb index 54545954804a..0f8b355fb1fa 100644 --- a/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_external_system.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_external_system +# +def update_external_system + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateExternalSystemRequest.new -# Call the update_external_system method. -result = client.update_external_system request + # Call the update_external_system method. + result = client.update_external_system request -# The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::ExternalSystem. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateExternalSystem_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_finding.rb b/google-cloud-security_center-v1/snippets/security_center/update_finding.rb index a3101db492bc..a39d37903b48 100755 --- a/google-cloud-security_center-v1/snippets/security_center/update_finding.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_finding.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_finding +# +def update_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateFindingRequest.new -# Call the update_finding method. -result = client.update_finding request + # Call the update_finding method. + result = client.update_finding request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Finding. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb b/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb index 6b1212b0c2d0..3c4270bfe600 100644 --- a/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_mute_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_mute_config +# +def update_mute_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateMuteConfigRequest.new -# Call the update_mute_config method. -result = client.update_mute_config request + # Call the update_mute_config method. + result = client.update_mute_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::MuteConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateMuteConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb b/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb index 29beeaf93fe2..f8bfcd39e1a7 100755 --- a/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_notification_config +# +def update_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateNotificationConfigRequest.new -# Call the update_notification_config method. -result = client.update_notification_config request + # Call the update_notification_config method. + result = client.update_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::NotificationConfig. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb b/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb index eec18989ade0..08233e36b9eb 100755 --- a/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_organization_settings.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_organization_settings +# +def update_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateOrganizationSettingsRequest.new -# Call the update_organization_settings method. -result = client.update_organization_settings request + # Call the update_organization_settings method. + result = client.update_organization_settings request -# The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::OrganizationSettings. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb b/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb index 1f33b3ecb1d2..ae2fe5a55eb6 100755 --- a/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_security_marks.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_security_marks +# +def update_security_marks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateSecurityMarksRequest.new -# Call the update_security_marks method. -result = client.update_security_marks request + # Call the update_security_marks method. + result = client.update_security_marks request -# The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::SecurityMarks. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/google-cloud-security_center-v1/snippets/security_center/update_source.rb b/google-cloud-security_center-v1/snippets/security_center/update_source.rb index ed3550e6ccac..380b4fdd3cb0 100755 --- a/google-cloud-security_center-v1/snippets/security_center/update_source.rb +++ b/google-cloud-security_center-v1/snippets/security_center/update_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] require "google/cloud/security_center/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1::SecurityCenter::Client#update_source +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1::UpdateSourceRequest.new -# Call the update_source method. -result = client.update_source request + # Call the update_source method. + result = client.update_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1::Source. + p result +end # [END securitycenter_v1_generated_SecurityCenter_UpdateSource_sync] diff --git a/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json b/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json index caf0a8a38424..789e727d5e2f 100644 --- a/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json +++ b/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-security_center-v1p1beta1/.rubocop.yml b/google-cloud-security_center-v1p1beta1/.rubocop.yml index f2b87fdd0306..83496958be62 100644 --- a/google-cloud-security_center-v1p1beta1/.rubocop.yml +++ b/google-cloud-security_center-v1p1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-security_center-v1p1beta1.rb" diff --git a/google-cloud-security_center-v1p1beta1/snippets/Gemfile b/google-cloud-security_center-v1p1beta1/snippets/Gemfile index ba7c1c6ca2f3..efc9baa41fab 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/Gemfile +++ b/google-cloud-security_center-v1p1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb index 043ddbe09e3b..42957fb36090 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_finding.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_finding +# +def create_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateFindingRequest.new -# Call the create_finding method. -result = client.create_finding request + # Call the create_finding method. + result = client.create_finding request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateFinding_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb index 89dcb4524e0d..63dc80a8fca3 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_notification_config +# +def create_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateNotificationConfigRequest.new -# Call the create_notification_config method. -result = client.create_notification_config request + # Call the create_notification_config method. + result = client.create_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateNotificationConfig_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb index cc9df417e712..60caf0c19a38 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/create_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#create_source +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::CreateSourceRequest.new -# Call the create_source method. -result = client.create_source request + # Call the create_source method. + result = client.create_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_CreateSource_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb index a5e6db9c5022..f789f263d3b6 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/delete_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#delete_notification_config +# +def delete_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::DeleteNotificationConfigRequest.new -# Call the delete_notification_config method. -result = client.delete_notification_config request + # Call the delete_notification_config method. + result = client.delete_notification_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_DeleteNotificationConfig_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb index 032ac216ce64..df12943eed27 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GetIamPolicy_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb index 7fcfd62190e2..595250d69ffc 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_notification_config +# +def get_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetNotificationConfigRequest.new -# Call the get_notification_config method. -result = client.get_notification_config request + # Call the get_notification_config method. + result = client.get_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GetNotificationConfig_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb index 550c0352a1bc..6a6f8e1d63f2 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_organization_settings.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_organization_settings +# +def get_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetOrganizationSettingsRequest.new -# Call the get_organization_settings method. -result = client.get_organization_settings request + # Call the get_organization_settings method. + result = client.get_organization_settings request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GetOrganizationSettings_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb index 0a43026abda2..40c9c5744980 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/get_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#get_source +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GetSourceRequest.new -# Call the get_source method. -result = client.get_source request + # Call the get_source method. + result = client.get_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GetSource_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb index bc898a0f252d..eed5a2f5ca11 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/group_assets.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_assets +# +def group_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GroupAssetsRequest.new -# Call the group_assets method. -result = client.group_assets request + # Call the group_assets method. + result = client.group_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupAssets_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb index 6f9ec74d8969..adabd0e123f1 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/group_findings.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#group_findings +# +def group_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::GroupFindingsRequest.new -# Call the group_findings method. -result = client.group_findings request + # Call the group_findings method. + result = client.group_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::GroupResult. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_GroupFindings_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb index f51fa32157ab..ab06584fe32e 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_assets.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_assets +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsRequest.new -# Call the list_assets method. -result = client.list_assets request + # Call the list_assets method. + result = client.list_assets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListAssetsResponse::ListAssetsResult. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_ListAssets_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb index bfc51b939eb5..86a9f6875438 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_findings.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_findings +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsRequest.new -# Call the list_findings method. -result = client.list_findings request + # Call the list_findings method. + result = client.list_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::ListFindingsResponse::ListFindingsResult. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_ListFindings_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb index e69b6e7c1899..2583a20f2e15 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_notification_configs.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_notification_configs +# +def list_notification_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListNotificationConfigsRequest.new -# Call the list_notification_configs method. -result = client.list_notification_configs request + # Call the list_notification_configs method. + result = client.list_notification_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_ListNotificationConfigs_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb index 9d42bd30a539..1b0394f37cd6 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/list_sources.rb @@ -19,21 +19,27 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#list_sources +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::ListSourcesRequest.new -# Call the list_sources method. -result = client.list_sources request + # Call the list_sources method. + result = client.list_sources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::SecurityCenter::V1p1beta1::Source. + p response + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_ListSources_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb index db0035754d39..43346b505e08 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/run_asset_discovery.rb @@ -19,22 +19,28 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#run_asset_discovery +# +def run_asset_discovery + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::RunAssetDiscoveryRequest.new -# Call the run_asset_discovery method. -result = client.run_asset_discovery request + # Call the run_asset_discovery method. + result = client.run_asset_discovery request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END securitycenter_v1p1beta1_generated_SecurityCenter_RunAssetDiscovery_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb index f892c765a6b2..15a67cf9ae8e 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/set_finding_state.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_finding_state +# +def set_finding_state + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::SetFindingStateRequest.new -# Call the set_finding_state method. -result = client.set_finding_state request + # Call the set_finding_state method. + result = client.set_finding_state request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_SetFindingState_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb index 732eb92c8699..6168ed918459 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_SetIamPolicy_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb index 1f783413c39f..4b5cd34ed4c8 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_TestIamPermissions_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb index 50df19676a3b..ca2dee1387e4 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_finding.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_finding +# +def update_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateFindingRequest.new -# Call the update_finding method. -result = client.update_finding request + # Call the update_finding method. + result = client.update_finding request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Finding. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateFinding_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb index a1ac119689e2..05886c6b940a 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_notification_config.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_notification_config +# +def update_notification_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateNotificationConfigRequest.new -# Call the update_notification_config method. -result = client.update_notification_config request + # Call the update_notification_config method. + result = client.update_notification_config request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::NotificationConfig. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateNotificationConfig_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb index 518dfea06532..66a1c9c268a8 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_organization_settings.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_organization_settings +# +def update_organization_settings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateOrganizationSettingsRequest.new -# Call the update_organization_settings method. -result = client.update_organization_settings request + # Call the update_organization_settings method. + result = client.update_organization_settings request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::OrganizationSettings. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateOrganizationSettings_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb index 1abb0db6c1dc..cecf8216525b 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_security_marks.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_security_marks +# +def update_security_marks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSecurityMarksRequest.new -# Call the update_security_marks method. -result = client.update_security_marks request + # Call the update_security_marks method. + result = client.update_security_marks request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::SecurityMarks. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSecurityMarks_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb index 245aab2853a3..fd791239520b 100755 --- a/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb +++ b/google-cloud-security_center-v1p1beta1/snippets/security_center/update_source.rb @@ -19,15 +19,21 @@ # [START securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] require "google/cloud/security_center/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client#update_source +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::SecurityCenter::V1p1beta1::SecurityCenter::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::SecurityCenter::V1p1beta1::UpdateSourceRequest.new -# Call the update_source method. -result = client.update_source request + # Call the update_source method. + result = client.update_source request -# The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. -p result + # The returned object is of type Google::Cloud::SecurityCenter::V1p1beta1::Source. + p result +end # [END securitycenter_v1p1beta1_generated_SecurityCenter_UpdateSource_sync] diff --git a/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json b/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json index b8f6be66d41a..7950c9ab9de1 100644 --- a/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json +++ b/google-cloud-security_center-v1p1beta1/snippets/snippet_metadata_google.cloud.securitycenter.v1p1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-service_control-v1/.rubocop.yml b/google-cloud-service_control-v1/.rubocop.yml index 51b8309a24c7..12b1f90426a5 100644 --- a/google-cloud-service_control-v1/.rubocop.yml +++ b/google-cloud-service_control-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-service_control-v1.rb" diff --git a/google-cloud-service_control-v1/snippets/Gemfile b/google-cloud-service_control-v1/snippets/Gemfile index 1e17129d0827..1511b258c81a 100755 --- a/google-cloud-service_control-v1/snippets/Gemfile +++ b/google-cloud-service_control-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb b/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb index 8372e06fc2e6..4edb5f1e6f3b 100755 --- a/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb +++ b/google-cloud-service_control-v1/snippets/quota_controller/allocate_quota.rb @@ -19,15 +19,21 @@ # [START servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] require "google/cloud/service_control/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::QuotaController::Client#allocate_quota +# +def allocate_quota + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::QuotaController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::AllocateQuotaRequest.new -# Call the allocate_quota method. -result = client.allocate_quota request + # Call the allocate_quota method. + result = client.allocate_quota request -# The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. -p result + # The returned object is of type Google::Cloud::ServiceControl::V1::AllocateQuotaResponse. + p result +end # [END servicecontrol_v1_generated_QuotaController_AllocateQuota_sync] diff --git a/google-cloud-service_control-v1/snippets/service_controller/check.rb b/google-cloud-service_control-v1/snippets/service_controller/check.rb index 986993bb250a..aa389db7a089 100755 --- a/google-cloud-service_control-v1/snippets/service_controller/check.rb +++ b/google-cloud-service_control-v1/snippets/service_controller/check.rb @@ -19,15 +19,21 @@ # [START servicecontrol_v1_generated_ServiceController_Check_sync] require "google/cloud/service_control/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::ServiceController::Client#check +# +def check + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceControl::V1::CheckRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::CheckRequest.new -# Call the check method. -result = client.check request + # Call the check method. + result = client.check request -# The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. -p result + # The returned object is of type Google::Cloud::ServiceControl::V1::CheckResponse. + p result +end # [END servicecontrol_v1_generated_ServiceController_Check_sync] diff --git a/google-cloud-service_control-v1/snippets/service_controller/report.rb b/google-cloud-service_control-v1/snippets/service_controller/report.rb index 68aeb1efd988..4e43eae67245 100755 --- a/google-cloud-service_control-v1/snippets/service_controller/report.rb +++ b/google-cloud-service_control-v1/snippets/service_controller/report.rb @@ -19,15 +19,21 @@ # [START servicecontrol_v1_generated_ServiceController_Report_sync] require "google/cloud/service_control/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceControl::V1::ServiceController::Client#report +# +def report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceControl::V1::ServiceController::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceControl::V1::ReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceControl::V1::ReportRequest.new -# Call the report method. -result = client.report request + # Call the report method. + result = client.report request -# The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. -p result + # The returned object is of type Google::Cloud::ServiceControl::V1::ReportResponse. + p result +end # [END servicecontrol_v1_generated_ServiceController_Report_sync] diff --git a/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json b/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json index bec4217ceeab..0c05c738f2bc 100644 --- a/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json +++ b/google-cloud-service_control-v1/snippets/snippet_metadata_google.api.servicecontrol.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-service_directory-v1/.rubocop.yml b/google-cloud-service_directory-v1/.rubocop.yml index d2fe91f7f3e1..2903a8a1c753 100644 --- a/google-cloud-service_directory-v1/.rubocop.yml +++ b/google-cloud-service_directory-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-service_directory-v1.rb" diff --git a/google-cloud-service_directory-v1/snippets/Gemfile b/google-cloud-service_directory-v1/snippets/Gemfile index f1ca5b0b7f07..3580eff4c561 100755 --- a/google-cloud-service_directory-v1/snippets/Gemfile +++ b/google-cloud-service_directory-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb b/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb index 0a8dfc858bc8..defe3ac89c5d 100755 --- a/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb +++ b/google-cloud-service_directory-v1/snippets/lookup_service/resolve_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_LookupService_ResolveService_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::LookupService::Client#resolve_service +# +def resolve_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::LookupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ResolveServiceRequest.new -# Call the resolve_service method. -result = client.resolve_service request + # Call the resolve_service method. + result = client.resolve_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::ResolveServiceResponse. + p result +end # [END servicedirectory_v1_generated_LookupService_ResolveService_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb b/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb index 0fded85dc872..38a744af53b9 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/create_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_endpoint +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new -# Call the create_endpoint method. -result = client.create_endpoint request + # Call the create_endpoint method. + result = client.create_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end # [END servicedirectory_v1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb b/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb index bbe2b8521956..3f2cafc88921 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/create_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_namespace +# +def create_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new -# Call the create_namespace method. -result = client.create_namespace request + # Call the create_namespace method. + result = client.create_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end # [END servicedirectory_v1_generated_RegistrationService_CreateNamespace_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb b/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb index ac6d95d0b6b3..c3a19488bf17 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/create_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_CreateService_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end # [END servicedirectory_v1_generated_RegistrationService_CreateService_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb b/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb index 54576163809f..67dec151f86c 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/delete_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_endpoint +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new -# Call the delete_endpoint method. -result = client.delete_endpoint request + # Call the delete_endpoint method. + result = client.delete_endpoint request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb b/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb index 0d18a7be20df..5d4ca763fe61 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/delete_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_namespace +# +def delete_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new -# Call the delete_namespace method. -result = client.delete_namespace request + # Call the delete_namespace method. + result = client.delete_namespace request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb b/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb index 05f0a1dd1c7a..9aecd07325fb 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/delete_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_DeleteService_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1_generated_RegistrationService_DeleteService_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb b/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb index af429d6eb49a..875b5a1c72df 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/get_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_endpoint +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new -# Call the get_endpoint method. -result = client.get_endpoint request + # Call the get_endpoint method. + result = client.get_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end # [END servicedirectory_v1_generated_RegistrationService_GetEndpoint_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb b/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb index 75c365ef45ea..b1b8ae5fd99b 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END servicedirectory_v1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb b/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb index ac6b84375900..ff3cff592efe 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/get_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_namespace +# +def get_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new -# Call the get_namespace method. -result = client.get_namespace request + # Call the get_namespace method. + result = client.get_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end # [END servicedirectory_v1_generated_RegistrationService_GetNamespace_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb b/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb index 224592cc0928..cd98cea201c2 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/get_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_GetService_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end # [END servicedirectory_v1_generated_RegistrationService_GetService_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb b/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb index 89ec523a6bc9..be6e4b1c9674 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/list_endpoints.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_endpoints +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new -# Call the list_endpoints method. -result = client.list_endpoints request + # Call the list_endpoints method. + result = client.list_endpoints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint. + p response + end end # [END servicedirectory_v1_generated_RegistrationService_ListEndpoints_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb b/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb index 192380df0de1..ec9dee48d2d8 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/list_namespaces.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_namespaces +# +def list_namespaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new -# Call the list_namespaces method. -result = client.list_namespaces request + # Call the list_namespaces method. + result = client.list_namespaces request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace. + p response + end end # [END servicedirectory_v1_generated_RegistrationService_ListNamespaces_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb b/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb index 0278db1dd795..e6c70cc202f2 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/list_services.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1_generated_RegistrationService_ListServices_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service. + p response + end end # [END servicedirectory_v1_generated_RegistrationService_ListServices_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb b/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb index 31d220a94cfe..91fdf46a3adf 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END servicedirectory_v1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb b/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb index 849a0196d53d..97cca317b5e3 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END servicedirectory_v1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb b/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb index 9cfacb2e299c..b567f68d38ab 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/update_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_endpoint +# +def update_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new -# Call the update_endpoint method. -result = client.update_endpoint request + # Call the update_endpoint method. + result = client.update_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint. + p result +end # [END servicedirectory_v1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb b/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb index 6357b11ca901..b9fed2401e59 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/update_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_namespace +# +def update_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new -# Call the update_namespace method. -result = client.update_namespace request + # Call the update_namespace method. + result = client.update_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace. + p result +end # [END servicedirectory_v1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb b/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb index 752ba292fb6c..05ddc2b71a33 100755 --- a/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb +++ b/google-cloud-service_directory-v1/snippets/registration_service/update_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1_generated_RegistrationService_UpdateService_sync] require "google/cloud/service_directory/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1::RegistrationService::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1::Service. + p result +end # [END servicedirectory_v1_generated_RegistrationService_UpdateService_sync] diff --git a/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json b/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json index db67b38db571..7bc409ec818b 100644 --- a/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json +++ b/google-cloud-service_directory-v1/snippets/snippet_metadata_google.cloud.servicedirectory.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-service_directory-v1beta1/.rubocop.yml b/google-cloud-service_directory-v1beta1/.rubocop.yml index 19b2022cbd07..d1efd0d6f24d 100644 --- a/google-cloud-service_directory-v1beta1/.rubocop.yml +++ b/google-cloud-service_directory-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-service_directory-v1beta1.rb" diff --git a/google-cloud-service_directory-v1beta1/snippets/Gemfile b/google-cloud-service_directory-v1beta1/snippets/Gemfile index 48ec648aee52..afa0c4f2165f 100755 --- a/google-cloud-service_directory-v1beta1/snippets/Gemfile +++ b/google-cloud-service_directory-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb b/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb index f8754ddac4db..7a7f90b7def5 100755 --- a/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb +++ b/google-cloud-service_directory-v1beta1/snippets/lookup_service/resolve_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client#resolve_service +# +def resolve_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::LookupService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceRequest.new -# Call the resolve_service method. -result = client.resolve_service request + # Call the resolve_service method. + result = client.resolve_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::ResolveServiceResponse. + p result +end # [END servicedirectory_v1beta1_generated_LookupService_ResolveService_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb index 70c1b5705950..4bc659aaaa51 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_endpoint +# +def create_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateEndpointRequest.new -# Call the create_endpoint method. -result = client.create_endpoint request + # Call the create_endpoint method. + result = client.create_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_CreateEndpoint_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb index ecc3a05c0520..70186485894b 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_namespace +# +def create_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateNamespaceRequest.new -# Call the create_namespace method. -result = client.create_namespace request + # Call the create_namespace method. + result = client.create_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_CreateNamespace_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb index ee7b1d6f84ff..263167ff36dc 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/create_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_CreateService_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb index eda9e676b5bc..dbe9d4753cf4 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_endpoint +# +def delete_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteEndpointRequest.new -# Call the delete_endpoint method. -result = client.delete_endpoint request + # Call the delete_endpoint method. + result = client.delete_endpoint request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_DeleteEndpoint_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb index 47d13c6b6a61..1f25a0cae94d 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_namespace +# +def delete_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteNamespaceRequest.new -# Call the delete_namespace method. -result = client.delete_namespace request + # Call the delete_namespace method. + result = client.delete_namespace request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_DeleteNamespace_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb index b06aaa4f8c63..14066c348db9 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/delete_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_DeleteService_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb index 5b4d56a332fa..0a701b7d0b4c 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_endpoint +# +def get_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetEndpointRequest.new -# Call the get_endpoint method. -result = client.get_endpoint request + # Call the get_endpoint method. + result = client.get_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_GetEndpoint_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb index ca218e6a7309..782dd52085ba 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_GetIamPolicy_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb index bb88991ccf57..52229b3062e1 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_namespace +# +def get_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetNamespaceRequest.new -# Call the get_namespace method. -result = client.get_namespace request + # Call the get_namespace method. + result = client.get_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_GetNamespace_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb index 93e4d0cd5f1b..b5b8f8bd74f4 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/get_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_GetService_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb index 4236c7ad451c..8a30b8a9fac2 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_endpoints.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_endpoints +# +def list_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListEndpointsRequest.new -# Call the list_endpoints method. -result = client.list_endpoints request + # Call the list_endpoints method. + result = client.list_endpoints request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p response + end end # [END servicedirectory_v1beta1_generated_RegistrationService_ListEndpoints_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb index 9976bdbf84d0..f8a50e3d77d0 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_namespaces.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_namespaces +# +def list_namespaces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListNamespacesRequest.new -# Call the list_namespaces method. -result = client.list_namespaces request + # Call the list_namespaces method. + result = client.list_namespaces request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p response + end end # [END servicedirectory_v1beta1_generated_RegistrationService_ListNamespaces_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb index aa093eb7fe7a..769ce573fb54 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/list_services.rb @@ -19,21 +19,27 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceDirectory::V1beta1::Service. + p response + end end # [END servicedirectory_v1beta1_generated_RegistrationService_ListServices_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb index fcd9ba237f00..059cb2c6ad2a 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_SetIamPolicy_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb index b34e37b9098b..df4939266beb 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_TestIamPermissions_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb index 373f3af65a7d..328078a63df5 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_endpoint.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_endpoint +# +def update_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateEndpointRequest.new -# Call the update_endpoint method. -result = client.update_endpoint request + # Call the update_endpoint method. + result = client.update_endpoint request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Endpoint. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_UpdateEndpoint_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb index 5fb90525eec0..5dec1dc4cdc5 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_namespace.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_namespace +# +def update_namespace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateNamespaceRequest.new -# Call the update_namespace method. -result = client.update_namespace request + # Call the update_namespace method. + result = client.update_namespace request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Namespace. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_UpdateNamespace_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb index 705da427ec69..c07b5075956b 100755 --- a/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb +++ b/google-cloud-service_directory-v1beta1/snippets/registration_service/update_service.rb @@ -19,15 +19,21 @@ # [START servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] require "google/cloud/service_directory/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client#update_service +# +def update_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceDirectory::V1beta1::RegistrationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceDirectory::V1beta1::UpdateServiceRequest.new -# Call the update_service method. -result = client.update_service request + # Call the update_service method. + result = client.update_service request -# The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. -p result + # The returned object is of type Google::Cloud::ServiceDirectory::V1beta1::Service. + p result +end # [END servicedirectory_v1beta1_generated_RegistrationService_UpdateService_sync] diff --git a/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json b/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json index 73eb2d720a3b..2f37d2052bc2 100644 --- a/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json +++ b/google-cloud-service_directory-v1beta1/snippets/snippet_metadata_google.cloud.servicedirectory.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-service_management-v1/.rubocop.yml b/google-cloud-service_management-v1/.rubocop.yml index cfb370d533db..af3b43f29aeb 100644 --- a/google-cloud-service_management-v1/.rubocop.yml +++ b/google-cloud-service_management-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-service_management-v1.rb" diff --git a/google-cloud-service_management-v1/snippets/Gemfile b/google-cloud-service_management-v1/snippets/Gemfile index 04b95eb36f0a..0d73afd4f831 100755 --- a/google-cloud-service_management-v1/snippets/Gemfile +++ b/google-cloud-service_management-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-service_management-v1/snippets/service_manager/create_service.rb b/google-cloud-service_management-v1/snippets/service_manager/create_service.rb index 5b6b757e8b3e..06688ef83f59 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/create_service.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/create_service.rb @@ -19,22 +19,28 @@ # [START servicemanagement_v1_generated_ServiceManager_CreateService_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service +# +def create_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceRequest.new -# Call the create_service method. -result = client.create_service request + # Call the create_service method. + result = client.create_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END servicemanagement_v1_generated_ServiceManager_CreateService_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb b/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb index 841309371beb..814aa6be71a0 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/create_service_config.rb @@ -19,15 +19,21 @@ # [START servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_config +# +def create_service_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest.new -# Call the create_service_config method. -result = client.create_service_config request + # Call the create_service_config method. + result = client.create_service_config request -# The returned object is of type Google::Api::Service. -p result + # The returned object is of type Google::Api::Service. + p result +end # [END servicemanagement_v1_generated_ServiceManager_CreateServiceConfig_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb b/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb index f5e004667ea4..41b3873bbb4a 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/create_service_rollout.rb @@ -19,22 +19,28 @@ # [START servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout +# +def create_service_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest.new -# Call the create_service_rollout method. -result = client.create_service_rollout request + # Call the create_service_rollout method. + result = client.create_service_rollout request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END servicemanagement_v1_generated_ServiceManager_CreateServiceRollout_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb b/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb index 920b30cb88d7..907c0e050b99 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/delete_service.rb @@ -19,22 +19,28 @@ # [START servicemanagement_v1_generated_ServiceManager_DeleteService_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#delete_service +# +def delete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::DeleteServiceRequest.new -# Call the delete_service method. -result = client.delete_service request + # Call the delete_service method. + result = client.delete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END servicemanagement_v1_generated_ServiceManager_DeleteService_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb b/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb index f924959a99be..51b5cbbf0f0d 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/generate_config_report.rb @@ -19,15 +19,21 @@ # [START servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#generate_config_report +# +def generate_config_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest.new -# Call the generate_config_report method. -result = client.generate_config_report request + # Call the generate_config_report method. + result = client.generate_config_report request -# The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. -p result + # The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse. + p result +end # [END servicemanagement_v1_generated_ServiceManager_GenerateConfigReport_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/get_service.rb b/google-cloud-service_management-v1/snippets/service_manager/get_service.rb index 3e3951bc9e93..ce0f5999d050 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/get_service.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/get_service.rb @@ -19,15 +19,21 @@ # [START servicemanagement_v1_generated_ServiceManager_GetService_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. -p result + # The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService. + p result +end # [END servicemanagement_v1_generated_ServiceManager_GetService_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb b/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb index 61684e6c9c39..2926a14e8af5 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/get_service_config.rb @@ -19,15 +19,21 @@ # [START servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_config +# +def get_service_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest.new -# Call the get_service_config method. -result = client.get_service_config request + # Call the get_service_config method. + result = client.get_service_config request -# The returned object is of type Google::Api::Service. -p result + # The returned object is of type Google::Api::Service. + p result +end # [END servicemanagement_v1_generated_ServiceManager_GetServiceConfig_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb b/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb index 34c24dc2614d..ed6f34dfc4f3 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/get_service_rollout.rb @@ -19,15 +19,21 @@ # [START servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#get_service_rollout +# +def get_service_rollout + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest.new -# Call the get_service_rollout method. -result = client.get_service_rollout request + # Call the get_service_rollout method. + result = client.get_service_rollout request -# The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. -p result + # The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout. + p result +end # [END servicemanagement_v1_generated_ServiceManager_GetServiceRollout_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb b/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb index ec90523e196a..0cdf6ab578b1 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/list_service_configs.rb @@ -19,21 +19,27 @@ # [START servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_configs +# +def list_service_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest.new -# Call the list_service_configs method. -result = client.list_service_configs request + # Call the list_service_configs method. + result = client.list_service_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Api::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Api::Service. + p response + end end # [END servicemanagement_v1_generated_ServiceManager_ListServiceConfigs_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb b/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb index b225a0e5374b..81b89f9c69b2 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/list_service_rollouts.rb @@ -19,21 +19,27 @@ # [START servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_service_rollouts +# +def list_service_rollouts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest.new -# Call the list_service_rollouts method. -result = client.list_service_rollouts request + # Call the list_service_rollouts method. + result = client.list_service_rollouts request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout. + p response + end end # [END servicemanagement_v1_generated_ServiceManager_ListServiceRollouts_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/list_services.rb b/google-cloud-service_management-v1/snippets/service_manager/list_services.rb index bb5a1216ecbc..033c486b514a 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/list_services.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/list_services.rb @@ -19,21 +19,27 @@ # [START servicemanagement_v1_generated_ServiceManager_ListServices_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService. + p response + end end # [END servicemanagement_v1_generated_ServiceManager_ListServices_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb b/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb index 0585e1aecf18..ec9b128601ac 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/submit_config_source.rb @@ -19,22 +19,28 @@ # [START servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#submit_config_source +# +def submit_config_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest.new -# Call the submit_config_source method. -result = client.submit_config_source request + # Call the submit_config_source method. + result = client.submit_config_source request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END servicemanagement_v1_generated_ServiceManager_SubmitConfigSource_sync] diff --git a/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb b/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb index 335a70cf8f7e..9e5e35a9a2a5 100755 --- a/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb +++ b/google-cloud-service_management-v1/snippets/service_manager/undelete_service.rb @@ -19,22 +19,28 @@ # [START servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] require "google/cloud/service_management/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service +# +def undelete_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceManagement::V1::ServiceManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest.new -# Call the undelete_service method. -result = client.undelete_service request + # Call the undelete_service method. + result = client.undelete_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END servicemanagement_v1_generated_ServiceManager_UndeleteService_sync] diff --git a/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json b/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json index 9454138b453a..bc16b3f66bb7 100644 --- a/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json +++ b/google-cloud-service_management-v1/snippets/snippet_metadata_google.api.servicemanagement.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-service_usage-v1/.rubocop.yml b/google-cloud-service_usage-v1/.rubocop.yml index 0693003db5a5..e4a9da8eab3b 100644 --- a/google-cloud-service_usage-v1/.rubocop.yml +++ b/google-cloud-service_usage-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-service_usage-v1.rb" diff --git a/google-cloud-service_usage-v1/snippets/Gemfile b/google-cloud-service_usage-v1/snippets/Gemfile index bf1acadf55af..3d09996abe23 100755 --- a/google-cloud-service_usage-v1/snippets/Gemfile +++ b/google-cloud-service_usage-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb b/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb index b6baf6c1d54d..89386cbfbbf2 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/batch_enable_services.rb @@ -19,22 +19,28 @@ # [START serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_enable_services +# +def batch_enable_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::BatchEnableServicesRequest.new -# Call the batch_enable_services method. -result = client.batch_enable_services request + # Call the batch_enable_services method. + result = client.batch_enable_services request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END serviceusage_v1_generated_ServiceUsage_BatchEnableServices_sync] diff --git a/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb b/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb index 1419bbedf8ed..9d4731df48c7 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/batch_get_services.rb @@ -19,15 +19,21 @@ # [START serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#batch_get_services +# +def batch_get_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::BatchGetServicesRequest.new -# Call the batch_get_services method. -result = client.batch_get_services request + # Call the batch_get_services method. + result = client.batch_get_services request -# The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. -p result + # The returned object is of type Google::Cloud::ServiceUsage::V1::BatchGetServicesResponse. + p result +end # [END serviceusage_v1_generated_ServiceUsage_BatchGetServices_sync] diff --git a/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb b/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb index 00775f09edac..93b417dc85fa 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/disable_service.rb @@ -19,22 +19,28 @@ # [START serviceusage_v1_generated_ServiceUsage_DisableService_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#disable_service +# +def disable_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::DisableServiceRequest.new -# Call the disable_service method. -result = client.disable_service request + # Call the disable_service method. + result = client.disable_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END serviceusage_v1_generated_ServiceUsage_DisableService_sync] diff --git a/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb b/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb index 7ad238314a69..507d75319b14 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/enable_service.rb @@ -19,22 +19,28 @@ # [START serviceusage_v1_generated_ServiceUsage_EnableService_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#enable_service +# +def enable_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::EnableServiceRequest.new -# Call the enable_service method. -result = client.enable_service request + # Call the enable_service method. + result = client.enable_service request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END serviceusage_v1_generated_ServiceUsage_EnableService_sync] diff --git a/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb b/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb index 8214e829af19..77e4797fffd6 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/get_service.rb @@ -19,15 +19,21 @@ # [START serviceusage_v1_generated_ServiceUsage_GetService_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#get_service +# +def get_service + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::GetServiceRequest.new -# Call the get_service method. -result = client.get_service request + # Call the get_service method. + result = client.get_service request -# The returned object is of type Google::Cloud::ServiceUsage::V1::Service. -p result + # The returned object is of type Google::Cloud::ServiceUsage::V1::Service. + p result +end # [END serviceusage_v1_generated_ServiceUsage_GetService_sync] diff --git a/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb b/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb index 38587cb6df0e..752e18604701 100755 --- a/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb +++ b/google-cloud-service_usage-v1/snippets/service_usage/list_services.rb @@ -19,21 +19,27 @@ # [START serviceusage_v1_generated_ServiceUsage_ListServices_sync] require "google/cloud/service_usage/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::ServiceUsage::V1::ServiceUsage::Client#list_services +# +def list_services + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::ServiceUsage::V1::ServiceUsage::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::ServiceUsage::V1::ListServicesRequest.new -# Call the list_services method. -result = client.list_services request + # Call the list_services method. + result = client.list_services request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::ServiceUsage::V1::Service. + p response + end end # [END serviceusage_v1_generated_ServiceUsage_ListServices_sync] diff --git a/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json b/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json index fd4f9fa67a0c..cc62ed95cf82 100644 --- a/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json +++ b/google-cloud-service_usage-v1/snippets/snippet_metadata_google.api.serviceusage.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-shell-v1/.rubocop.yml b/google-cloud-shell-v1/.rubocop.yml index 9b915b433a95..63ca4175e823 100644 --- a/google-cloud-shell-v1/.rubocop.yml +++ b/google-cloud-shell-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-shell-v1.rb" diff --git a/google-cloud-shell-v1/snippets/Gemfile b/google-cloud-shell-v1/snippets/Gemfile index ac28df414885..abe47da68fef 100755 --- a/google-cloud-shell-v1/snippets/Gemfile +++ b/google-cloud-shell-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb b/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb index 61941a09f0b5..72461e29632f 100755 --- a/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb +++ b/google-cloud-shell-v1/snippets/cloud_shell_service/add_public_key.rb @@ -19,22 +19,28 @@ # [START cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] require "google/cloud/shell/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Shell::V1::CloudShellService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#add_public_key +# +def add_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::AddPublicKeyRequest.new -# Call the add_public_key method. -result = client.add_public_key request + # Call the add_public_key method. + result = client.add_public_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudshell_v1_generated_CloudShellService_AddPublicKey_sync] diff --git a/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb b/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb index e07edc4c0ea3..dfab316d77cb 100755 --- a/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb +++ b/google-cloud-shell-v1/snippets/cloud_shell_service/authorize_environment.rb @@ -19,22 +19,28 @@ # [START cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] require "google/cloud/shell/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Shell::V1::CloudShellService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#authorize_environment +# +def authorize_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::AuthorizeEnvironmentRequest.new -# Call the authorize_environment method. -result = client.authorize_environment request + # Call the authorize_environment method. + result = client.authorize_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudshell_v1_generated_CloudShellService_AuthorizeEnvironment_sync] diff --git a/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb b/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb index 572056b71682..8a2327738f87 100755 --- a/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb +++ b/google-cloud-shell-v1/snippets/cloud_shell_service/get_environment.rb @@ -19,15 +19,21 @@ # [START cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] require "google/cloud/shell/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Shell::V1::CloudShellService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#get_environment +# +def get_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::GetEnvironmentRequest.new -# Call the get_environment method. -result = client.get_environment request + # Call the get_environment method. + result = client.get_environment request -# The returned object is of type Google::Cloud::Shell::V1::Environment. -p result + # The returned object is of type Google::Cloud::Shell::V1::Environment. + p result +end # [END cloudshell_v1_generated_CloudShellService_GetEnvironment_sync] diff --git a/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb b/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb index 3a8cf3fcd635..8fa0580bc7bd 100755 --- a/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb +++ b/google-cloud-shell-v1/snippets/cloud_shell_service/remove_public_key.rb @@ -19,22 +19,28 @@ # [START cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] require "google/cloud/shell/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Shell::V1::CloudShellService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#remove_public_key +# +def remove_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::RemovePublicKeyRequest.new -# Call the remove_public_key method. -result = client.remove_public_key request + # Call the remove_public_key method. + result = client.remove_public_key request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudshell_v1_generated_CloudShellService_RemovePublicKey_sync] diff --git a/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb b/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb index af9f3f74e756..115a451253c6 100755 --- a/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb +++ b/google-cloud-shell-v1/snippets/cloud_shell_service/start_environment.rb @@ -19,22 +19,28 @@ # [START cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] require "google/cloud/shell/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Shell::V1::CloudShellService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Shell::V1::CloudShellService::Client#start_environment +# +def start_environment + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Shell::V1::CloudShellService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Shell::V1::StartEnvironmentRequest.new -# Call the start_environment method. -result = client.start_environment request + # Call the start_environment method. + result = client.start_environment request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END cloudshell_v1_generated_CloudShellService_StartEnvironment_sync] diff --git a/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json b/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json index f369fccc4698..f3d3a0fd1a2c 100644 --- a/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json +++ b/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-spanner-admin-database-v1/.rubocop.yml b/google-cloud-spanner-admin-database-v1/.rubocop.yml index 085591913ce5..7278d0340d48 100644 --- a/google-cloud-spanner-admin-database-v1/.rubocop.yml +++ b/google-cloud-spanner-admin-database-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-spanner-admin-database-v1.rb" diff --git a/google-cloud-spanner-admin-database-v1/snippets/Gemfile b/google-cloud-spanner-admin-database-v1/snippets/Gemfile index 580eeb8eebb4..ec399a67f590 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/Gemfile +++ b/google-cloud-spanner-admin-database-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb index 57e942f09ac1..d1709d73a699 100644 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/copy_backup.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#copy_backup +# +def copy_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CopyBackupRequest.new -# Call the copy_backup method. -result = client.copy_backup request + # Call the copy_backup method. + result = client.copy_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_DatabaseAdmin_CopyBackup_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb index a664321da7ae..cda45f167bfd 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_backup.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_backup +# +def create_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CreateBackupRequest.new -# Call the create_backup method. -result = client.create_backup request + # Call the create_backup method. + result = client.create_backup request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_DatabaseAdmin_CreateBackup_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb index ff762c7424f6..866ad6d3dbac 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/create_database.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#create_database +# +def create_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseRequest.new -# Call the create_database method. -result = client.create_database request + # Call the create_database method. + result = client.create_database request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_DatabaseAdmin_CreateDatabase_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb index 24c27e9e40f2..8e54a38a5b87 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/delete_backup.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#delete_backup +# +def delete_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::DeleteBackupRequest.new -# Call the delete_backup method. -result = client.delete_backup request + # Call the delete_backup method. + result = client.delete_backup request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_DatabaseAdmin_DeleteBackup_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb index b4ad37c49df8..85a2010677d4 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/drop_database.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#drop_database +# +def drop_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::DropDatabaseRequest.new -# Call the drop_database method. -result = client.drop_database request + # Call the drop_database method. + result = client.drop_database request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_DatabaseAdmin_DropDatabase_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb index 7c7d061b099e..9b8906f26690 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_backup.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_GetBackup_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_backup +# +def get_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetBackupRequest.new -# Call the get_backup method. -result = client.get_backup request + # Call the get_backup method. + result = client.get_backup request -# The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + p result +end # [END spanner_v1_generated_DatabaseAdmin_GetBackup_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb index 23829ded45e0..9cdd142c74e1 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database +# +def get_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseRequest.new -# Call the get_database method. -result = client.get_database request + # Call the get_database method. + result = client.get_database request -# The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Database. + p result +end # [END spanner_v1_generated_DatabaseAdmin_GetDatabase_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb index f3a9ed80db18..d71db6410ce0 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_database_ddl.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_database_ddl +# +def get_database_ddl + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlRequest.new -# Call the get_database_ddl method. -result = client.get_database_ddl request + # Call the get_database_ddl method. + result = client.get_database_ddl request -# The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse. + p result +end # [END spanner_v1_generated_DatabaseAdmin_GetDatabaseDdl_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb index 864dfed9fc79..ab9eca27a7e8 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END spanner_v1_generated_DatabaseAdmin_GetIamPolicy_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb index a97c7993c084..ae0a9fdf0fc0 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backup_operations.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backup_operations +# +def list_backup_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsRequest.new -# Call the list_backup_operations method. -result = client.list_backup_operations request + # Call the list_backup_operations method. + result = client.list_backup_operations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Longrunning::Operation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Longrunning::Operation. + p response + end end # [END spanner_v1_generated_DatabaseAdmin_ListBackupOperations_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb index ac964e617042..f92a82109b57 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_backups.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_DatabaseAdmin_ListBackups_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_backups +# +def list_backups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListBackupsRequest.new -# Call the list_backups method. -result = client.list_backups request + # Call the list_backups method. + result = client.list_backups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Backup. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Backup. + p response + end end # [END spanner_v1_generated_DatabaseAdmin_ListBackups_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb index 1ec04bc8b098..6489756c69c3 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_operations.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_operations +# +def list_database_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsRequest.new -# Call the list_database_operations method. -result = client.list_database_operations request + # Call the list_database_operations method. + result = client.list_database_operations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Longrunning::Operation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Longrunning::Operation. + p response + end end # [END spanner_v1_generated_DatabaseAdmin_ListDatabaseOperations_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb index bad6c6c5be47..f9fa69a371eb 100644 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_database_roles.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_database_roles +# +def list_database_roles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseRolesRequest.new -# Call the list_database_roles method. -result = client.list_database_roles request + # Call the list_database_roles method. + result = client.list_database_roles request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::DatabaseRole. + p response + end end # [END spanner_v1_generated_DatabaseAdmin_ListDatabaseRoles_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb index ff8de33ddb50..98c5418fbb89 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/list_databases.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#list_databases +# +def list_databases + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesRequest.new -# Call the list_databases method. -result = client.list_databases request + # Call the list_databases method. + result = client.list_databases request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::Admin::Database::V1::Database. + p response + end end # [END spanner_v1_generated_DatabaseAdmin_ListDatabases_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb index 05835cf73b8c..db607097e71b 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/restore_database.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#restore_database +# +def restore_database + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseRequest.new -# Call the restore_database method. -result = client.restore_database request + # Call the restore_database method. + result = client.restore_database request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_DatabaseAdmin_RestoreDatabase_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb index 6f392388342c..9b69c4194c13 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END spanner_v1_generated_DatabaseAdmin_SetIamPolicy_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb index 355bcef9aa8c..0f790cde23cd 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END spanner_v1_generated_DatabaseAdmin_TestIamPermissions_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb index 1d800f4d5044..97653ef67922 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_backup.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_backup +# +def update_backup + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateBackupRequest.new -# Call the update_backup method. -result = client.update_backup request + # Call the update_backup method. + result = client.update_backup request -# The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Database::V1::Backup. + p result +end # [END spanner_v1_generated_DatabaseAdmin_UpdateBackup_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb b/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb index c4efa799877b..ef7a22704b8c 100755 --- a/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb +++ b/google-cloud-spanner-admin-database-v1/snippets/database_admin/update_database_ddl.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] require "google/cloud/spanner/admin/database/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client#update_database_ddl +# +def update_database_ddl + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest.new -# Call the update_database_ddl method. -result = client.update_database_ddl request + # Call the update_database_ddl method. + result = client.update_database_ddl request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_DatabaseAdmin_UpdateDatabaseDdl_sync] diff --git a/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json b/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json index bb24f3e6c3c7..6f31e1d0adf4 100644 --- a/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json +++ b/google-cloud-spanner-admin-database-v1/snippets/snippet_metadata_google.spanner.admin.database.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-spanner-admin-instance-v1/.rubocop.yml b/google-cloud-spanner-admin-instance-v1/.rubocop.yml index ad39e9ee68d8..d1a683d9ac76 100644 --- a/google-cloud-spanner-admin-instance-v1/.rubocop.yml +++ b/google-cloud-spanner-admin-instance-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-spanner-admin-instance-v1.rb" diff --git a/google-cloud-spanner-admin-instance-v1/snippets/Gemfile b/google-cloud-spanner-admin-instance-v1/snippets/Gemfile index 139b068bb36f..591dbb8ac5b0 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/Gemfile +++ b/google-cloud-spanner-admin-instance-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb index eaecb672f3f3..bf0c97bbf2ba 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_InstanceAdmin_CreateInstance_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance +# +def create_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new -# Call the create_instance method. -result = client.create_instance request + # Call the create_instance method. + result = client.create_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_InstanceAdmin_CreateInstance_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb index 5290d4abec1e..6df56283b015 100644 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/create_instance_config.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#create_instance_config +# +def create_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new -# Call the create_instance_config method. -result = client.create_instance_config request + # Call the create_instance_config method. + result = client.create_instance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_InstanceAdmin_CreateInstanceConfig_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb index 7ce41d5bc163..6dff5b9d9f31 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance +# +def delete_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceRequest.new -# Call the delete_instance method. -result = client.delete_instance request + # Call the delete_instance method. + result = client.delete_instance request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_InstanceAdmin_DeleteInstance_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb index 1566dcc93259..48cb31851ab7 100644 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/delete_instance_config.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#delete_instance_config +# +def delete_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new -# Call the delete_instance_config method. -result = client.delete_instance_config request + # Call the delete_instance_config method. + result = client.delete_instance_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_InstanceAdmin_DeleteInstanceConfig_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb index e241237965de..3758249007da 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END spanner_v1_generated_InstanceAdmin_GetIamPolicy_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb index 9d45eb846e59..ff9143b62d5e 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_GetInstance_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceRequest.new -# Call the get_instance method. -result = client.get_instance request + # Call the get_instance method. + result = client.get_instance request -# The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::Instance. + p result +end # [END spanner_v1_generated_InstanceAdmin_GetInstance_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb index 8f3e78d5dbbc..a32b13fbac4b 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/get_instance_config.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#get_instance_config +# +def get_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::GetInstanceConfigRequest.new -# Call the get_instance_config method. -result = client.get_instance_config request + # Call the get_instance_config method. + result = client.get_instance_config request -# The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. -p result + # The returned object is of type Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + p result +end # [END spanner_v1_generated_InstanceAdmin_GetInstanceConfig_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb index 8eecce492803..6cb338dd8e11 100644 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_config_operations.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_config_operations +# +def list_instance_config_operations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new -# Call the list_instance_config_operations method. -result = client.list_instance_config_operations request + # Call the list_instance_config_operations method. + result = client.list_instance_config_operations request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Longrunning::Operation. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Longrunning::Operation. + p response + end end # [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigOperations_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb index 7b7bc607ebdf..a8352cc4142c 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instance_configs.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instance_configs +# +def list_instance_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsRequest.new -# Call the list_instance_configs method. -result = client.list_instance_configs request + # Call the list_instance_configs method. + result = client.list_instance_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig. + p response + end end # [END spanner_v1_generated_InstanceAdmin_ListInstanceConfigs_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb index d611aaec2902..d9992a8e71e7 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/list_instances.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_InstanceAdmin_ListInstances_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#list_instances +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesRequest.new -# Call the list_instances method. -result = client.list_instances request + # Call the list_instances method. + result = client.list_instances request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::Admin::Instance::V1::Instance. + p response + end end # [END spanner_v1_generated_InstanceAdmin_ListInstances_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb index 60f8981d03f0..42161a39017a 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END spanner_v1_generated_InstanceAdmin_SetIamPolicy_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb index 81924bee13c9..ac3480062240 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END spanner_v1_generated_InstanceAdmin_TestIamPermissions_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb index d4b4654e3371..bd4456c1c3a0 100755 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance +# +def update_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new -# Call the update_instance method. -result = client.update_instance request + # Call the update_instance method. + result = client.update_instance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_InstanceAdmin_UpdateInstance_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb index de24241f7e10..edd39cd0a038 100644 --- a/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb +++ b/google-cloud-spanner-admin-instance-v1/snippets/instance_admin/update_instance_config.rb @@ -19,22 +19,28 @@ # [START spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] require "google/cloud/spanner/admin/instance/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client#update_instance_config +# +def update_instance_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new -# Call the update_instance_config method. -result = client.update_instance_config request + # Call the update_instance_config method. + result = client.update_instance_config request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END spanner_v1_generated_InstanceAdmin_UpdateInstanceConfig_sync] diff --git a/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json b/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json index 5ec97359a60b..875d2bf96501 100644 --- a/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json +++ b/google-cloud-spanner-admin-instance-v1/snippets/snippet_metadata_google.spanner.admin.instance.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-spanner-v1/.rubocop.yml b/google-cloud-spanner-v1/.rubocop.yml index 6cef97e29709..c29064123444 100644 --- a/google-cloud-spanner-v1/.rubocop.yml +++ b/google-cloud-spanner-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-spanner-v1.rb" diff --git a/google-cloud-spanner-v1/snippets/Gemfile b/google-cloud-spanner-v1/snippets/Gemfile index 0ac3be4f1cc4..187619c2d446 100755 --- a/google-cloud-spanner-v1/snippets/Gemfile +++ b/google-cloud-spanner-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json b/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json index b5e513091621..55b8323d6e00 100644 --- a/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json +++ b/google-cloud-spanner-v1/snippets/snippet_metadata_google.spanner.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 35, + "end": 41, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb b/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb index 41ff346ee5a1..9f20dadd4a06 100755 --- a/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb +++ b/google-cloud-spanner-v1/snippets/spanner/batch_create_sessions.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_BatchCreateSessions_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#batch_create_sessions +# +def batch_create_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BatchCreateSessionsRequest.new -# Call the batch_create_sessions method. -result = client.batch_create_sessions request + # Call the batch_create_sessions method. + result = client.batch_create_sessions request -# The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. -p result + # The returned object is of type Google::Cloud::Spanner::V1::BatchCreateSessionsResponse. + p result +end # [END spanner_v1_generated_Spanner_BatchCreateSessions_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb b/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb index 589ed3013576..678b7105f32a 100755 --- a/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb +++ b/google-cloud-spanner-v1/snippets/spanner/begin_transaction.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_BeginTransaction_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#begin_transaction +# +def begin_transaction + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::BeginTransactionRequest.new -# Call the begin_transaction method. -result = client.begin_transaction request + # Call the begin_transaction method. + result = client.begin_transaction request -# The returned object is of type Google::Cloud::Spanner::V1::Transaction. -p result + # The returned object is of type Google::Cloud::Spanner::V1::Transaction. + p result +end # [END spanner_v1_generated_Spanner_BeginTransaction_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/commit.rb b/google-cloud-spanner-v1/snippets/spanner/commit.rb index 7f146c00950c..35316ab2f968 100755 --- a/google-cloud-spanner-v1/snippets/spanner/commit.rb +++ b/google-cloud-spanner-v1/snippets/spanner/commit.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_Commit_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#commit +# +def commit + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::CommitRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CommitRequest.new -# Call the commit method. -result = client.commit request + # Call the commit method. + result = client.commit request -# The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. -p result + # The returned object is of type Google::Cloud::Spanner::V1::CommitResponse. + p result +end # [END spanner_v1_generated_Spanner_Commit_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/create_session.rb b/google-cloud-spanner-v1/snippets/spanner/create_session.rb index 37917af88aab..6c9b09e1a08f 100755 --- a/google-cloud-spanner-v1/snippets/spanner/create_session.rb +++ b/google-cloud-spanner-v1/snippets/spanner/create_session.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_CreateSession_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#create_session +# +def create_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::CreateSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::CreateSessionRequest.new -# Call the create_session method. -result = client.create_session request + # Call the create_session method. + result = client.create_session request -# The returned object is of type Google::Cloud::Spanner::V1::Session. -p result + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end # [END spanner_v1_generated_Spanner_CreateSession_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/delete_session.rb b/google-cloud-spanner-v1/snippets/spanner/delete_session.rb index b94b30c51d6e..d386d3032ceb 100755 --- a/google-cloud-spanner-v1/snippets/spanner/delete_session.rb +++ b/google-cloud-spanner-v1/snippets/spanner/delete_session.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_DeleteSession_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#delete_session +# +def delete_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::DeleteSessionRequest.new -# Call the delete_session method. -result = client.delete_session request + # Call the delete_session method. + result = client.delete_session request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_Spanner_DeleteSession_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb b/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb index afc15b0774dd..149bf39992f9 100755 --- a/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb +++ b/google-cloud-spanner-v1/snippets/spanner/execute_batch_dml.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_ExecuteBatchDml_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_batch_dml +# +def execute_batch_dml + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest.new -# Call the execute_batch_dml method. -result = client.execute_batch_dml request + # Call the execute_batch_dml method. + result = client.execute_batch_dml request -# The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. -p result + # The returned object is of type Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse. + p result +end # [END spanner_v1_generated_Spanner_ExecuteBatchDml_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb b/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb index d13b50315885..0d2a1dce6c73 100755 --- a/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb +++ b/google-cloud-spanner-v1/snippets/spanner/execute_sql.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_ExecuteSql_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_sql +# +def execute_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new -# Call the execute_sql method. -result = client.execute_sql request + # Call the execute_sql method. + result = client.execute_sql request -# The returned object is of type Google::Cloud::Spanner::V1::ResultSet. -p result + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end # [END spanner_v1_generated_Spanner_ExecuteSql_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb b/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb index 736efcc1d032..33af84992865 100755 --- a/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb +++ b/google-cloud-spanner-v1/snippets/spanner/execute_streaming_sql.rb @@ -19,18 +19,24 @@ # [START spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#execute_streaming_sql +# +def execute_streaming_sql + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new -# Call the execute_streaming_sql method. -result = client.execute_streaming_sql request + # Call the execute_streaming_sql method. + result = client.execute_streaming_sql request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Spanner::V1::PartialResultSet. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Spanner::V1::PartialResultSet. + result.each do |response| + p response + end end # [END spanner_v1_generated_Spanner_ExecuteStreamingSql_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/get_session.rb b/google-cloud-spanner-v1/snippets/spanner/get_session.rb index cbfa7e7b7a04..3016322056b6 100755 --- a/google-cloud-spanner-v1/snippets/spanner/get_session.rb +++ b/google-cloud-spanner-v1/snippets/spanner/get_session.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_GetSession_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#get_session +# +def get_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::GetSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::GetSessionRequest.new -# Call the get_session method. -result = client.get_session request + # Call the get_session method. + result = client.get_session request -# The returned object is of type Google::Cloud::Spanner::V1::Session. -p result + # The returned object is of type Google::Cloud::Spanner::V1::Session. + p result +end # [END spanner_v1_generated_Spanner_GetSession_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb b/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb index 09248ac0100e..e388869ffd69 100755 --- a/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb +++ b/google-cloud-spanner-v1/snippets/spanner/list_sessions.rb @@ -19,21 +19,27 @@ # [START spanner_v1_generated_Spanner_ListSessions_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#list_sessions +# +def list_sessions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ListSessionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ListSessionsRequest.new -# Call the list_sessions method. -result = client.list_sessions request + # Call the list_sessions method. + result = client.list_sessions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Spanner::V1::Session. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Spanner::V1::Session. + p response + end end # [END spanner_v1_generated_Spanner_ListSessions_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/partition_query.rb b/google-cloud-spanner-v1/snippets/spanner/partition_query.rb index 27b6ebee1d7a..e12f45d558df 100755 --- a/google-cloud-spanner-v1/snippets/spanner/partition_query.rb +++ b/google-cloud-spanner-v1/snippets/spanner/partition_query.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_PartitionQuery_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_query +# +def partition_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionQueryRequest.new -# Call the partition_query method. -result = client.partition_query request + # Call the partition_query method. + result = client.partition_query request -# The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. -p result + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end # [END spanner_v1_generated_Spanner_PartitionQuery_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/partition_read.rb b/google-cloud-spanner-v1/snippets/spanner/partition_read.rb index 8ece019f65d4..5f1a84b6992b 100755 --- a/google-cloud-spanner-v1/snippets/spanner/partition_read.rb +++ b/google-cloud-spanner-v1/snippets/spanner/partition_read.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_PartitionRead_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#partition_read +# +def partition_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::PartitionReadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::PartitionReadRequest.new -# Call the partition_read method. -result = client.partition_read request + # Call the partition_read method. + result = client.partition_read request -# The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. -p result + # The returned object is of type Google::Cloud::Spanner::V1::PartitionResponse. + p result +end # [END spanner_v1_generated_Spanner_PartitionRead_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/read.rb b/google-cloud-spanner-v1/snippets/spanner/read.rb index ca021749154f..835d26f26f3e 100755 --- a/google-cloud-spanner-v1/snippets/spanner/read.rb +++ b/google-cloud-spanner-v1/snippets/spanner/read.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_Read_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#read +# +def read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ReadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new -# Call the read method. -result = client.read request + # Call the read method. + result = client.read request -# The returned object is of type Google::Cloud::Spanner::V1::ResultSet. -p result + # The returned object is of type Google::Cloud::Spanner::V1::ResultSet. + p result +end # [END spanner_v1_generated_Spanner_Read_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/rollback.rb b/google-cloud-spanner-v1/snippets/spanner/rollback.rb index 17602afbdf37..f206a3370b33 100755 --- a/google-cloud-spanner-v1/snippets/spanner/rollback.rb +++ b/google-cloud-spanner-v1/snippets/spanner/rollback.rb @@ -19,15 +19,21 @@ # [START spanner_v1_generated_Spanner_Rollback_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#rollback +# +def rollback + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::RollbackRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::RollbackRequest.new -# Call the rollback method. -result = client.rollback request + # Call the rollback method. + result = client.rollback request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END spanner_v1_generated_Spanner_Rollback_sync] diff --git a/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb b/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb index 52edc3d52b8b..604135e4376e 100755 --- a/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb +++ b/google-cloud-spanner-v1/snippets/spanner/streaming_read.rb @@ -19,18 +19,24 @@ # [START spanner_v1_generated_Spanner_StreamingRead_sync] require "google/cloud/spanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Spanner::V1::Spanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Spanner::V1::Spanner::Client#streaming_read +# +def streaming_read + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Spanner::V1::Spanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Spanner::V1::ReadRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Spanner::V1::ReadRequest.new -# Call the streaming_read method. -result = client.streaming_read request + # Call the streaming_read method. + result = client.streaming_read request -# The returned object is a streamed enumerable yielding elements of -# type ::Google::Cloud::Spanner::V1::PartialResultSet. -result.each do |response| - p response + # The returned object is a streamed enumerable yielding elements of + # type ::Google::Cloud::Spanner::V1::PartialResultSet. + result.each do |response| + p response + end end # [END spanner_v1_generated_Spanner_StreamingRead_sync] diff --git a/google-cloud-speech-v1/.rubocop.yml b/google-cloud-speech-v1/.rubocop.yml index d17ad4636f27..3c22305c5efd 100644 --- a/google-cloud-speech-v1/.rubocop.yml +++ b/google-cloud-speech-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-speech-v1.rb" diff --git a/google-cloud-speech-v1/snippets/Gemfile b/google-cloud-speech-v1/snippets/Gemfile index 6e53ebbbaa58..172dcb0dd3c3 100755 --- a/google-cloud-speech-v1/snippets/Gemfile +++ b/google-cloud-speech-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb b/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb index 78d6e1211499..f7592a63740a 100644 --- a/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb +++ b/google-cloud-speech-v1/snippets/adaptation/create_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_CreateCustomClass_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#create_custom_class +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::CreateCustomClassRequest.new -# Call the create_custom_class method. -result = client.create_custom_class request + # Call the create_custom_class method. + result = client.create_custom_class request -# The returned object is of type Google::Cloud::Speech::V1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end # [END speech_v1_generated_Adaptation_CreateCustomClass_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb b/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb index 8918b1f98419..e14880dc4cac 100644 --- a/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb +++ b/google-cloud-speech-v1/snippets/adaptation/create_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_CreatePhraseSet_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#create_phrase_set +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::CreatePhraseSetRequest.new -# Call the create_phrase_set method. -result = client.create_phrase_set request + # Call the create_phrase_set method. + result = client.create_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end # [END speech_v1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb b/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb index 286855ea3b1c..9a8abe8e002a 100644 --- a/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb +++ b/google-cloud-speech-v1/snippets/adaptation/delete_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_DeleteCustomClass_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#delete_custom_class +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::DeleteCustomClassRequest.new -# Call the delete_custom_class method. -result = client.delete_custom_class request + # Call the delete_custom_class method. + result = client.delete_custom_class request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END speech_v1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb b/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb index 9b231c6d48fd..1228f7af3474 100644 --- a/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb +++ b/google-cloud-speech-v1/snippets/adaptation/delete_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_DeletePhraseSet_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#delete_phrase_set +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::DeletePhraseSetRequest.new -# Call the delete_phrase_set method. -result = client.delete_phrase_set request + # Call the delete_phrase_set method. + result = client.delete_phrase_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END speech_v1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb b/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb index 2141fd1fca4b..d268c25ec484 100644 --- a/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb +++ b/google-cloud-speech-v1/snippets/adaptation/get_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_GetCustomClass_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#get_custom_class +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::GetCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::GetCustomClassRequest.new -# Call the get_custom_class method. -result = client.get_custom_class request + # Call the get_custom_class method. + result = client.get_custom_class request -# The returned object is of type Google::Cloud::Speech::V1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end # [END speech_v1_generated_Adaptation_GetCustomClass_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb b/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb index 214d79d9ce1b..106a0d42f0d8 100644 --- a/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb +++ b/google-cloud-speech-v1/snippets/adaptation/get_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_GetPhraseSet_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#get_phrase_set +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::GetPhraseSetRequest.new -# Call the get_phrase_set method. -result = client.get_phrase_set request + # Call the get_phrase_set method. + result = client.get_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end # [END speech_v1_generated_Adaptation_GetPhraseSet_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb b/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb index ea5d6fac5428..b41b71e86406 100644 --- a/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb +++ b/google-cloud-speech-v1/snippets/adaptation/list_custom_classes.rb @@ -19,21 +19,27 @@ # [START speech_v1_generated_Adaptation_ListCustomClasses_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#list_custom_classes +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::ListCustomClassesRequest.new -# Call the list_custom_classes method. -result = client.list_custom_classes request + # Call the list_custom_classes method. + result = client.list_custom_classes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V1::CustomClass. + p response + end end # [END speech_v1_generated_Adaptation_ListCustomClasses_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb b/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb index de76bca3ac67..b4a20eed9d8d 100644 --- a/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb +++ b/google-cloud-speech-v1/snippets/adaptation/list_phrase_set.rb @@ -19,21 +19,27 @@ # [START speech_v1_generated_Adaptation_ListPhraseSet_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#list_phrase_set +# +def list_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::ListPhraseSetRequest.new -# Call the list_phrase_set method. -result = client.list_phrase_set request + # Call the list_phrase_set method. + result = client.list_phrase_set request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V1::PhraseSet. + p response + end end # [END speech_v1_generated_Adaptation_ListPhraseSet_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb b/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb index 2397ecfb387b..96f5dc6baf5f 100644 --- a/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb +++ b/google-cloud-speech-v1/snippets/adaptation/update_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_UpdateCustomClass_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#update_custom_class +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::UpdateCustomClassRequest.new -# Call the update_custom_class method. -result = client.update_custom_class request + # Call the update_custom_class method. + result = client.update_custom_class request -# The returned object is of type Google::Cloud::Speech::V1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1::CustomClass. + p result +end # [END speech_v1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb b/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb index 88225ffcad48..48b4ee1ea959 100644 --- a/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb +++ b/google-cloud-speech-v1/snippets/adaptation/update_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Adaptation_UpdatePhraseSet_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Adaptation::Client#update_phrase_set +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::UpdatePhraseSetRequest.new -# Call the update_phrase_set method. -result = client.update_phrase_set request + # Call the update_phrase_set method. + result = client.update_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1::PhraseSet. + p result +end # [END speech_v1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json b/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json index 0623fee0d2bd..d2fafe6ab37c 100644 --- a/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json +++ b/google-cloud-speech-v1/snippets/snippet_metadata_google.cloud.speech.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb b/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb index 06d0fe64c6f7..cb10e0b68eac 100755 --- a/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb +++ b/google-cloud-speech-v1/snippets/speech/long_running_recognize.rb @@ -19,22 +19,28 @@ # [START speech_v1_generated_Speech_LongRunningRecognize_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#long_running_recognize +# +def long_running_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::LongRunningRecognizeRequest.new -# Call the long_running_recognize method. -result = client.long_running_recognize request + # Call the long_running_recognize method. + result = client.long_running_recognize request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v1_generated_Speech_LongRunningRecognize_sync] diff --git a/google-cloud-speech-v1/snippets/speech/recognize.rb b/google-cloud-speech-v1/snippets/speech/recognize.rb index 9da989d1b272..ff6d1a784548 100755 --- a/google-cloud-speech-v1/snippets/speech/recognize.rb +++ b/google-cloud-speech-v1/snippets/speech/recognize.rb @@ -19,15 +19,21 @@ # [START speech_v1_generated_Speech_Recognize_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#recognize +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1::RecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1::RecognizeRequest.new -# Call the recognize method. -result = client.recognize request + # Call the recognize method. + result = client.recognize request -# The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. -p result + # The returned object is of type Google::Cloud::Speech::V1::RecognizeResponse. + p result +end # [END speech_v1_generated_Speech_Recognize_sync] diff --git a/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb b/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb index 51b92778c134..2160e6f244b2 100755 --- a/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb +++ b/google-cloud-speech-v1/snippets/speech/streaming_recognize.rb @@ -19,24 +19,30 @@ # [START speech_v1_generated_Speech_StreamingRecognize_sync] require "google/cloud/speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1::Speech::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_recognize method to start streaming. -output = client.streaming_recognize input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new -input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Speech::V1::StreamingRecognizeResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1::Speech::Client#streaming_recognize +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1::Speech::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V1::StreamingRecognizeRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Speech::V1::StreamingRecognizeResponse. + output.each do |response| + p response + end end # [END speech_v1_generated_Speech_StreamingRecognize_sync] diff --git a/google-cloud-speech-v1p1beta1/.rubocop.yml b/google-cloud-speech-v1p1beta1/.rubocop.yml index 2d44035556da..6e64dd5a1ded 100644 --- a/google-cloud-speech-v1p1beta1/.rubocop.yml +++ b/google-cloud-speech-v1p1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-speech-v1p1beta1.rb" diff --git a/google-cloud-speech-v1p1beta1/snippets/Gemfile b/google-cloud-speech-v1p1beta1/snippets/Gemfile index 3a078411d94e..9856684ac160 100755 --- a/google-cloud-speech-v1p1beta1/snippets/Gemfile +++ b/google-cloud-speech-v1p1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb index fb2649a99eb1..7095ae139761 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/create_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_custom_class +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new -# Call the create_custom_class method. -result = client.create_custom_class request + # Call the create_custom_class method. + result = client.create_custom_class request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end # [END speech_v1p1beta1_generated_Adaptation_CreateCustomClass_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb index 4d0909b0b1ce..668f794b2aee 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/create_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#create_phrase_set +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::CreatePhraseSetRequest.new -# Call the create_phrase_set method. -result = client.create_phrase_set request + # Call the create_phrase_set method. + result = client.create_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end # [END speech_v1p1beta1_generated_Adaptation_CreatePhraseSet_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb index 841aa07e67d9..3a055610f0cb 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_custom_class +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::DeleteCustomClassRequest.new -# Call the delete_custom_class method. -result = client.delete_custom_class request + # Call the delete_custom_class method. + result = client.delete_custom_class request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END speech_v1p1beta1_generated_Adaptation_DeleteCustomClass_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb index 2160fcad785d..215a01821f94 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/delete_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#delete_phrase_set +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::DeletePhraseSetRequest.new -# Call the delete_phrase_set method. -result = client.delete_phrase_set request + # Call the delete_phrase_set method. + result = client.delete_phrase_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END speech_v1p1beta1_generated_Adaptation_DeletePhraseSet_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb index 56d434c38cea..346a7701ab64 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/get_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_custom_class +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::GetCustomClassRequest.new -# Call the get_custom_class method. -result = client.get_custom_class request + # Call the get_custom_class method. + result = client.get_custom_class request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end # [END speech_v1p1beta1_generated_Adaptation_GetCustomClass_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb index be9a9f023ce1..f628a999c82d 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/get_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#get_phrase_set +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::GetPhraseSetRequest.new -# Call the get_phrase_set method. -result = client.get_phrase_set request + # Call the get_phrase_set method. + result = client.get_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end # [END speech_v1p1beta1_generated_Adaptation_GetPhraseSet_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb index f087fc164b04..fe0b8ac895e0 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/list_custom_classes.rb @@ -19,21 +19,27 @@ # [START speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_custom_classes +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::ListCustomClassesRequest.new -# Call the list_custom_classes method. -result = client.list_custom_classes request + # Call the list_custom_classes method. + result = client.list_custom_classes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V1p1beta1::CustomClass. + p response + end end # [END speech_v1p1beta1_generated_Adaptation_ListCustomClasses_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb index 29455b5fbce8..3c6c5c4fda89 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/list_phrase_set.rb @@ -19,21 +19,27 @@ # [START speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#list_phrase_set +# +def list_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::ListPhraseSetRequest.new -# Call the list_phrase_set method. -result = client.list_phrase_set request + # Call the list_phrase_set method. + result = client.list_phrase_set request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V1p1beta1::PhraseSet. + p response + end end # [END speech_v1p1beta1_generated_Adaptation_ListPhraseSet_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb index 1f0d4f74df0a..98db49fa0c46 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/update_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_custom_class +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::UpdateCustomClassRequest.new -# Call the update_custom_class method. -result = client.update_custom_class request + # Call the update_custom_class method. + result = client.update_custom_class request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::CustomClass. + p result +end # [END speech_v1p1beta1_generated_Adaptation_UpdateCustomClass_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb b/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb index e576f843997e..cc9ff6ad32e1 100755 --- a/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb +++ b/google-cloud-speech-v1p1beta1/snippets/adaptation/update_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Adaptation::Client#update_phrase_set +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Adaptation::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::UpdatePhraseSetRequest.new -# Call the update_phrase_set method. -result = client.update_phrase_set request + # Call the update_phrase_set method. + result = client.update_phrase_set request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::PhraseSet. + p result +end # [END speech_v1p1beta1_generated_Adaptation_UpdatePhraseSet_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json b/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json index 438c86e38251..2c392e4f0db5 100644 --- a/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json +++ b/google-cloud-speech-v1p1beta1/snippets/snippet_metadata_google.cloud.speech.v1p1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb b/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb index 98b4773e145e..2bdf852d39af 100755 --- a/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb +++ b/google-cloud-speech-v1p1beta1/snippets/speech/long_running_recognize.rb @@ -19,22 +19,28 @@ # [START speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#long_running_recognize +# +def long_running_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::LongRunningRecognizeRequest.new -# Call the long_running_recognize method. -result = client.long_running_recognize request + # Call the long_running_recognize method. + result = client.long_running_recognize request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v1p1beta1_generated_Speech_LongRunningRecognize_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb b/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb index b205c9745bf0..a95c7625cfad 100755 --- a/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb +++ b/google-cloud-speech-v1p1beta1/snippets/speech/recognize.rb @@ -19,15 +19,21 @@ # [START speech_v1p1beta1_generated_Speech_Recognize_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#recognize +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V1p1beta1::RecognizeRequest.new -# Call the recognize method. -result = client.recognize request + # Call the recognize method. + result = client.recognize request -# The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. -p result + # The returned object is of type Google::Cloud::Speech::V1p1beta1::RecognizeResponse. + p result +end # [END speech_v1p1beta1_generated_Speech_Recognize_sync] diff --git a/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb b/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb index d85a66698673..9d322fbfe5af 100755 --- a/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb +++ b/google-cloud-speech-v1p1beta1/snippets/speech/streaming_recognize.rb @@ -19,24 +19,30 @@ # [START speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] require "google/cloud/speech/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_recognize method to start streaming. -output = client.streaming_recognize input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new -input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V1p1beta1::Speech::Client#streaming_recognize +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V1p1beta1::Speech::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V1p1beta1::StreamingRecognizeRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Speech::V1p1beta1::StreamingRecognizeResponse. + output.each do |response| + p response + end end # [END speech_v1p1beta1_generated_Speech_StreamingRecognize_sync] diff --git a/google-cloud-speech-v2/.rubocop.yml b/google-cloud-speech-v2/.rubocop.yml index 543b1a027961..11a141b34f5b 100644 --- a/google-cloud-speech-v2/.rubocop.yml +++ b/google-cloud-speech-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-speech-v2.rb" diff --git a/google-cloud-speech-v2/snippets/Gemfile b/google-cloud-speech-v2/snippets/Gemfile index c58b87038718..b0590ee39a4d 100644 --- a/google-cloud-speech-v2/snippets/Gemfile +++ b/google-cloud-speech-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json b/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json index 8dfda6485fd8..ca9c8c686e62 100644 --- a/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json +++ b/google-cloud-speech-v2/snippets/snippet_metadata_google.cloud.speech.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-speech-v2/snippets/speech/batch_recognize.rb b/google-cloud-speech-v2/snippets/speech/batch_recognize.rb index 2b5040797092..ce0e9f0965d3 100644 --- a/google-cloud-speech-v2/snippets/speech/batch_recognize.rb +++ b/google-cloud-speech-v2/snippets/speech/batch_recognize.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_BatchRecognize_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#batch_recognize +# +def batch_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::BatchRecognizeRequest.new -# Call the batch_recognize method. -result = client.batch_recognize request + # Call the batch_recognize method. + result = client.batch_recognize request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/google-cloud-speech-v2/snippets/speech/create_custom_class.rb b/google-cloud-speech-v2/snippets/speech/create_custom_class.rb index f63fa8ca3c2c..f8972c83219a 100644 --- a/google-cloud-speech-v2/snippets/speech/create_custom_class.rb +++ b/google-cloud-speech-v2/snippets/speech/create_custom_class.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_CreateCustomClass_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_custom_class +# +def create_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateCustomClassRequest.new -# Call the create_custom_class method. -result = client.create_custom_class request + # Call the create_custom_class method. + result = client.create_custom_class request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb b/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb index 4b0880e39e0a..36a9485c9c33 100644 --- a/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb +++ b/google-cloud-speech-v2/snippets/speech/create_phrase_set.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_CreatePhraseSet_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_phrase_set +# +def create_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreatePhraseSetRequest.new -# Call the create_phrase_set method. -result = client.create_phrase_set request + # Call the create_phrase_set method. + result = client.create_phrase_set request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/google-cloud-speech-v2/snippets/speech/create_recognizer.rb b/google-cloud-speech-v2/snippets/speech/create_recognizer.rb index 300e51d16054..26c8b6b24cc8 100644 --- a/google-cloud-speech-v2/snippets/speech/create_recognizer.rb +++ b/google-cloud-speech-v2/snippets/speech/create_recognizer.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_CreateRecognizer_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#create_recognizer +# +def create_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::CreateRecognizerRequest.new -# Call the create_recognizer method. -result = client.create_recognizer request + # Call the create_recognizer method. + result = client.create_recognizer request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb b/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb index 9c9f841ddb1e..91108e4e6f87 100644 --- a/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb +++ b/google-cloud-speech-v2/snippets/speech/delete_custom_class.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_DeleteCustomClass_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_custom_class +# +def delete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteCustomClassRequest.new -# Call the delete_custom_class method. -result = client.delete_custom_class request + # Call the delete_custom_class method. + result = client.delete_custom_class request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb b/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb index 521c37d57e1c..ef570ab83064 100644 --- a/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb +++ b/google-cloud-speech-v2/snippets/speech/delete_phrase_set.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_DeletePhraseSet_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_phrase_set +# +def delete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeletePhraseSetRequest.new -# Call the delete_phrase_set method. -result = client.delete_phrase_set request + # Call the delete_phrase_set method. + result = client.delete_phrase_set request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb b/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb index 5903049ed8d1..d8a3f6e00e08 100644 --- a/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb +++ b/google-cloud-speech-v2/snippets/speech/delete_recognizer.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_DeleteRecognizer_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#delete_recognizer +# +def delete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::DeleteRecognizerRequest.new -# Call the delete_recognizer method. -result = client.delete_recognizer request + # Call the delete_recognizer method. + result = client.delete_recognizer request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/google-cloud-speech-v2/snippets/speech/get_config.rb b/google-cloud-speech-v2/snippets/speech/get_config.rb index ea6a342ec1b9..8decda0933cc 100644 --- a/google-cloud-speech-v2/snippets/speech/get_config.rb +++ b/google-cloud-speech-v2/snippets/speech/get_config.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_GetConfig_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_config +# +def get_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::GetConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetConfigRequest.new -# Call the get_config method. -result = client.get_config request + # Call the get_config method. + result = client.get_config request -# The returned object is of type Google::Cloud::Speech::V2::Config. -p result + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end # [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/google-cloud-speech-v2/snippets/speech/get_custom_class.rb b/google-cloud-speech-v2/snippets/speech/get_custom_class.rb index 26f01b37c509..2fd4ea42f9e1 100644 --- a/google-cloud-speech-v2/snippets/speech/get_custom_class.rb +++ b/google-cloud-speech-v2/snippets/speech/get_custom_class.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_GetCustomClass_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_custom_class +# +def get_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::GetCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetCustomClassRequest.new -# Call the get_custom_class method. -result = client.get_custom_class request + # Call the get_custom_class method. + result = client.get_custom_class request -# The returned object is of type Google::Cloud::Speech::V2::CustomClass. -p result + # The returned object is of type Google::Cloud::Speech::V2::CustomClass. + p result +end # [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb b/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb index 19b6b90be5e2..87f896853714 100644 --- a/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb +++ b/google-cloud-speech-v2/snippets/speech/get_phrase_set.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_GetPhraseSet_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_phrase_set +# +def get_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetPhraseSetRequest.new -# Call the get_phrase_set method. -result = client.get_phrase_set request + # Call the get_phrase_set method. + result = client.get_phrase_set request -# The returned object is of type Google::Cloud::Speech::V2::PhraseSet. -p result + # The returned object is of type Google::Cloud::Speech::V2::PhraseSet. + p result +end # [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/google-cloud-speech-v2/snippets/speech/get_recognizer.rb b/google-cloud-speech-v2/snippets/speech/get_recognizer.rb index f35d71405141..b031ea3260b0 100644 --- a/google-cloud-speech-v2/snippets/speech/get_recognizer.rb +++ b/google-cloud-speech-v2/snippets/speech/get_recognizer.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_GetRecognizer_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#get_recognizer +# +def get_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::GetRecognizerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::GetRecognizerRequest.new -# Call the get_recognizer method. -result = client.get_recognizer request + # Call the get_recognizer method. + result = client.get_recognizer request -# The returned object is of type Google::Cloud::Speech::V2::Recognizer. -p result + # The returned object is of type Google::Cloud::Speech::V2::Recognizer. + p result +end # [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb b/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb index 3663365e0dbd..721745672015 100644 --- a/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb +++ b/google-cloud-speech-v2/snippets/speech/list_custom_classes.rb @@ -19,21 +19,27 @@ # [START speech_v2_generated_Speech_ListCustomClasses_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_custom_classes +# +def list_custom_classes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListCustomClassesRequest.new -# Call the list_custom_classes method. -result = client.list_custom_classes request + # Call the list_custom_classes method. + result = client.list_custom_classes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V2::CustomClass. + p response + end end # [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb b/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb index cf2b2cdc2d80..8386a0f0f7c8 100644 --- a/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb +++ b/google-cloud-speech-v2/snippets/speech/list_phrase_sets.rb @@ -19,21 +19,27 @@ # [START speech_v2_generated_Speech_ListPhraseSets_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_phrase_sets +# +def list_phrase_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListPhraseSetsRequest.new -# Call the list_phrase_sets method. -result = client.list_phrase_sets request + # Call the list_phrase_sets method. + result = client.list_phrase_sets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V2::PhraseSet. + p response + end end # [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/google-cloud-speech-v2/snippets/speech/list_recognizers.rb b/google-cloud-speech-v2/snippets/speech/list_recognizers.rb index 9f71d3ebaf6b..e8099c17840e 100644 --- a/google-cloud-speech-v2/snippets/speech/list_recognizers.rb +++ b/google-cloud-speech-v2/snippets/speech/list_recognizers.rb @@ -19,21 +19,27 @@ # [START speech_v2_generated_Speech_ListRecognizers_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#list_recognizers +# +def list_recognizers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::ListRecognizersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::ListRecognizersRequest.new -# Call the list_recognizers method. -result = client.list_recognizers request + # Call the list_recognizers method. + result = client.list_recognizers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Speech::V2::Recognizer. + p response + end end # [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/google-cloud-speech-v2/snippets/speech/recognize.rb b/google-cloud-speech-v2/snippets/speech/recognize.rb index da935d42a6e2..c135a3d49a3e 100644 --- a/google-cloud-speech-v2/snippets/speech/recognize.rb +++ b/google-cloud-speech-v2/snippets/speech/recognize.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_Recognize_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#recognize +# +def recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::RecognizeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::RecognizeRequest.new -# Call the recognize method. -result = client.recognize request + # Call the recognize method. + result = client.recognize request -# The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. -p result + # The returned object is of type Google::Cloud::Speech::V2::RecognizeResponse. + p result +end # [END speech_v2_generated_Speech_Recognize_sync] diff --git a/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb b/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb index 3eb5efd74b9e..e119f12079ef 100644 --- a/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb +++ b/google-cloud-speech-v2/snippets/speech/streaming_recognize.rb @@ -19,24 +19,30 @@ # [START speech_v2_generated_Speech_StreamingRecognize_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_recognize method to start streaming. -output = client.streaming_recognize input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new -input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::Speech::V2::StreamingRecognizeResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#streaming_recognize +# +def streaming_recognize + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_recognize method to start streaming. + output = client.streaming_recognize input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input << Google::Cloud::Speech::V2::StreamingRecognizeRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::Speech::V2::StreamingRecognizeResponse. + output.each do |response| + p response + end end # [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb b/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb index 6a1d715d9d06..14cfbbd5bd79 100644 --- a/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb +++ b/google-cloud-speech-v2/snippets/speech/undelete_custom_class.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UndeleteCustomClass_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_custom_class +# +def undelete_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteCustomClassRequest.new -# Call the undelete_custom_class method. -result = client.undelete_custom_class request + # Call the undelete_custom_class method. + result = client.undelete_custom_class request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb b/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb index 3f0743e7276c..598ee1fb39b2 100644 --- a/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb +++ b/google-cloud-speech-v2/snippets/speech/undelete_phrase_set.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UndeletePhraseSet_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_phrase_set +# +def undelete_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeletePhraseSetRequest.new -# Call the undelete_phrase_set method. -result = client.undelete_phrase_set request + # Call the undelete_phrase_set method. + result = client.undelete_phrase_set request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb b/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb index 7d059eafbe22..a987c97f48ef 100644 --- a/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb +++ b/google-cloud-speech-v2/snippets/speech/undelete_recognizer.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UndeleteRecognizer_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#undelete_recognizer +# +def undelete_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UndeleteRecognizerRequest.new -# Call the undelete_recognizer method. -result = client.undelete_recognizer request + # Call the undelete_recognizer method. + result = client.undelete_recognizer request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/google-cloud-speech-v2/snippets/speech/update_config.rb b/google-cloud-speech-v2/snippets/speech/update_config.rb index 2ccb6c768490..04c5b9db5130 100644 --- a/google-cloud-speech-v2/snippets/speech/update_config.rb +++ b/google-cloud-speech-v2/snippets/speech/update_config.rb @@ -19,15 +19,21 @@ # [START speech_v2_generated_Speech_UpdateConfig_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_config +# +def update_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UpdateConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateConfigRequest.new -# Call the update_config method. -result = client.update_config request + # Call the update_config method. + result = client.update_config request -# The returned object is of type Google::Cloud::Speech::V2::Config. -p result + # The returned object is of type Google::Cloud::Speech::V2::Config. + p result +end # [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/google-cloud-speech-v2/snippets/speech/update_custom_class.rb b/google-cloud-speech-v2/snippets/speech/update_custom_class.rb index 412d38a230ec..d64cbd9b1ef4 100644 --- a/google-cloud-speech-v2/snippets/speech/update_custom_class.rb +++ b/google-cloud-speech-v2/snippets/speech/update_custom_class.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UpdateCustomClass_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_custom_class +# +def update_custom_class + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateCustomClassRequest.new -# Call the update_custom_class method. -result = client.update_custom_class request + # Call the update_custom_class method. + result = client.update_custom_class request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb b/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb index 97b3cab67eaf..96cba7f0490d 100644 --- a/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb +++ b/google-cloud-speech-v2/snippets/speech/update_phrase_set.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UpdatePhraseSet_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_phrase_set +# +def update_phrase_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdatePhraseSetRequest.new -# Call the update_phrase_set method. -result = client.update_phrase_set request + # Call the update_phrase_set method. + result = client.update_phrase_set request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/google-cloud-speech-v2/snippets/speech/update_recognizer.rb b/google-cloud-speech-v2/snippets/speech/update_recognizer.rb index 036bbdf3f86e..ea6d4c5246ec 100644 --- a/google-cloud-speech-v2/snippets/speech/update_recognizer.rb +++ b/google-cloud-speech-v2/snippets/speech/update_recognizer.rb @@ -19,22 +19,28 @@ # [START speech_v2_generated_Speech_UpdateRecognizer_sync] require "google/cloud/speech/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Speech::V2::Speech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Speech::V2::Speech::Client#update_recognizer +# +def update_recognizer + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Speech::V2::Speech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Speech::V2::UpdateRecognizerRequest.new -# Call the update_recognizer method. -result = client.update_recognizer request + # Call the update_recognizer method. + result = client.update_recognizer request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END speech_v2_generated_Speech_UpdateRecognizer_sync] diff --git a/google-cloud-storage_transfer-v1/.rubocop.yml b/google-cloud-storage_transfer-v1/.rubocop.yml index 55a633499ef0..9372f2dc47b5 100644 --- a/google-cloud-storage_transfer-v1/.rubocop.yml +++ b/google-cloud-storage_transfer-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-storage_transfer-v1.rb" diff --git a/google-cloud-storage_transfer-v1/snippets/Gemfile b/google-cloud-storage_transfer-v1/snippets/Gemfile index 760ff7213057..6f9fe1351e3e 100755 --- a/google-cloud-storage_transfer-v1/snippets/Gemfile +++ b/google-cloud-storage_transfer-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json b/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json index a24564d56f39..991219cd943b 100644 --- a/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json +++ b/google-cloud-storage_transfer-v1/snippets/snippet_metadata_google.storagetransfer.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb index 2ee5c616e8e9..d5379d164a23 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_agent_pool.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_agent_pool +# +def create_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new -# Call the create_agent_pool method. -result = client.create_agent_pool request + # Call the create_agent_pool method. + result = client.create_agent_pool request -# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_CreateAgentPool_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb index 6adea633109e..169bafca4d7f 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/create_transfer_job.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#create_transfer_job +# +def create_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new -# Call the create_transfer_job method. -result = client.create_transfer_job request + # Call the create_transfer_job method. + result = client.create_transfer_job request -# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_CreateTransferJob_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb index 76c88cb8abd3..afd29a76ee3d 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_agent_pool.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_agent_pool +# +def delete_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new -# Call the delete_agent_pool method. -result = client.delete_agent_pool request + # Call the delete_agent_pool method. + result = client.delete_agent_pool request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_DeleteAgentPool_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb index 6e3dac43b3f2..d4d0372f674d 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/delete_transfer_job.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#delete_transfer_job +# +def delete_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new -# Call the delete_transfer_job method. -result = client.delete_transfer_job request + # Call the delete_transfer_job method. + result = client.delete_transfer_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_DeleteTransferJob_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb index bfc407eaa968..38b30b09ab45 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_agent_pool.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_agent_pool +# +def get_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new -# Call the get_agent_pool method. -result = client.get_agent_pool request + # Call the get_agent_pool method. + result = client.get_agent_pool request -# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_GetAgentPool_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb index f1bebc948676..44a9650c343f 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_google_service_account.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_google_service_account +# +def get_google_service_account + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new -# Call the get_google_service_account method. -result = client.get_google_service_account request + # Call the get_google_service_account method. + result = client.get_google_service_account request -# The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_GetGoogleServiceAccount_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb index 1224843f15cd..3a38ed44fda1 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/get_transfer_job.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#get_transfer_job +# +def get_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new -# Call the get_transfer_job method. -result = client.get_transfer_job request + # Call the get_transfer_job method. + result = client.get_transfer_job request -# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_GetTransferJob_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb index 7caa1334cd70..202230396fa0 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_agent_pools.rb @@ -19,21 +19,27 @@ # [START storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_agent_pools +# +def list_agent_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new -# Call the list_agent_pools method. -result = client.list_agent_pools request + # Call the list_agent_pools method. + result = client.list_agent_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool. + p response + end end # [END storagetransfer_v1_generated_StorageTransferService_ListAgentPools_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb index 64f27015e71f..9982c9b488f1 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/list_transfer_jobs.rb @@ -19,21 +19,27 @@ # [START storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#list_transfer_jobs +# +def list_transfer_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new -# Call the list_transfer_jobs method. -result = client.list_transfer_jobs request + # Call the list_transfer_jobs method. + result = client.list_transfer_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob. + p response + end end # [END storagetransfer_v1_generated_StorageTransferService_ListTransferJobs_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb index fa2738e3c067..1b134eca2faf 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/pause_transfer_operation.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#pause_transfer_operation +# +def pause_transfer_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new -# Call the pause_transfer_operation method. -result = client.pause_transfer_operation request + # Call the pause_transfer_operation method. + result = client.pause_transfer_operation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_PauseTransferOperation_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb index 64d761cc5a54..2c6b9dab452f 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/resume_transfer_operation.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#resume_transfer_operation +# +def resume_transfer_operation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new -# Call the resume_transfer_operation method. -result = client.resume_transfer_operation request + # Call the resume_transfer_operation method. + result = client.resume_transfer_operation request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_ResumeTransferOperation_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb index a7ef9b2e89cd..b9d50e35e9a7 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/run_transfer_job.rb @@ -19,22 +19,28 @@ # [START storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#run_transfer_job +# +def run_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new -# Call the run_transfer_job method. -result = client.run_transfer_job request + # Call the run_transfer_job method. + result = client.run_transfer_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END storagetransfer_v1_generated_StorageTransferService_RunTransferJob_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb index 55c4757b2ca2..979d0405fa85 100644 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_agent_pool.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_agent_pool +# +def update_agent_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new -# Call the update_agent_pool method. -result = client.update_agent_pool request + # Call the update_agent_pool method. + result = client.update_agent_pool request -# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_UpdateAgentPool_sync] diff --git a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb index 7412dbc223ba..0a469751184a 100755 --- a/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb +++ b/google-cloud-storage_transfer-v1/snippets/storage_transfer_service/update_transfer_job.rb @@ -19,15 +19,21 @@ # [START storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] require "google/cloud/storage_transfer/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::StorageTransfer::V1::StorageTransferService::Client#update_transfer_job +# +def update_transfer_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new -# Call the update_transfer_job method. -result = client.update_transfer_job request + # Call the update_transfer_job method. + result = client.update_transfer_job request -# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. -p result + # The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob. + p result +end # [END storagetransfer_v1_generated_StorageTransferService_UpdateTransferJob_sync] diff --git a/google-cloud-talent-v4/.rubocop.yml b/google-cloud-talent-v4/.rubocop.yml index 87dbc96435cf..bd272e76c0ea 100644 --- a/google-cloud-talent-v4/.rubocop.yml +++ b/google-cloud-talent-v4/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-talent-v4.rb" diff --git a/google-cloud-talent-v4/snippets/Gemfile b/google-cloud-talent-v4/snippets/Gemfile index fab85bd6e59b..bb04910c8bb0 100755 --- a/google-cloud-talent-v4/snippets/Gemfile +++ b/google-cloud-talent-v4/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-talent-v4/snippets/company_service/create_company.rb b/google-cloud-talent-v4/snippets/company_service/create_company.rb index 808680eb4f3c..e515f11567db 100755 --- a/google-cloud-talent-v4/snippets/company_service/create_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/create_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_CompanyService_CreateCompany_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#create_company +# +def create_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::CreateCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateCompanyRequest.new -# Call the create_company method. -result = client.create_company request + # Call the create_company method. + result = client.create_company request -# The returned object is of type Google::Cloud::Talent::V4::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end # [END jobs_v4_generated_CompanyService_CreateCompany_sync] diff --git a/google-cloud-talent-v4/snippets/company_service/delete_company.rb b/google-cloud-talent-v4/snippets/company_service/delete_company.rb index f26a68673ed2..86e90b7af027 100755 --- a/google-cloud-talent-v4/snippets/company_service/delete_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/delete_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_CompanyService_DeleteCompany_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#delete_company +# +def delete_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteCompanyRequest.new -# Call the delete_company method. -result = client.delete_company request + # Call the delete_company method. + result = client.delete_company request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4_generated_CompanyService_DeleteCompany_sync] diff --git a/google-cloud-talent-v4/snippets/company_service/get_company.rb b/google-cloud-talent-v4/snippets/company_service/get_company.rb index a512f8fad138..038276821cf3 100755 --- a/google-cloud-talent-v4/snippets/company_service/get_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/get_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_CompanyService_GetCompany_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#get_company +# +def get_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::GetCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetCompanyRequest.new -# Call the get_company method. -result = client.get_company request + # Call the get_company method. + result = client.get_company request -# The returned object is of type Google::Cloud::Talent::V4::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end # [END jobs_v4_generated_CompanyService_GetCompany_sync] diff --git a/google-cloud-talent-v4/snippets/company_service/list_companies.rb b/google-cloud-talent-v4/snippets/company_service/list_companies.rb index 542533a5b54b..8bce79d485d8 100755 --- a/google-cloud-talent-v4/snippets/company_service/list_companies.rb +++ b/google-cloud-talent-v4/snippets/company_service/list_companies.rb @@ -19,21 +19,27 @@ # [START jobs_v4_generated_CompanyService_ListCompanies_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#list_companies +# +def list_companies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::ListCompaniesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListCompaniesRequest.new -# Call the list_companies method. -result = client.list_companies request + # Call the list_companies method. + result = client.list_companies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4::Company. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4::Company. + p response + end end # [END jobs_v4_generated_CompanyService_ListCompanies_sync] diff --git a/google-cloud-talent-v4/snippets/company_service/update_company.rb b/google-cloud-talent-v4/snippets/company_service/update_company.rb index 274cf3e9c95e..1744add6a0f8 100755 --- a/google-cloud-talent-v4/snippets/company_service/update_company.rb +++ b/google-cloud-talent-v4/snippets/company_service/update_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_CompanyService_UpdateCompany_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::CompanyService::Client#update_company +# +def update_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateCompanyRequest.new -# Call the update_company method. -result = client.update_company request + # Call the update_company method. + result = client.update_company request -# The returned object is of type Google::Cloud::Talent::V4::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4::Company. + p result +end # [END jobs_v4_generated_CompanyService_UpdateCompany_sync] diff --git a/google-cloud-talent-v4/snippets/completion/complete_query.rb b/google-cloud-talent-v4/snippets/completion/complete_query.rb index 00adc445213b..1afa966f6d04 100755 --- a/google-cloud-talent-v4/snippets/completion/complete_query.rb +++ b/google-cloud-talent-v4/snippets/completion/complete_query.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_Completion_CompleteQuery_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::Completion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::Completion::Client#complete_query +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::Completion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::CompleteQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CompleteQueryRequest.new -# Call the complete_query method. -result = client.complete_query request + # Call the complete_query method. + result = client.complete_query request -# The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4::CompleteQueryResponse. + p result +end # [END jobs_v4_generated_Completion_CompleteQuery_sync] diff --git a/google-cloud-talent-v4/snippets/event_service/create_client_event.rb b/google-cloud-talent-v4/snippets/event_service/create_client_event.rb index 83db400f1bb8..a5798935cd6c 100755 --- a/google-cloud-talent-v4/snippets/event_service/create_client_event.rb +++ b/google-cloud-talent-v4/snippets/event_service/create_client_event.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_EventService_CreateClientEvent_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::EventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::EventService::Client#create_client_event +# +def create_client_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::EventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::CreateClientEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateClientEventRequest.new -# Call the create_client_event method. -result = client.create_client_event request + # Call the create_client_event method. + result = client.create_client_event request -# The returned object is of type Google::Cloud::Talent::V4::ClientEvent. -p result + # The returned object is of type Google::Cloud::Talent::V4::ClientEvent. + p result +end # [END jobs_v4_generated_EventService_CreateClientEvent_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb index 6ce641b1c581..2ff36cb88e8d 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_create_jobs.rb @@ -19,22 +19,28 @@ # [START jobs_v4_generated_JobService_BatchCreateJobs_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_create_jobs +# +def batch_create_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchCreateJobsRequest.new -# Call the batch_create_jobs method. -result = client.batch_create_jobs request + # Call the batch_create_jobs method. + result = client.batch_create_jobs request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END jobs_v4_generated_JobService_BatchCreateJobs_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb index e2892091c3d2..7f3ae377dd74 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_delete_jobs.rb @@ -19,22 +19,28 @@ # [START jobs_v4_generated_JobService_BatchDeleteJobs_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_delete_jobs +# +def batch_delete_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchDeleteJobsRequest.new -# Call the batch_delete_jobs method. -result = client.batch_delete_jobs request + # Call the batch_delete_jobs method. + result = client.batch_delete_jobs request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END jobs_v4_generated_JobService_BatchDeleteJobs_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb b/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb index 896589ac9beb..4b366e14eb97 100755 --- a/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/batch_update_jobs.rb @@ -19,22 +19,28 @@ # [START jobs_v4_generated_JobService_BatchUpdateJobs_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#batch_update_jobs +# +def batch_update_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::BatchUpdateJobsRequest.new -# Call the batch_update_jobs method. -result = client.batch_update_jobs request + # Call the batch_update_jobs method. + result = client.batch_update_jobs request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END jobs_v4_generated_JobService_BatchUpdateJobs_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/create_job.rb b/google-cloud-talent-v4/snippets/job_service/create_job.rb index d10438033d39..0732bf9830a6 100755 --- a/google-cloud-talent-v4/snippets/job_service/create_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/create_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_CreateJob_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Talent::V4::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end # [END jobs_v4_generated_JobService_CreateJob_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/delete_job.rb b/google-cloud-talent-v4/snippets/job_service/delete_job.rb index 48fcf6690fd8..f51ffdd19e11 100755 --- a/google-cloud-talent-v4/snippets/job_service/delete_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/delete_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_DeleteJob_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4_generated_JobService_DeleteJob_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/get_job.rb b/google-cloud-talent-v4/snippets/job_service/get_job.rb index d245c16a63dd..13b2dbf1cda7 100755 --- a/google-cloud-talent-v4/snippets/job_service/get_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/get_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_GetJob_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Talent::V4::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end # [END jobs_v4_generated_JobService_GetJob_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/list_jobs.rb b/google-cloud-talent-v4/snippets/job_service/list_jobs.rb index 7d62f31a4583..381587cd978a 100755 --- a/google-cloud-talent-v4/snippets/job_service/list_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/list_jobs.rb @@ -19,21 +19,27 @@ # [START jobs_v4_generated_JobService_ListJobs_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4::Job. + p response + end end # [END jobs_v4_generated_JobService_ListJobs_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/search_jobs.rb b/google-cloud-talent-v4/snippets/job_service/search_jobs.rb index dfe9e2a969cc..805865d26fb3 100755 --- a/google-cloud-talent-v4/snippets/job_service/search_jobs.rb +++ b/google-cloud-talent-v4/snippets/job_service/search_jobs.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_SearchJobs_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#search_jobs +# +def search_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new -# Call the search_jobs method. -result = client.search_jobs request + # Call the search_jobs method. + result = client.search_jobs request -# The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end # [END jobs_v4_generated_JobService_SearchJobs_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb b/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb index fe9fa281538b..a07780e5a3d2 100755 --- a/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb +++ b/google-cloud-talent-v4/snippets/job_service/search_jobs_for_alert.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_SearchJobsForAlert_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#search_jobs_for_alert +# +def search_jobs_for_alert + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::SearchJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::SearchJobsRequest.new -# Call the search_jobs_for_alert method. -result = client.search_jobs_for_alert request + # Call the search_jobs_for_alert method. + result = client.search_jobs_for_alert request -# The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4::SearchJobsResponse. + p result +end # [END jobs_v4_generated_JobService_SearchJobsForAlert_sync] diff --git a/google-cloud-talent-v4/snippets/job_service/update_job.rb b/google-cloud-talent-v4/snippets/job_service/update_job.rb index 18198c949076..8e3f9573728d 100755 --- a/google-cloud-talent-v4/snippets/job_service/update_job.rb +++ b/google-cloud-talent-v4/snippets/job_service/update_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_JobService_UpdateJob_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::JobService::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Talent::V4::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4::Job. + p result +end # [END jobs_v4_generated_JobService_UpdateJob_sync] diff --git a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json index ccf922ef7614..be88c9a20dcf 100644 --- a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json +++ b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb index bb6c4edcab8c..0b74f6ae6af4 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/create_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_TenantService_CreateTenant_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#create_tenant +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::CreateTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::CreateTenantRequest.new -# Call the create_tenant method. -result = client.create_tenant request + # Call the create_tenant method. + result = client.create_tenant request -# The returned object is of type Google::Cloud::Talent::V4::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end # [END jobs_v4_generated_TenantService_CreateTenant_sync] diff --git a/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb index ce0850db9b6d..817c63526ed1 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/delete_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_TenantService_DeleteTenant_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#delete_tenant +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::DeleteTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::DeleteTenantRequest.new -# Call the delete_tenant method. -result = client.delete_tenant request + # Call the delete_tenant method. + result = client.delete_tenant request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4_generated_TenantService_DeleteTenant_sync] diff --git a/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb index 90e95eee96ed..ee96dd80c86f 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/get_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_TenantService_GetTenant_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#get_tenant +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::GetTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::GetTenantRequest.new -# Call the get_tenant method. -result = client.get_tenant request + # Call the get_tenant method. + result = client.get_tenant request -# The returned object is of type Google::Cloud::Talent::V4::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end # [END jobs_v4_generated_TenantService_GetTenant_sync] diff --git a/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb b/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb index 8755880fcb1a..57f21105c4a0 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/list_tenants.rb @@ -19,21 +19,27 @@ # [START jobs_v4_generated_TenantService_ListTenants_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#list_tenants +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::ListTenantsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::ListTenantsRequest.new -# Call the list_tenants method. -result = client.list_tenants request + # Call the list_tenants method. + result = client.list_tenants request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4::Tenant. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4::Tenant. + p response + end end # [END jobs_v4_generated_TenantService_ListTenants_sync] diff --git a/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb b/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb index ee0977e3df8e..1f5c3edf00a8 100755 --- a/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb +++ b/google-cloud-talent-v4/snippets/tenant_service/update_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4_generated_TenantService_UpdateTenant_sync] require "google/cloud/talent/v4" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4::TenantService::Client#update_tenant +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4::UpdateTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4::UpdateTenantRequest.new -# Call the update_tenant method. -result = client.update_tenant request + # Call the update_tenant method. + result = client.update_tenant request -# The returned object is of type Google::Cloud::Talent::V4::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4::Tenant. + p result +end # [END jobs_v4_generated_TenantService_UpdateTenant_sync] diff --git a/google-cloud-talent-v4beta1/.rubocop.yml b/google-cloud-talent-v4beta1/.rubocop.yml index 09a9332da3d2..8fe2d7ec9ecd 100644 --- a/google-cloud-talent-v4beta1/.rubocop.yml +++ b/google-cloud-talent-v4beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-talent-v4beta1.rb" diff --git a/google-cloud-talent-v4beta1/snippets/Gemfile b/google-cloud-talent-v4beta1/snippets/Gemfile index df25a3f0ef81..059d22e09003 100755 --- a/google-cloud-talent-v4beta1/snippets/Gemfile +++ b/google-cloud-talent-v4beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb index 23218ee2c552..c9dddf33537d 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/create_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_CompanyService_CreateCompany_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::CompanyService::Client#create_company +# +def create_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateCompanyRequest.new -# Call the create_company method. -result = client.create_company request + # Call the create_company method. + result = client.create_company request -# The returned object is of type Google::Cloud::Talent::V4beta1::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end # [END jobs_v4beta1_generated_CompanyService_CreateCompany_sync] diff --git a/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb index a2d5cb4b472b..95644bcdb684 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/delete_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::CompanyService::Client#delete_company +# +def delete_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::DeleteCompanyRequest.new -# Call the delete_company method. -result = client.delete_company request + # Call the delete_company method. + result = client.delete_company request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4beta1_generated_CompanyService_DeleteCompany_sync] diff --git a/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb index 52b7d09dcf3a..eb44ad2f3271 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/get_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_CompanyService_GetCompany_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::CompanyService::Client#get_company +# +def get_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetCompanyRequest.new -# Call the get_company method. -result = client.get_company request + # Call the get_company method. + result = client.get_company request -# The returned object is of type Google::Cloud::Talent::V4beta1::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end # [END jobs_v4beta1_generated_CompanyService_GetCompany_sync] diff --git a/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb b/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb index a8ba136d12f1..a67971c97d9d 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/list_companies.rb @@ -19,21 +19,27 @@ # [START jobs_v4beta1_generated_CompanyService_ListCompanies_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::CompanyService::Client#list_companies +# +def list_companies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::ListCompaniesRequest.new -# Call the list_companies method. -result = client.list_companies request + # Call the list_companies method. + result = client.list_companies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4beta1::Company. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4beta1::Company. + p response + end end # [END jobs_v4beta1_generated_CompanyService_ListCompanies_sync] diff --git a/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb b/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb index 50b05a813986..e1c51e4a4b9f 100755 --- a/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb +++ b/google-cloud-talent-v4beta1/snippets/company_service/update_company.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::CompanyService::Client#update_company +# +def update_company + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::CompanyService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateCompanyRequest.new -# Call the update_company method. -result = client.update_company request + # Call the update_company method. + result = client.update_company request -# The returned object is of type Google::Cloud::Talent::V4beta1::Company. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Company. + p result +end # [END jobs_v4beta1_generated_CompanyService_UpdateCompany_sync] diff --git a/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb b/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb index eeb514705414..3f325b05f07d 100755 --- a/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb +++ b/google-cloud-talent-v4beta1/snippets/completion/complete_query.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_Completion_CompleteQuery_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::Completion::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::Completion::Client#complete_query +# +def complete_query + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::Completion::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CompleteQueryRequest.new -# Call the complete_query method. -result = client.complete_query request + # Call the complete_query method. + result = client.complete_query request -# The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::CompleteQueryResponse. + p result +end # [END jobs_v4beta1_generated_Completion_CompleteQuery_sync] diff --git a/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb b/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb index 3be939b51768..05ef4185de04 100755 --- a/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb +++ b/google-cloud-talent-v4beta1/snippets/event_service/create_client_event.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_EventService_CreateClientEvent_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::EventService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::EventService::Client#create_client_event +# +def create_client_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::EventService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateClientEventRequest.new -# Call the create_client_event method. -result = client.create_client_event request + # Call the create_client_event method. + result = client.create_client_event request -# The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::ClientEvent. + p result +end # [END jobs_v4beta1_generated_EventService_CreateClientEvent_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb index 5c22d8251662..8491f042f0bf 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_create_jobs.rb @@ -19,22 +19,28 @@ # [START jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#batch_create_jobs +# +def batch_create_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchCreateJobsRequest.new -# Call the batch_create_jobs method. -result = client.batch_create_jobs request + # Call the batch_create_jobs method. + result = client.batch_create_jobs request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END jobs_v4beta1_generated_JobService_BatchCreateJobs_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb index 4eadf1dca13e..81debfdb05cd 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_delete_jobs.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#batch_delete_jobs +# +def batch_delete_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchDeleteJobsRequest.new -# Call the batch_delete_jobs method. -result = client.batch_delete_jobs request + # Call the batch_delete_jobs method. + result = client.batch_delete_jobs request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4beta1_generated_JobService_BatchDeleteJobs_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb index 4389d410e24a..cb8bad469d77 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/batch_update_jobs.rb @@ -19,22 +19,28 @@ # [START jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#batch_update_jobs +# +def batch_update_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::BatchUpdateJobsRequest.new -# Call the batch_update_jobs method. -result = client.batch_update_jobs request + # Call the batch_update_jobs method. + result = client.batch_update_jobs request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END jobs_v4beta1_generated_JobService_BatchUpdateJobs_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb index 981a24b38f9b..4cf4fbec868c 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/create_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_CreateJob_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Talent::V4beta1::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end # [END jobs_v4beta1_generated_JobService_CreateJob_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb index 5cbf141432dc..d12db7bdc2b5 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/delete_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_DeleteJob_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4beta1_generated_JobService_DeleteJob_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb index 06e7674afae7..1e0c252c36ee 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/get_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_GetJob_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Talent::V4beta1::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end # [END jobs_v4beta1_generated_JobService_GetJob_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb index 63d0f46653b9..2357b652cf92 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/list_jobs.rb @@ -19,21 +19,27 @@ # [START jobs_v4beta1_generated_JobService_ListJobs_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4beta1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4beta1::Job. + p response + end end # [END jobs_v4beta1_generated_JobService_ListJobs_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb index 03b7105efc48..a8e699d8528d 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_SearchJobs_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs +# +def search_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new -# Call the search_jobs method. -result = client.search_jobs request + # Call the search_jobs method. + result = client.search_jobs request -# The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + p result +end # [END jobs_v4beta1_generated_JobService_SearchJobs_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb index 6d12c8e077a6..acf1f0428291 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/search_jobs_for_alert.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#search_jobs_for_alert +# +def search_jobs_for_alert + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::SearchJobsRequest.new -# Call the search_jobs_for_alert method. -result = client.search_jobs_for_alert request + # Call the search_jobs_for_alert method. + result = client.search_jobs_for_alert request -# The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::SearchJobsResponse. + p result +end # [END jobs_v4beta1_generated_JobService_SearchJobsForAlert_sync] diff --git a/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb b/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb index da874a5e8ac6..33f889281365 100755 --- a/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb +++ b/google-cloud-talent-v4beta1/snippets/job_service/update_job.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_JobService_UpdateJob_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::JobService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::JobService::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::JobService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateJobRequest.new -# Call the update_job method. -result = client.update_job request + # Call the update_job method. + result = client.update_job request -# The returned object is of type Google::Cloud::Talent::V4beta1::Job. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Job. + p result +end # [END jobs_v4beta1_generated_JobService_UpdateJob_sync] diff --git a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json index 459bb9e2279a..8485709a54d1 100644 --- a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json +++ b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb index e9b964c04f6b..9c83c56a2731 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/create_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_TenantService_CreateTenant_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::TenantService::Client#create_tenant +# +def create_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::CreateTenantRequest.new -# Call the create_tenant method. -result = client.create_tenant request + # Call the create_tenant method. + result = client.create_tenant request -# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end # [END jobs_v4beta1_generated_TenantService_CreateTenant_sync] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb index 67edf5772009..8851bd4343d2 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/delete_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_TenantService_DeleteTenant_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::TenantService::Client#delete_tenant +# +def delete_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::DeleteTenantRequest.new -# Call the delete_tenant method. -result = client.delete_tenant request + # Call the delete_tenant method. + result = client.delete_tenant request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END jobs_v4beta1_generated_TenantService_DeleteTenant_sync] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb index 693bbaea7d3a..401df52229b8 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/get_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_TenantService_GetTenant_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::TenantService::Client#get_tenant +# +def get_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::GetTenantRequest.new -# Call the get_tenant method. -result = client.get_tenant request + # Call the get_tenant method. + result = client.get_tenant request -# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end # [END jobs_v4beta1_generated_TenantService_GetTenant_sync] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb index 802cd1b3ae5a..81fde2444bcd 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/list_tenants.rb @@ -19,21 +19,27 @@ # [START jobs_v4beta1_generated_TenantService_ListTenants_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::TenantService::Client#list_tenants +# +def list_tenants + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::ListTenantsRequest.new -# Call the list_tenants method. -result = client.list_tenants request + # Call the list_tenants method. + result = client.list_tenants request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Talent::V4beta1::Tenant. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Talent::V4beta1::Tenant. + p response + end end # [END jobs_v4beta1_generated_TenantService_ListTenants_sync] diff --git a/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb b/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb index 25e6f4433860..2488b552e7a3 100755 --- a/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb +++ b/google-cloud-talent-v4beta1/snippets/tenant_service/update_tenant.rb @@ -19,15 +19,21 @@ # [START jobs_v4beta1_generated_TenantService_UpdateTenant_sync] require "google/cloud/talent/v4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Talent::V4beta1::TenantService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Talent::V4beta1::TenantService::Client#update_tenant +# +def update_tenant + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Talent::V4beta1::TenantService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Talent::V4beta1::UpdateTenantRequest.new -# Call the update_tenant method. -result = client.update_tenant request + # Call the update_tenant method. + result = client.update_tenant request -# The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. -p result + # The returned object is of type Google::Cloud::Talent::V4beta1::Tenant. + p result +end # [END jobs_v4beta1_generated_TenantService_UpdateTenant_sync] diff --git a/google-cloud-tasks-v2/.rubocop.yml b/google-cloud-tasks-v2/.rubocop.yml index 6c475af2f496..c73aa9c3a62f 100644 --- a/google-cloud-tasks-v2/.rubocop.yml +++ b/google-cloud-tasks-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-tasks-v2.rb" diff --git a/google-cloud-tasks-v2/snippets/Gemfile b/google-cloud-tasks-v2/snippets/Gemfile index 87aa5eb74688..7f74e542f7af 100755 --- a/google-cloud-tasks-v2/snippets/Gemfile +++ b/google-cloud-tasks-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb index 53629bd36810..48736e827959 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/create_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#create_queue +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::CreateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::CreateQueueRequest.new -# Call the create_queue method. -result = client.create_queue request + # Call the create_queue method. + result = client.create_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_CreateQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb index 94783fd959cf..5625df7b6944 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/create_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_CreateTask_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#create_task +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::CreateTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::CreateTaskRequest.new -# Call the create_task method. -result = client.create_task request + # Call the create_task method. + result = client.create_task request -# The returned object is of type Google::Cloud::Tasks::V2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end # [END cloudtasks_v2_generated_CloudTasks_CreateTask_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb index 6b72b75dfc3c..9f7d325ace73 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#delete_queue +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::DeleteQueueRequest.new -# Call the delete_queue method. -result = client.delete_queue request + # Call the delete_queue method. + result = client.delete_queue request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb index 6468de544f35..73a5aeb7374a 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/delete_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#delete_task +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::DeleteTaskRequest.new -# Call the delete_task method. -result = client.delete_task request + # Call the delete_task method. + result = client.delete_task request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2_generated_CloudTasks_DeleteTask_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb index 94044e715326..0eeb405be1d5 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb index f97b4c9a0f6c..2262a7f1c23b 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_GetQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#get_queue +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::GetQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::GetQueueRequest.new -# Call the get_queue method. -result = client.get_queue request + # Call the get_queue method. + result = client.get_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_GetQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb index c2b045a85995..8e909fa3b95d 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/get_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_GetTask_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::GetTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::GetTaskRequest.new -# Call the get_task method. -result = client.get_task request + # Call the get_task method. + result = client.get_task request -# The returned object is of type Google::Cloud::Tasks::V2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end # [END cloudtasks_v2_generated_CloudTasks_GetTask_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb index 17ff40917eda..0533a1ea64e6 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/list_queues.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2_generated_CloudTasks_ListQueues_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#list_queues +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::ListQueuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ListQueuesRequest.new -# Call the list_queues method. -result = client.list_queues request + # Call the list_queues method. + result = client.list_queues request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2::Queue. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2::Queue. + p response + end end # [END cloudtasks_v2_generated_CloudTasks_ListQueues_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb index 26b63d278750..a95e69829fc7 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/list_tasks.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2_generated_CloudTasks_ListTasks_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::ListTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ListTasksRequest.new -# Call the list_tasks method. -result = client.list_tasks request + # Call the list_tasks method. + result = client.list_tasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2::Task. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2::Task. + p response + end end # [END cloudtasks_v2_generated_CloudTasks_ListTasks_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb index c24feb727c6f..2e7120e035cd 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/pause_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#pause_queue +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::PauseQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::PauseQueueRequest.new -# Call the pause_queue method. -result = client.pause_queue request + # Call the pause_queue method. + result = client.pause_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_PauseQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb index d028d33eb7bc..62544694207e 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/purge_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#purge_queue +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::PurgeQueueRequest.new -# Call the purge_queue method. -result = client.purge_queue request + # Call the purge_queue method. + result = client.purge_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb index 49011da32ca7..7d7c83e2af94 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/resume_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#resume_queue +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::ResumeQueueRequest.new -# Call the resume_queue method. -result = client.resume_queue request + # Call the resume_queue method. + result = client.resume_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb index 645bd95fe7cb..48b740782085 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/run_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_RunTask_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#run_task +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::RunTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::RunTaskRequest.new -# Call the run_task method. -result = client.run_task request + # Call the run_task method. + result = client.run_task request -# The returned object is of type Google::Cloud::Tasks::V2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Task. + p result +end # [END cloudtasks_v2_generated_CloudTasks_RunTask_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb index 01604c59e3d1..4ec8f9ec5ca6 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb index 2e87119e6c00..db4d7cad8fc0 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb index 53f660562f67..0f88b72bb73d 100755 --- a/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2/snippets/cloud_tasks/update_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] require "google/cloud/tasks/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2::CloudTasks::Client#update_queue +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2::UpdateQueueRequest.new -# Call the update_queue method. -result = client.update_queue request + # Call the update_queue method. + result = client.update_queue request -# The returned object is of type Google::Cloud::Tasks::V2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2::Queue. + p result +end # [END cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync] diff --git a/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json b/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json index 1b558aede2e6..788866cc09d5 100644 --- a/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json +++ b/google-cloud-tasks-v2/snippets/snippet_metadata_google.cloud.tasks.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-tasks-v2beta2/.rubocop.yml b/google-cloud-tasks-v2beta2/.rubocop.yml index 482cbb659b04..21bca46e5821 100644 --- a/google-cloud-tasks-v2beta2/.rubocop.yml +++ b/google-cloud-tasks-v2beta2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-tasks-v2beta2.rb" diff --git a/google-cloud-tasks-v2beta2/snippets/Gemfile b/google-cloud-tasks-v2beta2/snippets/Gemfile index e5edb63ab0e4..da118b5aac5f 100755 --- a/google-cloud-tasks-v2beta2/snippets/Gemfile +++ b/google-cloud-tasks-v2beta2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb index 8e4a6441901f..f82ed0c96d90 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/acknowledge_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#acknowledge_task +# +def acknowledge_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::AcknowledgeTaskRequest.new -# Call the acknowledge_task method. -result = client.acknowledge_task request + # Call the acknowledge_task method. + result = client.acknowledge_task request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb index f94894e40869..6725948ab376 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/cancel_lease.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#cancel_lease +# +def cancel_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CancelLeaseRequest.new -# Call the cancel_lease method. -result = client.cancel_lease request + # Call the cancel_lease method. + result = client.cancel_lease request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb index 38532a82a607..c8c14eef5aca 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_queue +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CreateQueueRequest.new -# Call the create_queue method. -result = client.create_queue request + # Call the create_queue method. + result = client.create_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb index e61b5b45768e..54134e15c7ef 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/create_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#create_task +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::CreateTaskRequest.new -# Call the create_task method. -result = client.create_task request + # Call the create_task method. + result = client.create_task request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb index a8f93a97763b..7534fadfb78a 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_queue +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::DeleteQueueRequest.new -# Call the delete_queue method. -result = client.delete_queue request + # Call the delete_queue method. + result = client.delete_queue request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb index b75325c156ea..8814332d028a 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/delete_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#delete_task +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::DeleteTaskRequest.new -# Call the delete_task method. -result = client.delete_task request + # Call the delete_task method. + result = client.delete_task request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb index 49deffc8869f..e2962666d4c9 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb index f782c8f6074e..9c3d974b4a39 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_queue +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::GetQueueRequest.new -# Call the get_queue method. -result = client.get_queue request + # Call the get_queue method. + result = client.get_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb index 0e82457e5ff6..298fa7cbaaa7 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/get_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::GetTaskRequest.new -# Call the get_task method. -result = client.get_task request + # Call the get_task method. + result = client.get_task request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb index 979c38f1a440..7aec7b718a8b 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/lease_tasks.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#lease_tasks +# +def lease_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::LeaseTasksRequest.new -# Call the lease_tasks method. -result = client.lease_tasks request + # Call the lease_tasks method. + result = client.lease_tasks request -# The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::LeaseTasksResponse. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb index b915d69e4d8e..39f81d2bd1c9 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_queues.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_queues +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ListQueuesRequest.new -# Call the list_queues method. -result = client.list_queues request + # Call the list_queues method. + result = client.list_queues request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2beta2::Queue. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2beta2::Queue. + p response + end end # [END cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb index 75f86b8afe78..b94b426b98cd 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/list_tasks.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ListTasksRequest.new -# Call the list_tasks method. -result = client.list_tasks request + # Call the list_tasks method. + result = client.list_tasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2beta2::Task. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2beta2::Task. + p response + end end # [END cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb index 5f644ba8e59e..ea06d011de85 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/pause_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#pause_queue +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::PauseQueueRequest.new -# Call the pause_queue method. -result = client.pause_queue request + # Call the pause_queue method. + result = client.pause_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb index 20b4aeb59caa..83e2e29be5a0 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/purge_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#purge_queue +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::PurgeQueueRequest.new -# Call the purge_queue method. -result = client.purge_queue request + # Call the purge_queue method. + result = client.purge_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb index d526eff720ee..3c602cacdfe2 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/renew_lease.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#renew_lease +# +def renew_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::RenewLeaseRequest.new -# Call the renew_lease method. -result = client.renew_lease request + # Call the renew_lease method. + result = client.renew_lease request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb index 7ee2db4b20fa..4794467cd9c1 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/resume_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#resume_queue +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::ResumeQueueRequest.new -# Call the resume_queue method. -result = client.resume_queue request + # Call the resume_queue method. + result = client.resume_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb index 33ff88b50ff3..51690acb5d48 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/run_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#run_task +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::RunTaskRequest.new -# Call the run_task method. -result = client.run_task request + # Call the run_task method. + result = client.run_task request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Task. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb index b4f21ef437e7..5c8d4f74873e 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb index 10fb9feb53ed..471366ef5db6 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb index 36f3417497cd..2e935f299ada 100755 --- a/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2beta2/snippets/cloud_tasks/update_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] require "google/cloud/tasks/v2beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta2::CloudTasks::Client#update_queue +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta2::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta2::UpdateQueueRequest.new -# Call the update_queue method. -result = client.update_queue request + # Call the update_queue method. + result = client.update_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta2::Queue. + p result +end # [END cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync] diff --git a/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json b/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json index d3f1450f26e6..89d4f9e964c8 100644 --- a/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json +++ b/google-cloud-tasks-v2beta2/snippets/snippet_metadata_google.cloud.tasks.v2beta2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-tasks-v2beta3/.rubocop.yml b/google-cloud-tasks-v2beta3/.rubocop.yml index a1ba0a52e374..da9d8f7ee985 100644 --- a/google-cloud-tasks-v2beta3/.rubocop.yml +++ b/google-cloud-tasks-v2beta3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-tasks-v2beta3.rb" diff --git a/google-cloud-tasks-v2beta3/snippets/Gemfile b/google-cloud-tasks-v2beta3/snippets/Gemfile index 012b6cdf04d5..6d89b0659ed9 100755 --- a/google-cloud-tasks-v2beta3/snippets/Gemfile +++ b/google-cloud-tasks-v2beta3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb index 85be000c6606..14a25e4f2c4b 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_queue +# +def create_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::CreateQueueRequest.new -# Call the create_queue method. -result = client.create_queue request + # Call the create_queue method. + result = client.create_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb index 06d84952d061..ffac24121663 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/create_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#create_task +# +def create_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::CreateTaskRequest.new -# Call the create_task method. -result = client.create_task request + # Call the create_task method. + result = client.create_task request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb index e964d15d3135..aa470e0ff1bc 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_queue +# +def delete_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::DeleteQueueRequest.new -# Call the delete_queue method. -result = client.delete_queue request + # Call the delete_queue method. + result = client.delete_queue request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb index 983f596f93fd..c440f888d041 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/delete_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#delete_task +# +def delete_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::DeleteTaskRequest.new -# Call the delete_task method. -result = client.delete_task request + # Call the delete_task method. + result = client.delete_task request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb index 582c67e48ddc..85b223e3c47f 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb index 376958b1f56a..785ddb16ae5f 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_queue +# +def get_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::GetQueueRequest.new -# Call the get_queue method. -result = client.get_queue request + # Call the get_queue method. + result = client.get_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb index e21b7549b3c0..96f6433d2084 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/get_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::GetTaskRequest.new -# Call the get_task method. -result = client.get_task request + # Call the get_task method. + result = client.get_task request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb index 3d9f57ac742e..fdce9246bc75 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_queues.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_queues +# +def list_queues + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ListQueuesRequest.new -# Call the list_queues method. -result = client.list_queues request + # Call the list_queues method. + result = client.list_queues request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2beta3::Queue. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2beta3::Queue. + p response + end end # [END cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb index 9a212e43efc2..4e2f875b7df0 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/list_tasks.rb @@ -19,21 +19,27 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ListTasksRequest.new -# Call the list_tasks method. -result = client.list_tasks request + # Call the list_tasks method. + result = client.list_tasks request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tasks::V2beta3::Task. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tasks::V2beta3::Task. + p response + end end # [END cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb index 2fd725765d9b..5db1ab627da3 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/pause_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#pause_queue +# +def pause_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::PauseQueueRequest.new -# Call the pause_queue method. -result = client.pause_queue request + # Call the pause_queue method. + result = client.pause_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb index 2266cbc2f563..10a07e42ab57 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/purge_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#purge_queue +# +def purge_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::PurgeQueueRequest.new -# Call the purge_queue method. -result = client.purge_queue request + # Call the purge_queue method. + result = client.purge_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb index f753d653cd9e..9cbf7473ec17 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/resume_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#resume_queue +# +def resume_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::ResumeQueueRequest.new -# Call the resume_queue method. -result = client.resume_queue request + # Call the resume_queue method. + result = client.resume_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb index 282a53c4a76d..a36e1356abc2 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/run_task.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#run_task +# +def run_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::RunTaskRequest.new -# Call the run_task method. -result = client.run_task request + # Call the run_task method. + result = client.run_task request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Task. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Task. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb index 111ac088f2b2..25c79838e4bf 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb index d15b70d6e543..21516f66b761 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb index 421c1009ca19..4651773933b9 100755 --- a/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb +++ b/google-cloud-tasks-v2beta3/snippets/cloud_tasks/update_queue.rb @@ -19,15 +19,21 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] require "google/cloud/tasks/v2beta3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tasks::V2beta3::CloudTasks::Client#update_queue +# +def update_queue + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tasks::V2beta3::CloudTasks::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tasks::V2beta3::UpdateQueueRequest.new -# Call the update_queue method. -result = client.update_queue request + # Call the update_queue method. + result = client.update_queue request -# The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. -p result + # The returned object is of type Google::Cloud::Tasks::V2beta3::Queue. + p result +end # [END cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync] diff --git a/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json b/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json index e354377aecf1..8655cfb32011 100644 --- a/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json +++ b/google-cloud-tasks-v2beta3/snippets/snippet_metadata_google.cloud.tasks.v2beta3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-text_to_speech-v1/.rubocop.yml b/google-cloud-text_to_speech-v1/.rubocop.yml index 92d8662391c8..dc3e19ac0403 100644 --- a/google-cloud-text_to_speech-v1/.rubocop.yml +++ b/google-cloud-text_to_speech-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-text_to_speech-v1.rb" diff --git a/google-cloud-text_to_speech-v1/snippets/Gemfile b/google-cloud-text_to_speech-v1/snippets/Gemfile index 44970a37284c..9ecf1a06a20e 100755 --- a/google-cloud-text_to_speech-v1/snippets/Gemfile +++ b/google-cloud-text_to_speech-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json b/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json index 086e8c2831ef..e7ccf190b421 100644 --- a/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json +++ b/google-cloud-text_to_speech-v1/snippets/snippet_metadata_google.cloud.texttospeech.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb b/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb index 4b421f150583..f9e871181824 100755 --- a/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb +++ b/google-cloud-text_to_speech-v1/snippets/text_to_speech/list_voices.rb @@ -19,15 +19,21 @@ # [START texttospeech_v1_generated_TextToSpeech_ListVoices_sync] require "google/cloud/text_to_speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#list_voices +# +def list_voices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1::ListVoicesRequest.new -# Call the list_voices method. -result = client.list_voices request + # Call the list_voices method. + result = client.list_voices request -# The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. -p result + # The returned object is of type Google::Cloud::TextToSpeech::V1::ListVoicesResponse. + p result +end # [END texttospeech_v1_generated_TextToSpeech_ListVoices_sync] diff --git a/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb b/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb index 804f76651020..e4ab9672471d 100755 --- a/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb +++ b/google-cloud-text_to_speech-v1/snippets/text_to_speech/synthesize_speech.rb @@ -19,15 +19,21 @@ # [START texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] require "google/cloud/text_to_speech/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::TextToSpeech::V1::TextToSpeech::Client#synthesize_speech +# +def synthesize_speech + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1::TextToSpeech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1::SynthesizeSpeechRequest.new -# Call the synthesize_speech method. -result = client.synthesize_speech request + # Call the synthesize_speech method. + result = client.synthesize_speech request -# The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. -p result + # The returned object is of type Google::Cloud::TextToSpeech::V1::SynthesizeSpeechResponse. + p result +end # [END texttospeech_v1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/google-cloud-text_to_speech-v1beta1/.rubocop.yml b/google-cloud-text_to_speech-v1beta1/.rubocop.yml index 61df8f4077af..1902584e3617 100644 --- a/google-cloud-text_to_speech-v1beta1/.rubocop.yml +++ b/google-cloud-text_to_speech-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-text_to_speech-v1beta1.rb" diff --git a/google-cloud-text_to_speech-v1beta1/snippets/Gemfile b/google-cloud-text_to_speech-v1beta1/snippets/Gemfile index 2b86317db80a..3970da1d9bc8 100755 --- a/google-cloud-text_to_speech-v1beta1/snippets/Gemfile +++ b/google-cloud-text_to_speech-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json b/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json index 790d909030fa..384a64b3adae 100644 --- a/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json +++ b/google-cloud-text_to_speech-v1beta1/snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb index 773c587d0610..0843fea6744c 100755 --- a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb +++ b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/list_voices.rb @@ -19,15 +19,21 @@ # [START texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] require "google/cloud/text_to_speech/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#list_voices +# +def list_voices + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new -# Call the list_voices method. -result = client.list_voices request + # Call the list_voices method. + result = client.list_voices request -# The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. -p result + # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::ListVoicesResponse. + p result +end # [END texttospeech_v1beta1_generated_TextToSpeech_ListVoices_sync] diff --git a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb index f645319dd637..d2e3e3a97598 100755 --- a/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb +++ b/google-cloud-text_to_speech-v1beta1/snippets/text_to_speech/synthesize_speech.rb @@ -19,15 +19,21 @@ # [START texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] require "google/cloud/text_to_speech/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client#synthesize_speech +# +def synthesize_speech + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeech::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechRequest.new -# Call the synthesize_speech method. -result = client.synthesize_speech request + # Call the synthesize_speech method. + result = client.synthesize_speech request -# The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. -p result + # The returned object is of type Google::Cloud::TextToSpeech::V1beta1::SynthesizeSpeechResponse. + p result +end # [END texttospeech_v1beta1_generated_TextToSpeech_SynthesizeSpeech_sync] diff --git a/google-cloud-tpu-v1/.rubocop.yml b/google-cloud-tpu-v1/.rubocop.yml index 9a169d1ac97c..0db23e57cdbd 100644 --- a/google-cloud-tpu-v1/.rubocop.yml +++ b/google-cloud-tpu-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-tpu-v1.rb" diff --git a/google-cloud-tpu-v1/snippets/Gemfile b/google-cloud-tpu-v1/snippets/Gemfile index 8a03384c0864..ca2396877728 100755 --- a/google-cloud-tpu-v1/snippets/Gemfile +++ b/google-cloud-tpu-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json b/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json index b88eedf72825..3942a1a9f3c0 100644 --- a/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json +++ b/google-cloud-tpu-v1/snippets/snippet_metadata_google.cloud.tpu.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-tpu-v1/snippets/tpu/create_node.rb b/google-cloud-tpu-v1/snippets/tpu/create_node.rb index f832f80f7305..9f20981573ba 100755 --- a/google-cloud-tpu-v1/snippets/tpu/create_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/create_node.rb @@ -19,22 +19,28 @@ # [START tpu_v1_generated_Tpu_CreateNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#create_node +# +def create_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::CreateNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::CreateNodeRequest.new -# Call the create_node method. -result = client.create_node request + # Call the create_node method. + result = client.create_node request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END tpu_v1_generated_Tpu_CreateNode_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/delete_node.rb b/google-cloud-tpu-v1/snippets/tpu/delete_node.rb index 38679a9984cd..a5e99ff07a37 100755 --- a/google-cloud-tpu-v1/snippets/tpu/delete_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/delete_node.rb @@ -19,22 +19,28 @@ # [START tpu_v1_generated_Tpu_DeleteNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#delete_node +# +def delete_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::DeleteNodeRequest.new -# Call the delete_node method. -result = client.delete_node request + # Call the delete_node method. + result = client.delete_node request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END tpu_v1_generated_Tpu_DeleteNode_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb b/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb index d793f6cfe359..468b8e897a81 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_accelerator_type.rb @@ -19,15 +19,21 @@ # [START tpu_v1_generated_Tpu_GetAcceleratorType_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#get_accelerator_type +# +def get_accelerator_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetAcceleratorTypeRequest.new -# Call the get_accelerator_type method. -result = client.get_accelerator_type request + # Call the get_accelerator_type method. + result = client.get_accelerator_type request -# The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. -p result + # The returned object is of type Google::Cloud::Tpu::V1::AcceleratorType. + p result +end # [END tpu_v1_generated_Tpu_GetAcceleratorType_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/get_node.rb b/google-cloud-tpu-v1/snippets/tpu/get_node.rb index 615c128eb819..585c804d8572 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_node.rb @@ -19,15 +19,21 @@ # [START tpu_v1_generated_Tpu_GetNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#get_node +# +def get_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::GetNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetNodeRequest.new -# Call the get_node method. -result = client.get_node request + # Call the get_node method. + result = client.get_node request -# The returned object is of type Google::Cloud::Tpu::V1::Node. -p result + # The returned object is of type Google::Cloud::Tpu::V1::Node. + p result +end # [END tpu_v1_generated_Tpu_GetNode_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb b/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb index 6185fb74e56f..51b8ae19b2a2 100755 --- a/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb +++ b/google-cloud-tpu-v1/snippets/tpu/get_tensor_flow_version.rb @@ -19,15 +19,21 @@ # [START tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#get_tensor_flow_version +# +def get_tensor_flow_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::GetTensorFlowVersionRequest.new -# Call the get_tensor_flow_version method. -result = client.get_tensor_flow_version request + # Call the get_tensor_flow_version method. + result = client.get_tensor_flow_version request -# The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. -p result + # The returned object is of type Google::Cloud::Tpu::V1::TensorFlowVersion. + p result +end # [END tpu_v1_generated_Tpu_GetTensorFlowVersion_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb b/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb index 3de8568fa6c8..acf755dc3123 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_accelerator_types.rb @@ -19,21 +19,27 @@ # [START tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#list_accelerator_types +# +def list_accelerator_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListAcceleratorTypesRequest.new -# Call the list_accelerator_types method. -result = client.list_accelerator_types request + # Call the list_accelerator_types method. + result = client.list_accelerator_types request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tpu::V1::AcceleratorType. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tpu::V1::AcceleratorType. + p response + end end # [END tpu_v1_generated_Tpu_ListAcceleratorTypes_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb b/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb index 6e0119433d56..1e0893eed3d2 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_nodes.rb @@ -19,21 +19,27 @@ # [START tpu_v1_generated_Tpu_ListNodes_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#list_nodes +# +def list_nodes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::ListNodesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListNodesRequest.new -# Call the list_nodes method. -result = client.list_nodes request + # Call the list_nodes method. + result = client.list_nodes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tpu::V1::Node. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tpu::V1::Node. + p response + end end # [END tpu_v1_generated_Tpu_ListNodes_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb b/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb index 472e3b9368a9..7b848942fe2f 100755 --- a/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb +++ b/google-cloud-tpu-v1/snippets/tpu/list_tensor_flow_versions.rb @@ -19,21 +19,27 @@ # [START tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#list_tensor_flow_versions +# +def list_tensor_flow_versions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ListTensorFlowVersionsRequest.new -# Call the list_tensor_flow_versions method. -result = client.list_tensor_flow_versions request + # Call the list_tensor_flow_versions method. + result = client.list_tensor_flow_versions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Tpu::V1::TensorFlowVersion. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Tpu::V1::TensorFlowVersion. + p response + end end # [END tpu_v1_generated_Tpu_ListTensorFlowVersions_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb b/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb index 2b1f5d919130..aef267f723c2 100755 --- a/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/reimage_node.rb @@ -19,22 +19,28 @@ # [START tpu_v1_generated_Tpu_ReimageNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#reimage_node +# +def reimage_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::ReimageNodeRequest.new -# Call the reimage_node method. -result = client.reimage_node request + # Call the reimage_node method. + result = client.reimage_node request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END tpu_v1_generated_Tpu_ReimageNode_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/start_node.rb b/google-cloud-tpu-v1/snippets/tpu/start_node.rb index f0f420b8b11b..92edc533628e 100755 --- a/google-cloud-tpu-v1/snippets/tpu/start_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/start_node.rb @@ -19,22 +19,28 @@ # [START tpu_v1_generated_Tpu_StartNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#start_node +# +def start_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::StartNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::StartNodeRequest.new -# Call the start_node method. -result = client.start_node request + # Call the start_node method. + result = client.start_node request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END tpu_v1_generated_Tpu_StartNode_sync] diff --git a/google-cloud-tpu-v1/snippets/tpu/stop_node.rb b/google-cloud-tpu-v1/snippets/tpu/stop_node.rb index e30f165f66f4..c15044946be3 100755 --- a/google-cloud-tpu-v1/snippets/tpu/stop_node.rb +++ b/google-cloud-tpu-v1/snippets/tpu/stop_node.rb @@ -19,22 +19,28 @@ # [START tpu_v1_generated_Tpu_StopNode_sync] require "google/cloud/tpu/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Tpu::V1::Tpu::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Tpu::V1::Tpu::Client#stop_node +# +def stop_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Tpu::V1::Tpu::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Tpu::V1::StopNodeRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Tpu::V1::StopNodeRequest.new -# Call the stop_node method. -result = client.stop_node request + # Call the stop_node method. + result = client.stop_node request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END tpu_v1_generated_Tpu_StopNode_sync] diff --git a/google-cloud-trace-v1/.rubocop.yml b/google-cloud-trace-v1/.rubocop.yml index d6cb5eee53d7..497c946242fd 100644 --- a/google-cloud-trace-v1/.rubocop.yml +++ b/google-cloud-trace-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-trace-v1.rb" diff --git a/google-cloud-trace-v1/snippets/Gemfile b/google-cloud-trace-v1/snippets/Gemfile index cbbb0934efff..037ad3a824cd 100755 --- a/google-cloud-trace-v1/snippets/Gemfile +++ b/google-cloud-trace-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json b/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json index af5bc3db6a18..a618fb307aff 100644 --- a/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json +++ b/google-cloud-trace-v1/snippets/snippet_metadata_google.devtools.cloudtrace.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-trace-v1/snippets/trace_service/get_trace.rb b/google-cloud-trace-v1/snippets/trace_service/get_trace.rb index 48adf3be999a..0e850511036b 100755 --- a/google-cloud-trace-v1/snippets/trace_service/get_trace.rb +++ b/google-cloud-trace-v1/snippets/trace_service/get_trace.rb @@ -19,15 +19,21 @@ # [START cloudtrace_v1_generated_TraceService_GetTrace_sync] require "google/cloud/trace/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Trace::V1::TraceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Trace::V1::TraceService::Client#get_trace +# +def get_trace + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Trace::V1::GetTraceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::GetTraceRequest.new -# Call the get_trace method. -result = client.get_trace request + # Call the get_trace method. + result = client.get_trace request -# The returned object is of type Google::Cloud::Trace::V1::Trace. -p result + # The returned object is of type Google::Cloud::Trace::V1::Trace. + p result +end # [END cloudtrace_v1_generated_TraceService_GetTrace_sync] diff --git a/google-cloud-trace-v1/snippets/trace_service/list_traces.rb b/google-cloud-trace-v1/snippets/trace_service/list_traces.rb index 9797de2ad872..7ea8dadb1536 100755 --- a/google-cloud-trace-v1/snippets/trace_service/list_traces.rb +++ b/google-cloud-trace-v1/snippets/trace_service/list_traces.rb @@ -19,21 +19,27 @@ # [START cloudtrace_v1_generated_TraceService_ListTraces_sync] require "google/cloud/trace/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Trace::V1::TraceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Trace::V1::TraceService::Client#list_traces +# +def list_traces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Trace::V1::ListTracesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::ListTracesRequest.new -# Call the list_traces method. -result = client.list_traces request + # Call the list_traces method. + result = client.list_traces request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Trace::V1::Trace. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Trace::V1::Trace. + p response + end end # [END cloudtrace_v1_generated_TraceService_ListTraces_sync] diff --git a/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb b/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb index 6a7536f7e054..34c47beed87c 100755 --- a/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb +++ b/google-cloud-trace-v1/snippets/trace_service/patch_traces.rb @@ -19,15 +19,21 @@ # [START cloudtrace_v1_generated_TraceService_PatchTraces_sync] require "google/cloud/trace/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Trace::V1::TraceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Trace::V1::TraceService::Client#patch_traces +# +def patch_traces + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V1::TraceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Trace::V1::PatchTracesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V1::PatchTracesRequest.new -# Call the patch_traces method. -result = client.patch_traces request + # Call the patch_traces method. + result = client.patch_traces request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtrace_v1_generated_TraceService_PatchTraces_sync] diff --git a/google-cloud-trace-v2/.rubocop.yml b/google-cloud-trace-v2/.rubocop.yml index 3608725e4b70..f3216e912f4e 100644 --- a/google-cloud-trace-v2/.rubocop.yml +++ b/google-cloud-trace-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-trace-v2.rb" diff --git a/google-cloud-trace-v2/snippets/Gemfile b/google-cloud-trace-v2/snippets/Gemfile index 364312315988..5959b5edf398 100755 --- a/google-cloud-trace-v2/snippets/Gemfile +++ b/google-cloud-trace-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json b/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json index e22e8bf0a5dd..77c14e302f64 100644 --- a/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json +++ b/google-cloud-trace-v2/snippets/snippet_metadata_google.devtools.cloudtrace.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb b/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb index 125a1af2a2df..4de10217e3eb 100755 --- a/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb +++ b/google-cloud-trace-v2/snippets/trace_service/batch_write_spans.rb @@ -19,15 +19,21 @@ # [START cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] require "google/cloud/trace/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Trace::V2::TraceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Trace::V2::TraceService::Client#batch_write_spans +# +def batch_write_spans + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V2::TraceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V2::BatchWriteSpansRequest.new -# Call the batch_write_spans method. -result = client.batch_write_spans request + # Call the batch_write_spans method. + result = client.batch_write_spans request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END cloudtrace_v2_generated_TraceService_BatchWriteSpans_sync] diff --git a/google-cloud-trace-v2/snippets/trace_service/create_span.rb b/google-cloud-trace-v2/snippets/trace_service/create_span.rb index 67c38a2fcbfe..e3c726df2f3e 100755 --- a/google-cloud-trace-v2/snippets/trace_service/create_span.rb +++ b/google-cloud-trace-v2/snippets/trace_service/create_span.rb @@ -19,15 +19,21 @@ # [START cloudtrace_v2_generated_TraceService_CreateSpan_sync] require "google/cloud/trace/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Trace::V2::TraceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Trace::V2::TraceService::Client#create_span +# +def create_span + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Trace::V2::TraceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Trace::V2::Span.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Trace::V2::Span.new -# Call the create_span method. -result = client.create_span request + # Call the create_span method. + result = client.create_span request -# The returned object is of type Google::Cloud::Trace::V2::Span. -p result + # The returned object is of type Google::Cloud::Trace::V2::Span. + p result +end # [END cloudtrace_v2_generated_TraceService_CreateSpan_sync] diff --git a/google-cloud-translate-v3/.rubocop.yml b/google-cloud-translate-v3/.rubocop.yml index d1d57781e4ff..68b485677107 100644 --- a/google-cloud-translate-v3/.rubocop.yml +++ b/google-cloud-translate-v3/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-translate-v3.rb" diff --git a/google-cloud-translate-v3/snippets/Gemfile b/google-cloud-translate-v3/snippets/Gemfile index 3ad7f42f051e..f3f62a33bc1c 100755 --- a/google-cloud-translate-v3/snippets/Gemfile +++ b/google-cloud-translate-v3/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json b/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json index e5f2bf98a359..96d92e5b9fcf 100644 --- a/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json +++ b/google-cloud-translate-v3/snippets/snippet_metadata_google.cloud.translation.v3.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb b/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb index d201df8b3d9f..b46a88bdb021 100755 --- a/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb +++ b/google-cloud-translate-v3/snippets/translation_service/batch_translate_document.rb @@ -19,22 +19,28 @@ # [START translate_v3_generated_TranslationService_BatchTranslateDocument_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_document +# +def batch_translate_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::BatchTranslateDocumentRequest.new -# Call the batch_translate_document method. -result = client.batch_translate_document request + # Call the batch_translate_document method. + result = client.batch_translate_document request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END translate_v3_generated_TranslationService_BatchTranslateDocument_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb b/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb index d50258d02151..f566c62f7256 100755 --- a/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb +++ b/google-cloud-translate-v3/snippets/translation_service/batch_translate_text.rb @@ -19,22 +19,28 @@ # [START translate_v3_generated_TranslationService_BatchTranslateText_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#batch_translate_text +# +def batch_translate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::BatchTranslateTextRequest.new -# Call the batch_translate_text method. -result = client.batch_translate_text request + # Call the batch_translate_text method. + result = client.batch_translate_text request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END translate_v3_generated_TranslationService_BatchTranslateText_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb index a1c3064b1085..45369b37d7c1 100755 --- a/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/create_glossary.rb @@ -19,22 +19,28 @@ # [START translate_v3_generated_TranslationService_CreateGlossary_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#create_glossary +# +def create_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::CreateGlossaryRequest.new -# Call the create_glossary method. -result = client.create_glossary request + # Call the create_glossary method. + result = client.create_glossary request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END translate_v3_generated_TranslationService_CreateGlossary_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb index 25edbae3709b..24274c0b24b5 100755 --- a/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/delete_glossary.rb @@ -19,22 +19,28 @@ # [START translate_v3_generated_TranslationService_DeleteGlossary_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#delete_glossary +# +def delete_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DeleteGlossaryRequest.new -# Call the delete_glossary method. -result = client.delete_glossary request + # Call the delete_glossary method. + result = client.delete_glossary request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END translate_v3_generated_TranslationService_DeleteGlossary_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/detect_language.rb b/google-cloud-translate-v3/snippets/translation_service/detect_language.rb index 58a055147ccf..2fb6befa47f3 100755 --- a/google-cloud-translate-v3/snippets/translation_service/detect_language.rb +++ b/google-cloud-translate-v3/snippets/translation_service/detect_language.rb @@ -19,15 +19,21 @@ # [START translate_v3_generated_TranslationService_DetectLanguage_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#detect_language +# +def detect_language + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::DetectLanguageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::DetectLanguageRequest.new -# Call the detect_language method. -result = client.detect_language request + # Call the detect_language method. + result = client.detect_language request -# The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. -p result + # The returned object is of type Google::Cloud::Translate::V3::DetectLanguageResponse. + p result +end # [END translate_v3_generated_TranslationService_DetectLanguage_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb b/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb index fc99b0e37ab6..a15d4ca9e071 100755 --- a/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_glossary.rb @@ -19,15 +19,21 @@ # [START translate_v3_generated_TranslationService_GetGlossary_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#get_glossary +# +def get_glossary + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::GetGlossaryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetGlossaryRequest.new -# Call the get_glossary method. -result = client.get_glossary request + # Call the get_glossary method. + result = client.get_glossary request -# The returned object is of type Google::Cloud::Translate::V3::Glossary. -p result + # The returned object is of type Google::Cloud::Translate::V3::Glossary. + p result +end # [END translate_v3_generated_TranslationService_GetGlossary_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb b/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb index 7e6fb803225f..6ffe1f8c2cd0 100755 --- a/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb +++ b/google-cloud-translate-v3/snippets/translation_service/get_supported_languages.rb @@ -19,15 +19,21 @@ # [START translate_v3_generated_TranslationService_GetSupportedLanguages_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#get_supported_languages +# +def get_supported_languages + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::GetSupportedLanguagesRequest.new -# Call the get_supported_languages method. -result = client.get_supported_languages request + # Call the get_supported_languages method. + result = client.get_supported_languages request -# The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. -p result + # The returned object is of type Google::Cloud::Translate::V3::SupportedLanguages. + p result +end # [END translate_v3_generated_TranslationService_GetSupportedLanguages_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb b/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb index 53a48e1f6ffd..ee23eee2b424 100755 --- a/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb +++ b/google-cloud-translate-v3/snippets/translation_service/list_glossaries.rb @@ -19,21 +19,27 @@ # [START translate_v3_generated_TranslationService_ListGlossaries_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#list_glossaries +# +def list_glossaries + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::ListGlossariesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::ListGlossariesRequest.new -# Call the list_glossaries method. -result = client.list_glossaries request + # Call the list_glossaries method. + result = client.list_glossaries request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Translate::V3::Glossary. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Translate::V3::Glossary. + p response + end end # [END translate_v3_generated_TranslationService_ListGlossaries_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/translate_document.rb b/google-cloud-translate-v3/snippets/translation_service/translate_document.rb index 3cbc1a7d5b05..ce8b919000d6 100755 --- a/google-cloud-translate-v3/snippets/translation_service/translate_document.rb +++ b/google-cloud-translate-v3/snippets/translation_service/translate_document.rb @@ -19,15 +19,21 @@ # [START translate_v3_generated_TranslationService_TranslateDocument_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#translate_document +# +def translate_document + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::TranslateDocumentRequest.new -# Call the translate_document method. -result = client.translate_document request + # Call the translate_document method. + result = client.translate_document request -# The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. -p result + # The returned object is of type Google::Cloud::Translate::V3::TranslateDocumentResponse. + p result +end # [END translate_v3_generated_TranslationService_TranslateDocument_sync] diff --git a/google-cloud-translate-v3/snippets/translation_service/translate_text.rb b/google-cloud-translate-v3/snippets/translation_service/translate_text.rb index e6f9cc29216d..41d2adfb2bd1 100755 --- a/google-cloud-translate-v3/snippets/translation_service/translate_text.rb +++ b/google-cloud-translate-v3/snippets/translation_service/translate_text.rb @@ -19,15 +19,21 @@ # [START translate_v3_generated_TranslationService_TranslateText_sync] require "google/cloud/translate/v3" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Translate::V3::TranslationService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Translate::V3::TranslationService::Client#translate_text +# +def translate_text + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Translate::V3::TranslationService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Translate::V3::TranslateTextRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Translate::V3::TranslateTextRequest.new -# Call the translate_text method. -result = client.translate_text request + # Call the translate_text method. + result = client.translate_text request -# The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. -p result + # The returned object is of type Google::Cloud::Translate::V3::TranslateTextResponse. + p result +end # [END translate_v3_generated_TranslationService_TranslateText_sync] diff --git a/google-cloud-video-live_stream-v1/.rubocop.yml b/google-cloud-video-live_stream-v1/.rubocop.yml index 738e7e662d71..3d8359eaee07 100644 --- a/google-cloud-video-live_stream-v1/.rubocop.yml +++ b/google-cloud-video-live_stream-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video-live_stream-v1.rb" diff --git a/google-cloud-video-live_stream-v1/snippets/Gemfile b/google-cloud-video-live_stream-v1/snippets/Gemfile index f6237d4ee386..e858dc4f2c52 100644 --- a/google-cloud-video-live_stream-v1/snippets/Gemfile +++ b/google-cloud-video-live_stream-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb index 0e28703fb036..39850a8b7504 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_channel.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_CreateChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_channel +# +def create_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateChannelRequest.new -# Call the create_channel method. -result = client.create_channel request + # Call the create_channel method. + result = client.create_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_CreateChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb index b07f29a67777..1bb0567cfe90 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_event.rb @@ -19,15 +19,21 @@ # [START livestream_v1_generated_LivestreamService_CreateEvent_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_event +# +def create_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateEventRequest.new -# Call the create_event method. -result = client.create_event request + # Call the create_event method. + result = client.create_event request -# The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. -p result + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + p result +end # [END livestream_v1_generated_LivestreamService_CreateEvent_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb index e7c6b9051201..0be7b7030f2d 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/create_input.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_CreateInput_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#create_input +# +def create_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::CreateInputRequest.new -# Call the create_input method. -result = client.create_input request + # Call the create_input method. + result = client.create_input request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_CreateInput_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb index 8373fc844ca4..9c087f6f445e 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_channel.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_DeleteChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_channel +# +def delete_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteChannelRequest.new -# Call the delete_channel method. -result = client.delete_channel request + # Call the delete_channel method. + result = client.delete_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_DeleteChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb index 64c0f7176e6d..e156480baac9 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_event.rb @@ -19,15 +19,21 @@ # [START livestream_v1_generated_LivestreamService_DeleteEvent_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_event +# +def delete_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteEventRequest.new -# Call the delete_event method. -result = client.delete_event request + # Call the delete_event method. + result = client.delete_event request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END livestream_v1_generated_LivestreamService_DeleteEvent_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb index d0c184f3db9b..9ac3e0fe1006 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/delete_input.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_DeleteInput_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#delete_input +# +def delete_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::DeleteInputRequest.new -# Call the delete_input method. -result = client.delete_input request + # Call the delete_input method. + result = client.delete_input request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_DeleteInput_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb index 7c89d3cb3f65..7c8853f18347 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_channel.rb @@ -19,15 +19,21 @@ # [START livestream_v1_generated_LivestreamService_GetChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_channel +# +def get_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetChannelRequest.new -# Call the get_channel method. -result = client.get_channel request + # Call the get_channel method. + result = client.get_channel request -# The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. -p result + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Channel. + p result +end # [END livestream_v1_generated_LivestreamService_GetChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb index 7f094da20e6e..e23e2a395cab 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_event.rb @@ -19,15 +19,21 @@ # [START livestream_v1_generated_LivestreamService_GetEvent_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_event +# +def get_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetEventRequest.new -# Call the get_event method. -result = client.get_event request + # Call the get_event method. + result = client.get_event request -# The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. -p result + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Event. + p result +end # [END livestream_v1_generated_LivestreamService_GetEvent_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb index e53c60f570ca..e694075edc16 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/get_input.rb @@ -19,15 +19,21 @@ # [START livestream_v1_generated_LivestreamService_GetInput_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#get_input +# +def get_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::GetInputRequest.new -# Call the get_input method. -result = client.get_input request + # Call the get_input method. + result = client.get_input request -# The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. -p result + # The returned object is of type Google::Cloud::Video::LiveStream::V1::Input. + p result +end # [END livestream_v1_generated_LivestreamService_GetInput_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb index af03a76821b2..d53e555fe6e3 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_channels.rb @@ -19,21 +19,27 @@ # [START livestream_v1_generated_LivestreamService_ListChannels_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_channels +# +def list_channels + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListChannelsRequest.new -# Call the list_channels method. -result = client.list_channels request + # Call the list_channels method. + result = client.list_channels request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Channel. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Channel. + p response + end end # [END livestream_v1_generated_LivestreamService_ListChannels_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb index 8fdbd55c9138..d057c13ade71 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_events.rb @@ -19,21 +19,27 @@ # [START livestream_v1_generated_LivestreamService_ListEvents_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_events +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListEventsRequest.new -# Call the list_events method. -result = client.list_events request + # Call the list_events method. + result = client.list_events request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Event. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Event. + p response + end end # [END livestream_v1_generated_LivestreamService_ListEvents_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb index bfe79a5dfa79..f0162f011611 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/list_inputs.rb @@ -19,21 +19,27 @@ # [START livestream_v1_generated_LivestreamService_ListInputs_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#list_inputs +# +def list_inputs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::ListInputsRequest.new -# Call the list_inputs method. -result = client.list_inputs request + # Call the list_inputs method. + result = client.list_inputs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Input. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::LiveStream::V1::Input. + p response + end end # [END livestream_v1_generated_LivestreamService_ListInputs_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb index b1ae7c1c931d..0c3c6bbd5e54 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/start_channel.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_StartChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#start_channel +# +def start_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StartChannelRequest.new -# Call the start_channel method. -result = client.start_channel request + # Call the start_channel method. + result = client.start_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_StartChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb index a7c4266e99f8..e3d4d2d3c8f2 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/stop_channel.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_StopChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#stop_channel +# +def stop_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::StopChannelRequest.new -# Call the stop_channel method. -result = client.stop_channel request + # Call the stop_channel method. + result = client.stop_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_StopChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb index 1429a118f7e4..f34d86c451c9 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_channel.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_UpdateChannel_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_channel +# +def update_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdateChannelRequest.new -# Call the update_channel method. -result = client.update_channel request + # Call the update_channel method. + result = client.update_channel request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_UpdateChannel_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb index ae43b9d39826..c7bbda2362d6 100644 --- a/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb +++ b/google-cloud-video-live_stream-v1/snippets/livestream_service/update_input.rb @@ -19,22 +19,28 @@ # [START livestream_v1_generated_LivestreamService_UpdateInput_sync] require "google/cloud/video/live_stream/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::LiveStream::V1::LivestreamService::Client#update_input +# +def update_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::LiveStream::V1::LivestreamService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::LiveStream::V1::UpdateInputRequest.new -# Call the update_input method. -result = client.update_input request + # Call the update_input method. + result = client.update_input request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END livestream_v1_generated_LivestreamService_UpdateInput_sync] diff --git a/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json b/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json index b38a9bf5ef2b..3503974a1167 100644 --- a/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json +++ b/google-cloud-video-live_stream-v1/snippets/snippet_metadata_google.cloud.video.livestream.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-video-stitcher-v1/.rubocop.yml b/google-cloud-video-stitcher-v1/.rubocop.yml index ca8cef8b0913..6750e6a72b64 100644 --- a/google-cloud-video-stitcher-v1/.rubocop.yml +++ b/google-cloud-video-stitcher-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video-stitcher-v1.rb" diff --git a/google-cloud-video-stitcher-v1/snippets/Gemfile b/google-cloud-video-stitcher-v1/snippets/Gemfile index 5f423cb95f97..62e0c445c8f5 100644 --- a/google-cloud-video-stitcher-v1/snippets/Gemfile +++ b/google-cloud-video-stitcher-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json b/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json index a2689aa6c448..ba9b581f429a 100644 --- a/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json +++ b/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_cdn_key.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_cdn_key.rb index 40e0235d89d4..35758766e999 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_cdn_key.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_cdn_key.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_CreateCdnKey_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#create_cdn_key +# +def create_cdn_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::CreateCdnKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::CreateCdnKeyRequest.new -# Call the create_cdn_key method. -result = client.create_cdn_key request + # Call the create_cdn_key method. + result = client.create_cdn_key request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_CreateCdnKey_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_live_session.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_live_session.rb index cd2a0832917d..6e5ce12aec19 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_live_session.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_live_session.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_CreateLiveSession_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#create_live_session +# +def create_live_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::CreateLiveSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::CreateLiveSessionRequest.new -# Call the create_live_session method. -result = client.create_live_session request + # Call the create_live_session method. + result = client.create_live_session request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveSession. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveSession. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_CreateLiveSession_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_slate.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_slate.rb index c78c835169fe..fa586e512a63 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_slate.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_slate.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_CreateSlate_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#create_slate +# +def create_slate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::CreateSlateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::CreateSlateRequest.new -# Call the create_slate method. -result = client.create_slate request + # Call the create_slate method. + result = client.create_slate request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_CreateSlate_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_vod_session.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_vod_session.rb index abde382c4f2f..ccf683117109 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_vod_session.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/create_vod_session.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_CreateVodSession_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#create_vod_session +# +def create_vod_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::CreateVodSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::CreateVodSessionRequest.new -# Call the create_vod_session method. -result = client.create_vod_session request + # Call the create_vod_session method. + result = client.create_vod_session request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::VodSession. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::VodSession. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_CreateVodSession_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_cdn_key.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_cdn_key.rb index 665312013746..a3930bd53c32 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_cdn_key.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_cdn_key.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_DeleteCdnKey_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#delete_cdn_key +# +def delete_cdn_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::DeleteCdnKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::DeleteCdnKeyRequest.new -# Call the delete_cdn_key method. -result = client.delete_cdn_key request + # Call the delete_cdn_key method. + result = client.delete_cdn_key request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_DeleteCdnKey_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_slate.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_slate.rb index f403be76987c..cef940f6f00f 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_slate.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/delete_slate.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_DeleteSlate_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#delete_slate +# +def delete_slate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::DeleteSlateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::DeleteSlateRequest.new -# Call the delete_slate method. -result = client.delete_slate request + # Call the delete_slate method. + result = client.delete_slate request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_DeleteSlate_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_cdn_key.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_cdn_key.rb index 0b91385261db..7a9be7db7809 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_cdn_key.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_cdn_key.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetCdnKey_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_cdn_key +# +def get_cdn_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetCdnKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetCdnKeyRequest.new -# Call the get_cdn_key method. -result = client.get_cdn_key request + # Call the get_cdn_key method. + result = client.get_cdn_key request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetCdnKey_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_ad_tag_detail.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_ad_tag_detail.rb index 214ea0af3749..777d75e6ff3d 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_ad_tag_detail.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_ad_tag_detail.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetLiveAdTagDetail_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_live_ad_tag_detail +# +def get_live_ad_tag_detail + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetLiveAdTagDetailRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetLiveAdTagDetailRequest.new -# Call the get_live_ad_tag_detail method. -result = client.get_live_ad_tag_detail request + # Call the get_live_ad_tag_detail method. + result = client.get_live_ad_tag_detail request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveAdTagDetail. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveAdTagDetail. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetLiveAdTagDetail_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_session.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_session.rb index e42fbebed18f..737a3d77104c 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_session.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_live_session.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetLiveSession_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_live_session +# +def get_live_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetLiveSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetLiveSessionRequest.new -# Call the get_live_session method. -result = client.get_live_session request + # Call the get_live_session method. + result = client.get_live_session request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveSession. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::LiveSession. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetLiveSession_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_slate.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_slate.rb index d7c61bec2dda..64824c18283d 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_slate.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_slate.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetSlate_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_slate +# +def get_slate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetSlateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetSlateRequest.new -# Call the get_slate method. -result = client.get_slate request + # Call the get_slate method. + result = client.get_slate request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetSlate_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_ad_tag_detail.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_ad_tag_detail.rb index a00e9eef2b12..3ae993508419 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_ad_tag_detail.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_ad_tag_detail.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetVodAdTagDetail_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_vod_ad_tag_detail +# +def get_vod_ad_tag_detail + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetVodAdTagDetailRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetVodAdTagDetailRequest.new -# Call the get_vod_ad_tag_detail method. -result = client.get_vod_ad_tag_detail request + # Call the get_vod_ad_tag_detail method. + result = client.get_vod_ad_tag_detail request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::VodAdTagDetail. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::VodAdTagDetail. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetVodAdTagDetail_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_session.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_session.rb index 0e48095cf78e..65985bfcd01d 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_session.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_session.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetVodSession_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_vod_session +# +def get_vod_session + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetVodSessionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetVodSessionRequest.new -# Call the get_vod_session method. -result = client.get_vod_session request + # Call the get_vod_session method. + result = client.get_vod_session request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::VodSession. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::VodSession. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetVodSession_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_stitch_detail.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_stitch_detail.rb index cb6ef68d4bfe..b36f3ffa31e5 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_stitch_detail.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/get_vod_stitch_detail.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#get_vod_stitch_detail +# +def get_vod_stitch_detail + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::GetVodStitchDetailRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::GetVodStitchDetailRequest.new -# Call the get_vod_stitch_detail method. -result = client.get_vod_stitch_detail request + # Call the get_vod_stitch_detail method. + result = client.get_vod_stitch_detail request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::VodStitchDetail. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::VodStitchDetail. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_GetVodStitchDetail_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_cdn_keys.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_cdn_keys.rb index a0556fdecaeb..12cd0da4078f 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_cdn_keys.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_cdn_keys.rb @@ -19,21 +19,27 @@ # [START videostitcher_v1_generated_VideoStitcherService_ListCdnKeys_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#list_cdn_keys +# +def list_cdn_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::ListCdnKeysRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::ListCdnKeysRequest.new -# Call the list_cdn_keys method. -result = client.list_cdn_keys request + # Call the list_cdn_keys method. + result = client.list_cdn_keys request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Stitcher::V1::CdnKey. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Stitcher::V1::CdnKey. + p response + end end # [END videostitcher_v1_generated_VideoStitcherService_ListCdnKeys_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_live_ad_tag_details.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_live_ad_tag_details.rb index db837f7502e9..09259aba5f82 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_live_ad_tag_details.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_live_ad_tag_details.rb @@ -19,21 +19,27 @@ # [START videostitcher_v1_generated_VideoStitcherService_ListLiveAdTagDetails_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#list_live_ad_tag_details +# +def list_live_ad_tag_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::ListLiveAdTagDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::ListLiveAdTagDetailsRequest.new -# Call the list_live_ad_tag_details method. -result = client.list_live_ad_tag_details request + # Call the list_live_ad_tag_details method. + result = client.list_live_ad_tag_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Stitcher::V1::LiveAdTagDetail. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Stitcher::V1::LiveAdTagDetail. + p response + end end # [END videostitcher_v1_generated_VideoStitcherService_ListLiveAdTagDetails_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_slates.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_slates.rb index b403822132be..3ae7545811f9 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_slates.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_slates.rb @@ -19,21 +19,27 @@ # [START videostitcher_v1_generated_VideoStitcherService_ListSlates_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#list_slates +# +def list_slates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::ListSlatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::ListSlatesRequest.new -# Call the list_slates method. -result = client.list_slates request + # Call the list_slates method. + result = client.list_slates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Stitcher::V1::Slate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Stitcher::V1::Slate. + p response + end end # [END videostitcher_v1_generated_VideoStitcherService_ListSlates_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_ad_tag_details.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_ad_tag_details.rb index ac69fc1692f0..43ac9a931eec 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_ad_tag_details.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_ad_tag_details.rb @@ -19,21 +19,27 @@ # [START videostitcher_v1_generated_VideoStitcherService_ListVodAdTagDetails_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#list_vod_ad_tag_details +# +def list_vod_ad_tag_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::ListVodAdTagDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::ListVodAdTagDetailsRequest.new -# Call the list_vod_ad_tag_details method. -result = client.list_vod_ad_tag_details request + # Call the list_vod_ad_tag_details method. + result = client.list_vod_ad_tag_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Stitcher::V1::VodAdTagDetail. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Stitcher::V1::VodAdTagDetail. + p response + end end # [END videostitcher_v1_generated_VideoStitcherService_ListVodAdTagDetails_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_stitch_details.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_stitch_details.rb index e367dd832079..119a1a573ea0 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_stitch_details.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/list_vod_stitch_details.rb @@ -19,21 +19,27 @@ # [START videostitcher_v1_generated_VideoStitcherService_ListVodStitchDetails_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#list_vod_stitch_details +# +def list_vod_stitch_details + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::ListVodStitchDetailsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::ListVodStitchDetailsRequest.new -# Call the list_vod_stitch_details method. -result = client.list_vod_stitch_details request + # Call the list_vod_stitch_details method. + result = client.list_vod_stitch_details request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Stitcher::V1::VodStitchDetail. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Stitcher::V1::VodStitchDetail. + p response + end end # [END videostitcher_v1_generated_VideoStitcherService_ListVodStitchDetails_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_cdn_key.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_cdn_key.rb index 3abef2f5065d..da338cd1ac94 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_cdn_key.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_cdn_key.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_UpdateCdnKey_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#update_cdn_key +# +def update_cdn_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::UpdateCdnKeyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::UpdateCdnKeyRequest.new -# Call the update_cdn_key method. -result = client.update_cdn_key request + # Call the update_cdn_key method. + result = client.update_cdn_key request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::CdnKey. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_UpdateCdnKey_sync] diff --git a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_slate.rb b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_slate.rb index 70f4b5c17509..35476dd518b1 100644 --- a/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_slate.rb +++ b/google-cloud-video-stitcher-v1/snippets/video_stitcher_service/update_slate.rb @@ -19,15 +19,21 @@ # [START videostitcher_v1_generated_VideoStitcherService_UpdateSlate_sync] require "google/cloud/video/stitcher/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client#update_slate +# +def update_slate + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Stitcher::V1::VideoStitcherService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Stitcher::V1::UpdateSlateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Stitcher::V1::UpdateSlateRequest.new -# Call the update_slate method. -result = client.update_slate request + # Call the update_slate method. + result = client.update_slate request -# The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. -p result + # The returned object is of type Google::Cloud::Video::Stitcher::V1::Slate. + p result +end # [END videostitcher_v1_generated_VideoStitcherService_UpdateSlate_sync] diff --git a/google-cloud-video-transcoder-v1/.rubocop.yml b/google-cloud-video-transcoder-v1/.rubocop.yml index 64fc1e9395d0..cf8b44206f29 100644 --- a/google-cloud-video-transcoder-v1/.rubocop.yml +++ b/google-cloud-video-transcoder-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video-transcoder-v1.rb" diff --git a/google-cloud-video-transcoder-v1/snippets/Gemfile b/google-cloud-video-transcoder-v1/snippets/Gemfile index 4c360e63446a..3cff0d4ef1ad 100755 --- a/google-cloud-video-transcoder-v1/snippets/Gemfile +++ b/google-cloud-video-transcoder-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video-transcoder-v1/snippets/snippet_metadata_google.cloud.video.transcoder.v1.json b/google-cloud-video-transcoder-v1/snippets/snippet_metadata_google.cloud.video.transcoder.v1.json index c8122606f3dc..34ea7c3b1c28 100644 --- a/google-cloud-video-transcoder-v1/snippets/snippet_metadata_google.cloud.video.transcoder.v1.json +++ b/google-cloud-video-transcoder-v1/snippets/snippet_metadata_google.cloud.video.transcoder.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job.rb index 730888f3dc1d..09c27aea14db 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_CreateJob_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::CreateJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::CreateJobRequest.new -# Call the create_job method. -result = client.create_job request + # Call the create_job method. + result = client.create_job request -# The returned object is of type Google::Cloud::Video::Transcoder::V1::Job. -p result + # The returned object is of type Google::Cloud::Video::Transcoder::V1::Job. + p result +end # [END transcoder_v1_generated_TranscoderService_CreateJob_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job_template.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job_template.rb index d9c7ad6d932b..1a4de0c0d96f 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job_template.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/create_job_template.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_CreateJobTemplate_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#create_job_template +# +def create_job_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::CreateJobTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::CreateJobTemplateRequest.new -# Call the create_job_template method. -result = client.create_job_template request + # Call the create_job_template method. + result = client.create_job_template request -# The returned object is of type Google::Cloud::Video::Transcoder::V1::JobTemplate. -p result + # The returned object is of type Google::Cloud::Video::Transcoder::V1::JobTemplate. + p result +end # [END transcoder_v1_generated_TranscoderService_CreateJobTemplate_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job.rb index fcdf31eabf81..cd518c579eb9 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_DeleteJob_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::DeleteJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::DeleteJobRequest.new -# Call the delete_job method. -result = client.delete_job request + # Call the delete_job method. + result = client.delete_job request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END transcoder_v1_generated_TranscoderService_DeleteJob_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job_template.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job_template.rb index cbe4eb6a9c06..050d9a405c15 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job_template.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/delete_job_template.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_DeleteJobTemplate_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#delete_job_template +# +def delete_job_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::DeleteJobTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::DeleteJobTemplateRequest.new -# Call the delete_job_template method. -result = client.delete_job_template request + # Call the delete_job_template method. + result = client.delete_job_template request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END transcoder_v1_generated_TranscoderService_DeleteJobTemplate_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job.rb index 7a20821c460f..555997896a9b 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_GetJob_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::GetJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::GetJobRequest.new -# Call the get_job method. -result = client.get_job request + # Call the get_job method. + result = client.get_job request -# The returned object is of type Google::Cloud::Video::Transcoder::V1::Job. -p result + # The returned object is of type Google::Cloud::Video::Transcoder::V1::Job. + p result +end # [END transcoder_v1_generated_TranscoderService_GetJob_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job_template.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job_template.rb index a1dde57206a0..b7fe1e320aa2 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job_template.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/get_job_template.rb @@ -19,15 +19,21 @@ # [START transcoder_v1_generated_TranscoderService_GetJobTemplate_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#get_job_template +# +def get_job_template + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::GetJobTemplateRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::GetJobTemplateRequest.new -# Call the get_job_template method. -result = client.get_job_template request + # Call the get_job_template method. + result = client.get_job_template request -# The returned object is of type Google::Cloud::Video::Transcoder::V1::JobTemplate. -p result + # The returned object is of type Google::Cloud::Video::Transcoder::V1::JobTemplate. + p result +end # [END transcoder_v1_generated_TranscoderService_GetJobTemplate_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_job_templates.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_job_templates.rb index 5d0b8d5e61ce..8d40ac2238fb 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_job_templates.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_job_templates.rb @@ -19,21 +19,27 @@ # [START transcoder_v1_generated_TranscoderService_ListJobTemplates_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#list_job_templates +# +def list_job_templates + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::ListJobTemplatesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::ListJobTemplatesRequest.new -# Call the list_job_templates method. -result = client.list_job_templates request + # Call the list_job_templates method. + result = client.list_job_templates request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Transcoder::V1::JobTemplate. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Transcoder::V1::JobTemplate. + p response + end end # [END transcoder_v1_generated_TranscoderService_ListJobTemplates_sync] diff --git a/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_jobs.rb b/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_jobs.rb index 6236e91722b5..c324a434bc73 100755 --- a/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_jobs.rb +++ b/google-cloud-video-transcoder-v1/snippets/transcoder_service/list_jobs.rb @@ -19,21 +19,27 @@ # [START transcoder_v1_generated_TranscoderService_ListJobs_sync] require "google/cloud/video/transcoder/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Video::Transcoder::V1::TranscoderService::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Video::Transcoder::V1::TranscoderService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Video::Transcoder::V1::ListJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Video::Transcoder::V1::ListJobsRequest.new -# Call the list_jobs method. -result = client.list_jobs request + # Call the list_jobs method. + result = client.list_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Video::Transcoder::V1::Job. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Video::Transcoder::V1::Job. + p response + end end # [END transcoder_v1_generated_TranscoderService_ListJobs_sync] diff --git a/google-cloud-video_intelligence-v1/.rubocop.yml b/google-cloud-video_intelligence-v1/.rubocop.yml index 6d00dc9c17b9..697ce3ad8472 100644 --- a/google-cloud-video_intelligence-v1/.rubocop.yml +++ b/google-cloud-video_intelligence-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video_intelligence-v1.rb" diff --git a/google-cloud-video_intelligence-v1/snippets/Gemfile b/google-cloud-video_intelligence-v1/snippets/Gemfile index 016faec76d8c..8986c812ffd6 100755 --- a/google-cloud-video_intelligence-v1/snippets/Gemfile +++ b/google-cloud-video_intelligence-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video_intelligence-v1/snippets/snippet_metadata_google.cloud.videointelligence.v1.json b/google-cloud-video_intelligence-v1/snippets/snippet_metadata_google.cloud.videointelligence.v1.json index 941d9e999c20..0673c1bf3e09 100644 --- a/google-cloud-video_intelligence-v1/snippets/snippet_metadata_google.cloud.videointelligence.v1.json +++ b/google-cloud-video_intelligence-v1/snippets/snippet_metadata_google.cloud.videointelligence.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-video_intelligence-v1/snippets/video_intelligence_service/annotate_video.rb b/google-cloud-video_intelligence-v1/snippets/video_intelligence_service/annotate_video.rb index 01c44c8bec95..2d550f1de7de 100755 --- a/google-cloud-video_intelligence-v1/snippets/video_intelligence_service/annotate_video.rb +++ b/google-cloud-video_intelligence-v1/snippets/video_intelligence_service/annotate_video.rb @@ -19,22 +19,28 @@ # [START videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_sync] require "google/cloud/video_intelligence/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Client#annotate_video +# +def annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1::VideoIntelligenceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VideoIntelligence::V1::AnnotateVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VideoIntelligence::V1::AnnotateVideoRequest.new -# Call the annotate_video method. -result = client.annotate_video request + # Call the annotate_video method. + result = client.annotate_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END videointelligence_v1_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/google-cloud-video_intelligence-v1beta2/.rubocop.yml b/google-cloud-video_intelligence-v1beta2/.rubocop.yml index 89810850589c..6a40a2f1ed20 100644 --- a/google-cloud-video_intelligence-v1beta2/.rubocop.yml +++ b/google-cloud-video_intelligence-v1beta2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video_intelligence-v1beta2.rb" diff --git a/google-cloud-video_intelligence-v1beta2/snippets/Gemfile b/google-cloud-video_intelligence-v1beta2/snippets/Gemfile index 7c5aafa3a301..ecfd4ad4b388 100755 --- a/google-cloud-video_intelligence-v1beta2/snippets/Gemfile +++ b/google-cloud-video_intelligence-v1beta2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video_intelligence-v1beta2/snippets/snippet_metadata_google.cloud.videointelligence.v1beta2.json b/google-cloud-video_intelligence-v1beta2/snippets/snippet_metadata_google.cloud.videointelligence.v1beta2.json index b49c7118ef4a..e9e55d1a872f 100644 --- a/google-cloud-video_intelligence-v1beta2/snippets/snippet_metadata_google.cloud.videointelligence.v1beta2.json +++ b/google-cloud-video_intelligence-v1beta2/snippets/snippet_metadata_google.cloud.videointelligence.v1beta2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-video_intelligence-v1beta2/snippets/video_intelligence_service/annotate_video.rb b/google-cloud-video_intelligence-v1beta2/snippets/video_intelligence_service/annotate_video.rb index 050c9749de32..317901eefd92 100755 --- a/google-cloud-video_intelligence-v1beta2/snippets/video_intelligence_service/annotate_video.rb +++ b/google-cloud-video_intelligence-v1beta2/snippets/video_intelligence_service/annotate_video.rb @@ -19,22 +19,28 @@ # [START videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_sync] require "google/cloud/video_intelligence/v1beta2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Client#annotate_video +# +def annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1beta2::VideoIntelligenceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VideoIntelligence::V1beta2::AnnotateVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VideoIntelligence::V1beta2::AnnotateVideoRequest.new -# Call the annotate_video method. -result = client.annotate_video request + # Call the annotate_video method. + result = client.annotate_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END videointelligence_v1beta2_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/google-cloud-video_intelligence-v1p1beta1/.rubocop.yml b/google-cloud-video_intelligence-v1p1beta1/.rubocop.yml index 4fa115e49099..06f967ab8cea 100644 --- a/google-cloud-video_intelligence-v1p1beta1/.rubocop.yml +++ b/google-cloud-video_intelligence-v1p1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video_intelligence-v1p1beta1.rb" diff --git a/google-cloud-video_intelligence-v1p1beta1/snippets/Gemfile b/google-cloud-video_intelligence-v1p1beta1/snippets/Gemfile index 92a5161bc67f..0731af208d14 100755 --- a/google-cloud-video_intelligence-v1p1beta1/snippets/Gemfile +++ b/google-cloud-video_intelligence-v1p1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video_intelligence-v1p1beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p1beta1.json b/google-cloud-video_intelligence-v1p1beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p1beta1.json index 4a9a2f8fb87e..42ff8083fe4c 100644 --- a/google-cloud-video_intelligence-v1p1beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p1beta1.json +++ b/google-cloud-video_intelligence-v1p1beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-video_intelligence-v1p1beta1/snippets/video_intelligence_service/annotate_video.rb b/google-cloud-video_intelligence-v1p1beta1/snippets/video_intelligence_service/annotate_video.rb index 0c2e2ba4b072..f7cb9edd3045 100755 --- a/google-cloud-video_intelligence-v1p1beta1/snippets/video_intelligence_service/annotate_video.rb +++ b/google-cloud-video_intelligence-v1p1beta1/snippets/video_intelligence_service/annotate_video.rb @@ -19,22 +19,28 @@ # [START videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] require "google/cloud/video_intelligence/v1p1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Client#annotate_video +# +def annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1p1beta1::VideoIntelligenceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VideoIntelligence::V1p1beta1::AnnotateVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VideoIntelligence::V1p1beta1::AnnotateVideoRequest.new -# Call the annotate_video method. -result = client.annotate_video request + # Call the annotate_video method. + result = client.annotate_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END videointelligence_v1p1beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/google-cloud-video_intelligence-v1p2beta1/.rubocop.yml b/google-cloud-video_intelligence-v1p2beta1/.rubocop.yml index fc15f4fe30d2..334ea0e42e58 100644 --- a/google-cloud-video_intelligence-v1p2beta1/.rubocop.yml +++ b/google-cloud-video_intelligence-v1p2beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video_intelligence-v1p2beta1.rb" diff --git a/google-cloud-video_intelligence-v1p2beta1/snippets/Gemfile b/google-cloud-video_intelligence-v1p2beta1/snippets/Gemfile index f1fe37f59eda..d08ee49eb9b9 100755 --- a/google-cloud-video_intelligence-v1p2beta1/snippets/Gemfile +++ b/google-cloud-video_intelligence-v1p2beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video_intelligence-v1p2beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p2beta1.json b/google-cloud-video_intelligence-v1p2beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p2beta1.json index 0bc5bff607d1..db96ba34e5bd 100644 --- a/google-cloud-video_intelligence-v1p2beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p2beta1.json +++ b/google-cloud-video_intelligence-v1p2beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p2beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-video_intelligence-v1p2beta1/snippets/video_intelligence_service/annotate_video.rb b/google-cloud-video_intelligence-v1p2beta1/snippets/video_intelligence_service/annotate_video.rb index 0caea74ac5bb..f4cfe8b312ce 100755 --- a/google-cloud-video_intelligence-v1p2beta1/snippets/video_intelligence_service/annotate_video.rb +++ b/google-cloud-video_intelligence-v1p2beta1/snippets/video_intelligence_service/annotate_video.rb @@ -19,22 +19,28 @@ # [START videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] require "google/cloud/video_intelligence/v1p2beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Client#annotate_video +# +def annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1p2beta1::VideoIntelligenceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VideoIntelligence::V1p2beta1::AnnotateVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VideoIntelligence::V1p2beta1::AnnotateVideoRequest.new -# Call the annotate_video method. -result = client.annotate_video request + # Call the annotate_video method. + result = client.annotate_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END videointelligence_v1p2beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/google-cloud-video_intelligence-v1p3beta1/.rubocop.yml b/google-cloud-video_intelligence-v1p3beta1/.rubocop.yml index 02ee6ca647fb..09a0a6fd85df 100644 --- a/google-cloud-video_intelligence-v1p3beta1/.rubocop.yml +++ b/google-cloud-video_intelligence-v1p3beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-video_intelligence-v1p3beta1.rb" diff --git a/google-cloud-video_intelligence-v1p3beta1/snippets/Gemfile b/google-cloud-video_intelligence-v1p3beta1/snippets/Gemfile index ac83708655cd..0f73224a9c4c 100755 --- a/google-cloud-video_intelligence-v1p3beta1/snippets/Gemfile +++ b/google-cloud-video_intelligence-v1p3beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-video_intelligence-v1p3beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p3beta1.json b/google-cloud-video_intelligence-v1p3beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p3beta1.json index f0fd98b65ec0..b6e6a924eb90 100644 --- a/google-cloud-video_intelligence-v1p3beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p3beta1.json +++ b/google-cloud-video_intelligence-v1p3beta1/snippets/snippet_metadata_google.cloud.videointelligence.v1p3beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 41, + "end": 47, "type": "FULL" } ] diff --git a/google-cloud-video_intelligence-v1p3beta1/snippets/streaming_video_intelligence_service/streaming_annotate_video.rb b/google-cloud-video_intelligence-v1p3beta1/snippets/streaming_video_intelligence_service/streaming_annotate_video.rb index 8be79870fc74..dd50b4067faa 100755 --- a/google-cloud-video_intelligence-v1p3beta1/snippets/streaming_video_intelligence_service/streaming_annotate_video.rb +++ b/google-cloud-video_intelligence-v1p3beta1/snippets/streaming_video_intelligence_service/streaming_annotate_video.rb @@ -19,24 +19,30 @@ # [START videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_sync] require "google/cloud/video_intelligence/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new - -# Create an input stream -input = Gapic::StreamInput.new - -# Call the streaming_annotate_video method to start streaming. -output = client.streaming_annotate_video input - -# Send requests on the stream. For each request, pass in keyword -# arguments to set fields. Be sure to close the stream when done. -input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new -input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new -input.close - -# Handle streamed responses. These may be interleaved with inputs. -# Each response is of type ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoResponse. -output.each do |response| - p response +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client#streaming_annotate_video +# +def streaming_annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1p3beta1::StreamingVideoIntelligenceService::Client.new + + # Create an input stream + input = Gapic::StreamInput.new + + # Call the streaming_annotate_video method to start streaming. + output = client.streaming_annotate_video input + + # Send requests on the stream. For each request, pass in keyword + # arguments to set fields. Be sure to close the stream when done. + input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new + input << Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoRequest.new + input.close + + # Handle streamed responses. These may be interleaved with inputs. + # Each response is of type ::Google::Cloud::VideoIntelligence::V1p3beta1::StreamingAnnotateVideoResponse. + output.each do |response| + p response + end end # [END videointelligence_v1p3beta1_generated_StreamingVideoIntelligenceService_StreamingAnnotateVideo_sync] diff --git a/google-cloud-video_intelligence-v1p3beta1/snippets/video_intelligence_service/annotate_video.rb b/google-cloud-video_intelligence-v1p3beta1/snippets/video_intelligence_service/annotate_video.rb index f46cf1eecba5..5b7a97d3844a 100755 --- a/google-cloud-video_intelligence-v1p3beta1/snippets/video_intelligence_service/annotate_video.rb +++ b/google-cloud-video_intelligence-v1p3beta1/snippets/video_intelligence_service/annotate_video.rb @@ -19,22 +19,28 @@ # [START videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] require "google/cloud/video_intelligence/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client#annotate_video +# +def annotate_video + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VideoIntelligence::V1p3beta1::VideoIntelligenceService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VideoIntelligence::V1p3beta1::AnnotateVideoRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VideoIntelligence::V1p3beta1::AnnotateVideoRequest.new -# Call the annotate_video method. -result = client.annotate_video request + # Call the annotate_video method. + result = client.annotate_video request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END videointelligence_v1p3beta1_generated_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/google-cloud-vision-v1/.repo-metadata.json b/google-cloud-vision-v1/.repo-metadata.json index 20f9a6926627..0693928f131a 100644 --- a/google-cloud-vision-v1/.repo-metadata.json +++ b/google-cloud-vision-v1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", "ruby-cloud-env-prefix": "VISION", "ruby-cloud-product-url": "https://cloud.google.com/vision", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-vision-v1/.rubocop.yml b/google-cloud-vision-v1/.rubocop.yml index 83d1036b25c8..94d0134a2110 100644 --- a/google-cloud-vision-v1/.rubocop.yml +++ b/google-cloud-vision-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-vision-v1.rb" diff --git a/google-cloud-vision-v1/snippets/Gemfile b/google-cloud-vision-v1/snippets/Gemfile index e2fdf8b0983c..29e9f3cbcc6b 100644 --- a/google-cloud-vision-v1/snippets/Gemfile +++ b/google-cloud-vision-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_files.rb b/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_files.rb index e10e0da7f42c..3a34c68f7bee 100644 --- a/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_files.rb +++ b/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_files.rb @@ -19,22 +19,28 @@ # [START vision_v1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ImageAnnotator::Client#async_batch_annotate_files +# +def async_batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::AsyncBatchAnnotateFilesRequest.new -# Call the async_batch_annotate_files method. -result = client.async_batch_annotate_files request + # Call the async_batch_annotate_files method. + result = client.async_batch_annotate_files request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_images.rb b/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_images.rb index d9dc635376ed..71303af11c57 100644 --- a/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_images.rb +++ b/google-cloud-vision-v1/snippets/image_annotator/async_batch_annotate_images.rb @@ -19,22 +19,28 @@ # [START vision_v1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ImageAnnotator::Client#async_batch_annotate_images +# +def async_batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::AsyncBatchAnnotateImagesRequest.new -# Call the async_batch_annotate_images method. -result = client.async_batch_annotate_images request + # Call the async_batch_annotate_images method. + result = client.async_batch_annotate_images request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] diff --git a/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_files.rb b/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_files.rb index 9f01f63cd7af..9155fa626950 100644 --- a/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_files.rb +++ b/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_files.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ImageAnnotator_BatchAnnotateFiles_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ImageAnnotator::Client#batch_annotate_files +# +def batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::BatchAnnotateFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::BatchAnnotateFilesRequest.new -# Call the batch_annotate_files method. -result = client.batch_annotate_files request + # Call the batch_annotate_files method. + result = client.batch_annotate_files request -# The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateFilesResponse. -p result + # The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateFilesResponse. + p result +end # [END vision_v1_generated_ImageAnnotator_BatchAnnotateFiles_sync] diff --git a/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_images.rb b/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_images.rb index c882169bd70d..2b3335ff279e 100644 --- a/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_images.rb +++ b/google-cloud-vision-v1/snippets/image_annotator/batch_annotate_images.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ImageAnnotator_BatchAnnotateImages_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ImageAnnotator::Client#batch_annotate_images +# +def batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::BatchAnnotateImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::BatchAnnotateImagesRequest.new -# Call the batch_annotate_images method. -result = client.batch_annotate_images request + # Call the batch_annotate_images method. + result = client.batch_annotate_images request -# The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateImagesResponse. -p result + # The returned object is of type Google::Cloud::Vision::V1::BatchAnnotateImagesResponse. + p result +end # [END vision_v1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/add_product_to_product_set.rb b/google-cloud-vision-v1/snippets/product_search/add_product_to_product_set.rb index edc36b4efa1f..1c3de802392a 100644 --- a/google-cloud-vision-v1/snippets/product_search/add_product_to_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/add_product_to_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_AddProductToProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#add_product_to_product_set +# +def add_product_to_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::AddProductToProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::AddProductToProductSetRequest.new -# Call the add_product_to_product_set method. -result = client.add_product_to_product_set request + # Call the add_product_to_product_set method. + result = client.add_product_to_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/create_product.rb b/google-cloud-vision-v1/snippets/product_search/create_product.rb index bea86ba358ed..bc284f685534 100644 --- a/google-cloud-vision-v1/snippets/product_search/create_product.rb +++ b/google-cloud-vision-v1/snippets/product_search/create_product.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_CreateProduct_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#create_product +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::CreateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::CreateProductRequest.new -# Call the create_product method. -result = client.create_product request + # Call the create_product method. + result = client.create_product request -# The returned object is of type Google::Cloud::Vision::V1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1::Product. + p result +end # [END vision_v1_generated_ProductSearch_CreateProduct_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/create_product_set.rb b/google-cloud-vision-v1/snippets/product_search/create_product_set.rb index 146060192416..3e480ce2a7ef 100644 --- a/google-cloud-vision-v1/snippets/product_search/create_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/create_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_CreateProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#create_product_set +# +def create_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::CreateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::CreateProductSetRequest.new -# Call the create_product_set method. -result = client.create_product_set request + # Call the create_product_set method. + result = client.create_product_set request -# The returned object is of type Google::Cloud::Vision::V1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1::ProductSet. + p result +end # [END vision_v1_generated_ProductSearch_CreateProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/create_reference_image.rb b/google-cloud-vision-v1/snippets/product_search/create_reference_image.rb index 3cf3e25afb49..5d2181d0c6b4 100644 --- a/google-cloud-vision-v1/snippets/product_search/create_reference_image.rb +++ b/google-cloud-vision-v1/snippets/product_search/create_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_CreateReferenceImage_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#create_reference_image +# +def create_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::CreateReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::CreateReferenceImageRequest.new -# Call the create_reference_image method. -result = client.create_reference_image request + # Call the create_reference_image method. + result = client.create_reference_image request -# The returned object is of type Google::Cloud::Vision::V1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage. + p result +end # [END vision_v1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/delete_product.rb b/google-cloud-vision-v1/snippets/product_search/delete_product.rb index 9b568b3cb564..9149b9583482 100644 --- a/google-cloud-vision-v1/snippets/product_search/delete_product.rb +++ b/google-cloud-vision-v1/snippets/product_search/delete_product.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_DeleteProduct_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#delete_product +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::DeleteProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::DeleteProductRequest.new -# Call the delete_product method. -result = client.delete_product request + # Call the delete_product method. + result = client.delete_product request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1_generated_ProductSearch_DeleteProduct_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/delete_product_set.rb b/google-cloud-vision-v1/snippets/product_search/delete_product_set.rb index 8f41a82f9ef3..5c65ed95bd07 100644 --- a/google-cloud-vision-v1/snippets/product_search/delete_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/delete_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_DeleteProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#delete_product_set +# +def delete_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::DeleteProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::DeleteProductSetRequest.new -# Call the delete_product_set method. -result = client.delete_product_set request + # Call the delete_product_set method. + result = client.delete_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/delete_reference_image.rb b/google-cloud-vision-v1/snippets/product_search/delete_reference_image.rb index 4d5a03874aee..17597ab82449 100644 --- a/google-cloud-vision-v1/snippets/product_search/delete_reference_image.rb +++ b/google-cloud-vision-v1/snippets/product_search/delete_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_DeleteReferenceImage_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#delete_reference_image +# +def delete_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::DeleteReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::DeleteReferenceImageRequest.new -# Call the delete_reference_image method. -result = client.delete_reference_image request + # Call the delete_reference_image method. + result = client.delete_reference_image request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/get_product.rb b/google-cloud-vision-v1/snippets/product_search/get_product.rb index 677e970d055e..e0cdbce18afc 100644 --- a/google-cloud-vision-v1/snippets/product_search/get_product.rb +++ b/google-cloud-vision-v1/snippets/product_search/get_product.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_GetProduct_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#get_product +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::GetProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::GetProductRequest.new -# Call the get_product method. -result = client.get_product request + # Call the get_product method. + result = client.get_product request -# The returned object is of type Google::Cloud::Vision::V1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1::Product. + p result +end # [END vision_v1_generated_ProductSearch_GetProduct_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/get_product_set.rb b/google-cloud-vision-v1/snippets/product_search/get_product_set.rb index 1073b194992f..c1e3a1bcf278 100644 --- a/google-cloud-vision-v1/snippets/product_search/get_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/get_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_GetProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#get_product_set +# +def get_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::GetProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::GetProductSetRequest.new -# Call the get_product_set method. -result = client.get_product_set request + # Call the get_product_set method. + result = client.get_product_set request -# The returned object is of type Google::Cloud::Vision::V1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1::ProductSet. + p result +end # [END vision_v1_generated_ProductSearch_GetProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/get_reference_image.rb b/google-cloud-vision-v1/snippets/product_search/get_reference_image.rb index e959b83c1bd8..0afd9a3e8a47 100644 --- a/google-cloud-vision-v1/snippets/product_search/get_reference_image.rb +++ b/google-cloud-vision-v1/snippets/product_search/get_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_GetReferenceImage_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#get_reference_image +# +def get_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::GetReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::GetReferenceImageRequest.new -# Call the get_reference_image method. -result = client.get_reference_image request + # Call the get_reference_image method. + result = client.get_reference_image request -# The returned object is of type Google::Cloud::Vision::V1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1::ReferenceImage. + p result +end # [END vision_v1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/import_product_sets.rb b/google-cloud-vision-v1/snippets/product_search/import_product_sets.rb index 5d03c19bd27a..044df60bed02 100644 --- a/google-cloud-vision-v1/snippets/product_search/import_product_sets.rb +++ b/google-cloud-vision-v1/snippets/product_search/import_product_sets.rb @@ -19,22 +19,28 @@ # [START vision_v1_generated_ProductSearch_ImportProductSets_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#import_product_sets +# +def import_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::ImportProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::ImportProductSetsRequest.new -# Call the import_product_sets method. -result = client.import_product_sets request + # Call the import_product_sets method. + result = client.import_product_sets request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1_generated_ProductSearch_ImportProductSets_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/list_product_sets.rb b/google-cloud-vision-v1/snippets/product_search/list_product_sets.rb index 0ac4b022430d..5dfe8e30c414 100644 --- a/google-cloud-vision-v1/snippets/product_search/list_product_sets.rb +++ b/google-cloud-vision-v1/snippets/product_search/list_product_sets.rb @@ -19,21 +19,27 @@ # [START vision_v1_generated_ProductSearch_ListProductSets_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#list_product_sets +# +def list_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::ListProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::ListProductSetsRequest.new -# Call the list_product_sets method. -result = client.list_product_sets request + # Call the list_product_sets method. + result = client.list_product_sets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1::ProductSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1::ProductSet. + p response + end end # [END vision_v1_generated_ProductSearch_ListProductSets_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/list_products.rb b/google-cloud-vision-v1/snippets/product_search/list_products.rb index d967fe63ed8e..ff346cddcd11 100644 --- a/google-cloud-vision-v1/snippets/product_search/list_products.rb +++ b/google-cloud-vision-v1/snippets/product_search/list_products.rb @@ -19,21 +19,27 @@ # [START vision_v1_generated_ProductSearch_ListProducts_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#list_products +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::ListProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::ListProductsRequest.new -# Call the list_products method. -result = client.list_products request + # Call the list_products method. + result = client.list_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1::Product. + p response + end end # [END vision_v1_generated_ProductSearch_ListProducts_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/list_products_in_product_set.rb b/google-cloud-vision-v1/snippets/product_search/list_products_in_product_set.rb index 460e431a5314..6fe0636c32e6 100644 --- a/google-cloud-vision-v1/snippets/product_search/list_products_in_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/list_products_in_product_set.rb @@ -19,21 +19,27 @@ # [START vision_v1_generated_ProductSearch_ListProductsInProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#list_products_in_product_set +# +def list_products_in_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::ListProductsInProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::ListProductsInProductSetRequest.new -# Call the list_products_in_product_set method. -result = client.list_products_in_product_set request + # Call the list_products_in_product_set method. + result = client.list_products_in_product_set request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1::Product. + p response + end end # [END vision_v1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/list_reference_images.rb b/google-cloud-vision-v1/snippets/product_search/list_reference_images.rb index d2fcfaed8921..26e93f716711 100644 --- a/google-cloud-vision-v1/snippets/product_search/list_reference_images.rb +++ b/google-cloud-vision-v1/snippets/product_search/list_reference_images.rb @@ -19,21 +19,27 @@ # [START vision_v1_generated_ProductSearch_ListReferenceImages_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#list_reference_images +# +def list_reference_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::ListReferenceImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::ListReferenceImagesRequest.new -# Call the list_reference_images method. -result = client.list_reference_images request + # Call the list_reference_images method. + result = client.list_reference_images request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1::ReferenceImage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1::ReferenceImage. + p response + end end # [END vision_v1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/purge_products.rb b/google-cloud-vision-v1/snippets/product_search/purge_products.rb index 434839b71d76..fa74d66a9964 100644 --- a/google-cloud-vision-v1/snippets/product_search/purge_products.rb +++ b/google-cloud-vision-v1/snippets/product_search/purge_products.rb @@ -19,22 +19,28 @@ # [START vision_v1_generated_ProductSearch_PurgeProducts_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#purge_products +# +def purge_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::PurgeProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::PurgeProductsRequest.new -# Call the purge_products method. -result = client.purge_products request + # Call the purge_products method. + result = client.purge_products request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1_generated_ProductSearch_PurgeProducts_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/remove_product_from_product_set.rb b/google-cloud-vision-v1/snippets/product_search/remove_product_from_product_set.rb index 17151496b22a..2350f5e3d6c8 100644 --- a/google-cloud-vision-v1/snippets/product_search/remove_product_from_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/remove_product_from_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_RemoveProductFromProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#remove_product_from_product_set +# +def remove_product_from_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::RemoveProductFromProductSetRequest.new -# Call the remove_product_from_product_set method. -result = client.remove_product_from_product_set request + # Call the remove_product_from_product_set method. + result = client.remove_product_from_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/update_product.rb b/google-cloud-vision-v1/snippets/product_search/update_product.rb index de7bf26bcd8b..82c610261484 100644 --- a/google-cloud-vision-v1/snippets/product_search/update_product.rb +++ b/google-cloud-vision-v1/snippets/product_search/update_product.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_UpdateProduct_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#update_product +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::UpdateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::UpdateProductRequest.new -# Call the update_product method. -result = client.update_product request + # Call the update_product method. + result = client.update_product request -# The returned object is of type Google::Cloud::Vision::V1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1::Product. + p result +end # [END vision_v1_generated_ProductSearch_UpdateProduct_sync] diff --git a/google-cloud-vision-v1/snippets/product_search/update_product_set.rb b/google-cloud-vision-v1/snippets/product_search/update_product_set.rb index b37e14acd10c..0a73712cdbfb 100644 --- a/google-cloud-vision-v1/snippets/product_search/update_product_set.rb +++ b/google-cloud-vision-v1/snippets/product_search/update_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1_generated_ProductSearch_UpdateProductSet_sync] require "google/cloud/vision/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1::ProductSearch::Client#update_product_set +# +def update_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1::UpdateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1::UpdateProductSetRequest.new -# Call the update_product_set method. -result = client.update_product_set request + # Call the update_product_set method. + result = client.update_product_set request -# The returned object is of type Google::Cloud::Vision::V1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1::ProductSet. + p result +end # [END vision_v1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/google-cloud-vision-v1/snippets/snippet_metadata_google.cloud.vision.v1.json b/google-cloud-vision-v1/snippets/snippet_metadata_google.cloud.vision.v1.json index 90a20dba2ae2..cc782bb87dec 100644 --- a/google-cloud-vision-v1/snippets/snippet_metadata_google.cloud.vision.v1.json +++ b/google-cloud-vision-v1/snippets/snippet_metadata_google.cloud.vision.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-vision-v1p3beta1/.repo-metadata.json b/google-cloud-vision-v1p3beta1/.repo-metadata.json index 3e710edb8e59..74faf230ff96 100644 --- a/google-cloud-vision-v1p3beta1/.repo-metadata.json +++ b/google-cloud-vision-v1p3beta1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p3beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", "ruby-cloud-env-prefix": "VISION", "ruby-cloud-product-url": "https://cloud.google.com/vision", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-vision-v1p3beta1/.rubocop.yml b/google-cloud-vision-v1p3beta1/.rubocop.yml index 9782e0266a5d..a1a5953f98fb 100644 --- a/google-cloud-vision-v1p3beta1/.rubocop.yml +++ b/google-cloud-vision-v1p3beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-vision-v1p3beta1.rb" diff --git a/google-cloud-vision-v1p3beta1/snippets/Gemfile b/google-cloud-vision-v1p3beta1/snippets/Gemfile index 0eb127625b86..22f9a9baa8ab 100755 --- a/google-cloud-vision-v1p3beta1/snippets/Gemfile +++ b/google-cloud-vision-v1p3beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb b/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb index 911c82355bb0..b015434905da 100755 --- a/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb +++ b/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb @@ -19,22 +19,28 @@ # [START vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files +# +def async_batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new -# Call the async_batch_annotate_files method. -result = client.async_batch_annotate_files request + # Call the async_batch_annotate_files method. + result = client.async_batch_annotate_files request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb b/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb index ae4e3e572280..99785e794cec 100755 --- a/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb +++ b/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images +# +def batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new -# Call the batch_annotate_images method. -result = client.batch_annotate_images request + # Call the batch_annotate_images method. + result = client.batch_annotate_images request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. + p result +end # [END vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb index d65dd97c5d41..d70146347518 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set +# +def add_product_to_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new -# Call the add_product_to_product_set method. -result = client.add_product_to_product_set request + # Call the add_product_to_product_set method. + result = client.add_product_to_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb index 106acf0f2ba2..dea057a9f7d5 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new -# Call the create_product method. -result = client.create_product request + # Call the create_product method. + result = client.create_product request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb index d0395876f3b9..0815986b7c57 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product_set +# +def create_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new -# Call the create_product_set method. -result = client.create_product_set request + # Call the create_product_set method. + result = client.create_product_set request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb index 8b7f2ead23ba..c52d82efec65 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_reference_image +# +def create_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new -# Call the create_reference_image method. -result = client.create_reference_image request + # Call the create_reference_image method. + result = client.create_reference_image request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb index 2783b116f65d..76c842837b50 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new -# Call the delete_product method. -result = client.delete_product request + # Call the delete_product method. + result = client.delete_product request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb index 7ab59cff9e0b..3b40e6081324 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product_set +# +def delete_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new -# Call the delete_product_set method. -result = client.delete_product_set request + # Call the delete_product_set method. + result = client.delete_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb index 839849ffda99..aac11489877c 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image +# +def delete_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new -# Call the delete_reference_image method. -result = client.delete_reference_image request + # Call the delete_reference_image method. + result = client.delete_reference_image request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb index e4cfca70e63e..16f1774deb31 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new -# Call the get_product method. -result = client.get_product request + # Call the get_product method. + result = client.get_product request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb index d9ee6c57ba31..c38999945526 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product_set +# +def get_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new -# Call the get_product_set method. -result = client.get_product_set request + # Call the get_product_set method. + result = client.get_product_set request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb index 9f59892c4954..91dc95793fa0 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_reference_image +# +def get_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new -# Call the get_reference_image method. -result = client.get_reference_image request + # Call the get_reference_image method. + result = client.get_reference_image request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb index cee0e9e4267f..3d124b6fac9f 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb @@ -19,22 +19,28 @@ # [START vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#import_product_sets +# +def import_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new -# Call the import_product_sets method. -result = client.import_product_sets request + # Call the import_product_sets method. + result = client.import_product_sets request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb index 1e7033be92e6..56716666496a 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb @@ -19,21 +19,27 @@ # [START vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_product_sets +# +def list_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new -# Call the list_product_sets method. -result = client.list_product_sets request + # Call the list_product_sets method. + result = client.list_product_sets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p3beta1::ProductSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p3beta1::ProductSet. + p response + end end # [END vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb index dad2f0797e16..92d8f03d1fbd 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb @@ -19,21 +19,27 @@ # [START vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new -# Call the list_products method. -result = client.list_products request + # Call the list_products method. + result = client.list_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p3beta1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p3beta1::Product. + p response + end end # [END vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb index ef15d0835eb4..77e30d1c0a1a 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb @@ -19,21 +19,27 @@ # [START vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set +# +def list_products_in_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new -# Call the list_products_in_product_set method. -result = client.list_products_in_product_set request + # Call the list_products_in_product_set method. + result = client.list_products_in_product_set request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p3beta1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p3beta1::Product. + p response + end end # [END vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb index e9ab7b7ec93f..c7b3745e70c9 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb @@ -19,21 +19,27 @@ # [START vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_reference_images +# +def list_reference_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new -# Call the list_reference_images method. -result = client.list_reference_images request + # Call the list_reference_images method. + result = client.list_reference_images request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p3beta1::ReferenceImage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p3beta1::ReferenceImage. + p response + end end # [END vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb index 819fca64d660..11ea97190f68 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set +# +def remove_product_from_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new -# Call the remove_product_from_product_set method. -result = client.remove_product_from_product_set request + # Call the remove_product_from_product_set method. + result = client.remove_product_from_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb index 6876577cfa31..1e07bd28086a 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new -# Call the update_product method. -result = client.update_product request + # Call the update_product method. + result = client.update_product request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb b/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb index 1a6e6144e218..0d1a55373045 100755 --- a/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb +++ b/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] require "google/cloud/vision/v1p3beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product_set +# +def update_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new -# Call the update_product_set method. -result = client.update_product_set request + # Call the update_product_set method. + result = client.update_product_set request -# The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end # [END vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json b/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json index 848f4300b43c..d656352d5668 100644 --- a/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json +++ b/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-vision-v1p4beta1/.repo-metadata.json b/google-cloud-vision-v1p4beta1/.repo-metadata.json index 196ad1fbe8e3..81257113eb40 100644 --- a/google-cloud-vision-v1p4beta1/.repo-metadata.json +++ b/google-cloud-vision-v1p4beta1/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", "ruby-cloud-env-prefix": "VISION", "ruby-cloud-product-url": "https://cloud.google.com/vision", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_COMBO" } diff --git a/google-cloud-vision-v1p4beta1/.rubocop.yml b/google-cloud-vision-v1p4beta1/.rubocop.yml index 7a72a45d7ae1..3b29e65f7fbe 100644 --- a/google-cloud-vision-v1p4beta1/.rubocop.yml +++ b/google-cloud-vision-v1p4beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-vision-v1p4beta1.rb" diff --git a/google-cloud-vision-v1p4beta1/snippets/Gemfile b/google-cloud-vision-v1p4beta1/snippets/Gemfile index 2280ab1dffa0..efa3bb509685 100755 --- a/google-cloud-vision-v1p4beta1/snippets/Gemfile +++ b/google-cloud-vision-v1p4beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb b/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb index 74207ef5ba9e..90d3a5878cb1 100755 --- a/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb +++ b/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb @@ -19,22 +19,28 @@ # [START vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files +# +def async_batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new -# Call the async_batch_annotate_files method. -result = client.async_batch_annotate_files request + # Call the async_batch_annotate_files method. + result = client.async_batch_annotate_files request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb b/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb index 84e6fb0bd376..562ea5621f71 100755 --- a/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb +++ b/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb @@ -19,22 +19,28 @@ # [START vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images +# +def async_batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new -# Call the async_batch_annotate_images method. -result = client.async_batch_annotate_images request + # Call the async_batch_annotate_images method. + result = client.async_batch_annotate_images request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb b/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb index ab8b96f19fd8..183d2c923d7d 100755 --- a/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb +++ b/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files +# +def batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new -# Call the batch_annotate_files method. -result = client.batch_annotate_files request + # Call the batch_annotate_files method. + result = client.batch_annotate_files request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. + p result +end # [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb b/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb index 3c6b6cc15a8f..07035fda6ebb 100755 --- a/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb +++ b/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images +# +def batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new -# Call the batch_annotate_images method. -result = client.batch_annotate_images request + # Call the batch_annotate_images method. + result = client.batch_annotate_images request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. + p result +end # [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb index 5ce10c9a182d..85b279ebff14 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set +# +def add_product_to_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new -# Call the add_product_to_product_set method. -result = client.add_product_to_product_set request + # Call the add_product_to_product_set method. + result = client.add_product_to_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb index 435f06a3cf2a..203f7230405e 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new -# Call the create_product method. -result = client.create_product request + # Call the create_product method. + result = client.create_product request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb index dd00df6616e0..64fb35337827 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product_set +# +def create_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new -# Call the create_product_set method. -result = client.create_product_set request + # Call the create_product_set method. + result = client.create_product_set request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb index 7924353ad881..22ec1f001af7 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_reference_image +# +def create_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new -# Call the create_reference_image method. -result = client.create_reference_image request + # Call the create_reference_image method. + result = client.create_reference_image request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb index 91105dc3c48c..651189d9b074 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new -# Call the delete_product method. -result = client.delete_product request + # Call the delete_product method. + result = client.delete_product request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb index 8fe528a26cc5..399a466e30f4 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product_set +# +def delete_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new -# Call the delete_product_set method. -result = client.delete_product_set request + # Call the delete_product_set method. + result = client.delete_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb index b6cff2416152..d22b163a0459 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image +# +def delete_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new -# Call the delete_reference_image method. -result = client.delete_reference_image request + # Call the delete_reference_image method. + result = client.delete_reference_image request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb index 5faa96135592..2521e8fe0a14 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new -# Call the get_product method. -result = client.get_product request + # Call the get_product method. + result = client.get_product request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb index 40bfcfccf4a1..e683f8aec9a7 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product_set +# +def get_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new -# Call the get_product_set method. -result = client.get_product_set request + # Call the get_product_set method. + result = client.get_product_set request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb index 46baf3b5fe7c..26d8f27d7fea 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_reference_image +# +def get_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new -# Call the get_reference_image method. -result = client.get_reference_image request + # Call the get_reference_image method. + result = client.get_reference_image request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb index a387daecbd0d..1bfbc5c56f66 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb @@ -19,22 +19,28 @@ # [START vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#import_product_sets +# +def import_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new -# Call the import_product_sets method. -result = client.import_product_sets request + # Call the import_product_sets method. + result = client.import_product_sets request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb index 2d1117941cbc..3033a375534a 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb @@ -19,21 +19,27 @@ # [START vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_product_sets +# +def list_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new -# Call the list_product_sets method. -result = client.list_product_sets request + # Call the list_product_sets method. + result = client.list_product_sets request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ProductSet. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ProductSet. + p response + end end # [END vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb index 10a852e8fb85..3b6e2009373c 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb @@ -19,21 +19,27 @@ # [START vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new -# Call the list_products method. -result = client.list_products request + # Call the list_products method. + result = client.list_products request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product. + p response + end end # [END vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb index 8c2b1c57ddba..e3e1c3f5e69d 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb @@ -19,21 +19,27 @@ # [START vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set +# +def list_products_in_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new -# Call the list_products_in_product_set method. -result = client.list_products_in_product_set request + # Call the list_products_in_product_set method. + result = client.list_products_in_product_set request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p4beta1::Product. + p response + end end # [END vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb index 75de054ee57a..e6a54c1459c5 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb @@ -19,21 +19,27 @@ # [START vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_reference_images +# +def list_reference_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new -# Call the list_reference_images method. -result = client.list_reference_images request + # Call the list_reference_images method. + result = client.list_reference_images request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ReferenceImage. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Vision::V1p4beta1::ReferenceImage. + p response + end end # [END vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb index b6c4d1401cc6..bb9558d42d9d 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb @@ -19,22 +19,28 @@ # [START vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#purge_products +# +def purge_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new -# Call the purge_products method. -result = client.purge_products request + # Call the purge_products method. + result = client.purge_products request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb index de80a3165b4a..5a56c1cc5c6e 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set +# +def remove_product_from_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new -# Call the remove_product_from_product_set method. -result = client.remove_product_from_product_set request + # Call the remove_product_from_product_set method. + result = client.remove_product_from_product_set request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb index a6da12902614..729c6a0dc4da 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new -# Call the update_product method. -result = client.update_product request + # Call the update_product method. + result = client.update_product request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb b/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb index 7eab3dc07365..2578b83ade56 100755 --- a/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb +++ b/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb @@ -19,15 +19,21 @@ # [START vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] require "google/cloud/vision/v1p4beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product_set +# +def update_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new -# Call the update_product_set method. -result = client.update_product_set request + # Call the update_product_set method. + result = client.update_product_set request -# The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. -p result + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end # [END vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json b/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json index f3ec10528485..e58db9911433 100644 --- a/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json +++ b/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-vm_migration-v1/.rubocop.yml b/google-cloud-vm_migration-v1/.rubocop.yml index 0cf2baf35a4c..ed368c04ab68 100755 --- a/google-cloud-vm_migration-v1/.rubocop.yml +++ b/google-cloud-vm_migration-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-vm_migration-v1.rb" diff --git a/google-cloud-vm_migration-v1/snippets/Gemfile b/google-cloud-vm_migration-v1/snippets/Gemfile index 243429462542..979afe6738c0 100755 --- a/google-cloud-vm_migration-v1/snippets/Gemfile +++ b/google-cloud-vm_migration-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json b/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json index c3e2d06e28fc..0245a730c95c 100644 --- a/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json +++ b/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -966,7 +966,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1006,7 +1006,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1046,7 +1046,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1086,7 +1086,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1126,7 +1126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1166,7 +1166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1206,7 +1206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1246,7 +1246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1286,7 +1286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1326,7 +1326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1366,7 +1366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1406,7 +1406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1446,7 +1446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1486,7 +1486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1526,7 +1526,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1566,7 +1566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1606,7 +1606,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -1646,7 +1646,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -1686,7 +1686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1726,7 +1726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -1766,7 +1766,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb index e6ebbd892645..a4ac40b222ec 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#add_group_migration +# +def add_group_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new -# Call the add_group_migration method. -result = client.add_group_migration request + # Call the add_group_migration method. + result = client.add_group_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb index b7a0ea4d05bb..2396ad50d26c 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_clone_job +# +def cancel_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new -# Call the cancel_clone_job method. -result = client.cancel_clone_job request + # Call the cancel_clone_job method. + result = client.cancel_clone_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb index 3250804dac84..62580fcb9cbc 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_cutover_job +# +def cancel_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new -# Call the cancel_cutover_job method. -result = client.cancel_cutover_job request + # Call the cancel_cutover_job method. + result = client.cancel_cutover_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb index 8061d3614fcf..d63bcc339271 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_clone_job +# +def create_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new -# Call the create_clone_job method. -result = client.create_clone_job request + # Call the create_clone_job method. + result = client.create_clone_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb index 792de4f8a208..7534c7873c95 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_cutover_job +# +def create_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new -# Call the create_cutover_job method. -result = client.create_cutover_job request + # Call the create_cutover_job method. + result = client.create_cutover_job request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb index 530dad326dcf..8f63114f6950 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_datacenter_connector +# +def create_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new -# Call the create_datacenter_connector method. -result = client.create_datacenter_connector request + # Call the create_datacenter_connector method. + result = client.create_datacenter_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb index 5cd5cb8758ed..87c84dc760ac 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateGroup_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_group +# +def create_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new -# Call the create_group method. -result = client.create_group request + # Call the create_group method. + result = client.create_group request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateGroup_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb index 75a7c36bf872..3301658e15e1 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_migrating_vm +# +def create_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new -# Call the create_migrating_vm method. -result = client.create_migrating_vm request + # Call the create_migrating_vm method. + result = client.create_migrating_vm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb index 90c9b9c7b706..285ce8c7b534 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateSource_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_source +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new -# Call the create_source method. -result = client.create_source request + # Call the create_source method. + result = client.create_source request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateSource_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb index fb2571c136b1..6dc97bb6590f 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_target_project +# +def create_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new -# Call the create_target_project method. -result = client.create_target_project request + # Call the create_target_project method. + result = client.create_target_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb index fce4802e0219..2987e5206162 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#create_utilization_report +# +def create_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new -# Call the create_utilization_report method. -result = client.create_utilization_report request + # Call the create_utilization_report method. + result = client.create_utilization_report request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb index 83e7aa5a4b48..74fefe8058a0 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_datacenter_connector +# +def delete_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new -# Call the delete_datacenter_connector method. -result = client.delete_datacenter_connector request + # Call the delete_datacenter_connector method. + result = client.delete_datacenter_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb index 09ed2433ec67..e719f4168936 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteGroup_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_group +# +def delete_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new -# Call the delete_group method. -result = client.delete_group request + # Call the delete_group method. + result = client.delete_group request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteGroup_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb index e1168702487e..359c330a0434 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_migrating_vm +# +def delete_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new -# Call the delete_migrating_vm method. -result = client.delete_migrating_vm request + # Call the delete_migrating_vm method. + result = client.delete_migrating_vm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb index 1733878ab5f7..9b975137abf8 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteSource_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_source +# +def delete_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new -# Call the delete_source method. -result = client.delete_source request + # Call the delete_source method. + result = client.delete_source request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteSource_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb index ff75e1eb16ff..e42722281c68 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_target_project +# +def delete_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new -# Call the delete_target_project method. -result = client.delete_target_project request + # Call the delete_target_project method. + result = client.delete_target_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb index 21286bc4e605..8a16623a118b 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#delete_utilization_report +# +def delete_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new -# Call the delete_utilization_report method. -result = client.delete_utilization_report request + # Call the delete_utilization_report method. + result = client.delete_utilization_report request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb index aa36ba3a0efe..13990743dea6 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_FetchInventory_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory +# +def fetch_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new -# Call the fetch_inventory method. -result = client.fetch_inventory request + # Call the fetch_inventory method. + result = client.fetch_inventory request -# The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. + p result +end # [END vmmigration_v1_generated_VMMigration_FetchInventory_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb index bc3cc22cbce3..e1183d04fd57 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#finalize_migration +# +def finalize_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new -# Call the finalize_migration method. -result = client.finalize_migration request + # Call the finalize_migration method. + result = client.finalize_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb index ee5622094f4b..8969e971ed24 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetCloneJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_clone_job +# +def get_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new -# Call the get_clone_job method. -result = client.get_clone_job request + # Call the get_clone_job method. + result = client.get_clone_job request -# The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. + p result +end # [END vmmigration_v1_generated_VMMigration_GetCloneJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb index a2e604202191..a5a15fd1e906 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_cutover_job +# +def get_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new -# Call the get_cutover_job method. -result = client.get_cutover_job request + # Call the get_cutover_job method. + result = client.get_cutover_job request -# The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. + p result +end # [END vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb index ca7a241e54d9..8c89058717f3 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_datacenter_connector +# +def get_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new -# Call the get_datacenter_connector method. -result = client.get_datacenter_connector request + # Call the get_datacenter_connector method. + result = client.get_datacenter_connector request -# The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. + p result +end # [END vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb index c2a6cbba6159..2795cd9c4edb 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetGroup_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_group +# +def get_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetGroupRequest.new -# Call the get_group method. -result = client.get_group request + # Call the get_group method. + result = client.get_group request -# The returned object is of type Google::Cloud::VMMigration::V1::Group. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::Group. + p result +end # [END vmmigration_v1_generated_VMMigration_GetGroup_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb index 3e343c2b6d2b..a93d1b4a3a5e 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_migrating_vm +# +def get_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new -# Call the get_migrating_vm method. -result = client.get_migrating_vm request + # Call the get_migrating_vm method. + result = client.get_migrating_vm request -# The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. + p result +end # [END vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb index 84a9834dc254..5c1f79b7712e 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetSource_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_source +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetSourceRequest.new -# Call the get_source method. -result = client.get_source request + # Call the get_source method. + result = client.get_source request -# The returned object is of type Google::Cloud::VMMigration::V1::Source. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::Source. + p result +end # [END vmmigration_v1_generated_VMMigration_GetSource_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb index 2a0c5f887a57..7f0c713285e7 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetTargetProject_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_target_project +# +def get_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new -# Call the get_target_project method. -result = client.get_target_project request + # Call the get_target_project method. + result = client.get_target_project request -# The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. + p result +end # [END vmmigration_v1_generated_VMMigration_GetTargetProject_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb index eb327f2feb6c..2c27e4dc2d04 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb @@ -19,15 +19,21 @@ # [START vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#get_utilization_report +# +def get_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new -# Call the get_utilization_report method. -result = client.get_utilization_report request + # Call the get_utilization_report method. + result = client.get_utilization_report request -# The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. -p result + # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. + p result +end # [END vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb index 5e9184930c13..57c8f1513559 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_clone_jobs +# +def list_clone_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new -# Call the list_clone_jobs method. -result = client.list_clone_jobs request + # Call the list_clone_jobs method. + result = client.list_clone_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::CloneJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::CloneJob. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb index 9d0e10db2d06..8151df196277 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_cutover_jobs +# +def list_cutover_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new -# Call the list_cutover_jobs method. -result = client.list_cutover_jobs request + # Call the list_cutover_jobs method. + result = client.list_cutover_jobs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::CutoverJob. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::CutoverJob. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb index 65fdcc319ffd..a657a7fb33fd 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_datacenter_connectors +# +def list_datacenter_connectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new -# Call the list_datacenter_connectors method. -result = client.list_datacenter_connectors request + # Call the list_datacenter_connectors method. + result = client.list_datacenter_connectors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::DatacenterConnector. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::DatacenterConnector. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb index be964632caa6..2b8720cccf4e 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListGroups_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_groups +# +def list_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new -# Call the list_groups method. -result = client.list_groups request + # Call the list_groups method. + result = client.list_groups request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::Group. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::Group. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListGroups_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb index 81c7cae4c85a..2df8822494b2 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_migrating_vms +# +def list_migrating_vms + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new -# Call the list_migrating_vms method. -result = client.list_migrating_vms request + # Call the list_migrating_vms method. + result = client.list_migrating_vms request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::MigratingVm. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::MigratingVm. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb index d956dccdcb80..0de3bfaee52f 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListSources_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_sources +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new -# Call the list_sources method. -result = client.list_sources request + # Call the list_sources method. + result = client.list_sources request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::Source. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::Source. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListSources_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb index b98872b36c15..b715881bfabb 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_target_projects +# +def list_target_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new -# Call the list_target_projects method. -result = client.list_target_projects request + # Call the list_target_projects method. + result = client.list_target_projects request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::TargetProject. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::TargetProject. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb index 0611818fa761..9e9d31987a4a 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb @@ -19,21 +19,27 @@ # [START vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#list_utilization_reports +# +def list_utilization_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new -# Call the list_utilization_reports method. -result = client.list_utilization_reports request + # Call the list_utilization_reports method. + result = client.list_utilization_reports request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VMMigration::V1::UtilizationReport. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VMMigration::V1::UtilizationReport. + p response + end end # [END vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb index 51babfd98092..95fb37a8303e 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_PauseMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#pause_migration +# +def pause_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new -# Call the pause_migration method. -result = client.pause_migration request + # Call the pause_migration method. + result = client.pause_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_PauseMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb index b53fc3db9944..6a534716c4eb 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#remove_group_migration +# +def remove_group_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new -# Call the remove_group_migration method. -result = client.remove_group_migration request + # Call the remove_group_migration method. + result = client.remove_group_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb index 056a620ae3a8..86ae1a2f2785 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_ResumeMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#resume_migration +# +def resume_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new -# Call the resume_migration method. -result = client.resume_migration request + # Call the resume_migration method. + result = client.resume_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_ResumeMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb index 27b48925cbca..1af03942b463 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_StartMigration_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#start_migration +# +def start_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new -# Call the start_migration method. -result = client.start_migration request + # Call the start_migration method. + result = client.start_migration request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_StartMigration_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb index adf1bc676c7e..acc72c3a474c 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_UpdateGroup_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#update_group +# +def update_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new -# Call the update_group method. -result = client.update_group request + # Call the update_group method. + result = client.update_group request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_UpdateGroup_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb index 06c7d5a25b1c..413096f41e2b 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#update_migrating_vm +# +def update_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new -# Call the update_migrating_vm method. -result = client.update_migrating_vm request + # Call the update_migrating_vm method. + result = client.update_migrating_vm request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb index e0a30a7d762c..daf94401d898 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_UpdateSource_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#update_source +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new -# Call the update_source method. -result = client.update_source request + # Call the update_source method. + result = client.update_source request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_UpdateSource_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb index 65eee4ef73ba..2f55d859c834 100755 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#update_target_project +# +def update_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new -# Call the update_target_project method. -result = client.update_target_project request + # Call the update_target_project method. + result = client.update_target_project request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] diff --git a/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb b/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb index 1499944a06a1..8f4610a6f31d 100644 --- a/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb +++ b/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb @@ -19,22 +19,28 @@ # [START vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] require "google/cloud/vm_migration/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VMMigration::V1::VMMigration::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VMMigration::V1::VMMigration::Client#upgrade_appliance +# +def upgrade_appliance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new -# Call the upgrade_appliance method. -result = client.upgrade_appliance request + # Call the upgrade_appliance method. + result = client.upgrade_appliance request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] diff --git a/google-cloud-vpc_access-v1/.rubocop.yml b/google-cloud-vpc_access-v1/.rubocop.yml index 0bdcc037da25..5d9ab3a8534f 100644 --- a/google-cloud-vpc_access-v1/.rubocop.yml +++ b/google-cloud-vpc_access-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-vpc_access-v1.rb" diff --git a/google-cloud-vpc_access-v1/snippets/Gemfile b/google-cloud-vpc_access-v1/snippets/Gemfile index 00b4a0c4c7c1..408703aab87c 100755 --- a/google-cloud-vpc_access-v1/snippets/Gemfile +++ b/google-cloud-vpc_access-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json b/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json index dc5990bdb47c..bd1e06e983b2 100644 --- a/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json +++ b/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb b/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb index 9555097844c6..098814eac991 100755 --- a/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb +++ b/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb @@ -19,22 +19,28 @@ # [START vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] require "google/cloud/vpc_access/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VpcAccess::V1::VpcAccessService::Client#create_connector +# +def create_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new -# Call the create_connector method. -result = client.create_connector request + # Call the create_connector method. + result = client.create_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] diff --git a/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb b/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb index b113ee07cee5..c30bef02b7a3 100755 --- a/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb +++ b/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb @@ -19,22 +19,28 @@ # [START vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] require "google/cloud/vpc_access/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VpcAccess::V1::VpcAccessService::Client#delete_connector +# +def delete_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new -# Call the delete_connector method. -result = client.delete_connector request + # Call the delete_connector method. + result = client.delete_connector request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] diff --git a/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb b/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb index da6161d076b3..033438c92c3a 100755 --- a/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb +++ b/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb @@ -19,15 +19,21 @@ # [START vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] require "google/cloud/vpc_access/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VpcAccess::V1::VpcAccessService::Client#get_connector +# +def get_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new -# Call the get_connector method. -result = client.get_connector request + # Call the get_connector method. + result = client.get_connector request -# The returned object is of type Google::Cloud::VpcAccess::V1::Connector. -p result + # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. + p result +end # [END vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] diff --git a/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb b/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb index 44a83654e6b0..3368c5cf5269 100755 --- a/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb +++ b/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb @@ -19,21 +19,27 @@ # [START vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] require "google/cloud/vpc_access/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::VpcAccess::V1::VpcAccessService::Client#list_connectors +# +def list_connectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new -# Call the list_connectors method. -result = client.list_connectors request + # Call the list_connectors method. + result = client.list_connectors request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::VpcAccess::V1::Connector. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::VpcAccess::V1::Connector. + p response + end end # [END vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] diff --git a/google-cloud-web_risk-v1/.rubocop.yml b/google-cloud-web_risk-v1/.rubocop.yml index 80fd8ff38b4e..8f9201883964 100644 --- a/google-cloud-web_risk-v1/.rubocop.yml +++ b/google-cloud-web_risk-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-web_risk-v1.rb" diff --git a/google-cloud-web_risk-v1/snippets/Gemfile b/google-cloud-web_risk-v1/snippets/Gemfile index d8d36015738d..7117c9b077ed 100755 --- a/google-cloud-web_risk-v1/snippets/Gemfile +++ b/google-cloud-web_risk-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json b/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json index a1344c90ba94..19d7176933bf 100644 --- a/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json +++ b/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb b/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb index b6b51c6fb5b2..8be24f3fd068 100755 --- a/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb +++ b/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb @@ -19,15 +19,21 @@ # [START webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] require "google/cloud/web_risk/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff +# +def compute_threat_list_diff + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new -# Call the compute_threat_list_diff method. -result = client.compute_threat_list_diff request + # Call the compute_threat_list_diff method. + result = client.compute_threat_list_diff request -# The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. + p result +end # [END webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb b/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb index 4cca2bb877f9..ffb15b18a4b3 100755 --- a/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb +++ b/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb @@ -19,15 +19,21 @@ # [START webrisk_v1_generated_WebRiskService_CreateSubmission_sync] require "google/cloud/web_risk/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1::WebRiskService::Client#create_submission +# +def create_submission + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new -# Call the create_submission method. -result = client.create_submission request + # Call the create_submission method. + result = client.create_submission request -# The returned object is of type Google::Cloud::WebRisk::V1::Submission. -p result + # The returned object is of type Google::Cloud::WebRisk::V1::Submission. + p result +end # [END webrisk_v1_generated_WebRiskService_CreateSubmission_sync] diff --git a/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb b/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb index 5ad79baff160..536895f97247 100755 --- a/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb +++ b/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb @@ -19,15 +19,21 @@ # [START webrisk_v1_generated_WebRiskService_SearchHashes_sync] require "google/cloud/web_risk/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1::WebRiskService::Client#search_hashes +# +def search_hashes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new -# Call the search_hashes method. -result = client.search_hashes request + # Call the search_hashes method. + result = client.search_hashes request -# The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. + p result +end # [END webrisk_v1_generated_WebRiskService_SearchHashes_sync] diff --git a/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb b/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb index 3fbb997b33e4..44cc6d597fbb 100755 --- a/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb +++ b/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb @@ -19,15 +19,21 @@ # [START webrisk_v1_generated_WebRiskService_SearchUris_sync] require "google/cloud/web_risk/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1::WebRiskService::Client#search_uris +# +def search_uris + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new -# Call the search_uris method. -result = client.search_uris request + # Call the search_uris method. + result = client.search_uris request -# The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. + p result +end # [END webrisk_v1_generated_WebRiskService_SearchUris_sync] diff --git a/google-cloud-web_risk-v1beta1/.rubocop.yml b/google-cloud-web_risk-v1beta1/.rubocop.yml index ee34ec8d8a32..259ed15aa523 100644 --- a/google-cloud-web_risk-v1beta1/.rubocop.yml +++ b/google-cloud-web_risk-v1beta1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-web_risk-v1beta1.rb" diff --git a/google-cloud-web_risk-v1beta1/snippets/Gemfile b/google-cloud-web_risk-v1beta1/snippets/Gemfile index f85413cd2235..695740dd7c78 100755 --- a/google-cloud-web_risk-v1beta1/snippets/Gemfile +++ b/google-cloud-web_risk-v1beta1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json b/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json index 93e9fb731e25..a790c281fd7d 100644 --- a/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json +++ b/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb index 3a287091d189..59a74cd9cde4 100755 --- a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb +++ b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb @@ -19,15 +19,21 @@ # [START webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] require "google/cloud/web_risk/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff +# +def compute_threat_list_diff + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new -# Call the compute_threat_list_diff method. -result = client.compute_threat_list_diff request + # Call the compute_threat_list_diff method. + result = client.compute_threat_list_diff request -# The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. + p result +end # [END webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb index 775f82a13351..c19b83d090c7 100755 --- a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb +++ b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb @@ -19,15 +19,21 @@ # [START webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] require "google/cloud/web_risk/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_hashes +# +def search_hashes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new -# Call the search_hashes method. -result = client.search_hashes request + # Call the search_hashes method. + result = client.search_hashes request -# The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. + p result +end # [END webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] diff --git a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb index 293d1d14353a..853b7f08057f 100755 --- a/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb +++ b/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb @@ -19,15 +19,21 @@ # [START webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] require "google/cloud/web_risk/v1beta1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_uris +# +def search_uris + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new -# Call the search_uris method. -result = client.search_uris request + # Call the search_uris method. + result = client.search_uris request -# The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. -p result + # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. + p result +end # [END webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] diff --git a/google-cloud-web_security_scanner-v1/.rubocop.yml b/google-cloud-web_security_scanner-v1/.rubocop.yml index 3fe7d4ee1878..d1aa57a60d61 100644 --- a/google-cloud-web_security_scanner-v1/.rubocop.yml +++ b/google-cloud-web_security_scanner-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-web_security_scanner-v1.rb" diff --git a/google-cloud-web_security_scanner-v1/snippets/Gemfile b/google-cloud-web_security_scanner-v1/snippets/Gemfile index e8dfd272fab8..7568b9dd0531 100755 --- a/google-cloud-web_security_scanner-v1/snippets/Gemfile +++ b/google-cloud-web_security_scanner-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json b/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json index 6c1a85d77252..0e380b355740 100644 --- a/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json +++ b/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb index 1122fef60834..2f51383b1d95 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config +# +def create_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new -# Call the create_scan_config method. -result = client.create_scan_config request + # Call the create_scan_config method. + result = client.create_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb index a301b07d3ce3..e154eacf6b49 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config +# +def delete_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new -# Call the delete_scan_config method. -result = client.delete_scan_config request + # Call the delete_scan_config method. + result = client.delete_scan_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb index 15d8967cf904..6b414c51e497 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding +# +def get_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new -# Call the get_finding method. -result = client.get_finding request + # Call the get_finding method. + result = client.get_finding request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb index 379c0c143edd..67c2293b3cb5 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config +# +def get_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new -# Call the get_scan_config method. -result = client.get_scan_config request + # Call the get_scan_config method. + result = client.get_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb index 2c7e31ada97d..c1a769df449d 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run +# +def get_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new -# Call the get_scan_run method. -result = client.get_scan_run request + # Call the get_scan_run method. + result = client.get_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb index 5941194020ed..96c2bd2df080 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls +# +def list_crawled_urls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new -# Call the list_crawled_urls method. -result = client.list_crawled_urls request + # Call the list_crawled_urls method. + result = client.list_crawled_urls request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::CrawledUrl. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::CrawledUrl. + p response + end end # [END websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb index a140e6d56bad..8e66b5d07b27 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats +# +def list_finding_type_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new -# Call the list_finding_type_stats method. -result = client.list_finding_type_stats request + # Call the list_finding_type_stats method. + result = client.list_finding_type_stats request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb index 4287076cde02..27258565512a 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new -# Call the list_findings method. -result = client.list_findings request + # Call the list_findings method. + result = client.list_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::Finding. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::Finding. + p response + end end # [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb index f85350e0ab7a..a254bfde6a00 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs +# +def list_scan_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new -# Call the list_scan_configs method. -result = client.list_scan_configs request + # Call the list_scan_configs method. + result = client.list_scan_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p response + end end # [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb index faa51c22c2f2..102b998b3480 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs +# +def list_scan_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new -# Call the list_scan_runs method. -result = client.list_scan_runs request + # Call the list_scan_runs method. + result = client.list_scan_runs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanRun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1::ScanRun. + p response + end end # [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb index 406e085baa8a..d0130b36f841 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run +# +def start_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new -# Call the start_scan_run method. -result = client.start_scan_run request + # Call the start_scan_run method. + result = client.start_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb index 716b1af396de..15dae045eaf6 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run +# +def stop_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new -# Call the stop_scan_run method. -result = client.stop_scan_run request + # Call the stop_scan_run method. + result = client.stop_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb index fc0ecd21d118..6f04ce2929d7 100755 --- a/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb +++ b/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] require "google/cloud/web_security_scanner/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config +# +def update_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new -# Call the update_scan_config method. -result = client.update_scan_config request + # Call the update_scan_config method. + result = client.update_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end # [END websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1beta/.rubocop.yml b/google-cloud-web_security_scanner-v1beta/.rubocop.yml index 2ec4a145abbd..e051a212551a 100644 --- a/google-cloud-web_security_scanner-v1beta/.rubocop.yml +++ b/google-cloud-web_security_scanner-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-web_security_scanner-v1beta.rb" diff --git a/google-cloud-web_security_scanner-v1beta/snippets/Gemfile b/google-cloud-web_security_scanner-v1beta/snippets/Gemfile index dc7f2f2123b0..b18c6577579e 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/Gemfile +++ b/google-cloud-web_security_scanner-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json b/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json index 315ee2162f9e..865e72e63b84 100644 --- a/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json +++ b/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb index a22c9163269d..193fd338aa60 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config +# +def create_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new -# Call the create_scan_config method. -result = client.create_scan_config request + # Call the create_scan_config method. + result = client.create_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb index 23d1a7ae9789..ec7bc3e18c6c 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config +# +def delete_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new -# Call the delete_scan_config method. -result = client.delete_scan_config request + # Call the delete_scan_config method. + result = client.delete_scan_config request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb index 1ccd273e0aae..baaaec7f0e5f 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding +# +def get_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new -# Call the get_finding method. -result = client.get_finding request + # Call the get_finding method. + result = client.get_finding request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb index 6228a4c95286..b3def02ebb54 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config +# +def get_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new -# Call the get_scan_config method. -result = client.get_scan_config request + # Call the get_scan_config method. + result = client.get_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb index c72d8725ef18..3e1e2267b171 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run +# +def get_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new -# Call the get_scan_run method. -result = client.get_scan_run request + # Call the get_scan_run method. + result = client.get_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb index 3f69cbe6d013..b628427a4f1b 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls +# +def list_crawled_urls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new -# Call the list_crawled_urls method. -result = client.list_crawled_urls request + # Call the list_crawled_urls method. + result = client.list_crawled_urls request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl. + p response + end end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb index 08099ce493c2..b8e12a8c3749 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats +# +def list_finding_type_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new -# Call the list_finding_type_stats method. -result = client.list_finding_type_stats request + # Call the list_finding_type_stats method. + result = client.list_finding_type_stats request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb index ffa57c91e12f..04b7713aa0b1 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new -# Call the list_findings method. -result = client.list_findings request + # Call the list_findings method. + result = client.list_findings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::Finding. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::Finding. + p response + end end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb index bf5b02317d75..188e8b7ede3b 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs +# +def list_scan_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new -# Call the list_scan_configs method. -result = client.list_scan_configs request + # Call the list_scan_configs method. + result = client.list_scan_configs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p response + end end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb index 71a2d70a0798..b1c2c7de6968 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb @@ -19,21 +19,27 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs +# +def list_scan_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new -# Call the list_scan_runs method. -result = client.list_scan_runs request + # Call the list_scan_runs method. + result = client.list_scan_runs request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p response + end end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb index 2b718db984b3..67ac91ac1a0f 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run +# +def start_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new -# Call the start_scan_run method. -result = client.start_scan_run request + # Call the start_scan_run method. + result = client.start_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb index f3ef0839ffdb..bf823bcb789c 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run +# +def stop_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new -# Call the stop_scan_run method. -result = client.stop_scan_run request + # Call the stop_scan_run method. + result = client.stop_scan_run request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb index 6b77434a43dc..78722436e7aa 100755 --- a/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb +++ b/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb @@ -19,15 +19,21 @@ # [START websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] require "google/cloud/web_security_scanner/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config +# +def update_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new -# Call the update_scan_config method. -result = client.update_scan_config request + # Call the update_scan_config method. + result = client.update_scan_config request -# The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. -p result + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end # [END websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/google-cloud-workflows-executions-v1/.rubocop.yml b/google-cloud-workflows-executions-v1/.rubocop.yml index 2c36645edc38..ba04c515e3d9 100644 --- a/google-cloud-workflows-executions-v1/.rubocop.yml +++ b/google-cloud-workflows-executions-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-workflows-executions-v1.rb" diff --git a/google-cloud-workflows-executions-v1/snippets/Gemfile b/google-cloud-workflows-executions-v1/snippets/Gemfile index 52fc3132aa3a..2d8cda0be363 100755 --- a/google-cloud-workflows-executions-v1/snippets/Gemfile +++ b/google-cloud-workflows-executions-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb b/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb index a299491769cd..5104567b0bf3 100755 --- a/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb +++ b/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1_generated_Executions_CancelExecution_sync] require "google/cloud/workflows/executions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution +# +def cancel_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new -# Call the cancel_execution method. -result = client.cancel_execution request + # Call the cancel_execution method. + result = client.cancel_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end # [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb b/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb index 2f249a53a4e5..422cb58e1c06 100755 --- a/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb +++ b/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1_generated_Executions_CreateExecution_sync] require "google/cloud/workflows/executions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new -# Call the create_execution method. -result = client.create_execution request + # Call the create_execution method. + result = client.create_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end # [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb b/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb index 33739f72e240..f846a7389e65 100755 --- a/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb +++ b/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1_generated_Executions_GetExecution_sync] require "google/cloud/workflows/executions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new -# Call the get_execution method. -result = client.get_execution request + # Call the get_execution method. + result = client.get_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end # [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb b/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb index 2cdabb10b4b1..c3ef76e897e0 100755 --- a/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb +++ b/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb @@ -19,21 +19,27 @@ # [START workflowexecutions_v1_generated_Executions_ListExecutions_sync] require "google/cloud/workflows/executions/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new -# Call the list_executions method. -result = client.list_executions request + # Call the list_executions method. + result = client.list_executions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Workflows::Executions::V1::Execution. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Workflows::Executions::V1::Execution. + p response + end end # [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json b/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json index 275056c9849d..08380fe15aba 100644 --- a/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json +++ b/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-workflows-executions-v1beta/.rubocop.yml b/google-cloud-workflows-executions-v1beta/.rubocop.yml index aadd50a99249..307c124f8568 100644 --- a/google-cloud-workflows-executions-v1beta/.rubocop.yml +++ b/google-cloud-workflows-executions-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-workflows-executions-v1beta.rb" diff --git a/google-cloud-workflows-executions-v1beta/snippets/Gemfile b/google-cloud-workflows-executions-v1beta/snippets/Gemfile index 7ea0b55a5b7c..68e763424279 100755 --- a/google-cloud-workflows-executions-v1beta/snippets/Gemfile +++ b/google-cloud-workflows-executions-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb b/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb index dd31604ba771..e2b988cc4832 100755 --- a/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb +++ b/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] require "google/cloud/workflows/executions/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution +# +def cancel_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new -# Call the cancel_execution method. -result = client.cancel_execution request + # Call the cancel_execution method. + result = client.cancel_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end # [END workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] diff --git a/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb b/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb index dce319664b8e..2647f7079d96 100755 --- a/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb +++ b/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] require "google/cloud/workflows/executions/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new -# Call the create_execution method. -result = client.create_execution request + # Call the create_execution method. + result = client.create_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end # [END workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] diff --git a/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb b/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb index 9d81469e81bd..767c2c790db8 100755 --- a/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb +++ b/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb @@ -19,15 +19,21 @@ # [START workflowexecutions_v1beta_generated_Executions_GetExecution_sync] require "google/cloud/workflows/executions/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new -# Call the get_execution method. -result = client.get_execution request + # Call the get_execution method. + result = client.get_execution request -# The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. -p result + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end # [END workflowexecutions_v1beta_generated_Executions_GetExecution_sync] diff --git a/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb b/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb index eb265208ccf0..8f1e82bb1536 100755 --- a/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb +++ b/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb @@ -19,21 +19,27 @@ # [START workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] require "google/cloud/workflows/executions/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new -# Call the list_executions method. -result = client.list_executions request + # Call the list_executions method. + result = client.list_executions request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Workflows::Executions::V1beta::Execution. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Workflows::Executions::V1beta::Execution. + p response + end end # [END workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] diff --git a/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json b/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json index effc22993630..ff16574c2b83 100644 --- a/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json +++ b/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-cloud-workflows-v1/.rubocop.yml b/google-cloud-workflows-v1/.rubocop.yml index 18f9caa0d824..f3347d525c00 100644 --- a/google-cloud-workflows-v1/.rubocop.yml +++ b/google-cloud-workflows-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-workflows-v1.rb" diff --git a/google-cloud-workflows-v1/snippets/Gemfile b/google-cloud-workflows-v1/snippets/Gemfile index bd548483f6c2..0b27239ffd9b 100755 --- a/google-cloud-workflows-v1/snippets/Gemfile +++ b/google-cloud-workflows-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json b/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json index 420954838161..96e383e5d88f 100644 --- a/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json +++ b/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb b/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb index 686de025d971..1a11b6fbb5b9 100755 --- a/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb +++ b/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1_generated_Workflows_CreateWorkflow_sync] require "google/cloud/workflows/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1::Workflows::Client#create_workflow +# +def create_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new -# Call the create_workflow method. -result = client.create_workflow request + # Call the create_workflow method. + result = client.create_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1_generated_Workflows_CreateWorkflow_sync] diff --git a/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb b/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb index 34d8a785e675..1db086b33881 100755 --- a/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb +++ b/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1_generated_Workflows_DeleteWorkflow_sync] require "google/cloud/workflows/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow +# +def delete_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new -# Call the delete_workflow method. -result = client.delete_workflow request + # Call the delete_workflow method. + result = client.delete_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1_generated_Workflows_DeleteWorkflow_sync] diff --git a/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb b/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb index cefc63dab741..f9ae19397d51 100755 --- a/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb +++ b/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb @@ -19,15 +19,21 @@ # [START workflows_v1_generated_Workflows_GetWorkflow_sync] require "google/cloud/workflows/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1::Workflows::Client#get_workflow +# +def get_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new -# Call the get_workflow method. -result = client.get_workflow request + # Call the get_workflow method. + result = client.get_workflow request -# The returned object is of type Google::Cloud::Workflows::V1::Workflow. -p result + # The returned object is of type Google::Cloud::Workflows::V1::Workflow. + p result +end # [END workflows_v1_generated_Workflows_GetWorkflow_sync] diff --git a/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb b/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb index 2ed3f856e76d..cb99e7bbfa5e 100755 --- a/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb +++ b/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb @@ -19,21 +19,27 @@ # [START workflows_v1_generated_Workflows_ListWorkflows_sync] require "google/cloud/workflows/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1::Workflows::Client#list_workflows +# +def list_workflows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new -# Call the list_workflows method. -result = client.list_workflows request + # Call the list_workflows method. + result = client.list_workflows request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Workflows::V1::Workflow. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Workflows::V1::Workflow. + p response + end end # [END workflows_v1_generated_Workflows_ListWorkflows_sync] diff --git a/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb b/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb index bb66b46a0581..71bab2f0df46 100755 --- a/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb +++ b/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1_generated_Workflows_UpdateWorkflow_sync] require "google/cloud/workflows/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1::Workflows::Client#update_workflow +# +def update_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new -# Call the update_workflow method. -result = client.update_workflow request + # Call the update_workflow method. + result = client.update_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1_generated_Workflows_UpdateWorkflow_sync] diff --git a/google-cloud-workflows-v1beta/.rubocop.yml b/google-cloud-workflows-v1beta/.rubocop.yml index 28d61c6df30c..40c98f2b2441 100644 --- a/google-cloud-workflows-v1beta/.rubocop.yml +++ b/google-cloud-workflows-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-cloud-workflows-v1beta.rb" diff --git a/google-cloud-workflows-v1beta/snippets/Gemfile b/google-cloud-workflows-v1beta/snippets/Gemfile index 6a26f232f05a..7536575cc565 100755 --- a/google-cloud-workflows-v1beta/snippets/Gemfile +++ b/google-cloud-workflows-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json b/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json index 00d5ce80f6f1..50cc47937d68 100644 --- a/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json +++ b/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb b/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb index e6d1c2e3369c..88e3179ee9dc 100755 --- a/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb +++ b/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1beta_generated_Workflows_CreateWorkflow_sync] require "google/cloud/workflows/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1beta::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow +# +def create_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new -# Call the create_workflow method. -result = client.create_workflow request + # Call the create_workflow method. + result = client.create_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1beta_generated_Workflows_CreateWorkflow_sync] diff --git a/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb b/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb index 134857fa7b30..8f09e061b7cf 100755 --- a/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb +++ b/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] require "google/cloud/workflows/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1beta::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow +# +def delete_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new -# Call the delete_workflow method. -result = client.delete_workflow request + # Call the delete_workflow method. + result = client.delete_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] diff --git a/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb b/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb index b9328c2c4670..90122b9a757f 100755 --- a/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb +++ b/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb @@ -19,15 +19,21 @@ # [START workflows_v1beta_generated_Workflows_GetWorkflow_sync] require "google/cloud/workflows/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1beta::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow +# +def get_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new -# Call the get_workflow method. -result = client.get_workflow request + # Call the get_workflow method. + result = client.get_workflow request -# The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. -p result + # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. + p result +end # [END workflows_v1beta_generated_Workflows_GetWorkflow_sync] diff --git a/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb b/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb index 4e984cbc3737..c72204b58412 100755 --- a/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb +++ b/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb @@ -19,21 +19,27 @@ # [START workflows_v1beta_generated_Workflows_ListWorkflows_sync] require "google/cloud/workflows/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1beta::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows +# +def list_workflows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new -# Call the list_workflows method. -result = client.list_workflows request + # Call the list_workflows method. + result = client.list_workflows request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Cloud::Workflows::V1beta::Workflow. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Workflows::V1beta::Workflow. + p response + end end # [END workflows_v1beta_generated_Workflows_ListWorkflows_sync] diff --git a/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb b/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb index 953934a1c66c..207dbc613a04 100755 --- a/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb +++ b/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb @@ -19,22 +19,28 @@ # [START workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] require "google/cloud/workflows/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Cloud::Workflows::V1beta::Workflows::Client.new +## +# Example demonstrating basic usage of +# Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow +# +def update_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new -# Call the update_workflow method. -result = client.update_workflow request + # Call the update_workflow method. + result = client.update_workflow request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] diff --git a/google-iam-credentials-v1/.rubocop.yml b/google-iam-credentials-v1/.rubocop.yml index 52ffaeee6e18..9b2a231aba17 100644 --- a/google-iam-credentials-v1/.rubocop.yml +++ b/google-iam-credentials-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-iam-credentials-v1.rb" diff --git a/google-iam-credentials-v1/snippets/Gemfile b/google-iam-credentials-v1/snippets/Gemfile index bd100aba884a..4193d6959cae 100755 --- a/google-iam-credentials-v1/snippets/Gemfile +++ b/google-iam-credentials-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb b/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb index 3354757e3cb9..dd5bb01cf676 100755 --- a/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb +++ b/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb @@ -19,15 +19,21 @@ # [START iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] require "google/iam/credentials/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::Credentials::V1::IAMCredentials::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token +# +def generate_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new -# Call the generate_access_token method. -result = client.generate_access_token request + # Call the generate_access_token method. + result = client.generate_access_token request -# The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. -p result + # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. + p result +end # [END iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] diff --git a/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb b/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb index 9d207ec0f830..cef1203b59ab 100755 --- a/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb +++ b/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb @@ -19,15 +19,21 @@ # [START iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] require "google/iam/credentials/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::Credentials::V1::IAMCredentials::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token +# +def generate_id_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new -# Call the generate_id_token method. -result = client.generate_id_token request + # Call the generate_id_token method. + result = client.generate_id_token request -# The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. -p result + # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. + p result +end # [END iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] diff --git a/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb b/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb index 3ac384cab31c..e63000dcf435 100755 --- a/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb +++ b/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb @@ -19,15 +19,21 @@ # [START iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] require "google/iam/credentials/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::Credentials::V1::IAMCredentials::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::Credentials::V1::IAMCredentials::Client#sign_blob +# +def sign_blob + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::Credentials::V1::SignBlobRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::SignBlobRequest.new -# Call the sign_blob method. -result = client.sign_blob request + # Call the sign_blob method. + result = client.sign_blob request -# The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. -p result + # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. + p result +end # [END iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] diff --git a/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb b/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb index 8d013ea39071..050b592bf466 100755 --- a/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb +++ b/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb @@ -19,15 +19,21 @@ # [START iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] require "google/iam/credentials/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::Credentials::V1::IAMCredentials::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt +# +def sign_jwt + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::Credentials::V1::SignJwtRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::SignJwtRequest.new -# Call the sign_jwt method. -result = client.sign_jwt request + # Call the sign_jwt method. + result = client.sign_jwt request -# The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. -p result + # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. + p result +end # [END iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] diff --git a/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json b/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json index 451e84e6caa3..e966ac00c94a 100644 --- a/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json +++ b/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-iam-v1/.rubocop.yml b/google-iam-v1/.rubocop.yml index 078d122be3ae..b2f162eb67aa 100644 --- a/google-iam-v1/.rubocop.yml +++ b/google-iam-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-iam-v1.rb" diff --git a/google-iam-v1/snippets/Gemfile b/google-iam-v1/snippets/Gemfile index b009a80f2dca..56ec9858b7a9 100644 --- a/google-iam-v1/snippets/Gemfile +++ b/google-iam-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-iam-v1/snippets/iam_policy/get_iam_policy.rb b/google-iam-v1/snippets/iam_policy/get_iam_policy.rb index a0c0201b6b79..bb31ed4b41a8 100644 --- a/google-iam-v1/snippets/iam_policy/get_iam_policy.rb +++ b/google-iam-v1/snippets/iam_policy/get_iam_policy.rb @@ -19,15 +19,21 @@ # [START iam_v1_generated_IAMPolicy_GetIamPolicy_sync] require "google/iam/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1::IAMPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::GetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new -# Call the get_iam_policy method. -result = client.get_iam_policy request + # Call the get_iam_policy method. + result = client.get_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END iam_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/google-iam-v1/snippets/iam_policy/set_iam_policy.rb b/google-iam-v1/snippets/iam_policy/set_iam_policy.rb index db405a6b2a09..c2df172d713e 100644 --- a/google-iam-v1/snippets/iam_policy/set_iam_policy.rb +++ b/google-iam-v1/snippets/iam_policy/set_iam_policy.rb @@ -19,15 +19,21 @@ # [START iam_v1_generated_IAMPolicy_SetIamPolicy_sync] require "google/iam/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1::IAMPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::SetIamPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new -# Call the set_iam_policy method. -result = client.set_iam_policy request + # Call the set_iam_policy method. + result = client.set_iam_policy request -# The returned object is of type Google::Iam::V1::Policy. -p result + # The returned object is of type Google::Iam::V1::Policy. + p result +end # [END iam_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb b/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb index 6474928962f4..eb8e4f5e6eb2 100644 --- a/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb +++ b/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb @@ -19,15 +19,21 @@ # [START iam_v1_generated_IAMPolicy_TestIamPermissions_sync] require "google/iam/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1::IAMPolicy::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1::IAMPolicy::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1::TestIamPermissionsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new -# Call the test_iam_permissions method. -result = client.test_iam_permissions request + # Call the test_iam_permissions method. + result = client.test_iam_permissions request -# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. -p result + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end # [END iam_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json b/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json index 056259abe678..01eb87e281e9 100644 --- a/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json +++ b/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] diff --git a/google-iam-v1beta/.rubocop.yml b/google-iam-v1beta/.rubocop.yml index c8c19857beac..e1301e1a1ab9 100644 --- a/google-iam-v1beta/.rubocop.yml +++ b/google-iam-v1beta/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-iam-v1beta.rb" diff --git a/google-iam-v1beta/snippets/Gemfile b/google-iam-v1beta/snippets/Gemfile index ab3ec7059521..16e8cfc8422e 100755 --- a/google-iam-v1beta/snippets/Gemfile +++ b/google-iam-v1beta/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json b/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json index 2a46cdf5d81d..6da6f77bcd0c 100644 --- a/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json +++ b/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb b/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb index 04471f93068c..e99259d4097e 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool +# +def create_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new -# Call the create_workload_identity_pool method. -result = client.create_workload_identity_pool request + # Call the create_workload_identity_pool method. + result = client.create_workload_identity_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb b/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb index 14c9e54ad830..6385d492b74f 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider +# +def create_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new -# Call the create_workload_identity_pool_provider method. -result = client.create_workload_identity_pool_provider request + # Call the create_workload_identity_pool_provider method. + result = client.create_workload_identity_pool_provider request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb b/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb index 73bb98ad6ddd..f9325d10c196 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool +# +def delete_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new -# Call the delete_workload_identity_pool method. -result = client.delete_workload_identity_pool request + # Call the delete_workload_identity_pool method. + result = client.delete_workload_identity_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb b/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb index d0ed720ee8e9..c03d8fa752fd 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider +# +def delete_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new -# Call the delete_workload_identity_pool_provider method. -result = client.delete_workload_identity_pool_provider request + # Call the delete_workload_identity_pool_provider method. + result = client.delete_workload_identity_pool_provider request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb b/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb index af294ef9bac9..fefdccbc4134 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb @@ -19,15 +19,21 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool +# +def get_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new -# Call the get_workload_identity_pool method. -result = client.get_workload_identity_pool request + # Call the get_workload_identity_pool method. + result = client.get_workload_identity_pool request -# The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. -p result + # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. + p result +end # [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb b/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb index 24e2286541aa..47391d85685c 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb @@ -19,15 +19,21 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider +# +def get_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new -# Call the get_workload_identity_pool_provider method. -result = client.get_workload_identity_pool_provider request + # Call the get_workload_identity_pool_provider method. + result = client.get_workload_identity_pool_provider request -# The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. -p result + # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. + p result +end # [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb b/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb index a2af450a0238..acbfbe2023a0 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb @@ -19,21 +19,27 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers +# +def list_workload_identity_pool_providers + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new -# Call the list_workload_identity_pool_providers method. -result = client.list_workload_identity_pool_providers request + # Call the list_workload_identity_pool_providers method. + result = client.list_workload_identity_pool_providers request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Iam::V1beta::WorkloadIdentityPoolProvider. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Iam::V1beta::WorkloadIdentityPoolProvider. + p response + end end # [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb b/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb index 0575941ff509..e360e9b60b45 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb @@ -19,21 +19,27 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools +# +def list_workload_identity_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new -# Call the list_workload_identity_pools method. -result = client.list_workload_identity_pools request + # Call the list_workload_identity_pools method. + result = client.list_workload_identity_pools request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Iam::V1beta::WorkloadIdentityPool. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Iam::V1beta::WorkloadIdentityPool. + p response + end end # [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb b/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb index 800fd1f5c16b..128514cb487f 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool +# +def undelete_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new -# Call the undelete_workload_identity_pool method. -result = client.undelete_workload_identity_pool request + # Call the undelete_workload_identity_pool method. + result = client.undelete_workload_identity_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb b/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb index b7f796738929..cc2fedccf11a 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider +# +def undelete_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new -# Call the undelete_workload_identity_pool_provider method. -result = client.undelete_workload_identity_pool_provider request + # Call the undelete_workload_identity_pool_provider method. + result = client.undelete_workload_identity_pool_provider request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb b/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb index e6b6c5b83eef..05c3b178b066 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool +# +def update_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new -# Call the update_workload_identity_pool method. -result = client.update_workload_identity_pool request + # Call the update_workload_identity_pool method. + result = client.update_workload_identity_pool request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] diff --git a/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb b/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb index dace6279f78c..5bf5f70d5549 100755 --- a/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb +++ b/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb @@ -19,22 +19,28 @@ # [START iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] require "google/iam/v1beta" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider +# +def update_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new -# Call the update_workload_identity_pool_provider method. -result = client.update_workload_identity_pool_provider request + # Call the update_workload_identity_pool_provider method. + result = client.update_workload_identity_pool_provider request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] diff --git a/google-iam-v2/.rubocop.yml b/google-iam-v2/.rubocop.yml index 1061c8a5dca4..34e52b136070 100644 --- a/google-iam-v2/.rubocop.yml +++ b/google-iam-v2/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-iam-v2.rb" diff --git a/google-iam-v2/snippets/Gemfile b/google-iam-v2/snippets/Gemfile index 78c6f7bd86fc..1d6df5db4ae8 100644 --- a/google-iam-v2/snippets/Gemfile +++ b/google-iam-v2/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-iam-v2/snippets/policies/create_policy.rb b/google-iam-v2/snippets/policies/create_policy.rb index f020184abb42..9b9216a8cb93 100644 --- a/google-iam-v2/snippets/policies/create_policy.rb +++ b/google-iam-v2/snippets/policies/create_policy.rb @@ -19,22 +19,28 @@ # [START iam_v2_generated_Policies_CreatePolicy_sync] require "google/iam/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V2::Policies::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V2::Policies::Client#create_policy +# +def create_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V2::CreatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::CreatePolicyRequest.new -# Call the create_policy method. -result = client.create_policy request + # Call the create_policy method. + result = client.create_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v2_generated_Policies_CreatePolicy_sync] diff --git a/google-iam-v2/snippets/policies/delete_policy.rb b/google-iam-v2/snippets/policies/delete_policy.rb index 6180a5cf7b02..0ab9fec0d16d 100644 --- a/google-iam-v2/snippets/policies/delete_policy.rb +++ b/google-iam-v2/snippets/policies/delete_policy.rb @@ -19,22 +19,28 @@ # [START iam_v2_generated_Policies_DeletePolicy_sync] require "google/iam/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V2::Policies::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V2::Policies::Client#delete_policy +# +def delete_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V2::DeletePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::DeletePolicyRequest.new -# Call the delete_policy method. -result = client.delete_policy request + # Call the delete_policy method. + result = client.delete_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v2_generated_Policies_DeletePolicy_sync] diff --git a/google-iam-v2/snippets/policies/get_policy.rb b/google-iam-v2/snippets/policies/get_policy.rb index f3e99e6c8129..1d79bcffd764 100644 --- a/google-iam-v2/snippets/policies/get_policy.rb +++ b/google-iam-v2/snippets/policies/get_policy.rb @@ -19,15 +19,21 @@ # [START iam_v2_generated_Policies_GetPolicy_sync] require "google/iam/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V2::Policies::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V2::Policies::Client#get_policy +# +def get_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V2::GetPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::GetPolicyRequest.new -# Call the get_policy method. -result = client.get_policy request + # Call the get_policy method. + result = client.get_policy request -# The returned object is of type Google::Iam::V2::Policy. -p result + # The returned object is of type Google::Iam::V2::Policy. + p result +end # [END iam_v2_generated_Policies_GetPolicy_sync] diff --git a/google-iam-v2/snippets/policies/list_policies.rb b/google-iam-v2/snippets/policies/list_policies.rb index 961258ea5530..a4965e735c4d 100644 --- a/google-iam-v2/snippets/policies/list_policies.rb +++ b/google-iam-v2/snippets/policies/list_policies.rb @@ -19,21 +19,27 @@ # [START iam_v2_generated_Policies_ListPolicies_sync] require "google/iam/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V2::Policies::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V2::Policies::Client#list_policies +# +def list_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V2::ListPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::ListPoliciesRequest.new -# Call the list_policies method. -result = client.list_policies request + # Call the list_policies method. + result = client.list_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Iam::V2::Policy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Iam::V2::Policy. + p response + end end # [END iam_v2_generated_Policies_ListPolicies_sync] diff --git a/google-iam-v2/snippets/policies/update_policy.rb b/google-iam-v2/snippets/policies/update_policy.rb index 4ed3c90573eb..c26e7603a267 100644 --- a/google-iam-v2/snippets/policies/update_policy.rb +++ b/google-iam-v2/snippets/policies/update_policy.rb @@ -19,22 +19,28 @@ # [START iam_v2_generated_Policies_UpdatePolicy_sync] require "google/iam/v2" -# Create a client object. The client can be reused for multiple calls. -client = Google::Iam::V2::Policies::Client.new +## +# Example demonstrating basic usage of +# Google::Iam::V2::Policies::Client#update_policy +# +def update_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Iam::V2::UpdatePolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::UpdatePolicyRequest.new -# Call the update_policy method. -result = client.update_policy request + # Call the update_policy method. + result = client.update_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END iam_v2_generated_Policies_UpdatePolicy_sync] diff --git a/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json b/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json index dca05fd7c428..a86b936f3d07 100644 --- a/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json +++ b/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/google-identity-access_context_manager-v1/.rubocop.yml b/google-identity-access_context_manager-v1/.rubocop.yml index f8866422a3d0..15b11069b7b8 100644 --- a/google-identity-access_context_manager-v1/.rubocop.yml +++ b/google-identity-access_context_manager-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/google-identity-access_context_manager-v1.rb" diff --git a/google-identity-access_context_manager-v1/snippets/Gemfile b/google-identity-access_context_manager-v1/snippets/Gemfile index 2e07395d774f..88da91e4e317 100755 --- a/google-identity-access_context_manager-v1/snippets/Gemfile +++ b/google-identity-access_context_manager-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/commit_service_perimeters.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/commit_service_perimeters.rb index e4c03c1f2b23..96ee79ce3614 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/commit_service_perimeters.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/commit_service_perimeters.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_CommitServicePerimeters_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#commit_service_perimeters +# +def commit_service_perimeters + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest.new -# Call the commit_service_perimeters method. -result = client.commit_service_perimeters request + # Call the commit_service_perimeters method. + result = client.commit_service_perimeters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_CommitServicePerimeters_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_level.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_level.rb index 5188122b3fe2..7bbd63c8f3f8 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_level.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_level.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_CreateAccessLevel_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#create_access_level +# +def create_access_level + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest.new -# Call the create_access_level method. -result = client.create_access_level request + # Call the create_access_level method. + result = client.create_access_level request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_CreateAccessLevel_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_policy.rb index c3cd90f718f0..85410e36ef00 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_policy.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_access_policy.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_CreateAccessPolicy_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#create_access_policy +# +def create_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::AccessPolicy.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::AccessPolicy.new -# Call the create_access_policy method. -result = client.create_access_policy request + # Call the create_access_policy method. + result = client.create_access_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_CreateAccessPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_gcp_user_access_binding.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_gcp_user_access_binding.rb index 6c23399eae2f..38115a7fda0b 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_gcp_user_access_binding.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_gcp_user_access_binding.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_CreateGcpUserAccessBinding_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#create_gcp_user_access_binding +# +def create_gcp_user_access_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::CreateGcpUserAccessBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::CreateGcpUserAccessBindingRequest.new -# Call the create_gcp_user_access_binding method. -result = client.create_gcp_user_access_binding request + # Call the create_gcp_user_access_binding method. + result = client.create_gcp_user_access_binding request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_CreateGcpUserAccessBinding_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_service_perimeter.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_service_perimeter.rb index 5d78ab6d7fc0..f977cdc5910d 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/create_service_perimeter.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/create_service_perimeter.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_CreateServicePerimeter_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#create_service_perimeter +# +def create_service_perimeter + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest.new -# Call the create_service_perimeter method. -result = client.create_service_perimeter request + # Call the create_service_perimeter method. + result = client.create_service_perimeter request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_CreateServicePerimeter_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_level.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_level.rb index 7b1e2844a97a..5cd9a8d1768c 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_level.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_level.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_DeleteAccessLevel_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#delete_access_level +# +def delete_access_level + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest.new -# Call the delete_access_level method. -result = client.delete_access_level request + # Call the delete_access_level method. + result = client.delete_access_level request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_DeleteAccessLevel_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_policy.rb index 9140429e769d..ea4860767237 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_policy.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_access_policy.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_DeleteAccessPolicy_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#delete_access_policy +# +def delete_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest.new -# Call the delete_access_policy method. -result = client.delete_access_policy request + # Call the delete_access_policy method. + result = client.delete_access_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_DeleteAccessPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_gcp_user_access_binding.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_gcp_user_access_binding.rb index dd7fbfbbfbb9..7d1f7336b1b0 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_gcp_user_access_binding.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_gcp_user_access_binding.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_DeleteGcpUserAccessBinding_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#delete_gcp_user_access_binding +# +def delete_gcp_user_access_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest.new -# Call the delete_gcp_user_access_binding method. -result = client.delete_gcp_user_access_binding request + # Call the delete_gcp_user_access_binding method. + result = client.delete_gcp_user_access_binding request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_DeleteGcpUserAccessBinding_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_service_perimeter.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_service_perimeter.rb index 231390b3312a..cd46edae3d88 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_service_perimeter.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/delete_service_perimeter.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_DeleteServicePerimeter_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#delete_service_perimeter +# +def delete_service_perimeter + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest.new -# Call the delete_service_perimeter method. -result = client.delete_service_perimeter request + # Call the delete_service_perimeter method. + result = client.delete_service_perimeter request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_DeleteServicePerimeter_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_level.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_level.rb index 146a1c67f6d5..aa770fe447b9 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_level.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_level.rb @@ -19,15 +19,21 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_GetAccessLevel_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_access_level +# +def get_access_level + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::GetAccessLevelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::GetAccessLevelRequest.new -# Call the get_access_level method. -result = client.get_access_level request + # Call the get_access_level method. + result = client.get_access_level request -# The returned object is of type Google::Identity::AccessContextManager::V1::AccessLevel. -p result + # The returned object is of type Google::Identity::AccessContextManager::V1::AccessLevel. + p result +end # [END accesscontextmanager_v1_generated_AccessContextManager_GetAccessLevel_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_policy.rb index 586be2e001f4..19bf367db3d2 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_policy.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_access_policy.rb @@ -19,15 +19,21 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_GetAccessPolicy_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_access_policy +# +def get_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest.new -# Call the get_access_policy method. -result = client.get_access_policy request + # Call the get_access_policy method. + result = client.get_access_policy request -# The returned object is of type Google::Identity::AccessContextManager::V1::AccessPolicy. -p result + # The returned object is of type Google::Identity::AccessContextManager::V1::AccessPolicy. + p result +end # [END accesscontextmanager_v1_generated_AccessContextManager_GetAccessPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_gcp_user_access_binding.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_gcp_user_access_binding.rb index e7f69c74085d..ef91140c09c3 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_gcp_user_access_binding.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_gcp_user_access_binding.rb @@ -19,15 +19,21 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_GetGcpUserAccessBinding_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_gcp_user_access_binding +# +def get_gcp_user_access_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::GetGcpUserAccessBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::GetGcpUserAccessBindingRequest.new -# Call the get_gcp_user_access_binding method. -result = client.get_gcp_user_access_binding request + # Call the get_gcp_user_access_binding method. + result = client.get_gcp_user_access_binding request -# The returned object is of type Google::Identity::AccessContextManager::V1::GcpUserAccessBinding. -p result + # The returned object is of type Google::Identity::AccessContextManager::V1::GcpUserAccessBinding. + p result +end # [END accesscontextmanager_v1_generated_AccessContextManager_GetGcpUserAccessBinding_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_service_perimeter.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_service_perimeter.rb index 49994b748fae..d5ef06de4042 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_service_perimeter.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_service_perimeter.rb @@ -19,15 +19,21 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_GetServicePerimeter_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_service_perimeter +# +def get_service_perimeter + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest.new -# Call the get_service_perimeter method. -result = client.get_service_perimeter request + # Call the get_service_perimeter method. + result = client.get_service_perimeter request -# The returned object is of type Google::Identity::AccessContextManager::V1::ServicePerimeter. -p result + # The returned object is of type Google::Identity::AccessContextManager::V1::ServicePerimeter. + p result +end # [END accesscontextmanager_v1_generated_AccessContextManager_GetServicePerimeter_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_levels.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_levels.rb index 956439ae5b8d..bdce29188911 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_levels.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_levels.rb @@ -19,21 +19,27 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ListAccessLevels_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#list_access_levels +# +def list_access_levels + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest.new -# Call the list_access_levels method. -result = client.list_access_levels request + # Call the list_access_levels method. + result = client.list_access_levels request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Identity::AccessContextManager::V1::AccessLevel. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Identity::AccessContextManager::V1::AccessLevel. + p response + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ListAccessLevels_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_policies.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_policies.rb index 593e7c6824eb..743807473222 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_policies.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_access_policies.rb @@ -19,21 +19,27 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ListAccessPolicies_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#list_access_policies +# +def list_access_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest.new -# Call the list_access_policies method. -result = client.list_access_policies request + # Call the list_access_policies method. + result = client.list_access_policies request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Identity::AccessContextManager::V1::AccessPolicy. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Identity::AccessContextManager::V1::AccessPolicy. + p response + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ListAccessPolicies_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_gcp_user_access_bindings.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_gcp_user_access_bindings.rb index 312861b0c325..abf3c8d94075 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_gcp_user_access_bindings.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_gcp_user_access_bindings.rb @@ -19,21 +19,27 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ListGcpUserAccessBindings_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#list_gcp_user_access_bindings +# +def list_gcp_user_access_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ListGcpUserAccessBindingsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ListGcpUserAccessBindingsRequest.new -# Call the list_gcp_user_access_bindings method. -result = client.list_gcp_user_access_bindings request + # Call the list_gcp_user_access_bindings method. + result = client.list_gcp_user_access_bindings request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Identity::AccessContextManager::V1::GcpUserAccessBinding. + p response + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ListGcpUserAccessBindings_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_service_perimeters.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_service_perimeters.rb index f352a0c4f41a..b047a555ddd0 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/list_service_perimeters.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/list_service_perimeters.rb @@ -19,21 +19,27 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ListServicePerimeters_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#list_service_perimeters +# +def list_service_perimeters + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest.new -# Call the list_service_perimeters method. -result = client.list_service_perimeters request + # Call the list_service_perimeters method. + result = client.list_service_perimeters request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Google::Identity::AccessContextManager::V1::ServicePerimeter. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Identity::AccessContextManager::V1::ServicePerimeter. + p response + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ListServicePerimeters_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_access_levels.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_access_levels.rb index 2214c188e2be..ef4e6ab1ce78 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_access_levels.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_access_levels.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ReplaceAccessLevels_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#replace_access_levels +# +def replace_access_levels + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest.new -# Call the replace_access_levels method. -result = client.replace_access_levels request + # Call the replace_access_levels method. + result = client.replace_access_levels request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ReplaceAccessLevels_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_service_perimeters.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_service_perimeters.rb index bb488d548524..8727c41c6635 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_service_perimeters.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/replace_service_perimeters.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_ReplaceServicePerimeters_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#replace_service_perimeters +# +def replace_service_perimeters + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest.new -# Call the replace_service_perimeters method. -result = client.replace_service_perimeters request + # Call the replace_service_perimeters method. + result = client.replace_service_perimeters request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_ReplaceServicePerimeters_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_level.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_level.rb index 7ee57a7b9851..b7b5b7a41b57 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_level.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_level.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_UpdateAccessLevel_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#update_access_level +# +def update_access_level + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest.new -# Call the update_access_level method. -result = client.update_access_level request + # Call the update_access_level method. + result = client.update_access_level request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_UpdateAccessLevel_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_policy.rb index e56a6958454f..1ef5f057f3bd 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_policy.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_access_policy.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_UpdateAccessPolicy_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#update_access_policy +# +def update_access_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest.new -# Call the update_access_policy method. -result = client.update_access_policy request + # Call the update_access_policy method. + result = client.update_access_policy request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_UpdateAccessPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_gcp_user_access_binding.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_gcp_user_access_binding.rb index 5ad0676a45b2..431d67c304c2 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_gcp_user_access_binding.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_gcp_user_access_binding.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_UpdateGcpUserAccessBinding_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#update_gcp_user_access_binding +# +def update_gcp_user_access_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::UpdateGcpUserAccessBindingRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::UpdateGcpUserAccessBindingRequest.new -# Call the update_gcp_user_access_binding method. -result = client.update_gcp_user_access_binding request + # Call the update_gcp_user_access_binding method. + result = client.update_gcp_user_access_binding request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_UpdateGcpUserAccessBinding_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_service_perimeter.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_service_perimeter.rb index 4a541071b344..99f5dfe52292 100755 --- a/google-identity-access_context_manager-v1/snippets/access_context_manager/update_service_perimeter.rb +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/update_service_perimeter.rb @@ -19,22 +19,28 @@ # [START accesscontextmanager_v1_generated_AccessContextManager_UpdateServicePerimeter_sync] require "google/identity/access_context_manager/v1" -# Create a client object. The client can be reused for multiple calls. -client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#update_service_perimeter +# +def update_service_perimeter + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest.new -# Call the update_service_perimeter method. -result = client.update_service_perimeter request + # Call the update_service_perimeter method. + result = client.update_service_perimeter request -# The returned object is of type Gapic::Operation. You can use this -# object to check the status of an operation, cancel it, or wait -# for results. Here is how to block until completion: -result.wait_until_done! timeout: 60 -if result.response? - p result.response -else - puts "Error!" + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end end # [END accesscontextmanager_v1_generated_AccessContextManager_UpdateServicePerimeter_sync] diff --git a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json index 238e75b6fa29..b494dbe02886 100644 --- a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json +++ b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -606,7 +606,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -646,7 +646,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -686,7 +686,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -726,7 +726,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -766,7 +766,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -806,7 +806,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -846,7 +846,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -886,7 +886,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] @@ -926,7 +926,7 @@ "segments": [ { "start": 20, - "end": 39, + "end": 45, "type": "FULL" } ] diff --git a/grafeas-v1/.rubocop.yml b/grafeas-v1/.rubocop.yml index 9ba75363cfab..34342e2dbb2e 100644 --- a/grafeas-v1/.rubocop.yml +++ b/grafeas-v1/.rubocop.yml @@ -25,6 +25,9 @@ Metrics/ModuleLength: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Naming/AccessorMethodName: + Exclude: + - "snippets/**/*.rb" Naming/FileName: Exclude: - "lib/grafeas-v1.rb" diff --git a/grafeas-v1/snippets/Gemfile b/grafeas-v1/snippets/Gemfile index 5ca28bbae820..30cc273217d7 100755 --- a/grafeas-v1/snippets/Gemfile +++ b/grafeas-v1/snippets/Gemfile @@ -25,8 +25,8 @@ else end group :test do - gem "google-style", "~> 1.25.1" - gem "minitest", "~> 5.14" + gem "google-style", "~> 1.26.1" + gem "minitest", "~> 5.16" gem "minitest-focus", "~> 1.1" gem "minitest-hooks", "~> 1.5" end diff --git a/grafeas-v1/snippets/grafeas/batch_create_notes.rb b/grafeas-v1/snippets/grafeas/batch_create_notes.rb index cea3c67f1a1d..fd67048c0b0c 100755 --- a/grafeas-v1/snippets/grafeas/batch_create_notes.rb +++ b/grafeas-v1/snippets/grafeas/batch_create_notes.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_BatchCreateNotes_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#batch_create_notes +# +def batch_create_notes + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::BatchCreateNotesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::BatchCreateNotesRequest.new -# Call the batch_create_notes method. -result = client.batch_create_notes request + # Call the batch_create_notes method. + result = client.batch_create_notes request -# The returned object is of type Grafeas::V1::BatchCreateNotesResponse. -p result + # The returned object is of type Grafeas::V1::BatchCreateNotesResponse. + p result +end # [END grafeas_v1_generated_Grafeas_BatchCreateNotes_sync] diff --git a/grafeas-v1/snippets/grafeas/batch_create_occurrences.rb b/grafeas-v1/snippets/grafeas/batch_create_occurrences.rb index 7343f7520a68..29aabdf7360c 100755 --- a/grafeas-v1/snippets/grafeas/batch_create_occurrences.rb +++ b/grafeas-v1/snippets/grafeas/batch_create_occurrences.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_BatchCreateOccurrences_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#batch_create_occurrences +# +def batch_create_occurrences + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::BatchCreateOccurrencesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::BatchCreateOccurrencesRequest.new -# Call the batch_create_occurrences method. -result = client.batch_create_occurrences request + # Call the batch_create_occurrences method. + result = client.batch_create_occurrences request -# The returned object is of type Grafeas::V1::BatchCreateOccurrencesResponse. -p result + # The returned object is of type Grafeas::V1::BatchCreateOccurrencesResponse. + p result +end # [END grafeas_v1_generated_Grafeas_BatchCreateOccurrences_sync] diff --git a/grafeas-v1/snippets/grafeas/create_note.rb b/grafeas-v1/snippets/grafeas/create_note.rb index 47513175375f..340eb631afdc 100755 --- a/grafeas-v1/snippets/grafeas/create_note.rb +++ b/grafeas-v1/snippets/grafeas/create_note.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_CreateNote_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#create_note +# +def create_note + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::CreateNoteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::CreateNoteRequest.new -# Call the create_note method. -result = client.create_note request + # Call the create_note method. + result = client.create_note request -# The returned object is of type Grafeas::V1::Note. -p result + # The returned object is of type Grafeas::V1::Note. + p result +end # [END grafeas_v1_generated_Grafeas_CreateNote_sync] diff --git a/grafeas-v1/snippets/grafeas/create_occurrence.rb b/grafeas-v1/snippets/grafeas/create_occurrence.rb index fd615194968b..513a1af17bf7 100755 --- a/grafeas-v1/snippets/grafeas/create_occurrence.rb +++ b/grafeas-v1/snippets/grafeas/create_occurrence.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_CreateOccurrence_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#create_occurrence +# +def create_occurrence + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::CreateOccurrenceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::CreateOccurrenceRequest.new -# Call the create_occurrence method. -result = client.create_occurrence request + # Call the create_occurrence method. + result = client.create_occurrence request -# The returned object is of type Grafeas::V1::Occurrence. -p result + # The returned object is of type Grafeas::V1::Occurrence. + p result +end # [END grafeas_v1_generated_Grafeas_CreateOccurrence_sync] diff --git a/grafeas-v1/snippets/grafeas/delete_note.rb b/grafeas-v1/snippets/grafeas/delete_note.rb index e1ad28950608..285f917c0258 100755 --- a/grafeas-v1/snippets/grafeas/delete_note.rb +++ b/grafeas-v1/snippets/grafeas/delete_note.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_DeleteNote_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#delete_note +# +def delete_note + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::DeleteNoteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::DeleteNoteRequest.new -# Call the delete_note method. -result = client.delete_note request + # Call the delete_note method. + result = client.delete_note request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END grafeas_v1_generated_Grafeas_DeleteNote_sync] diff --git a/grafeas-v1/snippets/grafeas/delete_occurrence.rb b/grafeas-v1/snippets/grafeas/delete_occurrence.rb index 6107b85f7a35..ecb5440b7c0a 100755 --- a/grafeas-v1/snippets/grafeas/delete_occurrence.rb +++ b/grafeas-v1/snippets/grafeas/delete_occurrence.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_DeleteOccurrence_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#delete_occurrence +# +def delete_occurrence + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::DeleteOccurrenceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::DeleteOccurrenceRequest.new -# Call the delete_occurrence method. -result = client.delete_occurrence request + # Call the delete_occurrence method. + result = client.delete_occurrence request -# The returned object is of type Google::Protobuf::Empty. -p result + # The returned object is of type Google::Protobuf::Empty. + p result +end # [END grafeas_v1_generated_Grafeas_DeleteOccurrence_sync] diff --git a/grafeas-v1/snippets/grafeas/get_note.rb b/grafeas-v1/snippets/grafeas/get_note.rb index a7256d9b0912..5c4cc5220f88 100755 --- a/grafeas-v1/snippets/grafeas/get_note.rb +++ b/grafeas-v1/snippets/grafeas/get_note.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_GetNote_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#get_note +# +def get_note + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::GetNoteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::GetNoteRequest.new -# Call the get_note method. -result = client.get_note request + # Call the get_note method. + result = client.get_note request -# The returned object is of type Grafeas::V1::Note. -p result + # The returned object is of type Grafeas::V1::Note. + p result +end # [END grafeas_v1_generated_Grafeas_GetNote_sync] diff --git a/grafeas-v1/snippets/grafeas/get_occurrence.rb b/grafeas-v1/snippets/grafeas/get_occurrence.rb index 59a03c56b5ba..c21a769d7f08 100755 --- a/grafeas-v1/snippets/grafeas/get_occurrence.rb +++ b/grafeas-v1/snippets/grafeas/get_occurrence.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_GetOccurrence_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#get_occurrence +# +def get_occurrence + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::GetOccurrenceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::GetOccurrenceRequest.new -# Call the get_occurrence method. -result = client.get_occurrence request + # Call the get_occurrence method. + result = client.get_occurrence request -# The returned object is of type Grafeas::V1::Occurrence. -p result + # The returned object is of type Grafeas::V1::Occurrence. + p result +end # [END grafeas_v1_generated_Grafeas_GetOccurrence_sync] diff --git a/grafeas-v1/snippets/grafeas/get_occurrence_note.rb b/grafeas-v1/snippets/grafeas/get_occurrence_note.rb index 353202058bd7..357172978665 100755 --- a/grafeas-v1/snippets/grafeas/get_occurrence_note.rb +++ b/grafeas-v1/snippets/grafeas/get_occurrence_note.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_GetOccurrenceNote_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#get_occurrence_note +# +def get_occurrence_note + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::GetOccurrenceNoteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::GetOccurrenceNoteRequest.new -# Call the get_occurrence_note method. -result = client.get_occurrence_note request + # Call the get_occurrence_note method. + result = client.get_occurrence_note request -# The returned object is of type Grafeas::V1::Note. -p result + # The returned object is of type Grafeas::V1::Note. + p result +end # [END grafeas_v1_generated_Grafeas_GetOccurrenceNote_sync] diff --git a/grafeas-v1/snippets/grafeas/list_note_occurrences.rb b/grafeas-v1/snippets/grafeas/list_note_occurrences.rb index ee15ff73382d..0742d5da08c7 100755 --- a/grafeas-v1/snippets/grafeas/list_note_occurrences.rb +++ b/grafeas-v1/snippets/grafeas/list_note_occurrences.rb @@ -19,21 +19,27 @@ # [START grafeas_v1_generated_Grafeas_ListNoteOccurrences_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#list_note_occurrences +# +def list_note_occurrences + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::ListNoteOccurrencesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::ListNoteOccurrencesRequest.new -# Call the list_note_occurrences method. -result = client.list_note_occurrences request + # Call the list_note_occurrences method. + result = client.list_note_occurrences request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Grafeas::V1::Occurrence. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Grafeas::V1::Occurrence. + p response + end end # [END grafeas_v1_generated_Grafeas_ListNoteOccurrences_sync] diff --git a/grafeas-v1/snippets/grafeas/list_notes.rb b/grafeas-v1/snippets/grafeas/list_notes.rb index 1658125b118a..113aaf11191e 100755 --- a/grafeas-v1/snippets/grafeas/list_notes.rb +++ b/grafeas-v1/snippets/grafeas/list_notes.rb @@ -19,21 +19,27 @@ # [START grafeas_v1_generated_Grafeas_ListNotes_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#list_notes +# +def list_notes + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::ListNotesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::ListNotesRequest.new -# Call the list_notes method. -result = client.list_notes request + # Call the list_notes method. + result = client.list_notes request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Grafeas::V1::Note. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Grafeas::V1::Note. + p response + end end # [END grafeas_v1_generated_Grafeas_ListNotes_sync] diff --git a/grafeas-v1/snippets/grafeas/list_occurrences.rb b/grafeas-v1/snippets/grafeas/list_occurrences.rb index cdaa471618aa..9fcce037ab5c 100755 --- a/grafeas-v1/snippets/grafeas/list_occurrences.rb +++ b/grafeas-v1/snippets/grafeas/list_occurrences.rb @@ -19,21 +19,27 @@ # [START grafeas_v1_generated_Grafeas_ListOccurrences_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#list_occurrences +# +def list_occurrences + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::ListOccurrencesRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::ListOccurrencesRequest.new -# Call the list_occurrences method. -result = client.list_occurrences request + # Call the list_occurrences method. + result = client.list_occurrences request -# The returned object is of type Gapic::PagedEnumerable. You can -# iterate over all elements by calling #each, and the enumerable -# will lazily make API calls to fetch subsequent pages. Other -# methods are also available for managing paging directly. -result.each do |response| - # Each element is of type ::Grafeas::V1::Occurrence. - p response + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Grafeas::V1::Occurrence. + p response + end end # [END grafeas_v1_generated_Grafeas_ListOccurrences_sync] diff --git a/grafeas-v1/snippets/grafeas/update_note.rb b/grafeas-v1/snippets/grafeas/update_note.rb index 4e6c2419fa1b..6f92b4a04a5a 100755 --- a/grafeas-v1/snippets/grafeas/update_note.rb +++ b/grafeas-v1/snippets/grafeas/update_note.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_UpdateNote_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#update_note +# +def update_note + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::UpdateNoteRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::UpdateNoteRequest.new -# Call the update_note method. -result = client.update_note request + # Call the update_note method. + result = client.update_note request -# The returned object is of type Grafeas::V1::Note. -p result + # The returned object is of type Grafeas::V1::Note. + p result +end # [END grafeas_v1_generated_Grafeas_UpdateNote_sync] diff --git a/grafeas-v1/snippets/grafeas/update_occurrence.rb b/grafeas-v1/snippets/grafeas/update_occurrence.rb index 99180607c952..f4f4e9857ffb 100755 --- a/grafeas-v1/snippets/grafeas/update_occurrence.rb +++ b/grafeas-v1/snippets/grafeas/update_occurrence.rb @@ -19,15 +19,21 @@ # [START grafeas_v1_generated_Grafeas_UpdateOccurrence_sync] require "grafeas/v1" -# Create a client object. The client can be reused for multiple calls. -client = Grafeas::V1::Grafeas::Client.new +## +# Example demonstrating basic usage of +# Grafeas::V1::Grafeas::Client#update_occurrence +# +def update_occurrence + # Create a client object. The client can be reused for multiple calls. + client = Grafeas::V1::Grafeas::Client.new -# Create a request. To set request fields, pass in keyword arguments. -request = Grafeas::V1::UpdateOccurrenceRequest.new + # Create a request. To set request fields, pass in keyword arguments. + request = Grafeas::V1::UpdateOccurrenceRequest.new -# Call the update_occurrence method. -result = client.update_occurrence request + # Call the update_occurrence method. + result = client.update_occurrence request -# The returned object is of type Grafeas::V1::Occurrence. -p result + # The returned object is of type Grafeas::V1::Occurrence. + p result +end # [END grafeas_v1_generated_Grafeas_UpdateOccurrence_sync] diff --git a/grafeas-v1/snippets/snippet_metadata_grafeas.v1.json b/grafeas-v1/snippets/snippet_metadata_grafeas.v1.json index a99ba62e90cf..57d7c0fb22a3 100644 --- a/grafeas-v1/snippets/snippet_metadata_grafeas.v1.json +++ b/grafeas-v1/snippets/snippet_metadata_grafeas.v1.json @@ -46,7 +46,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -86,7 +86,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -126,7 +126,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -166,7 +166,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -206,7 +206,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -246,7 +246,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -286,7 +286,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -326,7 +326,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -366,7 +366,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] @@ -406,7 +406,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -446,7 +446,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -486,7 +486,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -526,7 +526,7 @@ "segments": [ { "start": 20, - "end": 32, + "end": 38, "type": "FULL" } ] @@ -566,7 +566,7 @@ "segments": [ { "start": 20, - "end": 38, + "end": 44, "type": "FULL" } ] From 6b0b96a4b136d99f443b7f579edac6e15e9e9c01 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Tue, 1 Nov 2022 10:38:07 -0700 Subject: [PATCH 008/112] chore: Use owlbot copy-bazel-bin when copying custom bazel builds (#19352) --- .toys/owlbot.rb | 85 ++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/.toys/owlbot.rb b/.toys/owlbot.rb index 2f1ad80a1223..a8bda076cc93 100644 --- a/.toys/owlbot.rb +++ b/.toys/owlbot.rb @@ -33,14 +33,23 @@ flag :commit_message, "--message=MESSAGE" do desc "The conventional commit message" end -flag :source_path, "--source-path=PATH" do - desc "Path to the googleapis-gen source repo" -end -flag :protos_path, "--protos-path=PATH" do - desc "Path to the googleapis protos repo or third_party directory" -end -flag :piper_client, "--piper-client=NAME" do - desc "Generate by running Bazel from the given piper client rather than using googleapis-gen" +at_most_one desc: "Source" do + long_desc \ + "Specify where the generated client comes from.", + "At most one of these flags can be set. If none is given, the googleapis-gen repo is cloned." + flag :googleapis_gen_github_token, "--googleapis-gen-github-token=TOKEN" do + default(ENV["GOOGLEAPIS_GEN_GITHUB_TOKEN"] || ENV["GITHUB_TOKEN"]) + desc "GitHub token for cloning the googleapis-gen repository." + end + flag :source_path, "--source-path=PATH" do + desc "Path to the googleapis-gen source repo." + end + flag :protos_path, "--protos-path=PATH" do + desc "Generate by running Bazel from the given path to the googleapis protos repo or third_party directory." + end + flag :piper_client, "--piper-client=NAME" do + desc "Generate by running Bazel from the given piper client" + end end flag :combined_prs do desc "Combine all changes into a single pull request" @@ -48,10 +57,6 @@ flag :enable_tests, "--test" do desc "Run CI on each library" end -flag :googleapis_gen_github_token, "--googleapis-gen-github-token=TOKEN" do - default(ENV["GOOGLEAPIS_GEN_GITHUB_TOKEN"] || ENV["GITHUB_TOKEN"]) - desc "GitHub token for cloning the googleapis-gen repository" -end OWLBOT_CONFIG_FILE_NAME = ".OwlBot.yaml" OWLBOT_CLI_IMAGE = "gcr.io/cloud-devrel-public-resources/owlbot-cli" @@ -69,16 +74,18 @@ def run require "fileutils" require "tmpdir" - set :source_path, File.expand_path(source_path) if source_path - ensure_source_path gems = choose_gems - Dir.chdir context_directory + cd context_directory yoshi_utils.git_ensure_identity gem_info = collect_gem_info gems pull_images - run_bazel gem_info if piper_client || protos_path - run_owlbot gem_info + if piper_client || protos_path + set :source_path, run_bazel(gem_info) + else + set :source_path, source_path ? File.expand_path(source_path) : googleapis_gen_path + end + run_owlbot gem_info, use_bazel_bin: piper_client || protos_path verify_staging gems results = process_gems gems final_output results @@ -106,7 +113,7 @@ def gems_from_subdirectory end def all_gems - Dir.chdir context_directory do + cd context_directory do gems = Dir.glob("*/#{OWLBOT_CONFIG_FILE_NAME}").map { |path| File.dirname path } gems.delete_if do |name| !File.file? File.join(context_directory, name, "#{name}.gemspec") @@ -163,20 +170,19 @@ def run_bazel gem_info gem_info.each do |name, info| info[:bazel_targets].each do |library_path, bazel_target| exec ["bazel", "build", "//#{library_path}:#{bazel_target}"], chdir: bazel_base_dir - generated_dir = File.join bazel_base_dir, "bazel-bin", library_path, bazel_target - source_dir = File.join source_path, library_path, bazel_target - rm_rf source_dir - mkdir_p File.dirname source_dir - cp_r generated_dir, source_dir end end + temp_dir = Dir.mktmpdir + at_exit { FileUtils.rm_rf temp_dir } + results_dir = File.join temp_dir, "bazel-bin" + cp_r File.join(bazel_base_dir, "bazel-bin"), results_dir + results_dir end -def ensure_source_path - return if source_path +def googleapis_gen_path temp_dir = Dir.mktmpdir at_exit { FileUtils.rm_rf temp_dir } - Dir.chdir temp_dir do + cd temp_dir do exec ["git", "init"] token = googleapis_gen_github_token || yoshi_utils.gh_cur_token error "No github token found to load googleapis-gen" unless token @@ -192,26 +198,27 @@ def ensure_source_path exec ["git", "branch", "github-head", "FETCH_HEAD"] exec ["git", "switch", "github-head"] end - set :source_path, temp_dir + temp_dir end -def run_owlbot gem_info - FileUtils.mkdir_p TMP_DIR_NAME +def run_owlbot gem_info, use_bazel_bin: + mkdir_p TMP_DIR_NAME temp_config = File.join TMP_DIR_NAME, OWLBOT_CONFIG_FILE_NAME - FileUtils.rm_f temp_config + rm_f temp_config combined_deep_copy_regex = gem_info.values.map { |info| info[:deep_copy_regexes] }.flatten combined_config = {"deep-copy-regex" => combined_deep_copy_regex} File.open temp_config, "w" do |file| file.puts Psych.dump combined_config end cmd = [ - "-v", "#{source_path}:/googleapis-gen", - "#{OWLBOT_CLI_IMAGE}:#{owlbot_cli_tag}", "copy-code", + "-v", "#{source_path}:/source-path", + "#{OWLBOT_CLI_IMAGE}:#{owlbot_cli_tag}", + (use_bazel_bin ? "copy-bazel-bin" : "copy-code"), "--config-file", temp_config, - "--source-repo", "/googleapis-gen" + (use_bazel_bin ? "--source-dir" : "--source-repo"), "/source-path" ] docker_run(*cmd) - FileUtils.rm_f ".gitconfig" + rm_f ".gitconfig" end def verify_staging gems @@ -224,8 +231,8 @@ def verify_staging gems def process_gems gems temp_staging_dir = File.join TMP_DIR_NAME, STAGING_DIR_NAME - FileUtils.rm_rf temp_staging_dir - FileUtils.mv STAGING_DIR_NAME, temp_staging_dir + rm_rf temp_staging_dir + mv STAGING_DIR_NAME, temp_staging_dir if combined_prs process_gems_combined_pr gems, temp_staging_dir else @@ -276,11 +283,11 @@ def build_commit_message name end def process_single_gem name, temp_staging_dir - FileUtils.mkdir_p STAGING_DIR_NAME - FileUtils.mv File.join(temp_staging_dir, name), File.join(STAGING_DIR_NAME, name) + mkdir_p STAGING_DIR_NAME + mv File.join(temp_staging_dir, name), File.join(STAGING_DIR_NAME, name) docker_run "#{POSTPROCESSOR_IMAGE}:#{postprocessor_tag}", "--gem", name if enable_tests - Dir.chdir name do + cd name do exec ["bundle", "install"] exec ["bundle", "exec", "rake", "ci"] end From 6eab3c7b98cbbae19b9180fb3f96d96536e7887d Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 10:59:18 -0700 Subject: [PATCH 009/112] chore(main): release google-cloud-dialogflow-v2 0.19.0 (#19346) --- .release-please-manifest.json | 2 +- google-cloud-dialogflow-v2/CHANGELOG.md | 8 ++++++++ .../lib/google/cloud/dialogflow/v2/version.rb | 2 +- .../snippet_metadata_google.cloud.dialogflow.v2.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4fab03dab2f8..f1ddc33833a7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -235,7 +235,7 @@ "google-cloud-dialogflow-cx+FILLER": "0.0.0", "google-cloud-dialogflow-cx-v3": "0.10.2", "google-cloud-dialogflow-cx-v3+FILLER": "0.0.0", - "google-cloud-dialogflow-v2": "0.18.0", + "google-cloud-dialogflow-v2": "0.19.0", "google-cloud-dialogflow-v2+FILLER": "0.0.0", "google-cloud-dlp": "1.3.0", "google-cloud-dlp+FILLER": "0.0.0", diff --git a/google-cloud-dialogflow-v2/CHANGELOG.md b/google-cloud-dialogflow-v2/CHANGELOG.md index 432a9ca5fcac..0e51fb5fab0b 100644 --- a/google-cloud-dialogflow-v2/CHANGELOG.md +++ b/google-cloud-dialogflow-v2/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +### 0.19.0 (2022-11-01) + +#### Features + +* Added obfuscated_external_user_id to Participant +* Added support for the streaming_analyze_content call ([#19340](https://github.com/googleapis/google-cloud-ruby/issues/19340)) +* Can directly set Cloud Speech model on the SpeechToTextConfig + ### 0.18.0 (2022-10-03) #### Features diff --git a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb index c489ea2ca48e..b9d341da05ba 100644 --- a/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb +++ b/google-cloud-dialogflow-v2/lib/google/cloud/dialogflow/v2/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Dialogflow module V2 - VERSION = "0.18.0" + VERSION = "0.19.0" end end end diff --git a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json index 39b49db41280..3a4fdbb1ee31 100644 --- a/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json +++ b/google-cloud-dialogflow-v2/snippets/snippet_metadata_google.cloud.dialogflow.v2.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-dialogflow-v2", - "version": "0.18.0", + "version": "0.19.0", "language": "RUBY", "apis": [ { From 5ec95414efd45399091857703b601bc0b103dff7 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:18:21 -0700 Subject: [PATCH 010/112] chore(main): release google-cloud-monitoring-dashboard-v1 0.9.0 (#19347) --- .release-please-manifest.json | 2 +- google-cloud-monitoring-dashboard-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/monitoring/dashboard/v1/version.rb | 2 +- .../snippet_metadata_google.monitoring.dashboard.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f1ddc33833a7..8a89febc6078 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -365,7 +365,7 @@ "google-cloud-metastore-v1beta+FILLER": "0.0.0", "google-cloud-monitoring": "1.4.1", "google-cloud-monitoring+FILLER": "0.0.0", - "google-cloud-monitoring-dashboard-v1": "0.8.0", + "google-cloud-monitoring-dashboard-v1": "0.9.0", "google-cloud-monitoring-dashboard-v1+FILLER": "0.0.0", "google-cloud-monitoring-metrics_scope-v1": "0.2.0", "google-cloud-monitoring-metrics_scope-v1+FILLER": "0.0.0", diff --git a/google-cloud-monitoring-dashboard-v1/CHANGELOG.md b/google-cloud-monitoring-dashboard-v1/CHANGELOG.md index e053ed0e20b0..a3f574be6414 100644 --- a/google-cloud-monitoring-dashboard-v1/CHANGELOG.md +++ b/google-cloud-monitoring-dashboard-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.9.0 (2022-11-01) + +#### Features + +* Added support for PromQL queries ([#19343](https://github.com/googleapis/google-cloud-ruby/issues/19343)) + ### 0.8.0 (2022-07-05) #### Features diff --git a/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/version.rb b/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/version.rb index 918c2e399442..af8897714abd 100644 --- a/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/version.rb +++ b/google-cloud-monitoring-dashboard-v1/lib/google/cloud/monitoring/dashboard/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Monitoring module Dashboard module V1 - VERSION = "0.8.0" + VERSION = "0.9.0" end end end diff --git a/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json b/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json index d2c27845f808..e318cea8b46e 100644 --- a/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json +++ b/google-cloud-monitoring-dashboard-v1/snippets/snippet_metadata_google.monitoring.dashboard.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-monitoring-dashboard-v1", - "version": "0.8.0", + "version": "0.9.0", "language": "RUBY", "apis": [ { From d45c9b266fb00fc674df712caaadd1d5e47d7328 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:18:43 -0700 Subject: [PATCH 011/112] chore(main): release google-cloud-video-stitcher-v1 0.4.0 (#19348) --- .release-please-manifest.json | 2 +- google-cloud-video-stitcher-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/video/stitcher/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.video.stitcher.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8a89febc6078..e1fb064979e8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -585,7 +585,7 @@ "google-cloud-video-live_stream-v1+FILLER": "0.0.0", "google-cloud-video-stitcher": "0.2.0", "google-cloud-video-stitcher+FILLER": "0.0.0", - "google-cloud-video-stitcher-v1": "0.3.0", + "google-cloud-video-stitcher-v1": "0.4.0", "google-cloud-video-stitcher-v1+FILLER": "0.0.0", "google-cloud-video-transcoder": "1.2.0", "google-cloud-video-transcoder+FILLER": "0.0.0", diff --git a/google-cloud-video-stitcher-v1/CHANGELOG.md b/google-cloud-video-stitcher-v1/CHANGELOG.md index 5422ef2720b3..606a6ba0069f 100644 --- a/google-cloud-video-stitcher-v1/CHANGELOG.md +++ b/google-cloud-video-stitcher-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.4.0 (2022-11-01) + +#### Features + +* Added support for Media CDN ([#19344](https://github.com/googleapis/google-cloud-ruby/issues/19344)) + ### 0.3.0 (2022-07-08) #### Features diff --git a/google-cloud-video-stitcher-v1/lib/google/cloud/video/stitcher/v1/version.rb b/google-cloud-video-stitcher-v1/lib/google/cloud/video/stitcher/v1/version.rb index c177b2822f02..f24d92a6fb8a 100644 --- a/google-cloud-video-stitcher-v1/lib/google/cloud/video/stitcher/v1/version.rb +++ b/google-cloud-video-stitcher-v1/lib/google/cloud/video/stitcher/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Video module Stitcher module V1 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json b/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json index ba9b581f429a..294f88b73f8e 100644 --- a/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json +++ b/google-cloud-video-stitcher-v1/snippets/snippet_metadata_google.cloud.video.stitcher.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-video-stitcher-v1", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 0c4494545848dc5cfa08254bfa18cf26d8c5786c Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:19:07 -0700 Subject: [PATCH 012/112] chore(main): release google-cloud-build-v1 0.13.0 (#19351) --- .release-please-manifest.json | 2 +- google-cloud-build-v1/CHANGELOG.md | 7 +++++++ google-cloud-build-v1/lib/google/cloud/build/v1/version.rb | 2 +- .../snippet_metadata_google.devtools.cloudbuild.v1.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e1fb064979e8..55386e8301e1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -141,7 +141,7 @@ "google-cloud-binary_authorization-v1beta1+FILLER": "0.0.0", "google-cloud-build": "1.2.0", "google-cloud-build+FILLER": "0.0.0", - "google-cloud-build-v1": "0.12.0", + "google-cloud-build-v1": "0.13.0", "google-cloud-build-v1+FILLER": "0.0.0", "google-cloud-certificate_manager": "0.2.0", "google-cloud-certificate_manager+FILLER": "0.0.0", diff --git a/google-cloud-build-v1/CHANGELOG.md b/google-cloud-build-v1/CHANGELOG.md index 8a816b4d87b5..bdc8477d7c8f 100644 --- a/google-cloud-build-v1/CHANGELOG.md +++ b/google-cloud-build-v1/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +### 0.13.0 (2022-11-01) + +#### Features + +* Added allow_failure, exit_code, and allow_exit_code fields to BuildStep type ([#19349](https://github.com/googleapis/google-cloud-ruby/issues/19349)) +* Support for uploading Python packages and Maven artifacts to Artifact Registry ([#19353](https://github.com/googleapis/google-cloud-ruby/issues/19353)) + ### 0.12.0 (2022-07-02) #### Features diff --git a/google-cloud-build-v1/lib/google/cloud/build/v1/version.rb b/google-cloud-build-v1/lib/google/cloud/build/v1/version.rb index 748328cbf555..975b282eea1f 100644 --- a/google-cloud-build-v1/lib/google/cloud/build/v1/version.rb +++ b/google-cloud-build-v1/lib/google/cloud/build/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Build module V1 - VERSION = "0.12.0" + VERSION = "0.13.0" end end end diff --git a/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json b/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json index 0e6721636cfe..a9a5be6a33cc 100644 --- a/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json +++ b/google-cloud-build-v1/snippets/snippet_metadata_google.devtools.cloudbuild.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-build-v1", - "version": "0.12.0", + "version": "0.13.0", "language": "RUBY", "apis": [ { From 8415a97e7b3e7d96d42dbe8eaffaee20bcfbb16a Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:20:01 -0700 Subject: [PATCH 013/112] chore(main): release google-cloud-dataform-v1beta1 0.1.0 (#19360) --- .release-please-manifest.json | 2 +- google-cloud-dataform-v1beta1/.repo-metadata.json | 2 +- google-cloud-dataform-v1beta1/CHANGELOG.md | 9 ++++++++- .../lib/google/cloud/dataform/v1beta1/version.rb | 2 +- .../snippet_metadata_google.cloud.dataform.v1beta1.json | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 55386e8301e1..698980a0211d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -193,7 +193,7 @@ "google-cloud-dataflow-v1beta3+FILLER": "0.0.0", "google-cloud-dataform": "0.0.1", "google-cloud-dataform+FILLER": "0.0.0", - "google-cloud-dataform-v1beta1": "0.0.1", + "google-cloud-dataform-v1beta1": "0.1.0", "google-cloud-dataform-v1beta1+FILLER": "0.0.0", "google-cloud-dataplex": "0.3.0", "google-cloud-dataplex+FILLER": "0.0.0", diff --git a/google-cloud-dataform-v1beta1/.repo-metadata.json b/google-cloud-dataform-v1beta1/.repo-metadata.json index b3db96bf96eb..4aee9cc9dfeb 100644 --- a/google-cloud-dataform-v1beta1/.repo-metadata.json +++ b/google-cloud-dataform-v1beta1/.repo-metadata.json @@ -8,7 +8,7 @@ "name": "dataform", "name_pretty": "Dataform V1beta1 API", "product_documentation": "https://cloud.google.com/dataform", - "release_level": "unreleased", + "release_level": "preview", "repo": "googleapis/google-cloud-ruby", "requires_billing": true, "ruby-cloud-description": "Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery. Note that google-cloud-dataform-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-dataform instead. See the readme for more details.", diff --git a/google-cloud-dataform-v1beta1/CHANGELOG.md b/google-cloud-dataform-v1beta1/CHANGELOG.md index f88957a62ba2..306bd652a3c8 100644 --- a/google-cloud-dataform-v1beta1/CHANGELOG.md +++ b/google-cloud-dataform-v1beta1/CHANGELOG.md @@ -1,2 +1,9 @@ -# Release History +# Changelog +### 0.1.0 (2022-11-01) + +#### Features + +* Initial generation of google-cloud-dataform-v1beta1 ([#19345](https://github.com/googleapis/google-cloud-ruby/issues/19345)) + +## Release History diff --git a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/version.rb b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/version.rb index b2a239bb5ab1..e9e94855c3c1 100644 --- a/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/version.rb +++ b/google-cloud-dataform-v1beta1/lib/google/cloud/dataform/v1beta1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Dataform module V1beta1 - VERSION = "0.0.1" + VERSION = "0.1.0" end end end diff --git a/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json b/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json index 8c2e41f99c25..b6e1f42dd37f 100644 --- a/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json +++ b/google-cloud-dataform-v1beta1/snippets/snippet_metadata_google.cloud.dataform.v1beta1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-dataform-v1beta1", - "version": "", + "version": "0.1.0", "language": "RUBY", "apis": [ { From 4e50215af50735e51c1c96271af42760ae626f86 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 1 Nov 2022 11:39:51 -0700 Subject: [PATCH 014/112] chore(main): release google-cloud-dataform 0.1.0 (#19359) --- .release-please-manifest.json | 2 +- google-cloud-dataform/.repo-metadata.json | 2 +- google-cloud-dataform/CHANGELOG.md | 9 ++++++++- .../lib/google/cloud/dataform/version.rb | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 698980a0211d..1e7c339cb438 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -191,7 +191,7 @@ "google-cloud-dataflow+FILLER": "0.0.0", "google-cloud-dataflow-v1beta3": "0.4.0", "google-cloud-dataflow-v1beta3+FILLER": "0.0.0", - "google-cloud-dataform": "0.0.1", + "google-cloud-dataform": "0.1.0", "google-cloud-dataform+FILLER": "0.0.0", "google-cloud-dataform-v1beta1": "0.1.0", "google-cloud-dataform-v1beta1+FILLER": "0.0.0", diff --git a/google-cloud-dataform/.repo-metadata.json b/google-cloud-dataform/.repo-metadata.json index d9c358e8e136..21504b036d15 100644 --- a/google-cloud-dataform/.repo-metadata.json +++ b/google-cloud-dataform/.repo-metadata.json @@ -8,7 +8,7 @@ "name": "dataform", "name_pretty": "Dataform API", "product_documentation": "https://cloud.google.com/dataform", - "release_level": "unreleased", + "release_level": "preview", "repo": "googleapis/google-cloud-ruby", "requires_billing": true, "ruby-cloud-description": "Dataform is a service for data analysts to develop, test, version control, and schedule complex SQL workflows for data transformation in BigQuery.", diff --git a/google-cloud-dataform/CHANGELOG.md b/google-cloud-dataform/CHANGELOG.md index f88957a62ba2..d69d8eb71a52 100644 --- a/google-cloud-dataform/CHANGELOG.md +++ b/google-cloud-dataform/CHANGELOG.md @@ -1,2 +1,9 @@ -# Release History +# Changelog +### 0.1.0 (2022-11-01) + +#### Features + +* Initial generation of google-cloud-dataform ([#19355](https://github.com/googleapis/google-cloud-ruby/issues/19355)) + +## Release History diff --git a/google-cloud-dataform/lib/google/cloud/dataform/version.rb b/google-cloud-dataform/lib/google/cloud/dataform/version.rb index 116183f30eb1..46e03a320951 100644 --- a/google-cloud-dataform/lib/google/cloud/dataform/version.rb +++ b/google-cloud-dataform/lib/google/cloud/dataform/version.rb @@ -20,7 +20,7 @@ module Google module Cloud module Dataform - VERSION = "0.0.1" + VERSION = "0.1.0" end end end From ff83f5fee06fbc7eede866a9aa145f5013d1a1d3 Mon Sep 17 00:00:00 2001 From: Neha Bajaj Date: Wed, 2 Nov 2022 22:51:30 +0530 Subject: [PATCH 015/112] chore(spanner): move google-cloud-spanner from google-cloud-ruby mono repo to ruby-spanner mono repo (#19363) --- .github/CODEOWNERS | 1 - ...er-integration-tests-against-emulator.yaml | 36 - .release-please-manifest.json | 2 - google-cloud-spanner/.autotest | 15 - google-cloud-spanner/.gitignore | 10 - google-cloud-spanner/.repo-metadata.json | 17 - google-cloud-spanner/.rubocop.yml | 47 - google-cloud-spanner/.yardopts | 17 - google-cloud-spanner/AUTHENTICATION.md | 178 -- google-cloud-spanner/CHANGELOG.md | 447 ---- google-cloud-spanner/CODE_OF_CONDUCT.md | 40 - google-cloud-spanner/CONTRIBUTING.md | 188 -- google-cloud-spanner/Gemfile | 11 - google-cloud-spanner/LICENSE | 201 -- google-cloud-spanner/LOGGING.md | 32 - google-cloud-spanner/OVERVIEW.md | 343 --- google-cloud-spanner/README.md | 184 -- google-cloud-spanner/Rakefile | 214 -- google-cloud-spanner/TROUBLESHOOTING.md | 31 - google-cloud-spanner/acceptance/data | 1 - .../acceptance/instance_client_test.rb | 82 - .../spanner/backup_operations_test.rb | 101 - .../acceptance/spanner/backup_test.rb | 197 -- .../batch_client/execute_partition_test.rb | 252 -- .../spanner/client/batch_update_test.rb | 194 -- .../spanner/client/commit_timestamp_test.rb | 30 - .../acceptance/spanner/client/crud_test.rb | 213 -- .../acceptance/spanner/client/dml_test.rb | 177 -- .../acceptance/spanner/client/edge_test.rb | 78 - .../acceptance/spanner/client/execute_test.rb | 221 -- .../spanner/client/large_data_test.rb | 113 - .../spanner/client/params/bool_test.rb | 67 - .../spanner/client/params/bytes_test.rb | 80 - .../spanner/client/params/date_test.rb | 89 - .../spanner/client/params/float64_test.rb | 106 - .../spanner/client/params/int64_test.rb | 67 - .../spanner/client/params/json_test.rb | 86 - .../spanner/client/params/pgjsonb_test.rb | 82 - .../spanner/client/params/pgnumeric_test.rb | 47 - .../spanner/client/params/string_test.rb | 67 - .../spanner/client/params/struct_test.rb | 206 -- .../spanner/client/params/timestamp_test.rb | 104 - .../acceptance/spanner/client/pdml_test.rb | 84 - .../acceptance/spanner/client/read_test.rb | 214 -- .../acceptance/spanner/client/reset_test.rb | 24 - .../spanner/client/single_use_test.rb | 223 -- .../spanner/client/snapshot_test.rb | 487 ---- .../spanner/client/transaction_test.rb | 306 --- .../spanner/client/types/bool_test.rb | 140 - .../spanner/client/types/bytes_test.rb | 200 -- .../spanner/client/types/date_test.rb | 177 -- .../spanner/client/types/float64_test.rb | 206 -- .../spanner/client/types/int64_test.rb | 140 - .../spanner/client/types/json_test.rb | 173 -- .../spanner/client/types/numeric_test.rb | 202 -- .../spanner/client/types/pgjsonb_test.rb | 160 -- .../spanner/client/types/pgnumeric_test.rb | 98 - .../spanner/client/types/string_test.rb | 141 - .../spanner/client/types/struct_test.rb | 39 - .../spanner/client/types/timestamp_test.rb | 181 -- .../spanner/database_client_test.rb | 121 - .../spanner/database_operations_test.rb | 56 - .../acceptance/spanner/database_test.rb | 135 - .../spanner/fine_grain_access_control_test.rb | 80 - .../spanner/instance_config_test.rb | 28 - .../acceptance/spanner/instance_test.rb | 57 - .../acceptance/spanner_helper.rb | 189 -- .../benchmark/benchwrapper/README.md | 20 - .../benchmark/benchwrapper/benchwrapper.rb | 99 - .../benchwrapper/benchwrapper_test_client.rb | 56 - .../benchwrapper/kokoro/benchwrapper.sh | 33 - .../benchmark/benchwrapper/spanner.proto | 71 - .../benchmark/benchwrapper/spanner_pb.rb | 55 - .../benchwrapper/spanner_services_pb.rb | 54 - google-cloud-spanner/benchmark/bin/ycsb | 22 - google-cloud-spanner/benchmark/ycsb.rb | 202 -- .../google-cloud-spanner.gemspec | 40 - .../lib/google-cloud-spanner.rb | 188 -- .../lib/google/cloud/spanner.rb | 189 -- .../google/cloud/spanner/admin/database.rb | 324 --- .../spanner/admin/database/credentials.rb | 31 - .../google/cloud/spanner/admin/instance.rb | 324 --- .../spanner/admin/instance/credentials.rb | 31 - .../lib/google/cloud/spanner/backup.rb | 400 --- .../lib/google/cloud/spanner/backup/job.rb | 281 -- .../google/cloud/spanner/backup/job/list.rb | 184 -- .../lib/google/cloud/spanner/backup/list.rb | 176 -- .../cloud/spanner/backup/restore/job.rb | 253 -- .../lib/google/cloud/spanner/batch_client.rb | 433 ---- .../google/cloud/spanner/batch_snapshot.rb | 822 ------ .../lib/google/cloud/spanner/batch_update.rb | 170 -- .../lib/google/cloud/spanner/client.rb | 2273 ----------------- .../lib/google/cloud/spanner/column_value.rb | 115 - .../lib/google/cloud/spanner/commit.rb | 356 --- .../google/cloud/spanner/commit_response.rb | 87 - .../spanner/commit_response/commit_stats.rb | 51 - .../lib/google/cloud/spanner/convert.rb | 360 --- .../lib/google/cloud/spanner/credentials.rb | 44 - .../lib/google/cloud/spanner/data.rb | 244 -- .../lib/google/cloud/spanner/database.rb | 754 ------ .../cloud/spanner/database/backup_info.rb | 119 - .../lib/google/cloud/spanner/database/job.rb | 222 -- .../google/cloud/spanner/database/job/list.rb | 184 -- .../lib/google/cloud/spanner/database/list.rb | 178 -- .../cloud/spanner/database/restore_info.rb | 68 - .../lib/google/cloud/spanner/errors.rb | 100 - .../lib/google/cloud/spanner/fields.rb | 450 ---- .../lib/google/cloud/spanner/instance.rb | 977 ------- .../google/cloud/spanner/instance/config.rb | 104 - .../cloud/spanner/instance/config/list.rb | 178 -- .../lib/google/cloud/spanner/instance/job.rb | 240 -- .../lib/google/cloud/spanner/instance/list.rb | 174 -- .../lib/google/cloud/spanner/partition.rb | 217 -- .../lib/google/cloud/spanner/policy.rb | 188 -- .../lib/google/cloud/spanner/pool.rb | 292 --- .../lib/google/cloud/spanner/project.rb | 684 ----- .../lib/google/cloud/spanner/range.rb | 99 - .../lib/google/cloud/spanner/results.rb | 408 --- .../lib/google/cloud/spanner/service.rb | 657 ----- .../lib/google/cloud/spanner/session.rb | 1250 --------- .../lib/google/cloud/spanner/snapshot.rb | 504 ---- .../lib/google/cloud/spanner/status.rb | 85 - .../lib/google/cloud/spanner/transaction.rb | 1149 --------- .../lib/google/cloud/spanner/version.rb | 22 - .../support/doctest_helper.rb | 1758 ------------- .../admin/database/client_config_test.rb | 60 - .../admin/instance/client_config_test.rb | 60 - .../spanner/admin/instance/client_test.rb | 47 - .../cloud/spanner/backup/delete_test.rb | 37 - .../cloud/spanner/backup/expire_time_test.rb | 57 - .../backup/referencing_databases_test.rb | 50 - .../cloud/spanner/backup/restore_test.rb | 143 -- .../test/google/cloud/spanner/backup_test.rb | 53 - .../google/cloud/spanner/batch_client_test.rb | 292 --- .../batch_snapshot/execute_partition_test.rb | 471 ---- .../batch_snapshot/execute_query_test.rb | 354 --- .../spanner/batch_snapshot/metadata_test.rb | 40 - .../batch_snapshot/partition_query_test.rb | 462 ---- .../batch_snapshot/partition_read_test.rb | 220 -- .../cloud/spanner/batch_snapshot/read_test.rb | 259 -- .../google/cloud/spanner/client/admin_test.rb | 76 - .../google/cloud/spanner/client/close_test.rb | 64 - .../client/commit_field_values_test.rb | 205 -- .../cloud/spanner/client/commit_test.rb | 677 ----- .../spanner/client/commit_timestamp_test.rb | 36 - .../client/commit_transaction_tag_test.rb | 166 -- .../client/execute_partition_update_test.rb | 358 --- .../client/execute_query_resume_test.rb | 271 -- .../client/execute_query_single_use_test.rb | 302 --- .../spanner/client/execute_query_test.rb | 459 ---- .../cloud/spanner/client/fields_for_test.rb | 76 - .../google/cloud/spanner/client/range_test.rb | 67 - .../cloud/spanner/client/read_error_test.rb | 121 - .../client/read_resume_buffer_bound_test.rb | 254 -- .../cloud/spanner/client/read_resume_test.rb | 168 -- .../spanner/client/read_single_use_test.rb | 358 --- .../google/cloud/spanner/client/read_test.rb | 378 --- .../google/cloud/spanner/client/reset_test.rb | 71 - .../cloud/spanner/client/snapshot_test.rb | 325 --- .../cloud/spanner/client/threads_test.rb | 43 - .../spanner/client/transaction_retry_test.rb | 430 ---- .../client/transaction_rollback_test.rb | 197 -- .../cloud/spanner/client/transaction_test.rb | 733 ------ .../google/cloud/spanner/column_value_test.rb | 25 - .../cloud/spanner/commit_response_test.rb | 41 - .../convert/duration_to_number_test.rb | 76 - .../convert/grpc_type_for_field_test.rb | 100 - .../convert/grpc_value_to_object_test.rb | 146 -- .../convert/number_to_duration_test.rb | 94 - .../cloud/spanner/convert/timestamp_test.rb | 58 - .../spanner/convert/to_key_range_test.rb | 88 - .../spanner/convert/to_query_params_test.rb | 1133 -------- .../convert/to_request_options_test.rb | 47 - .../cloud/spanner/database/backup_test.rb | 136 - .../cloud/spanner/database/client_test.rb | 47 - .../spanner/database/create_backup_test.rb | 201 -- .../database/database_operations_test.rb | 242 -- .../google/cloud/spanner/database/ddl_test.rb | 63 - .../cloud/spanner/database/drop_test.rb | 32 - .../google/cloud/spanner/database/iam_test.rb | 149 -- .../cloud/spanner/database/update_test.rb | 88 - .../google/cloud/spanner/database_test.rb | 81 - .../fields/deeply_nested_struct_test.rb | 101 - .../cloud/spanner/fields/initializer_test.rb | 118 - .../cloud/spanner/fields/struct_test.rb | 264 -- .../instance/backup_operations_test.rb | 225 -- .../cloud/spanner/instance/backup_test.rb | 70 - .../cloud/spanner/instance/backups_test.rb | 162 -- .../cloud/spanner/instance/config_test.rb | 39 - .../spanner/instance/create_database_test.rb | 138 - .../instance/database_operations_test.rb | 225 -- .../cloud/spanner/instance/database_test.rb | 63 - .../cloud/spanner/instance/databases_test.rb | 175 -- .../cloud/spanner/instance/delete_test.rb | 31 - .../google/cloud/spanner/instance/iam_test.rb | 149 -- .../cloud/spanner/instance/save_test.rb | 109 - .../google/cloud/spanner/instance_test.rb | 38 - .../google/cloud/spanner/pool/close_test.rb | 64 - .../spanner/pool/keepalive_or_release_test.rb | 125 - .../pool/new_sessions_in_process_test.rb | 84 - .../cloud/spanner/pool/write_ratio_test.rb | 143 -- .../test/google/cloud/spanner/pool_test.rb | 350 --- .../spanner/project/create_database_test.rb | 100 - .../spanner/project/create_instance_test.rb | 135 - .../cloud/spanner/project/database_test.rb | 61 - .../cloud/spanner/project/databases_test.rb | 173 -- .../spanner/project/instance_config_test.rb | 51 - .../spanner/project/instance_configs_test.rb | 172 -- .../cloud/spanner/project/instance_test.rb | 51 - .../cloud/spanner/project/instances_test.rb | 172 -- .../test/google/cloud/spanner/project_test.rb | 43 - .../test/google/cloud/spanner/range_test.rb | 57 - .../spanner/results/anonymous_struct_test.rb | 61 - .../results/deeply_nested_list_test.rb | 201 -- .../spanner/results/duplicate_struct_test.rb | 67 - .../cloud/spanner/results/duplicate_test.rb | 81 - .../spanner/results/empty_field_names_test.rb | 73 - .../spanner/results/empty_fields_test.rb | 52 - .../cloud/spanner/results/empty_rows_test.rb | 57 - .../spanner/results/from_enum_single_test.rb | 88 - .../cloud/spanner/results/from_enum_test.rb | 100 - .../cloud/spanner/results/merge_test.rb | 224 -- .../spanner/results/nested_struct_test.rb | 65 - .../cloud/spanner/results/row_count_test.rb | 83 - .../cloud/spanner/results/timestamp_test.rb | 47 - .../test/google/cloud/spanner/service_test.rb | 70 - .../cloud/spanner/session/commit_test.rb | 268 -- .../spanner/session/execute_query_test.rb | 311 --- .../cloud/spanner/session/keepalive_test.rb | 82 - .../google/cloud/spanner/session/read_test.rb | 214 -- .../cloud/spanner/session/release_test.rb | 34 - .../cloud/spanner/session/reload_test.rb | 93 - .../spanner/snapshot/execute_query_test.rb | 318 --- .../cloud/spanner/snapshot/metadata_test.rb | 40 - .../cloud/spanner/snapshot/range_test.rb | 66 - .../cloud/spanner/snapshot/read_test.rb | 260 -- .../test/google/cloud/spanner/status_test.rb | 166 -- .../spanner/transaction/batch_update_test.rb | 227 -- .../transaction/commit_timestamp_test.rb | 33 - .../spanner/transaction/execute_query_test.rb | 336 --- .../transaction/execute_update_test.rb | 293 --- .../spanner/transaction/fields_for_test.rb | 77 - .../spanner/transaction/keepalive_test.rb | 40 - .../cloud/spanner/transaction/range_test.rb | 66 - .../cloud/spanner/transaction/read_test.rb | 283 -- .../cloud/spanner/transaction/release_test.rb | 37 - .../transaction/transaction_id_test.rb | 32 - .../test/google/cloud/spanner_test.rb | 805 ------ google-cloud-spanner/test/helper.rb | 262 -- release-please-config.json | 4 - 250 files changed, 48175 deletions(-) delete mode 100644 .github/workflows/spanner-integration-tests-against-emulator.yaml delete mode 100644 google-cloud-spanner/.autotest delete mode 100644 google-cloud-spanner/.gitignore delete mode 100644 google-cloud-spanner/.repo-metadata.json delete mode 100644 google-cloud-spanner/.rubocop.yml delete mode 100644 google-cloud-spanner/.yardopts delete mode 100644 google-cloud-spanner/AUTHENTICATION.md delete mode 100644 google-cloud-spanner/CHANGELOG.md delete mode 100644 google-cloud-spanner/CODE_OF_CONDUCT.md delete mode 100644 google-cloud-spanner/CONTRIBUTING.md delete mode 100644 google-cloud-spanner/Gemfile delete mode 100644 google-cloud-spanner/LICENSE delete mode 100644 google-cloud-spanner/LOGGING.md delete mode 100644 google-cloud-spanner/OVERVIEW.md delete mode 100644 google-cloud-spanner/README.md delete mode 100644 google-cloud-spanner/Rakefile delete mode 100644 google-cloud-spanner/TROUBLESHOOTING.md delete mode 120000 google-cloud-spanner/acceptance/data delete mode 100644 google-cloud-spanner/acceptance/instance_client_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/backup_operations_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/backup_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/batch_client/execute_partition_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/batch_update_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/commit_timestamp_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/crud_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/dml_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/edge_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/execute_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/large_data_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/bool_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/bytes_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/date_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/float64_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/int64_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/json_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/pgjsonb_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/pgnumeric_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/string_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/struct_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/params/timestamp_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/pdml_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/read_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/reset_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/single_use_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/snapshot_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/transaction_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/bool_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/bytes_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/date_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/float64_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/int64_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/json_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/numeric_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/pgjsonb_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/pgnumeric_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/string_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/struct_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/client/types/timestamp_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/database_client_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/database_operations_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/database_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/fine_grain_access_control_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/instance_config_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner/instance_test.rb delete mode 100644 google-cloud-spanner/acceptance/spanner_helper.rb delete mode 100644 google-cloud-spanner/benchmark/benchwrapper/README.md delete mode 100755 google-cloud-spanner/benchmark/benchwrapper/benchwrapper.rb delete mode 100644 google-cloud-spanner/benchmark/benchwrapper/benchwrapper_test_client.rb delete mode 100755 google-cloud-spanner/benchmark/benchwrapper/kokoro/benchwrapper.sh delete mode 100644 google-cloud-spanner/benchmark/benchwrapper/spanner.proto delete mode 100644 google-cloud-spanner/benchmark/benchwrapper/spanner_pb.rb delete mode 100644 google-cloud-spanner/benchmark/benchwrapper/spanner_services_pb.rb delete mode 100755 google-cloud-spanner/benchmark/bin/ycsb delete mode 100644 google-cloud-spanner/benchmark/ycsb.rb delete mode 100644 google-cloud-spanner/google-cloud-spanner.gemspec delete mode 100644 google-cloud-spanner/lib/google-cloud-spanner.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/admin/database.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/admin/database/credentials.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/admin/instance.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/admin/instance/credentials.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/backup.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/backup/job.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/backup/job/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/backup/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/backup/restore/job.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/batch_client.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/batch_snapshot.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/batch_update.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/client.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/column_value.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/commit.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/commit_response.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/commit_response/commit_stats.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/convert.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/credentials.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/data.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database/backup_info.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database/job.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database/job/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/database/restore_info.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/errors.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/fields.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/instance.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/instance/config.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/instance/config/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/instance/job.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/instance/list.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/partition.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/policy.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/pool.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/project.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/range.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/results.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/service.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/session.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/snapshot.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/status.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/transaction.rb delete mode 100644 google-cloud-spanner/lib/google/cloud/spanner/version.rb delete mode 100644 google-cloud-spanner/support/doctest_helper.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/admin/database/client_config_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_config_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/backup/delete_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/backup/expire_time_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/backup/referencing_databases_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/backup/restore_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/backup_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_client_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_partition_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/metadata_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/admin_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/close_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/commit_field_values_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/commit_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/commit_timestamp_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/commit_transaction_tag_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/execute_partition_update_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/execute_query_resume_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/execute_query_single_use_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/execute_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/fields_for_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/range_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/read_error_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/read_resume_buffer_bound_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/read_resume_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/read_single_use_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/reset_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/snapshot_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/threads_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/transaction_retry_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/transaction_rollback_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/client/transaction_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/column_value_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/commit_response_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/duration_to_number_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/grpc_type_for_field_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/grpc_value_to_object_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/number_to_duration_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/timestamp_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/to_key_range_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/to_query_params_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/convert/to_request_options_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/backup_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/client_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/create_backup_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/database_operations_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/ddl_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/drop_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/iam_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database/update_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/database_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/fields/deeply_nested_struct_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/fields/initializer_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/fields/struct_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/backup_operations_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/backup_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/backups_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/config_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/create_database_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/database_operations_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/database_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/databases_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/delete_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/iam_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance/save_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/instance_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/pool/close_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/pool/keepalive_or_release_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/pool/new_sessions_in_process_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/pool/write_ratio_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/pool_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/create_database_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/create_instance_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/database_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/databases_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/instance_config_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/instance_configs_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/instance_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project/instances_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/project_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/range_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/anonymous_struct_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/deeply_nested_list_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/duplicate_struct_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/duplicate_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/empty_field_names_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/empty_fields_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/empty_rows_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/from_enum_single_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/from_enum_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/merge_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/nested_struct_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/row_count_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/results/timestamp_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/service_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/commit_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/execute_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/keepalive_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/release_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/session/reload_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/snapshot/execute_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/snapshot/metadata_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/snapshot/range_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/snapshot/read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/status_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/batch_update_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/commit_timestamp_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/execute_query_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/execute_update_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/fields_for_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/keepalive_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/range_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/read_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/release_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner/transaction/transaction_id_test.rb delete mode 100644 google-cloud-spanner/test/google/cloud/spanner_test.rb delete mode 100644 google-cloud-spanner/test/helper.rb diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5a33cfbb142c..cac8734c1b13 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -16,7 +16,6 @@ /google-cloud-firestore*/. @googleapis/ruby-team @googleapis/firestore-dpe /google-cloud-language*/. @googleapis/ruby-team @googleapis/ml-apis /google-cloud-pubsub*/. @googleapis/ruby-team @googleapis/api-pubsub -/google-cloud-spanner*/ @googleapis/ruby-team @googleapis/api-spanner-ruby /google-cloud-speech*/. @googleapis/ruby-team @googleapis/ml-apis /google-cloud-storage/ @googleapis/ruby-team @googleapis/cloud-storage-dpe /google-cloud-talent*/. @googleapis/ruby-team @googleapis/ml-apis diff --git a/.github/workflows/spanner-integration-tests-against-emulator.yaml b/.github/workflows/spanner-integration-tests-against-emulator.yaml deleted file mode 100644 index 1454d5fc0e78..000000000000 --- a/.github/workflows/spanner-integration-tests-against-emulator.yaml +++ /dev/null @@ -1,36 +0,0 @@ -on: - push: - branches: - - main - paths: - - 'google-cloud-spanner*/**' - pull_request: - paths: - - 'google-cloud-spanner*/**' -name: Run Spanner integration tests against service emulator -jobs: - test: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - working-directory: google-cloud-spanner - - services: - emulator: - image: gcr.io/cloud-spanner-emulator/emulator:1.4.6 - ports: - - 9010:9010 - - 9020:9020 - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - run: ruby --version - - run: bundle install - - run: bundle exec rake acceptance - env: - SPANNER_EMULATOR_HOST: localhost:9010 - SPANNER_TEST_PROJECT: emulator-test-project diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1e7c339cb438..a5504635a619 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -521,8 +521,6 @@ "google-cloud-shell+FILLER": "0.0.0", "google-cloud-shell-v1": "0.2.0", "google-cloud-shell-v1+FILLER": "0.0.0", - "google-cloud-spanner": "2.16.0", - "google-cloud-spanner+FILLER": "0.0.0", "google-cloud-spanner-admin-database-v1": "0.11.0", "google-cloud-spanner-admin-database-v1+FILLER": "0.0.0", "google-cloud-spanner-admin-instance-v1": "0.8.0", diff --git a/google-cloud-spanner/.autotest b/google-cloud-spanner/.autotest deleted file mode 100644 index a904fa5abf9b..000000000000 --- a/google-cloud-spanner/.autotest +++ /dev/null @@ -1,15 +0,0 @@ -# -*- ruby -*- - -require "autotest/suffix" - -# Autotest.add_hook :initialize do |at| -# at.clear_mappings -# -# at.add_mapping %r%^lib/(.*)\.rb$% do |_, m| -# at.files_matching %r%^test/#{m[1]}.*_test.rb$% -# end -# -# at.add_mapping %r%^test/.*_test\.rb$% do |filename, _| -# filename -# end -# end diff --git a/google-cloud-spanner/.gitignore b/google-cloud-spanner/.gitignore deleted file mode 100644 index a392f5ce05eb..000000000000 --- a/google-cloud-spanner/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -Gemfile.lock -coverage/* -doc/* -pkg/* -html/* -jsondoc/* -.ruby-version - -# Ignore YARD stuffs -.yardoc diff --git a/google-cloud-spanner/.repo-metadata.json b/google-cloud-spanner/.repo-metadata.json deleted file mode 100644 index 9d6e41f7ffd9..000000000000 --- a/google-cloud-spanner/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "spanner.googleapis.com", - "api_shortname": "spanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-spanner/latest", - "distribution_name": "google-cloud-spanner", - "language": "ruby", - "name": "spanner", - "name_pretty": "Cloud Spanner API", - "product_documentation": "https://cloud.google.com/spanner", - "release_level": "stable", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Spanner is a managed, mission-critical, globally consistent and scalable relational database service. Note that google-cloud-spanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-spanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "SPANNER", - "ruby-cloud-product-url": "https://cloud.google.com/spanner", - "library_type": "GAPIC_MANUAL" -} diff --git a/google-cloud-spanner/.rubocop.yml b/google-cloud-spanner/.rubocop.yml deleted file mode 100644 index 71b696e4aa2f..000000000000 --- a/google-cloud-spanner/.rubocop.yml +++ /dev/null @@ -1,47 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "support/**/*" - - "google-cloud-spanner.gemspec" - - "Rakefile" - - "test/**/*" - - "benchmark/**/*" - - "vendor/**/*" - -Documentation: - Enabled: false - -Metrics/BlockLength: - Exclude: - - "acceptance/**/*" -Metrics/MethodLength: - Exclude: - - "acceptance/**/*" -Metrics/ModuleLength: - Exclude: - - "acceptance/**/*" -Metrics/AbcSize: - Exclude: - - "acceptance/**/*" -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Exclude: - - "acceptance/**/*" - - "lib/google/cloud/spanner.rb" -Metrics/PerceivedComplexity: - Exclude: - - "acceptance/**/*" - - "lib/google/cloud/spanner.rb" -Naming/FileName: - Exclude: - - "lib/google-cloud-spanner.rb" -Style/GlobalVars: - Exclude: - - "acceptance/**/*" -Style/SymbolArray: - Enabled: false -Style/WordArray: - Enabled: false diff --git a/google-cloud-spanner/.yardopts b/google-cloud-spanner/.yardopts deleted file mode 100644 index c2e13ae18d50..000000000000 --- a/google-cloud-spanner/.yardopts +++ /dev/null @@ -1,17 +0,0 @@ ---no-private ---title=Google Cloud Spanner ---exclude _pb\.rb$ ---markup markdown ---markup-provider redcarpet ---main OVERVIEW.md - -./lib/**/*.rb -- -OVERVIEW.md -AUTHENTICATION.md -LOGGING.md -CONTRIBUTING.md -TROUBLESHOOTING.md -CHANGELOG.md -CODE_OF_CONDUCT.md -LICENSE diff --git a/google-cloud-spanner/AUTHENTICATION.md b/google-cloud-spanner/AUTHENTICATION.md deleted file mode 100644 index 7fa3a0d16b96..000000000000 --- a/google-cloud-spanner/AUTHENTICATION.md +++ /dev/null @@ -1,178 +0,0 @@ -# Authentication - -In general, the google-cloud-spanner library uses [Service -Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts) -credentials to connect to Google Cloud services. When running within [Google -Cloud Platform environments](#google-cloud-platform-environments) -the credentials will be discovered automatically. When running on other -environments, the Service Account credentials can be specified by providing the -path to the [JSON -keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys) for -the account (or the JSON itself) in [environment -variables](#environment-variables). Additionally, Cloud SDK credentials can also -be discovered automatically, but this is only recommended during development. - -## Quickstart - -1. [Create a service account and credentials](#creating-a-service-account). -2. Set the [environment variable](#environment-variables). - -```sh -export SPANNER_CREDENTIALS=/path/to/json` -``` - -3. Initialize the client. - -```ruby -require "google/cloud/spanner" - -client = Google::Cloud::Spanner.new -``` - -## Project and Credential Lookup - -The google-cloud-spanner library aims to make authentication -as simple as possible, and provides several mechanisms to configure your system -without providing **Project ID** and **Service Account Credentials** directly in -code. - -**Project ID** is discovered in the following order: - -1. Specify project ID in method arguments -2. Specify project ID in configuration -3. Discover project ID in environment variables -4. Discover GCE project ID -5. Discover project ID in credentials JSON - -**Credentials** are discovered in the following order: - -1. Specify credentials in method arguments -2. Specify credentials in configuration -3. Discover credentials path in environment variables -4. Discover credentials JSON in environment variables -5. Discover credentials file in the Cloud SDK's path -6. Discover GCE credentials - -### Google Cloud Platform environments - -When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE), -Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions -(GCF) and Cloud Run, the **Project ID** and **Credentials** and are discovered -automatically. Code should be written as if already authenticated. - -### Environment Variables - -The **Project ID** and **Credentials JSON** can be placed in environment -variables instead of declaring them directly in code. Each service has its own -environment variable, allowing for different service accounts to be used for -different services. (See the READMEs for the individual service gems for -details.) The path to the **Credentials JSON** file can be stored in the -environment variable, or the **Credentials JSON** itself can be stored for -environments such as Docker containers where writing files is difficult or not -encouraged. - -The environment variables that google-cloud-spanner checks for project ID are: - -1. `SPANNER_PROJECT` -2. `GOOGLE_CLOUD_PROJECT` - -The environment variables that google-cloud-spanner checks for credentials are configured on `Google::Cloud::Spanner::V1::Spanner::Credentials`: - -1. `SPANNER_CREDENTIALS` - Path to JSON file, or JSON contents -2. `SPANNER_KEYFILE` - Path to JSON file, or JSON contents -3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents -5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/cloud/spanner" - -ENV["SPANNER_PROJECT"] = "my-project-id" -ENV["SPANNER_CREDENTIALS"] = "path/to/keyfile.json" - -client = Google::Cloud::Spanner.new -``` - -### Configuration - -The **Project ID** and the path to the **Credentials JSON** file can be configured -instead of placing them in environment variables or providing them as arguments. - -```ruby -require "google/cloud/spanner" - -Google::Cloud::Spanner.configure do |config| - config.project_id = "my-project-id" - config.credentials = "path/to/keyfile.json" -end - -client = Google::Cloud::Spanner.new -``` - -### Cloud SDK - -This option allows for an easy way to authenticate during development. If -credentials are not provided in code or in environment variables, then Cloud SDK -credentials are discovered. - -To configure your system for this, simply: - -1. [Download and install the Cloud SDK](https://cloud.google.com/sdk) -2. Authenticate using OAuth 2.0 `$ gcloud auth login` -3. Write code as if already authenticated. - -**NOTE:** This is _not_ recommended for running in production. The Cloud SDK -*should* only be used during development. - -[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using -[dev-console]: https://console.cloud.google.com/project - -[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png - -[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png -[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png -[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png - -## Creating a Service Account - -Google Cloud requires a **Project ID** and **Service Account Credentials** to -connect to the APIs. You will use the **Project ID** and **JSON key file** to -connect to most services with google-cloud-spanner. - -If you are not running this client within [Google Cloud Platform -environments](#google-cloud-platform-environments), you need a Google -Developers service account. - -1. Visit the [Google Developers Console][dev-console]. -1. Create a new project or click on an existing project. -1. Activate the slide-out navigation tray and select **API Manager**. From - here, you will enable the APIs that your application requires. - - ![Enable the APIs that your application requires][enable-apis] - - *Note: You may need to enable billing in order to use these services.* - -1. Select **Credentials** from the side navigation. - - You should see a screen like one of the following. - - ![Create a new service account][create-new-service-account] - - ![Create a new service account With Existing Keys][create-new-service-account-existing-keys] - - Find the "Add credentials" drop down and select "Service account" to be - guided through downloading a new JSON key file. - - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, and click "Generate - new JSON key": - - ![Re-use an existing service account][reuse-service-account] - - The key file you download will be used by this library to authenticate API - requests and should be stored in a secure location. - -## Troubleshooting - -If you're having trouble authenticating you can ask for help by following the -[Troubleshooting Guide](TROUBLESHOOTING.md). diff --git a/google-cloud-spanner/CHANGELOG.md b/google-cloud-spanner/CHANGELOG.md deleted file mode 100644 index bcc5fe254a84..000000000000 --- a/google-cloud-spanner/CHANGELOG.md +++ /dev/null @@ -1,447 +0,0 @@ -# Release History - -### 2.16.0 (2022-10-25) - -#### Features - -* support pg jsonb ([#19116](https://github.com/googleapis/google-cloud-ruby/issues/19116)) - -### 2.15.0 (2022-09-07) - -#### Features - -* Support fine grained access control ([#19067](https://github.com/googleapis/google-cloud-ruby/issues/19067)) - -### 2.14.0 (2022-07-08) - -#### Features - -* Updated minimum Ruby version to 2.6 ([#18454](https://github.com/googleapis/google-cloud-ruby/issues/18454)) - -### 2.13.0 / 2022-04-01 - -#### Features - -* add spangres support ([#17661](https://www.github.com/googleapis/google-cloud-ruby/issues/17661)) - * add pg_numeric and tests - * skip test for emulator - * add rubocop for acceptance - -### 2.12.1 / 2022-02-16 - -#### Bug Fixes - -* pass quota_project_id from credentials - -### 2.12.0 / 2022-01-11 - -No significant changes. - -### 2.11.0 / 2021-12-10 - -#### Features - -* add admin instance wrapper. -* Updated benchwrapper and proto for spanner. -* use gRPC clients for instance/database management. -* wrapper to create generated admin database client. - -### 2.10.1 / 2021-11-09 - -#### Documentation - -* Add documentation for quota_project Configuration attribute - -### 2.10.0 / 2021-08-24 - -#### Features - -* add field JSON type support - -### 2.9.0 / 2021-07-26 - -#### Features - -* support request tagging - -### 2.8.1 / 2021-07-08 - -#### Documentation - -* Update AUTHENTICATION.md in handwritten packages - -### 2.8.0 / 2021-06-17 - -#### Features - -* create instance using processing units/node count - -### 2.7.0 / 2021-06-09 - -#### Features - -* add the support of optimizer statistics package -* database create time access method -* RPC priority request option. - -#### Bug Fixes - -* extract binary retry info from error - -### 2.6.0 / 2021-03-31 - -#### Features - -* add cmek backup support -* add cmek db support - -### 2.5.0 / 2021-03-10 - -#### Features - -* Drop support for Ruby 2.4 and add support for Ruby 3.0 - -### 2.4.0 / 2021-02-18 - -#### Features - -* Point In Time Recovery (PITR) - -### 2.3.0 / 2021-02-09 - -#### Features - -* CommitStats in CommitResponse -* optionalize `credentials` when using cloud spanner emulator host - -### 2.2.0 / 2020-09-15 - -#### Features - -* quota_project can be set via library configuration -* Support numeric type. - -#### Bug Fixes - -* retry or resume eos and rst_stream errors - -### 2.1.0 / 2020-08-05 - -#### Features - -* Support custom setting of timeout and retry - -### 2.0.0 / 2020-07-23 - -This is a major update that removes the "low-level" client interface code, and -instead adds `google-cloud-spanner-v1`, `google-cloud-spanner-admin-database-v1`, -and `google-cloud-spanner-admin-instance-v1` as dependencies. -The new dependencies are rewritten low-level clients, produced by a next- -generation client code generator, with improved performance and stability. - -This change should have no effect on the high-level interface that most users -will use. The one exception is that the (mostly undocumented) `client_config` -argument, for adjusting low-level parameters such as RPC retry settings on -client objects, has been removed. If you need to adjust these parameters, use -the configuration interface in low-level clients. - -Substantial changes have been made in the low-level interfaces, however. If you -are using the low-level classes under the old `Google::Spanner::V1` module, -please review the docs for the new `google-cloud-spanner-v1` gem. In particular: - -* Some classes have been renamed, notably the client class itself. -* The client constructor takes a configuration block instead of configuration - keyword arguments. -* All RPC method arguments are now keyword arguments. - -### 1.16.2 / 2020-05-28 - -#### Documentation - -* Fix a few broken links - -### 1.16.1 / 2020-05-21 - -#### Bug Fixes - -* Increased default timeouts to match clients in other languages -* Run system tests against the emulator, skipping those not supported by the emulator -* Do not require a key file when running against the emulator - -### 1.16.0 / 2020-03-20 - -#### Features - -* Added support for backing up and restoring databases - -### 1.15.0 / 2020-03-15 - -#### Features - -* Added support for query options -* Support separate project setting for quota/billing - -### 1.14.0 / 2020-02-18 - -#### Features - -* allow custom lib name and version for telemetry purpose - -### 1.13.1 / 2020-01-22 - -#### Documentation - -* fix incorrect doc links in CONTRIBUTING.md -* Update copyright year -* Update Status documentation - -### 1.13.0 / 2020-01-08 - -#### Features - -* Add support for SPANNER_EMULATOR_HOST - -### 1.12.2 / 2019-12-19 - -#### Bug Fixes - -* Rename endpoint_urls to endpoint_uris -* Revert #commit mutations to positional in lower-level API -* Revert breaking change to test_iam_permissions in lower-level API - -#### Performance Improvements - -* Add Instance#endpoint_urls and GetInstanceRequest#field_mask in lower-level API -* Add service address and port for lower-level API clients - -### 1.12.1 / 2019-11-12 - -#### Features - -* Add InstanceConfig#replicas (ReplicaInfo) to the lower-level API. - -#### Documentation - -* Update lower-level API documentation. - -#### Bug Fixes - -* Update minimum runtime dependencies. - -### 1.12.0 / 2019-10-29 - -This release requires Ruby 2.4 or later. - -#### Documentation - -* Clarify which Google Cloud Platform environments support automatic authentication - -### 1.11.0 / 2019-10-07 - -#### BREAKING CHANGES (LOWER-LEVEL API ONLY) - -* Make the session_count argument required in the lower-level API batch_create_sessions call - -#### Performance Improvements - -* Update Pool#init to use BatchCreateSessions - * Update pool checkout to pop sessions for LIFO - -#### Documentation - -* Update Policy example code -* Update IAM Policy class description and sample code - -### 1.10.1 / 2019-09-04 - -#### Documentation - -* Update low-level IAM documentation - * Update GetPolicyOption#requested_policy_version docs - * Un-deprecate Policy#version - -### 1.10.0 / 2019-08-23 - -#### Features - -* Add Batch Create Sessions to low-level API - * Add SpannerClient#batch_create_sessions - * Add BatchCreateSessionsRequest - * Add BatchCreateSessionsResponse -* Support overriding of service endpoint - -#### Bug Fixes - -* Low-level admin clients now honor service_address and service_port - -#### Documentation - -* Update documentation - -### 1.9.5 / 2019-07-31 - -* Reduce thread usage at startup - * Allocate threads in pool as needed, not all up front -* Update documentation links - -### 1.9.4 / 2019-07-08 - -* Add IAM GetPolicyOptions in the lower-level API. -* Support overriding service host and port in the lower-level interface. - -### 1.9.3 / 2019-06-27 - -* Update network configuration for some initial_retry_delay_millis - and timeout_millis settings - -### 1.9.2 / 2019-06-13 - -* Update IAM: - * Deprecate Policy#version - * Add Binding#condition - * Add Google::Type::Expr - * Update documentation -* Update retry configuration -* Use VERSION constant in GAPIC client - -### 1.9.1 / 2019-04-30 - -* Fix Spanner session limit bug. -* Update AUTHENTICATION.md guide. -* Update documentation for common types. -* Update generated documentation. -* Extract gRPC header values from request. - -### 1.9.0 / 2019-03-08 - -* Spanner Batch DML. - * Add Transaction#batch_update. - * Add BatchUpdate. - * Add BatchUpdateError. - * Add SpannerClient#execute_batch_dml. - -### 1.8.0 / 2019-02-01 - -* Make use of Credentials#project_id - * Use Credentials#project_id - If a project_id is not provided, use the value on the Credentials object. - This value was added in googleauth 0.7.0. - * Loosen googleauth dependency - Allow for new releases up to 0.10. - The googleauth devs have committed to maintaining the current API - and will not make backwards compatible changes before 0.10. -* Performance improvements for Data#to_h - * Add Data skip_dup_check optional arg - * This enhancement allows users to skip the dupplicate name check - when serializing Data to a Ruby Hash or Array. - This speeds up the serialization, but data may be lost. -* Update network configuration -* Update Client#close to block on session release - -### 1.7.2 / 2018-11-15 - -* Allow Spanner streams to recover from more errors. - -### 1.7.1 / 2018-10-08 - -* Add DML and Partitioned DML support - * Add execute_update to process DML statements - * Add execute_partition_update for Partitioned DML -* Rename execute_query method - * Maintain naming consistency with execute_update method. - * Maintain compatibility by adding query, execute and execute_sql aliases. - -### 1.6.4 / 2018-09-20 - -* Update Spanner generated files. - * Add DML/PDML code structures. -* Update documentation. - * Change documentation URL to googleapis GitHub org. -* Fix circular require warning. - -### 1.6.3 / 2018-09-12 - -* Add missing documentation files to package. - -### 1.6.2 / 2018-09-10 - -* Update documentation. - -### 1.6.1 / 2018-08-21 - -* Update documentation. - -### 1.6.0 / 2018-06-28 - -* Add Session labels - * Add labels optional argument to Project#client and #batch_client. - * Add labels optional argument to Project#batch_client. -* Bug fix when an error is raised while returning results. - -### 1.5.0 / 2018-06-12 - -* Support STRUCT values in query parameters. - * Add `Fields#struct` to create a `Data` object. -* Documentation updates. - -### 1.4.0 / 2018-03-26 - -* Add support for commit_timestamp. - -### 1.3.1 / 2018-02-27 - -* Add Batch Client - * Support partitioned reads and queries. -* Support Shared Configuration. -* Fix issue with IAM Policy not refreshing properly. -* Fix issue when using Time objects as keys. - -### 1.2.0 / 2017-12-19 - -* Update Low Level API code - * Remove deprecated constructor arguments. - * Update documentation. -* Update google-gax dependency to 1.0. - -### 1.1.1 / 2017-11-15 - -* Fix Admin Credentials (GAPIC) environment variable names. - -### 1.1.0 / 2017-11-14 - -* Add `Google::Cloud::Spanner::Credentials` class. -* Rename constructor arguments to `project_id` and `credentials`. - (The previous arguments `project` and `keyfile` are still supported.) -* Document `Google::Auth::Credentials` as `credentials` value. -* Update generated low level GAPIC code. -* Updated `google-gax` (`grpc`, `google-protobuf`), `googleauth` dependencies. - -### 1.0.0 / 2017-09-29 - -* Release 1.0 - -### 0.23.2 / 2017-09-12 - -* Update connection configuration. - -### 0.23.1 / 2017-08-18 - -* Update connection configuration. - -### 0.23.0 / 2017-07-27 - -* Add `Job#error` returning `Spanner::Status`. - -### 0.22.0 / 2017-07-11 - -* Remove `Policy#deep_dup`. -* Add thread pool size to `Session` pool configuration. -* Add error handling for some GRPC errors. -* Do not allow nested snapshots or transactions. -* Update initialization to raise a better error if project ID is not specified. -* Update GAPIC configuration to exclude `UNAVAILABLE` errors from automatic retry. -* Update example code in the API documentation and guide. - -### 0.21.0 / 2017-06-08 - -Initial implementation of the Google Cloud Spanner API Ruby client. diff --git a/google-cloud-spanner/CODE_OF_CONDUCT.md b/google-cloud-spanner/CODE_OF_CONDUCT.md deleted file mode 100644 index bc5a589ca9d7..000000000000 --- a/google-cloud-spanner/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,40 +0,0 @@ -# Contributor Code of Conduct - -As contributors and maintainers of this project, and in the interest of -fostering an open and welcoming community, we pledge to respect all people who -contribute through reporting issues, posting feature requests, updating -documentation, submitting pull requests or patches, and other activities. - -We are committed to making participation in this project a harassment-free -experience for everyone, regardless of level of experience, gender, gender -identity and expression, sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments -* Public or private harassment -* Publishing other's private information, such as physical or electronic - addresses, without explicit permission -* Other unethical or unprofessional conduct. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct. By adopting this Code of Conduct, project -maintainers commit themselves to fairly and consistently applying these -principles to every aspect of managing this project. Project maintainers who do -not follow or enforce the Code of Conduct may be permanently removed from the -project team. - -This code of conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by opening an issue or contacting one or more of the project -maintainers. - -This Code of Conduct is adapted from the [Contributor -Covenant](http://contributor-covenant.org), version 1.2.0, available at -[http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/google-cloud-spanner/CONTRIBUTING.md b/google-cloud-spanner/CONTRIBUTING.md deleted file mode 100644 index 34f4b062f17f..000000000000 --- a/google-cloud-spanner/CONTRIBUTING.md +++ /dev/null @@ -1,188 +0,0 @@ -# Contributing to Google Cloud Spanner - -1. **Sign one of the contributor license agreements below.** -2. Fork the repo, develop and test your code changes. -3. Send a pull request. - -## Contributor License Agreements - -Before we can accept your pull requests you'll need to sign a Contributor -License Agreement (CLA): - -- **If you are an individual writing original source code** and **you own the - intellectual property**, then you'll need to sign an [individual - CLA](https://developers.google.com/open-source/cla/individual). -- **If you work for a company that wants to allow you to contribute your work**, - then you'll need to sign a [corporate - CLA](https://developers.google.com/open-source/cla/corporate). - -You can sign these electronically (just scroll to the bottom). After that, we'll -be able to accept your pull requests. - -## Setup - -In order to use the google-cloud-spanner console and run the project's tests, -there is a small amount of setup: - -1. Install Ruby. google-cloud-spanner requires Ruby 2.5+. You may choose to - manage your Ruby and gem installations with [RVM](https://rvm.io/), - [rbenv](https://github.com/rbenv/rbenv), or - [chruby](https://github.com/postmodern/chruby). - -2. Install [Bundler](http://bundler.io/). - - ```sh - $ gem install bundler - ``` - -3. Install the top-level project dependencies. - - ```sh - $ bundle install - ``` - -4. Install the Spanner dependencies. - - ```sh - $ cd google-cloud-spanner/ - $ bundle install - ``` - -## Console - -In order to run code interactively, you can automatically load -google-cloud-spanner and its dependencies in IRB. This requires that your -developer environment has already been configured by following the steps -described in the [Authentication Guide](AUTHENTICATION.md). An IRB console -can be created with: - -```sh -$ cd google-cloud-spanner/ -$ bundle exec rake console -``` - -## Spanner Tests - -Tests are very important part of google-cloud-spanner. All contributions -should include tests that ensure the contributed code behaves as expected. - -To run the unit tests, documentation tests, and code style checks together for a -package: - -``` sh -$ cd google-cloud-spanner/ -$ bundle exec rake ci -``` - -To run the command above, plus all acceptance tests, use `rake ci:acceptance` or -its handy alias, `rake ci:a`. - -### Spanner Unit Tests - - -The project uses the [minitest](https://github.com/seattlerb/minitest) library, -including [specs](https://github.com/seattlerb/minitest#specs), -[mocks](https://github.com/seattlerb/minitest#mocks) and -[minitest-autotest](https://github.com/seattlerb/minitest-autotest). - -To run the Spanner unit tests: - -``` sh -$ cd google-cloud-spanner/ -$ bundle exec rake test -``` - -### Spanner Documentation Tests - -The project tests the code examples in the gem's -[YARD](https://github.com/lsegal/yard)-based documentation. - -The example testing functions in a way that is very similar to unit testing, and -in fact the library providing it, -[yard-doctest](https://github.com/p0deje/yard-doctest), is based on the -project's unit test library, [minitest](https://github.com/seattlerb/minitest). - -To run the Spanner documentation tests: - -``` sh -$ cd google-cloud-spanner/ -$ bundle exec rake doctest -``` - -If you add, remove or modify documentation examples when working on a pull -request, you may need to update the setup for the tests. The stubs and mocks -required to run the tests are located in `support/doctest_helper.rb`. Please -note that much of the setup is matched by the title of the -[`@example`](http://www.rubydoc.info/gems/yard/file/docs/Tags.md#example) tag. -If you alter an example's title, you may encounter breaking tests. - -### Spanner Acceptance Tests - -The Spanner acceptance tests interact with the live service API. Follow the -instructions in the [Authentication Guide](AUTHENTICATION.md) for enabling -the Spanner API. Occasionally, some API features may not yet be generally -available, making it difficult for some contributors to successfully run the -entire acceptance test suite. However, please ensure that you do successfully -run acceptance tests for any code areas covered by your pull request. - -To run the acceptance tests, first create and configure a project in the Google -Developers Console, as described in the -[Authentication Guide](AUTHENTICATION.md). Be sure to download the JSON KEY -file. Make note of the PROJECT_ID and the KEYFILE location on your system. - -Before you can run the Spanner acceptance tests, you must first create indexes -used in the tests. - -#### Running the Spanner acceptance tests - -To run the Spanner acceptance tests: - -``` sh -$ cd google-cloud-spanner/ -$ bundle exec rake acceptance[\\{my-project-id},\\{/path/to/keyfile.json}] -``` - -Or, if you prefer you can store the values in the `GCLOUD_TEST_PROJECT` and -`GCLOUD_TEST_KEYFILE` environment variables: - -``` sh -$ cd google-cloud-spanner/ -$ export GCLOUD_TEST_PROJECT=\\{my-project-id} -$ export GCLOUD_TEST_KEYFILE=\\{/path/to/keyfile.json} -$ bundle exec rake acceptance -``` - -If you want to use a different project and credentials for acceptance tests, you -can use the more specific `SPANNER_TEST_PROJECT` and `SPANNER_TEST_KEYFILE` -environment variables: - -``` sh -$ cd google-cloud-spanner/ -$ export SPANNER_TEST_PROJECT=\\{my-project-id} -$ export SPANNER_TEST_KEYFILE=\\{/path/to/keyfile.json} -$ bundle exec rake acceptance -``` - -## Coding Style - -Please follow the established coding style in the library. The style is is -largely based on [The Ruby Style -Guide](https://github.com/bbatsov/ruby-style-guide) with a few exceptions based -on seattle-style: - -* Avoid parenthesis when possible, including in method definitions. -* Always use double quotes strings. ([Option - B](https://github.com/bbatsov/ruby-style-guide#strings)) - -You can check your code against these rules by running Rubocop like so: - -```sh -$ cd google-cloud-spanner/ -$ bundle exec rake rubocop -``` - -## Code of Conduct - -Please note that this project is released with a Contributor Code of Conduct. By -participating in this project you agree to abide by its terms. See the -[Code of Conduct](CODE_OF_CONDUCT.md) for more information. diff --git a/google-cloud-spanner/Gemfile b/google-cloud-spanner/Gemfile deleted file mode 100644 index ea416d196510..000000000000 --- a/google-cloud-spanner/Gemfile +++ /dev/null @@ -1,11 +0,0 @@ -source "http://rubygems.org" - -gemspec - -gem "google-cloud-core", path: "../google-cloud-core" -gem "google-cloud-errors", path: "../google-cloud-errors" -gem "google-cloud-spanner-admin-database-v1", path: "../google-cloud-spanner-admin-database-v1" -gem "google-cloud-spanner-admin-instance-v1", path: "../google-cloud-spanner-admin-instance-v1" -gem "google-cloud-spanner-v1", path: "../google-cloud-spanner-v1" - -gem "rake" diff --git a/google-cloud-spanner/LICENSE b/google-cloud-spanner/LICENSE deleted file mode 100644 index 724a8807144b..000000000000 --- a/google-cloud-spanner/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/google-cloud-spanner/LOGGING.md b/google-cloud-spanner/LOGGING.md deleted file mode 100644 index d74769e814ce..000000000000 --- a/google-cloud-spanner/LOGGING.md +++ /dev/null @@ -1,32 +0,0 @@ -# Enabling gRPC Logging - -To enable logging for this library, set the logger for the underlying -[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger -that you set may be a Ruby stdlib -[`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as -shown below, or a -[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest) -that will write logs to [Stackdriver -Logging](https://cloud.google.com/logging/). See -[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) -and the gRPC -[spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) -for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` diff --git a/google-cloud-spanner/OVERVIEW.md b/google-cloud-spanner/OVERVIEW.md deleted file mode 100644 index 25c6195e12c5..000000000000 --- a/google-cloud-spanner/OVERVIEW.md +++ /dev/null @@ -1,343 +0,0 @@ -# Cloud Spanner - -Cloud Spanner is a fully managed, mission-critical, relational database service -that offers transactional consistency at global scale, schemas, SQL (ANSI 2011 -with extensions), and automatic, synchronous replication for high availability. - -For more information about Cloud Spanner, read the [Cloud Spanner -Documentation](https://cloud.google.com/spanner/docs/). - -The goal of google-cloud is to provide an API that is comfortable to Rubyists. -Your authentication credentials are detected automatically in Google Cloud -Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine -(GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run. In -other environments you can configure authentication easily, either directly in -your code or via environment variables. Read more about the options for -connecting in the [Authentication Guide](AUTHENTICATION.md). - -## Creating instances - -When you first use Cloud Spanner, you must create an instance, which is an -allocation of resources that are used by Cloud Spanner databases. When you -create an instance, you choose where your data is stored and how many nodes are -used for your data. (For more information, see [Configuration -Guide](https://googleapis.dev/ruby/stackdriver/latest/file.INSTRUMENTATION_CONFIGURATION.html). - -Use {Google::Cloud::Spanner::Admin::Instance#instance_admin -Client#create_instance} to create an instance: - -```ruby -require "google/cloud/spanner" - -instance_admin_client = \ - Google::Cloud::Spanner::Admin::Instance.instance_admin project_id: "my-project" - -project_path = \ - instance_admin_client.project_path project: "my-project" -config_path = \ - instance_admin_client.instance_config_path project: "my-project", - instance_config: "regional-us-central1" -instance_path = \ - instance_admin_client.instance_path project: "my-project", - instance: "my-instance" - -job = instance_admin_client.create_instance parent: project_path, - instance_id: "my-instance", - instance: Google::Cloud::Spanner::Admin::Instance::V1::Instance.new({ - name: instance_path - display_name: "My Instance", - config: config_path, - node_count: 5, - labels: { "production": :env } - }) - -job.wait_until_done! -instance = job.results -``` - -## Creating databases - -Now that you have created an instance, you can create a database. Cloud -Spanner databases hold the tables and indexes that allow you to read and -write data. You may create multiple databases in an instance. - -Use {Google::Cloud::Spanner::Admin::Database#database_admin -Client#create_database} to create a database: - -```ruby -require "google/cloud/spanner" - -db_admin_client = \ - Google::Cloud::Spanner::Admin::Database.database_admin project_id: "my-project" - -instance_path = \ - db_admin_client.instance_path project: "my-project", instance: "my-instance" - -job = db_admin_client.create_database parent: instance_path, - create_statement: "CREATE DATABASE my-database", - -job.wait_until_done! -database = job.results -``` - -## Updating database schemas - -Cloud Spanner supports schema updates to a database while the database -continues to serve traffic. Schema updates do not require taking the -database offline and they do not lock entire tables or columns; you can -continue writing data to the database during the schema update. - -Use {Google::Cloud::Spanner::Admin::Database#database_admin -Client#update_database_ddl} to execute one or more statements in Cloud Spanner's -Data Definition Language (DDL): - -```ruby -require "google/cloud/spanner" - -db_admin_client = \ - Google::Cloud::Spanner::Admin::Database.database_admin project_id: "my-project" - -db_path = db_admin_client.database_path project: "my-project", - instance: "my-instance", - database: "my-database" -add_users_table_sql = %q( - CREATE TABLE users ( - id INT64 NOT NULL, - username STRING(25) NOT NULL, - name STRING(45) NOT NULL, - email STRING(128), - ) PRIMARY KEY(id) -) - -job = db_admin_client.update_database_ddl database: db_path, - statements: [add_users_table_sql] - -job.wait_until_done! -database = job.results -``` - -## Creating clients - -In order to read and/or write data, you must create a data client. You can think -of a client as a database connection: All of your interactions with Cloud -Spanner data must go through a client. Typically you create a client when your -application starts up, then you re-use that client to read, write, and execute -transactions. - -Use {Google::Cloud::Spanner::Project#client Project#client} to create a client: - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -results = db.execute "SELECT 1" - -results.rows.each do |row| - puts row -end -``` - -## Writing data - -You write data using your client object. The client object supports various -mutation operations, as well as combinations of inserts, updates, deletes, etc., -that can be applied atomically to different rows and/or tables in a database. - -Use {Google::Cloud::Spanner::Client#commit Client#commit} to execute various -mutations atomically at a single logical point in time. All changes are -accumulated in memory until the block completes. Unlike -{Google::Cloud::Spanner::Client#transaction Client#transaction}, which can also -perform reads, this operation accepts only mutations and makes a single API -request. - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -db.commit do |c| - c.update "users", [{ id: 1, username: "charlie94", name: "Charlie" }] - c.insert "users", [{ id: 2, username: "harvey00", name: "Harvey" }] -end -``` - -## Querying data using SQL - -Cloud Spanner supports a native SQL interface for reading data that is available -through {Google::Cloud::Spanner::Client#execute Client#execute}: - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -results = db.execute "SELECT * FROM users" - -results.rows.each do |row| - puts "User #{row[:id]} is #{row[:name]}" -end -``` - -## Reading data using the read method - -In addition to Cloud Spanner's SQL interface, Cloud Spanner also supports a read -interface. Use the {Google::Cloud::Spanner::Client#read Client#read} method to -read rows from the database, and use its `keys` option to pass unique -identifiers as both lists and ranges: - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -results = db.read "users", [:id, :name], keys: 1..5 - -results.rows.each do |row| - puts "User #{row[:id]} is #{row[:name]}" -end -``` - -## Using read-write transactions - -When an operation might write data depending on values it reads, you should use -a read-write transaction to perform the reads and writes atomically. - -Suppose that sales of `Albums(1, 1)` are lower than expected and you want to -move $200,000 from the marketing budget of `Albums(2, 2)` to it, but only if the -budget of `Albums(2, 2)` is at least $300,000. - -Use {Google::Cloud::Spanner::Client#transaction Client#transaction} to execute -both reads and writes atomically at a single logical point in time. All changes -are accumulated in memory until the block completes. Transactions will be -automatically retried when possible. This operation makes separate API requests -to begin and commit the transaction. - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -db.transaction do |tx| - # Read the second album budget. - second_album_result = tx.read "Albums", ["marketing_budget"], - keys: [[2, 2]], limit: 1 - second_album_row = second_album_result.rows.first - second_album_budget = second_album_row.values.first - - transfer_amount = 200000 - - if second_album_budget < 300000 - # Raising an exception will automatically roll back the transaction. - raise "The second album doesn't have enough funds to transfer" - end - - # Read the first album's budget. - first_album_result = tx.read "Albums", ["marketing_budget"], - keys: [[1, 1]], limit: 1 - first_album_row = first_album_result.rows.first - first_album_budget = first_album_row.values.first - - # Update the budgets. - second_album_budget -= transfer_amount - first_album_budget += transfer_amount - puts "Setting first album's budget to #{first_album_budget} and the " \ - "second album's budget to #{second_album_budget}." - - # Update the rows. - rows = [ - {singer_id: 1, album_id: 1, marketing_budget: first_album_budget}, - {singer_id: 2, album_id: 2, marketing_budget: second_album_budget} - ] - tx.update "Albums", rows -end -``` - -## Using read-only transactions - -Suppose you want to execute more than one read at the same timestamp. Read-only -transactions observe a consistent prefix of the transaction commit history, so -your application always gets consistent data. Because read-only transactions are -much faster than locking read-write transactions, we strongly recommend that you -do all of your transaction reads in read-only transactions if possible. - -Use a {Google::Cloud::Spanner::Snapshot Snapshot} object to execute statements -in a read-only transaction. The snapshot object is available via a block -provided to {Google::Cloud::Spanner::Client#snapshot Client#snapshot}: - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -db.snapshot do |snp| - results_1 = snp.execute "SELECT * FROM users" - results_1.rows.each do |row| - puts "User #{row[:id]} is #{row[:name]}" - end - - # Perform another read using the `read` method. Even if the data - # is updated in-between the reads, the snapshot ensures that both - # return the same data. - results_2 = db.read "users", [:id, :name] - results_2.rows.each do |row| - puts "User #{row[:id]} is #{row[:name]}" - end -end -``` - -## Deleting databases - -Use {Google::Cloud::Spanner::Admin::Database#database_admin -Client#drop_database} to delete a database: - -```ruby -require "google/cloud/spanner" - -db_admin_client = \ - Google::Cloud::Spanner::Admin::Database.database_admin project_id: "my-project" - -db_path = db_admin_client.database_path project: "my-project", - instance: "my-instance", - database: "my-database" -db_admin_client.drop_database database: db_path -``` - -## Deleting instances - -When you delete an instance, all databases within it are automatically deleted. -(If you only delete databases and not your instance, you will still incur -charges for the instance.) - -Use {Google::Cloud::Spanner::Admin::Instance#instance_admin -Client#delete_instance} to delete an instance: - -```ruby -require "google/cloud/spanner" - -instance_admin_client = \ - Google::Cloud::Spanner::Admin::Instance.instance_admin project_id: "my-project" - -instance_path = \ - instance_admin_client.instance_path project: "my-project", - instance: "my-instance" - -instance_admin_client.delete_instance name: instance_path -``` - -## Additional information - -Cloud Spanner can be configured to use gRPC's logging. To learn more, see the -[Logging guide](LOGGING.md). diff --git a/google-cloud-spanner/README.md b/google-cloud-spanner/README.md deleted file mode 100644 index 60287cdc4807..000000000000 --- a/google-cloud-spanner/README.md +++ /dev/null @@ -1,184 +0,0 @@ -# google-cloud-spanner - -[Google Cloud Spanner API](https://cloud.google.com/spanner/) ([docs](https://cloud.google.com/spanner/docs)) provides a fully managed, mission-critical, relational database service that offers transactional consistency at global scale, schemas, SQL (ANSI 2011 with extensions), and automatic, synchronous replication for high availability. - -- [google-cloud-spanner API - documentation](https://googleapis.dev/ruby/google-cloud-spanner/latest) -- [google-cloud-spanner on - RubyGems](https://rubygems.org/gems/google-cloud-spanner) -- [Google Cloud Spanner API - documentation](https://cloud.google.com/spanner/docs) - -## NOTICE: Freezing development of `Database`, `Instance` and `Backup` classes. - -From `google-cloud-spanner/v2.11.0` onwards, **new features for mananging -databases, instances and backups will only be available through the -[google-cloud-spanner-admin-instance-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-instance-v1) -and -[google-cloud-spanner-admin-database-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-database-v1) -packages**. The -[`Database`](https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-spanner/lib/google/cloud/spanner/database.rb), - -[`Instance`](https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-spanner/lib/google/cloud/spanner/instance.rb) and -[`Backup`](https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-spanner/lib/google/cloud/spanner/backup.rb) -classes in -[google-cloud-spanner](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner) -and methods related to database and instance management in the -[`Project`](https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-spanner/lib/google/cloud/spanner/project.rb) -class, -will no longer be updated to support new features. Please refer to the [FAQ](#faq-for-freezing-development-of-database-and-instance-classes) -for further details. - -## Quick Start - -```sh -$ gem install google-cloud-spanner -``` - -## Authentication - -This library uses Service Account credentials to connect to Google Cloud services. When running on Google Cloud Platform (GCP), including Google Compute Engine (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud Functions (GCF) and Cloud Run, the credentials will be discovered automatically. When running on other environments the Service Account credentials can be specified by providing the path to the JSON file, or the JSON itself, in environment variables. - -Instructions and configuration options are covered in the [Authentication Guide](https://googleapis.dev/ruby/google-cloud-spanner/latest/file.AUTHENTICATION.html). - -## Example - -```ruby -require "google/cloud/spanner" - -spanner = Google::Cloud::Spanner.new - -db = spanner.client "my-instance", "my-database" - -db.transaction do |tx| - results = tx.execute_query "SELECT * FROM users" - - results.rows.each do |row| - puts "User #{row[:id]} is #{row[:name]}" - end -end -``` - -## Enabling Logging - -To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below, or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest) that will write logs to [Stackdriver Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb) and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information. - -Configuring a Ruby stdlib logger: - -```ruby -require "logger" - -module MyLogger - LOGGER = Logger.new $stderr, level: Logger::WARN - def logger - LOGGER - end -end - -# Define a gRPC module-level logger method before grpc/logconfig.rb loads. -module GRPC - extend MyLogger -end -``` - -## FAQ for freezing development of `Database`, `Instance` and `Backup` classes - -### Can I keep using the frozen classes and methods? - -Yes, these classes and methods can continue to be used for the forseeable -future, even in production applications. P0/P1 bug fixes and security patches -for up to 1 year will be provided after `google-cloud-spanner/v2.11.0` is released. - -### When should I use the `google-cloud-spanner-admin-instance-v1` and `google-cloud-spanner-admin-database-v1` packages? - -Only when your application needs to use Cloud Spanner features for managing -databases and instances that are released after `google-cloud-spanner/v2.11.0`. -You may continue to use the existing `Database`, `Instance` and `Backup` classes -from `google-cloud-spanner`, and the methods from the `Project` class for all -existing usages in your code for managing databases, instances and backups. - -### Which classes and methods are subject to the freeze? - -#### `Backup` -* `Google::Cloud::Spanner::Backup` -* `Google::Cloud::Spanner::Backup::Job` -* `Google::Cloud::Spanner::Backup::Job::List` -* `Google::Cloud::Spanner::Backup::List` -* `Google::Cloud::Spanner::Backup::Restore::Job` - -#### `Database` -* `Google::Cloud::Spanner::Database` -* `Google::Cloud::Spanner::Database::BackupInfo` -* `Google::Cloud::Spanner::Database::Config` -* `Google::Cloud::Spanner::Database::Job` -* `Google::Cloud::Spanner::Database::Job::List` -* `Google::Cloud::Spanner::Database::List` -* `Google::Cloud::Spanner::Database::RestoreInfo` - -#### `Instance` -* `Google::Cloud::Spanner::Instance` -* `Google::Cloud::Spanner::Instance::Config` -* `Google::Cloud::Spanner::Instance::Job` -* `Google::Cloud::Spanner::Instance::Job::List` -* `Google::Cloud::Spanner::Instance::List` - -#### `Project` -* `Google::Cloud::Spanner::Project#create_database` -* `Google::Cloud::Spanner::Project#create_instance` -* `Google::Cloud::Spanner::Project#database` -* `Google::Cloud::Spanner::Project#databases` -* `Google::Cloud::Spanner::Project#database_path` -* `Google::Cloud::Spanner::Project#instance` -* `Google::Cloud::Spanner::Project#instances` -* `Google::Cloud::Spanner::Project#instance_config` -* `Google::Cloud::Spanner::Project#instance_configs` - -### Where can I find code samples? -The code samples for all new features that relate to managing databases and -instances will include code samples on how to use the feature through -`google-cloud-spanner-admin-instance-v1` or -`google-cloud-spanner-admin-database-v1` in the documentation. - -Code samples on how to manage instances and databases can also be found in -[OVERVIEW](https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-spanner/OVERVIEW.md). - -## Supported Ruby Versions - -This library is supported on Ruby 2.6+. - -Google provides official support for Ruby versions that are actively supported -by Ruby Core—that is, Ruby versions that are either in normal maintenance or -in security maintenance, and not end of life. Older versions of Ruby _may_ -still work, but are unsupported and not recommended. See -https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby -support schedule. - -## Versioning - -This library follows [Semantic Versioning](http://semver.org/). - -## Contributing - -Contributions to this library are always welcome and highly encouraged. - -See the [Contributing -Guide](https://googleapis.dev/ruby/google-cloud-spanner/latest/file.CONTRIBUTING.html) -for more information on how to get started. - -Please note that this project is released with a Contributor Code of Conduct. By -participating in this project you agree to abide by its terms. See [Code of -Conduct](https://googleapis.dev/ruby/google-cloud-spanner/latest/file.CODE_OF_CONDUCT.html) -for more information. - -## License - -This library is licensed under Apache 2.0. Full license text is available in -[LICENSE](https://googleapis.dev/ruby/google-cloud-spanner/latest/file.LICENSE.html). - -## Support - -Please [report bugs at the project on -Github](https://github.com/googleapis/google-cloud-ruby/issues). Don't -hesitate to [ask -questions](http://stackoverflow.com/questions/tagged/google-cloud-ruby) about -the client or APIs on [StackOverflow](http://stackoverflow.com). diff --git a/google-cloud-spanner/Rakefile b/google-cloud-spanner/Rakefile deleted file mode 100644 index ad8214997515..000000000000 --- a/google-cloud-spanner/Rakefile +++ /dev/null @@ -1,214 +0,0 @@ -require "bundler/setup" -require "bundler/gem_tasks" - -require "rubocop/rake_task" -RuboCop::RakeTask.new - -require "rake/testtask" -desc "Run tests." -Rake::TestTask.new do |t| - t.libs << "test" - t.test_files = FileList["test/**/*_test.rb"] - t.warning = false -end - -namespace :test do - desc "Run tests with coverage." - task :coverage do - require "simplecov" - SimpleCov.start do - command_name "google-cloud-spanner" - track_files "lib/**/*.rb" - add_filter "test/" - add_filter "lib/google/spanner/" - add_filter "lib/google/cloud/spanner/v1/" - add_filter "lib/google/cloud/spanner/admin/instance/v1/" - add_filter "lib/google/cloud/spanner/admin/database/v1/" - end - - Rake::Task[:test].invoke - end -end - -# Acceptance tests -desc "Run the spanner acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= ENV["SPANNER_TEST_PROJECT"] || ENV["GCLOUD_TEST_PROJECT"] - if ENV["SPANNER_EMULATOR_HOST"].nil? - keyfile = args[:keyfile] - keyfile ||= ENV["SPANNER_TEST_KEYFILE"] || ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= ENV["SPANNER_TEST_KEYFILE_JSON"] || ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - # clear any env var already set - require "google/cloud/spanner/credentials" - Google::Cloud::Spanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - else - if project.nil? - fail "You must provide a project. e.g. rake acceptance[test123] or SPANNER_TEST_PROJECT=test123 rake acceptance" - end - keyfile = "{}" - end - # always overwrite when running tests - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_KEYFILE_JSON"] = keyfile - - Rake::Task["acceptance:run"].invoke -end - -namespace :acceptance do - desc "Run acceptance tests with coverage." - task :coverage, :project, :keyfile do |t, args| - require "simplecov" - SimpleCov.start do - command_name "google-cloud-spanner" - track_files "lib/**/*.rb" - add_filter "acceptance/" - end - - Rake::Task[:acceptance].invoke - end - - desc "Run acceptance cleanup." - task :cleanup, :project, :keyfile do |t, args| - project = args[:project] - project ||= ENV["SPANNER_TEST_PROJECT"] || ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= ENV["SPANNER_TEST_KEYFILE"] || ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= ENV["SPANNER_TEST_KEYFILE_JSON"] || ENV["GCLOUD_TEST_KEYFILE_JSON"] - end - if project.nil? || keyfile.nil? - fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or SPANNER_TEST_PROJECT=test123 SPANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - # clear any env var already set - require "google/cloud/spanner/credentials" - Google::Cloud::Spanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - # always overwrite when running tests - ENV["SPANNER_PROJECT"] = project - ENV["SPANNER_KEYFILE_JSON"] = keyfile - - $LOAD_PATH.unshift "lib" - require "google/cloud/spanner" - puts "Cleaning up Spanner instances and databases." - Google::Cloud::Spanner.new.instances.all do |instance| - begin - instance.databases.all.each &:drop - instance.delete - rescue => e - puts "Error while cleaning up #{instance.instance_id} instance.\n\n#{e}" - end - end - end - - Rake::TestTask.new :run do |t| - t.libs << "acceptance" - t.test_files = FileList["acceptance/**/*_test.rb"] - t.warning = false - end -end - -namespace :samples do - task :latest do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "not_master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-spanner gem has no samples to test." - end - end - - task :master do - if File.directory? "samples" - Dir.chdir "samples" do - Bundler.with_clean_env do - ENV["GOOGLE_CLOUD_SAMPLES_TEST"] = "master" - sh "bundle update" - sh "bundle exec rake test" - end - end - else - puts "The google-cloud-spanner gem has no samples to test." - end - end -end - -desc "Run yard-doctest example tests." -task :doctest do - sh "bundle exec yard config load_plugins true && bundle exec yard doctest" -end - -desc "Start an interactive shell." -task :console do - require "irb" - require "irb/completion" - require "pp" - - $LOAD_PATH.unshift "lib" - - require "google-cloud-spanner" - def gcloud; @gcloud ||= Google::Cloud.new; end - - ARGV.clear - IRB.start -end - -require "yard" -require "yard/rake/yardoc_task" -YARD::Rake::YardocTask.new do |y| - # y.options << "--fail-on-warning" -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-spanner" - header "google-cloud-spanner rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-spanner yard", "*" - header "spanner yard still had warnings", "!" - Rake::Task[:yard].invoke - header "google-cloud-spanner doctest", "*" - Rake::Task[:doctest].invoke - header "google-cloud-spanner test", "*" - Rake::Task[:test].invoke -end -namespace :ci do - desc "Run the CI build, with acceptance tests." - task :acceptance do - Rake::Task[:ci].invoke - header "google-cloud-spanner acceptance", "*" - Rake::Task[:acceptance].invoke - end - task :a do - # This is a handy shortcut to save typing - Rake::Task["ci:acceptance"].invoke - end -end - -task :default => :test - -def header str, token = "#" - line_length = str.length + 8 - puts "" - puts token * line_length - puts "#{token * 3} #{str} #{token * 3}" - puts token * line_length - puts "" -end diff --git a/google-cloud-spanner/TROUBLESHOOTING.md b/google-cloud-spanner/TROUBLESHOOTING.md deleted file mode 100644 index af3fe3f3be7e..000000000000 --- a/google-cloud-spanner/TROUBLESHOOTING.md +++ /dev/null @@ -1,31 +0,0 @@ -# Troubleshooting - -## Where can I get more help? - -### Ask the Community - -If you have a question about how to use a Google Cloud client library in your -project or are stuck in the Developer's console and don't know where to turn, -it's possible your questions have already been addressed by the community. - -First, check out the appropriate tags on StackOverflow: - - [`google-cloud-platform+ruby+spanner`][so-ruby] - -Next, try searching through the issues on GitHub: - - - [`api:spanner` issues][gh-search-ruby] - -Still nothing? - -### Ask the Developers - -If you're experiencing a bug with the code, or have an idea for how it can be -improved, *please* create a new issue on GitHub so we can talk about it. - - - [New issue][gh-ruby] - -[so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+spanner - -[gh-search-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues?q=label%3A%22api%3A+spanner%22 - -[gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new diff --git a/google-cloud-spanner/acceptance/data b/google-cloud-spanner/acceptance/data deleted file mode 120000 index e7750c8d96f8..000000000000 --- a/google-cloud-spanner/acceptance/data +++ /dev/null @@ -1 +0,0 @@ -../../acceptance/data \ No newline at end of file diff --git a/google-cloud-spanner/acceptance/instance_client_test.rb b/google-cloud-spanner/acceptance/instance_client_test.rb deleted file mode 100644 index 956780fe3092..000000000000 --- a/google-cloud-spanner/acceptance/instance_client_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "google/cloud/spanner/admin/instance" -require "spanner_helper" - -describe "Spanner Instances Client", :spanner do - let(:instance_id) { "#{$spanner_instance_id}-crud" } - let(:client) { Google::Cloud::Spanner::Admin::Instance.instance_admin project_id: spanner.project } - let(:project_path) { client.project_path project: spanner.project } - let(:instance_path) { client.instance_path project: spanner.project, instance: instance_id } - - after do - client.delete_instance name: instance_path - end - - it "creates, gets, updates, and deletes an instance" do - instance_config_path = client.instance_config_path project: spanner.project, instance_config: "regional-asia-south1" - - instance = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new name: instance_path, - config: instance_config_path, - display_name: instance_id, - node_count: 1 - - request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceRequest.new parent: project_path, - instance_id: instance_id, - instance: instance - - job = client.create_instance request - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - instance = job.results - _(instance).wont_be :nil? - _(instance).must_be_kind_of Google::Cloud::Spanner::Admin::Instance::V1::Instance - _(instance.name).must_equal instance_path - _(instance.config).must_equal instance_config_path - - instance = client.get_instance name: instance_path - _(instance).must_be_kind_of Google::Cloud::Spanner::Admin::Instance::V1::Instance - - # skipping the update instance test as it's not supported by emulator right now. - # update display_name of the instance - # instance.display_name = "#{instance.display_name}-updated" - # request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest.new instance: instance, - # field_mask: { paths: ["display_name"] } - - # job2 = client.update_instance request - - # _(job2).wont_be :done? unless emulator_enabled? - # job2.wait_until_done! - - # _(job2).must_be :done? - - client.delete_instance name: instance_path - assert_raises Google::Cloud::NotFoundError do - client.get_instance name: instance_path - end - end - - it "lists instances" do - all_instances = client.list_instances parent: project_path - - _(all_instances.response).wont_be :nil? - all_instances.each do |instance| - _(instance).must_be_kind_of Google::Cloud::Spanner::Admin::Instance::V1::Instance - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/backup_operations_test.rb b/google-cloud-spanner/acceptance/spanner/backup_operations_test.rb deleted file mode 100644 index 69dc379940f0..000000000000 --- a/google-cloud-spanner/acceptance/spanner/backup_operations_test.rb +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "spanner_helper" - -describe "Spanner Database Backup Operations", :spanner do - let(:instance_id) { $spanner_instance_id } - let(:database_id) { $spanner_database_id } - let(:backup_id) { "#{$spanner_database_id}-ops" } - let(:expire_time) { Time.now + 36_000 } - - it "list backup operations" do - skip if emulator_enabled? - - instance = spanner.instance instance_id - _(instance).wont_be :nil? - - database = instance.database database_id - _(database).wont_be :nil? - - create_job = database.create_backup backup_id, expire_time - create_job.wait_until_done! - - # All - jobs = instance.backup_operations.all.to_a - _(jobs).wont_be :empty? - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - - unless job.error? - _(job.backup).must_be_kind_of Google::Cloud::Spanner::Backup - end - - _(job.progress_percent).must_be :>=, 0 - _(job.start_time).must_be_kind_of Time - end - - first_job = jobs.first - _(first_job.reload!).must_be_kind_of Google::Cloud::Spanner::Backup::Job - - # Filter completed jobs - filter = "done:true" - jobs = instance.backup_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job).must_be :done? - end - - # Filter by database name - filter = "metadata.database:#{database_id}" - jobs = instance.backup_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job.backup.database_id).must_equal database_id unless job.error? - end - - # Filter by metdata type - filter = "metadata.@type:CreateBackupMetadata" - jobs = instance.backup_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job.grpc.metadata).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata - end - - # Filter by job start time - time = (Time.now - 360_000) - filter = "metadata.progress.start_time > \"#{time.iso8601}\"" - jobs = instance.backup_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job.start_time).must_be :>, time - end - - # Filer - AND - time = (Time.now - 360_000) - filter = [ - "metadata.database:#{database_id}", - "metadata.progress.start_time > \"#{time.iso8601}\"" - ].map { |f| "(#{f})" }.join(" AND ") - - jobs = instance.backup_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job.backup.database_id).must_equal database_id unless job.error? - _(job.start_time).must_be :>, time - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/backup_test.rb b/google-cloud-spanner/acceptance/spanner/backup_test.rb deleted file mode 100644 index bc5c330e3fd5..000000000000 --- a/google-cloud-spanner/acceptance/spanner/backup_test.rb +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "spanner_helper" - -describe "Spanner Database Backup", :spanner do - let(:instance_id) { $spanner_instance_id } - let(:database_id) { $spanner_database_id } - let(:expire_time) { Time.now + 36_000 } - - it "creates, get, updates, restore and delete a database backup" do - skip if emulator_enabled? - - backup_id = "#{$spanner_database_id}-crud" - database = spanner.database instance_id, database_id - _(database).wont_be :nil? - version_time = database.earliest_version_time - - encryption_config = { encryption_type: :GOOGLE_DEFAULT_ENCRYPTION } - - # Create - job = database.create_backup backup_id, - expire_time, - version_time: version_time, - encryption_config: encryption_config - - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - _(job).wont_be :done? - job.wait_until_done! - - _(job).must_be :done? - _(job.error).must_be :nil? - - backup = job.backup - _(backup).wont_be :nil? - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - _(backup.backup_id).must_equal backup_id - _(backup.database_id).must_equal database_id - _(backup.instance_id).must_equal instance_id - _(backup.project_id).must_equal spanner.project - _(backup.expire_time.to_i).must_equal expire_time.to_i - _(backup.version_time.to_i).must_equal version_time.to_i - _(backup.create_time).must_be_kind_of Time - _(backup.size_in_bytes).must_be :>=, 0 - _(backup.encryption_info).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo - _(backup.encryption_info.encryption_type).must_equal :GOOGLE_DEFAULT_ENCRYPTION - - # Get - instance = spanner.instance instance_id - backup = instance.backup backup_id - - _(backup).wont_be :nil? - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - _(backup.backup_id).must_equal backup_id - _(backup.database_id).must_equal database_id - _(backup.instance_id).must_equal instance_id - _(backup.project_id).must_equal spanner.project - _(backup.expire_time.to_i).must_equal expire_time.to_i - _(backup.version_time.to_i).must_equal version_time.to_i - _(backup.create_time).must_be_kind_of Time - _(backup.size_in_bytes).must_be :>=, 0 - - # Update - backup.expire_time = expire_time + 3600 - backup = instance.backup backup_id - _(backup.expire_time.to_i).must_equal((expire_time + 3600).to_i) - - _ do - backup.expire_time = Time.now - 36_000 - end.must_raise Google::Cloud::InvalidArgumentError - _(backup.expire_time.to_i).must_equal((expire_time + 3600).to_i) - - # Restore - restore_database_id = "restore-#{database_id}" - backup = instance.backup backup_id - job = backup.restore restore_database_id, encryption_config: encryption_config - _(job).wont_be :done? - - job.wait_until_done! - - _(job).must_be :done? - _(job).wont_be :error? - - database = job.database - _(database).must_be_kind_of Google::Cloud::Spanner::Database - _(database.database_id).must_equal restore_database_id - _(database.instance_id).must_equal instance_id - _(database.project_id).must_equal spanner.project - - restore_info = database.restore_info - _(restore_info).must_be_kind_of Google::Cloud::Spanner::Database::RestoreInfo - _(restore_info.source_type).must_equal :BACKUP - _(restore_info).must_be :source_backup? - - backup_info = restore_info.backup_info - _(backup_info).must_be_kind_of Google::Cloud::Spanner::Database::BackupInfo - _(backup_info.project_id).must_equal spanner.project - _(backup_info.instance_id).must_equal instance_id - _(backup_info.backup_id).must_equal backup_id - _(backup_info.source_database_project_id).must_equal spanner.project - _(backup_info.source_database_instance_id).must_equal instance_id - _(backup_info.source_database_id).must_equal database_id - _(backup_info.create_time).must_be_kind_of Time - _(backup_info.version_time.to_i).must_equal version_time.to_i - - # Delete - backup.delete - _(instance.backup(backup_id)).must_be :nil? - end - - it "cancel create backup operation" do - skip if emulator_enabled? - - backup_id = "#{$spanner_database_id}-cancel" - database = spanner.database instance_id, database_id - - job = database.create_backup backup_id, expire_time - _(job).wont_be :done? - - job.cancel - - job.reload! - _(job).must_be :done? - _(job.error).wont_be :nil? - _(job.error.code).must_equal 1 - _(job.error.description).must_equal "CANCELLED" - end - - it "fails to create a backup with a version time too far in the past" do - skip if emulator_enabled? - - backup_id = "#{$spanner_database_id}-version-time-fail" - database = spanner.database instance_id, database_id - thirty_days_ago = Time.now - (30 * 24 * 60 * 60) - - assert_raises Google::Cloud::InvalidArgumentError do - database.create_backup backup_id, expire_time, version_time: thirty_days_ago - end - end - - it "fails to create a backup with a version time in the future" do - skip if emulator_enabled? - - backup_id = "#{$spanner_database_id}-version-time-fail" - database = spanner.database instance_id, database_id - tomorrow = Time.now + (24 * 60 * 60) - - assert_raises Google::Cloud::InvalidArgumentError do - database.create_backup backup_id, expire_time, version_time: tomorrow - end - end - - it "lists and gets database backups" do - skip if emulator_enabled? - - backup_id = "#{$spanner_database_id}-list" - database = spanner.database instance_id, database_id - _(database).wont_be :nil? - - job = database.create_backup backup_id, expire_time - job.wait_until_done! - created_backup = job.backup - - instance = spanner.instance instance_id - - # List all - all_backups = instance.backups.all.to_a - _(all_backups).wont_be :empty? - all_backups.each do |backup| - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - end - - # Filter by backup name - backups = instance.backups(filter: "name:#{backup_id}").to_a - _(backups.length).must_equal 1 - _(backups.first.backup_id).must_equal backup_id - - # Filter by database name - backups = instance.backups(filter: "database:#{database_id}").to_a - _(backups).wont_be :empty? - _(backups.first.database_id).must_equal database_id - - created_backup.delete - end -end diff --git a/google-cloud-spanner/acceptance/spanner/batch_client/execute_partition_test.rb b/google-cloud-spanner/acceptance/spanner/batch_client/execute_partition_test.rb deleted file mode 100644 index 5d88bc390ed3..000000000000 --- a/google-cloud-spanner/acceptance/spanner/batch_client/execute_partition_test.rb +++ /dev/null @@ -1,252 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Batch Client", :execute_partition, :spanner do - let(:db) { spanner_client } - let(:pg_db) { spanner_pg_client } - let(:batch_client) { $spanner.batch_client $spanner_instance_id, $spanner_database_id } - let(:pg_batch_client) { $spanner.batch_client $spanner_instance_id, $spanner_pg_database_id unless emulator_enabled? } - let(:table_name) { "stuffs" } - let(:table_index) { "IsStuffsIdPrime" } - let(:batch_snapshot) { batch_client.batch_snapshot } - let(:pg_batch_snapshot) { pg_batch_client.batch_snapshot unless emulator_enabled? } - - before do - db.delete table_name # remove all data - db.insert table_name, [ - { id: 1, bool: false }, - { id: 2, bool: false }, - { id: 3, bool: true }, - { id: 4, bool: false }, - { id: 5, bool: true }, - { id: 6, bool: false }, - { id: 7, bool: true }, - { id: 8, bool: false }, - { id: 9, bool: false }, - { id: 10, bool: false }, - { id: 11, bool: true }, - { id: 12, bool: false } - ] - pg_db.delete table_name unless emulator_enabled? - unless emulator_enabled? - pg_db.insert table_name, [ - { id: 1, bool: false }, - { id: 2, bool: false }, - { id: 3, bool: true }, - { id: 4, bool: false }, - { id: 5, bool: true }, - { id: 6, bool: false }, - { id: 7, bool: true }, - { id: 8, bool: false }, - { id: 9, bool: false }, - { id: 10, bool: false }, - { id: 11, bool: true }, - { id: 12, bool: false } - ] - end - end - - after do - batch_snapshot.close - db.delete table_name # remove all data - pg_batch_snapshot.close unless emulator_enabled? - pg_db.delete table_name unless emulator_enabled? - end - - it "reads all by default" do - _(batch_snapshot.timestamp).must_be_kind_of Time - serialized_snapshot = batch_snapshot.dump - - columns = [:id] - rows = [] - partitions = batch_snapshot.partition_read table_name, columns - partitions.each do |partition| - _(partition.read.partition_token).wont_be_nil - _(partition.read.columns).must_equal columns.map(&:to_s) - _(partition.read.table).must_equal "stuffs" - - partition = batch_client.load_partition partition.dump - - _(partition.read.partition_token).wont_be_nil - _(partition.read.columns).must_equal columns.map(&:to_s) - _(partition.read.table).must_equal "stuffs" - - new_batch_snapshot = batch_client.load_batch_snapshot serialized_snapshot - _(new_batch_snapshot.timestamp).must_be_kind_of Time - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }, { id: 8 }, - { id: 9 }, { id: 10 }, { id: 11 }, { id: 12 }] - batch_snapshot.close - end - - it "reads all by default in pg" do - skip if emulator_enabled? - skip "Skipped due to b/216209306" - _(pg_batch_snapshot.timestamp).must_be_kind_of Time - serialized_snapshot = pg_batch_snapshot.dump - - columns = [:id] - rows = [] - partitions = pg_batch_snapshot.partition_read table_name, columns - partitions.each do |partition| - _(partition.read.partition_token).wont_be_nil - _(partition.read.columns).must_equal columns.map(&:to_s) - _(partition.read.table).must_equal "stuffs" - - partition = pg_batch_client.load_partition partition.dump - - _(partition.read.partition_token).wont_be_nil - _(partition.read.columns).must_equal columns.map(&:to_s) - _(partition.read.table).must_equal "stuffs" - - new_batch_snapshot = pg_batch_client.load_batch_snapshot serialized_snapshot - _(new_batch_snapshot.timestamp).must_be_kind_of Time - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }, { id: 6 }, { id: 7 }, { id: 8 }, - { id: 9 }, { id: 10 }, { id: 11 }, { id: 12 }] - pg_batch_snapshot.close - end - - it "queries all by default" do - batch_snapshot = batch_client.batch_snapshot - serialized_snapshot = batch_snapshot.dump - - sql = "SELECT s.id, s.bool FROM stuffs AS s WHERE s.id = 2 AND s.bool = false" - rows = [] - partitions = batch_snapshot.partition_query sql - partitions.each do |partition| - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - partition = batch_client.load_partition partition.dump - - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - new_batch_snapshot = batch_client.load_batch_snapshot serialized_snapshot - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 2, bool: false }] - batch_snapshot.close - end - - it "queries all by default in pg" do - skip if emulator_enabled? - pg_batch_snapshot = pg_batch_client.batch_snapshot - serialized_snapshot = pg_batch_snapshot.dump - - sql = "SELECT s.id, s.bool FROM stuffs AS s WHERE s.id = 2 AND s.bool = false" - rows = [] - partitions = pg_batch_snapshot.partition_query sql - partitions.each do |partition| - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - partition = pg_batch_client.load_partition partition.dump - - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - new_batch_snapshot = pg_batch_client.load_batch_snapshot serialized_snapshot - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 2, bool: false }] - pg_batch_snapshot.close - end - - it "queries all by default with query options" do - batch_snapshot = batch_client.batch_snapshot - serialized_snapshot = batch_snapshot.dump - - sql = "SELECT s.id, s.bool FROM stuffs AS s WHERE s.id = 2 AND s.bool = false" - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - rows = [] - partitions = batch_snapshot.partition_query sql, query_options: query_options - partitions.each do |partition| - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - partition = batch_client.load_partition partition.dump - - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - new_batch_snapshot = batch_client.load_batch_snapshot serialized_snapshot - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 2, bool: false }] - batch_snapshot.close - end - - it "queries all by default with query options pg" do - skip if emulator_enabled? - pg_batch_snapshot = pg_batch_client.batch_snapshot - serialized_snapshot = pg_batch_snapshot.dump - - sql = "SELECT s.id, s.bool FROM stuffs AS s WHERE s.id = 2 AND s.bool = false" - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - rows = [] - partitions = pg_batch_snapshot.partition_query sql, query_options: query_options - partitions.each do |partition| - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - partition = pg_batch_client.load_partition partition.dump - - _(partition.execute.partition_token).wont_be_nil - _(partition.execute.sql).must_equal sql - - new_batch_snapshot = pg_batch_client.load_batch_snapshot serialized_snapshot - results = new_batch_snapshot.execute_partition partition - _(results).must_be_kind_of Google::Cloud::Spanner::Results - unless results.fields.to_a.empty? # With so little data, just one partition should get the entire result set - rows.concat(results.rows.map(&:to_h)) - end - end - - _(rows).must_equal [{ id: 2, bool: false }] - pg_batch_snapshot.close - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/batch_update_test.rb b/google-cloud-spanner/acceptance/spanner/client/batch_update_test.rb deleted file mode 100644 index b85140dd0307..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/batch_update_test.rb +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "concurrent" - -describe "Spanner Client", :batch_update, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - - let :insert_dml do - { gsql: "INSERT INTO accounts (account_id, username, active, reputation) \ - VALUES (@account_id, @username, @active, @reputation)", - pg: "INSERT INTO accounts (account_id, username, active, reputation) VALUES ($1, $2, $3, $4)" } - end - - let :update_dml do - { gsql: "UPDATE accounts SET username = @username, active = @active WHERE account_id = @account_id", - pg: "UPDATE accounts SET username = $2, active = $3 WHERE account_id = $1" } - end - - let :select_dql do - { gsql: "SELECT username FROM accounts WHERE account_id = @account_id", - pg: "SELECT username FROM accounts WHERE account_id = $1" } - end - - let(:update_dml_syntax_error) { "UPDDDD accounts" } - let :delete_dml do - { gsql: "DELETE FROM accounts WHERE account_id = @account_id", - pg: "DELETE FROM accounts WHERE account_id = $1" } - end - let :insert_params do - { gsql: { account_id: 4, username: "inserted", active: true, reputation: 88.8 }, - pg: { p1: 4, p2: "inserted", p3: true, p4: 88.8 } } - end - let :update_params do - { gsql: { account_id: 4, username: "updated", active: false }, - pg: { p1: 4, p2: "updated", p3: false } } - end - let :delete_params do - { gsql: { account_id: 4 }, pg: { p1: 4 } } - end - - before do - db[:gsql].commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - unless emulator_enabled? - db[:pg].commit do |c| - c.delete "accounts" - c.insert "accounts", default_pg_account_rows - end - end - end - - after do - db[:gsql].delete "accounts" - db[:pg].delete "accounts" unless emulator_enabled? - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "executes multiple DML statements in a batch for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - row_counts = tx.batch_update do |b| - b.batch_update insert_dml[dialect], params: insert_params[dialect] - b.batch_update update_dml[dialect], params: update_params[dialect] - b.batch_update delete_dml[dialect], params: delete_params[dialect] - end - - _(row_counts).must_be_kind_of Array - _(row_counts.count).must_equal 3 - _(row_counts[0]).must_equal 1 - _(row_counts[1]).must_equal 1 - _(row_counts[2]).must_equal 1 - - update_results = tx.execute_sql \ - select_dql[dialect], - params: delete_params[dialect] - _(update_results.rows.count).must_equal 0 - end - _(timestamp).must_be_kind_of Time - end - - it "raises InvalidArgumentError when no DML statements are executed in a batch for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - err = expect do - tx.batch_update { |b| } # rubocop:disable Lint/EmptyBlock - end.must_raise Google::Cloud::InvalidArgumentError - _(err.message).must_match( - /3:(No statements in batch DML request|Request must contain at least one DML statement)/ - ) - end - _(timestamp).must_be_kind_of Time - end - - it "executes multiple DML statements in a batch with syntax error for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - begin - tx.batch_update do |b| - b.batch_update insert_dml[dialect], params: insert_params[dialect] - b.batch_update update_dml_syntax_error, params: update_params[dialect] - b.batch_update delete_dml[dialect], params: delete_params[dialect] - end - rescue Google::Cloud::Spanner::BatchUpdateError => e - _(e.cause).must_be_kind_of Google::Cloud::InvalidArgumentError - _(e.cause.message).must_equal "Statement 1: 'UPDDDD accounts' is not valid DML." - - row_counts = e.row_counts - _(row_counts).must_be_kind_of Array - _(row_counts.count).must_equal 1 - _(row_counts[0]).must_equal 1 - end - update_results = tx.execute_sql \ - select_dql[dialect], - params: delete_params[dialect] - _(update_results.rows.count).must_equal 1 # DELETE statement did not execute. - end - _(timestamp).must_be_kind_of Time - end - - it "runs execute_update and batch_update in the same transaction for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - row_counts = tx.batch_update do |b| - b.batch_update insert_dml[dialect], params: insert_params[dialect] - b.batch_update update_dml[dialect], params: update_params[dialect] - end - - _(row_counts).must_be_kind_of Array - _(row_counts.count).must_equal 2 - _(row_counts[0]).must_equal 1 - _(row_counts[1]).must_equal 1 - - delete_row_count = tx.execute_update delete_dml[dialect], params: delete_params[dialect] - - _(delete_row_count).must_equal 1 - - update_results = tx.execute_sql \ - select_dql[dialect], - params: delete_params[dialect] - _(update_results.rows.count).must_equal 0 - end - _(timestamp).must_be_kind_of Time - end - - describe "request options for #{dialect}" do - it "execute batch update with priority options for #{dialect}" do - db[dialect].transaction do |tx| - row_counts = tx.batch_update request_options: { priority: :PRIORITY_HIGH } do |b| - b.batch_update insert_dml[dialect], params: insert_params[dialect] - b.batch_update update_dml[dialect], params: update_params[dialect] - end - - _(row_counts).must_be_kind_of Array - _(row_counts.count).must_equal 2 - end - end - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/commit_timestamp_test.rb b/google-cloud-spanner/acceptance/spanner/client/commit_timestamp_test.rb deleted file mode 100644 index 9510ed7464e6..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/commit_timestamp_test.rb +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License 00:00:00Z"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :commit_timestamp, :spanner do - let(:db) { spanner_client } - let(:table_name) { "commit_timestamp_test" } - let(:table_types) { [:committs] } - - it "writes and reads commit_timestamp timestamp to test table" do - commit_timestamp = db.upsert table_name, { committs: db.commit_timestamp } - results = db.read table_name, table_types, keys: commit_timestamp - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ committs: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ committs: commit_timestamp }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/crud_test.rb b/google-cloud-spanner/acceptance/spanner/client/crud_test.rb deleted file mode 100644 index 08a311b3796b..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/crud_test.rb +++ /dev/null @@ -1,213 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :crud, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - - before do - setup_timestamp_gsql = db[:gsql].delete "accounts" - setup_timestamp_pg = db[:pg].delete "accounts" unless emulator_enabled? - @setup_timestamp = { gsql: setup_timestamp_gsql, pg: setup_timestamp_pg } - @default_rows = { gsql: default_account_rows, pg: default_pg_account_rows } - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "inserts, updates, upserts, reads, and deletes records for #{dialect}" do - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: @setup_timestamp[dialect] } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - - db[dialect].insert "accounts", @default_rows[dialect][0] - db[dialect].upsert "accounts", @default_rows[dialect][1] - timestamp = db[dialect].insert "accounts", @default_rows[dialect][2] - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: timestamp } - _(results.rows.count).must_equal 3 - _(results.timestamp).wont_be :nil? - - active_count_sql = "SELECT COUNT(*) AS count FROM accounts WHERE active = true" - - results = db[dialect].execute_query active_count_sql, single_use: { timestamp: timestamp } - _(results.rows.first[:count]).must_equal 2 - _(results.timestamp).wont_be :nil? - - activate_inactive_account = { account_id: 3, active: true } - - timestamp = db[dialect].upsert "accounts", activate_inactive_account - - results = db[dialect].execute_query active_count_sql, single_use: { timestamp: timestamp } - _(results.rows.first[:count]).must_equal 3 - _(results.timestamp).wont_be :nil? - - timestamp = db[dialect].delete "accounts", [1, 2, 3] - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: timestamp } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - end - - it "inserts, updates, upserts, reads, and deletes records using commit for #{dialect}" do - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: @setup_timestamp[dialect] } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - - timestamp = db[dialect].commit do |c| - c.insert "accounts", @default_rows[dialect][0] - c.upsert "accounts", @default_rows[dialect][1] - c.insert "accounts", @default_rows[dialect][2] - end - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: timestamp } - _(results.rows.count).must_equal 3 - _(results.timestamp).wont_be :nil? - - active_count_sql = "SELECT COUNT(*) AS count FROM accounts WHERE active = true" - - results = db[dialect].execute_query active_count_sql, single_use: { timestamp: timestamp } - _(results.rows.first[:count]).must_equal 2 - _(results.timestamp).wont_be :nil? - - activate_inactive_account = { account_id: 3, active: true } - - timestamp = db[dialect].commit do |c| - c.upsert "accounts", activate_inactive_account - end - - results = db[dialect].execute_query active_count_sql, single_use: { timestamp: timestamp } - _(results.rows.first[:count]).must_equal 3 - _(results.timestamp).wont_be :nil? - - timestamp = db[dialect].commit do |c| - c.delete "accounts", [1, 2, 3] - end - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: timestamp } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - end - - it "inserts, updates, upserts, reads, and deletes records using commit and return commit stats for #{dialect}" do - skip if emulator_enabled? - - commit_options = { return_commit_stats: true } - commit_resp = db[dialect].commit commit_options: commit_options do |c| - c.insert "accounts", @default_rows[dialect][0] - end - - assert_commit_response commit_resp, commit_options - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: commit_resp.timestamp } - _(results.rows.count).must_equal 1 - _(results.timestamp).wont_be :nil? - - commit_resp = db[dialect].commit commit_options: commit_options do |c| - c.upsert "accounts", @default_rows[dialect][0] - end - - assert_commit_response commit_resp, commit_options - - commit_resp = db[dialect].commit commit_options: commit_options do |c| - c.delete "accounts", [1] - end - - assert_commit_response commit_resp, commit_options - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: commit_resp.timestamp } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - end - - it "inserts, updates, upserts, reads, and deletes records in a transaction for #{dialect}" do - @setup_timestamp[dialect] - active_count_sql = "SELECT COUNT(*) AS count FROM accounts WHERE active = true" - - db[dialect].transaction do |tx| - _(tx.read("accounts", ["account_id"]).rows.count).must_equal 0 - - tx.insert "accounts", @default_rows[dialect][0] - tx.upsert "accounts", @default_rows[dialect][1] - tx.insert "accounts", @default_rows[dialect][2] - end - - db[dialect].transaction do |tx| - _(db[dialect].read("accounts", ["account_id"]).rows.count).must_equal 3 - - _(tx.execute_query(active_count_sql).rows.first[:count]).must_equal 2 - - activate_inactive_account = { account_id: 3, active: true } - - tx.upsert "accounts", activate_inactive_account - end - - timestamp = db[dialect].transaction do |tx| - _(tx.execute_query(active_count_sql).rows.first[:count]).must_equal 3 - - tx.delete "accounts", [1, 2, 3] - end - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: timestamp } - _(results.rows.count).must_equal 0 - _(results.timestamp).wont_be :nil? - end - - describe "request options for #{dialect}" do - it "execute CRUD statement with priority options for #{dialect}" do - request_options = { priority: :PRIORITY_MEDIUM } - results = db[dialect].read "accounts", ["account_id"], request_options: request_options - _(results.rows.count).must_equal 0 - - db[dialect].insert "accounts", @default_rows[dialect][0], request_options: request_options - db[dialect].upsert "accounts", @default_rows[dialect][1], request_options: request_options - - results = db[dialect].read "accounts", ["account_id"] - _(results.rows.count).must_equal 2 - - db[dialect].replace "accounts", @default_rows[dialect][0], request_options: request_options - db[dialect].delete "accounts", [1, 2, 3], request_options: request_options - - results = db[dialect].read "accounts", ["account_id"] - _(results.rows.count).must_equal 0 - end - end - - it "inserts, updates, upserts, reads, and deletes records with request tagging options for #{dialect}" do - timestamp = db[dialect].insert "accounts", @default_rows[dialect][0], - request_options: { tag: "Tag-CRUD-1" } - _(timestamp).wont_be :nil? - - results = db[dialect].read "accounts", ["account_id"], single_use: { timestamp: @setup_timestamp[dialect] }, - request_options: { tag: "Tag-CRUD-2" } - _(results.timestamp).wont_be :nil? - - timestamp = db[dialect].update "accounts", @default_rows[dialect][0], - request_options: { tag: "Tag-CRUD-2" } - _(timestamp).wont_be :nil? - - timestamp = db[dialect].upsert "accounts", @default_rows[dialect][1], - request_options: { tag: "Tag-CRUD-4" } - _(timestamp).wont_be :nil? - - timestamp = db[dialect].delete "accounts", [1, 2, 3], - request_options: { tag: "Tag-CRUD-5" } - _(timestamp).wont_be :nil? - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/dml_test.rb b/google-cloud-spanner/acceptance/spanner/client/dml_test.rb deleted file mode 100644 index d83a51b4b91f..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/dml_test.rb +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "concurrent" - -describe "Spanner Client", :dml, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - let :insert_dml do - { gsql: "INSERT INTO accounts (account_id, username, active, reputation) \ - VALUES (@account_id, @username, @active, @reputation)", - pg: "INSERT INTO accounts (account_id, username, active, reputation) VALUES ($1, $2, $3, $4)" } - end - let :update_dml do - { gsql: "UPDATE accounts SET username = @username, active = @active WHERE account_id = @account_id", - pg: "UPDATE accounts SET username = $2, active = $3 WHERE account_id = $1" } - end - let :select_dql do - { gsql: "SELECT username FROM accounts WHERE account_id = @account_id", - pg: "SELECT username FROM accounts WHERE account_id = $1" } - end - let :insert_params do - { gsql: { account_id: 4, username: "inserted", active: true, reputation: 88.8 }, - pg: { p1: 4, p2: "inserted", p3: true, p4: 88.8 } } - end - let :update_params do - { gsql: { account_id: 4, username: "updated", active: false }, - pg: { p1: 4, p2: "updated", p3: false } } - end - let :select_params do - { gsql: { account_id: 4 }, pg: { p1: 4 } } - end - - before do - db[:gsql].commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - unless emulator_enabled? - db[:pg].commit do |c| - c.delete "accounts" - c.insert "accounts", default_pg_account_rows - end - end - end - - after do - db[:pg].delete "accounts" unless emulator_enabled? - db[:gsql].delete "accounts" - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "executes multiple DML statements in a transaction for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - # Execute a DML using execute_update and make sure data is updated and correct count is returned. - insert_row_count = tx.execute_update \ - insert_dml[dialect], - params: insert_params[dialect] - _(insert_row_count).must_equal 1 - - insert_results = tx.execute_sql \ - select_dql[dialect], - params: select_params[dialect] - insert_rows = insert_results.rows.to_a - _(insert_rows.count).must_equal 1 - _(insert_rows.first[:username]).must_equal "inserted" - - # Execute a DML using execute_sql and make sure data is updated and correct count is returned. - update_results = tx.execute_sql \ - update_dml[dialect], - params: update_params[dialect] - update_results.rows.to_a # fetch all the results - _(update_results).must_be :row_count_exact? - _(update_results.row_count).must_equal 1 - - update_results = tx.execute_sql \ - select_dql[dialect], - params: select_params[dialect] - update_rows = update_results.rows.to_a - _(update_rows.count).must_equal 1 - _(update_rows.first[:username]).must_equal "updated" - end - _(timestamp).must_be_kind_of Time - - post_results = db[dialect].execute_sql "SELECT * FROM accounts", single_use: { timestamp: timestamp } - _(post_results.rows.count).must_equal 4 - end - - it "executes a DML statement, then rollback the transaction for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - # Execute a DML using execute_update and make sure data is updated and correct count is returned. - insert_row_count = tx.execute_update \ - insert_dml[dialect], - params: insert_params[dialect] - _(insert_row_count).must_equal 1 - - insert_results = tx.execute_sql \ - select_dql[dialect], - params: select_params[dialect] - insert_rows = insert_results.rows.to_a - _(insert_rows.count).must_equal 1 - _(insert_rows.first[:username]).must_equal "inserted" - - # Execute a DML statement, then rollback the transaction and assert that data is not updated. - raise Google::Cloud::Spanner::Rollback - end - _(timestamp).must_be :nil? # because the transaction was rolled back - - post_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(post_results.rows.count).must_equal 3 - end - - it "executes a DML statement, then a mutation for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts" - _(prior_results.rows.count).must_equal 3 - - timestamp = db[dialect].transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - # Execute a DML statement, followed by calling existing insert method, - # commit the transaction and assert that both the updates are present. - insert_row_count = tx.execute_update \ - insert_dml[dialect], - params: insert_params[dialect] - _(insert_row_count).must_equal 1 - - insert_mut_rows = tx.insert "accounts", - { account_id: 5, username: "inserted by mutation", active: true, reputation: 99.9 } - _(insert_mut_rows.count).must_equal 1 - end - _(timestamp).must_be_kind_of Time - - post_results = db[dialect].execute_sql "SELECT * FROM accounts", single_use: { timestamp: timestamp } - _(post_results.rows.count).must_equal 5 - end - - describe "request options for #{dialect}" do - it "execute DML statement with priority options for #{dialect}" do - request_options = { priority: :PRIORITY_MEDIUM } - - db[dialect].transaction request_options: request_options do |tx| - insert_row_count = tx.execute_update \ - insert_dml[dialect], - params: insert_params[dialect], - request_options: request_options - _(insert_row_count).must_equal 1 - end - end - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/edge_test.rb b/google-cloud-spanner/acceptance/spanner/client/edge_test.rb deleted file mode 100644 index 56815453d446..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/edge_test.rb +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :edge, :spanner do - let(:db) { spanner_client } - let(:bad_db) { spanner.client db.instance_id, "invalid_database" } - let(:table_name) { "stuffs" } - - it "reads with invalid database fails" do - assert_raises Google::Cloud::NotFoundError do - bad_db.read table_name, [:id, :int] - end - end - - it "reads with invalid table fails" do - assert_raises Google::Cloud::NotFoundError do - db.read "invalid_table", [:id, :int] - end - end - - it "reads with invalid column fails" do - assert_raises Google::Cloud::NotFoundError do - db.read table_name, [:id, :invalid] - end - end - - it "writes to a non-existing table fails" do - id = SecureRandom.int64 - assert_raises Google::Cloud::NotFoundError do - db.upsert "invalid_table", { id: id, name: "invalid table" } - end - end - - it "writes to a non-existing column fails" do - id = SecureRandom.int64 - assert_raises Google::Cloud::NotFoundError do - db.upsert table_name, { id: id, invalid: "invalid column" } - end - end - - it "writes with incorrect column type fails" do - id = SecureRandom.int64 - assert_raises Google::Cloud::FailedPreconditionError do - db.upsert table_name, { id: id, int: "invalid type" } - end - end - - it "queries to a non-existing table fails" do - assert_raises Google::Cloud::InvalidArgumentError do - db.execute_sql "SELECT id, name FROM invalid_table" - end - end - - it "queries to a non-existing column fails" do - assert_raises Google::Cloud::InvalidArgumentError do - db.execute_sql "SELECT id, name FROM #{table_name}" - end - end - - it "queries with bad SQL fails" do - assert_raises Google::Cloud::InvalidArgumentError do - db.execute_sql "SELECT Apples AND Oranges" - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/execute_test.rb b/google-cloud-spanner/acceptance/spanner/client/execute_test.rb deleted file mode 100644 index 4a36e7a422a6..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/execute_test.rb +++ /dev/null @@ -1,221 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :execute_sql, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "runs SELECT 1 for #{dialect}" do - results = db[dialect].execute_sql "SELECT 1" - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[0]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[0]).must_equal 1 - end - - it "runs a simple query for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num" - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query using a single-use strong option for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num", single_use: { strong: true } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query using a single-use timestamp option for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num", single_use: { timestamp: (Time.now - 60) } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query using a single-use staleness option for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num", single_use: { staleness: 60 } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query using a single-use bounded_timestamp option for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num", single_use: { bounded_timestamp: (Time.now - 60) } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query using a single-use bounded_staleness option for #{dialect}" do - results = db[dialect].execute_sql "SELECT 42 AS num", single_use: { bounded_staleness: 60 } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query with query options for #{dialect}" do - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - results = db[dialect].execute_sql "SELECT 42 AS num", query_options: query_options - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - it "runs a simple query when the client-level config of query options is set for #{dialect}" do - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - new_spanner = Google::Cloud::Spanner.new - new_db = new_spanner.client db[dialect].instance_id, db[dialect].database_id, query_options: query_options - _(new_db.query_options).must_equal({ optimizer_version: "3", optimizer_statistics_package: "latest" }) - - results = new_db.execute_sql "SELECT 42 AS num" - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - - describe "when the environment variable of query options is set for #{dialect}" do - let(:origin_opt_version) { nil } - let(:origin_opt_stats_pkg) { nil } - - before do - origin_opt_version = ENV["SPANNER_OPTIMIZER_VERSION"] # rubocop:disable Lint/UselessAssignment - ENV["SPANNER_OPTIMIZER_VERSION"] = "3" - origin_opt_stats_pkg = ENV["SPANNER_OPTIMIZER_STATISTICS_PACKAGE"] # rubocop:disable Lint/UselessAssignment - ENV["SPANNER_OPTIMIZER_STATISTICS_PACKAGE"] = "latest" - end - - after do - ENV["SPANNER_OPTIMIZER_VERSION"] = origin_opt_version - ENV["SPANNER_OPTIMIZER_STATISTICS_PACKAGE"] = origin_opt_stats_pkg - end - - it "runs a simple query for #{dialect}" do - new_spanner = Google::Cloud::Spanner.new - new_db = new_spanner.client db[dialect].instance_id, db[dialect].database_id - _(new_db.project.query_options).must_equal({ optimizer_version: "3", optimizer_statistics_package: "latest" }) - - results = new_db.execute_sql "SELECT 42 AS num" - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:num]).must_equal :INT64 - - rows = results.rows.to_a # grab all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:num] - _(row[:num]).must_equal 42 - end - end - - describe "request options for #{dialect}" do - it "run sample query with priority for #{dialect}" do - results = db[dialect].execute_sql "SELECT 1", request_options: { priority: :PRIORITY_MEDIUM } - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.rows.count).must_equal 1 - end - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/large_data_test.rb b/google-cloud-spanner/acceptance/spanner/client/large_data_test.rb deleted file mode 100644 index 07e24272b3c5..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/large_data_test.rb +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :large_data, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - def generate_bytes count = 2048 - StringIO.new SecureRandom.random_bytes(count) - end - - def generate_string count = 50 - count.times.map { "The quick brown fox jumps over the lazy dog." }.join("\n") - end - - def random_small_bytes count = rand(1024..4096) - generate_bytes count - end - - def random_small_string count = rand(25..100) - generate_string count - end - - ## - # Guarenteed to be at least 1 MB - def random_big_bytes offset = rand(1..2048) - generate_bytes offset + (1024 * 1024) - end - - ## - # Guarenteed to be at least 1 MB - def random_big_string offset = rand(1..500) - generate_string 25_000 + offset - end - - def random_row - { - id: SecureRandom.int64, - string: random_big_string, - strings: [random_big_string, random_small_string, random_big_string], - byte: random_big_bytes, - bytes: [random_big_bytes, random_small_bytes, random_big_bytes] - } - end - - it "writes and reads large random data" do - my_row = random_row - db.upsert table_name, my_row - results = db.read table_name, [:id, :string, :byte, :strings, :bytes], keys: my_row[:id] - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - expected_fields = { id: :INT64, string: :STRING, byte: :BYTES, strings: [:STRING], bytes: [:BYTES] } - _(results.fields.to_h).must_equal expected_fields - returned_row = results.rows.first - - _(returned_row[:string]).must_equal my_row[:string] - - _(returned_row[:strings]).must_equal my_row[:strings] - - _(returned_row[:byte]).must_be_kind_of StringIO - my_row[:byte].rewind - _(returned_row[:byte].read).must_equal my_row[:byte].read - - returned_row[:bytes].each do |byte| - _(byte).must_be_kind_of StringIO - end - my_row[:bytes].each(&:rewind) - returned_row[:bytes].each_with_index do |byte, index| - _(byte.read).must_equal my_row[:bytes][index].read - end - end - - it "writes and queries bytes" do - my_row = random_row - db.upsert table_name, my_row - results = db.execute_sql "SELECT id, string, byte, strings, bytes FROM #{table_name} WHERE id = @id", - params: { id: my_row[:id] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - expected_fields = { id: :INT64, string: :STRING, byte: :BYTES, strings: [:STRING], bytes: [:BYTES] } - _(results.fields.to_h).must_equal expected_fields - returned_row = results.rows.first - - _(returned_row[:string]).must_equal my_row[:string] - - _(returned_row[:strings]).must_equal my_row[:strings] - - _(returned_row[:byte]).must_be_kind_of StringIO - my_row[:byte].rewind - _(returned_row[:byte].read).must_equal my_row[:byte].read - - returned_row[:bytes].each do |byte| - _(byte).must_be_kind_of StringIO - end - my_row[:bytes].each(&:rewind) - returned_row[:bytes].each_with_index do |byte, index| - _(byte.read).must_equal my_row[:bytes][index].read - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/bool_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/bool_test.rb deleted file mode 100644 index b3d2be3e94f8..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/bool_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :bool, :spanner do - let(:db) { spanner_client } - - it "queries and returns a bool parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: true } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :BOOL - _(results.rows.first[:value]).must_equal true - end - - it "queries and returns a NULL bool parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :BOOL } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :BOOL - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of bool parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [false, true, false] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BOOL] - _(results.rows.first[:value]).must_equal [false, true, false] - end - - it "queries and returns an array of bool parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", params: { value: [nil, false, true, false] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BOOL] - _(results.rows.first[:value]).must_equal [nil, false, true, false] - end - - it "queries and returns an empty array of bool parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:BOOL] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BOOL] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of bool parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:BOOL] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BOOL] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/bytes_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/bytes_test.rb deleted file mode 100644 index 857d69747131..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/bytes_test.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :bytes, :spanner do - let(:db) { spanner_client } - - it "queries and returns a bytes parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: StringIO.new("hello world!") } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :BYTES - returned_value = results.rows.first[:value] - _(returned_value).must_be_kind_of StringIO - _(returned_value.read).must_equal "hello world!" - end - - it "queries and returns a NULL bytes parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :BYTES } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :BYTES - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of bytes parameters" do - results = db.execute_query "SELECT @value AS value", - params: { value: [StringIO.new("foo"), StringIO.new("bar"), StringIO.new("baz")] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BYTES] - bytes_array = results.rows.first[:value] - _(bytes_array.size).must_equal 3 - _(bytes_array[0].read).must_equal "foo" - _(bytes_array[1].read).must_equal "bar" - _(bytes_array[2].read).must_equal "baz" - end - - it "queries and returns an array of bytes parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", - params: { value: [nil, StringIO.new("foo"), StringIO.new("bar"), StringIO.new("baz")] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BYTES] - bytes_array = results.rows.first[:value] - _(bytes_array.size).must_equal 4 - _(bytes_array[0]).must_be :nil? - _(bytes_array[1].read).must_equal "foo" - _(bytes_array[2].read).must_equal "bar" - _(bytes_array[3].read).must_equal "baz" - end - - it "queries and returns an empty array of bytes parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:BYTES] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BYTES] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of bytes parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:BYTES] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:BYTES] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/date_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/date_test.rb deleted file mode 100644 index cb327f15912e..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/date_test.rb +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :date, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - let :date_query do - { gsql: "SELECT @value AS value", - pg: "SELECT $1 AS value" } - end - let(:date_value) { Date.today } - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "queries and returns a date parameter for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, date_value) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :DATE - _(results.rows.first[:value]).must_equal date_value - end - - it "queries and returns a NULL date parameter for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, nil), - types: make_params(dialect, :DATE) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :DATE - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of date parameters for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, [(date_value - 1), date_value, (date_value + 1)]) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:DATE] - _(results.rows.first[:value]).must_equal [(date_value - 1), date_value, (date_value + 1)] - end - - it "queries and returns an array of date parameters with a nil value for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, - [nil, (date_value - 1), date_value, (date_value + 1)]) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:DATE] - _(results.rows.first[:value]).must_equal [nil, (date_value - 1), date_value, (date_value + 1)] - end - - it "queries and returns an empty array of date parameters for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, []), - types: make_params(dialect, [:DATE]) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:DATE] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of date parameters for #{dialect}" do - results = db[dialect].execute_query date_query[dialect], - params: make_params(dialect, nil), - types: make_params(dialect, [:DATE]) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:DATE] - _(results.rows.first[:value]).must_be :nil? - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/float64_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/float64_test.rb deleted file mode 100644 index fef70a3d8cce..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/float64_test.rb +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :float64, :spanner do - let(:db) { spanner_client } - - it "queries and returns a float64 parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: 12.0 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :FLOAT64 - _(results.rows.first[:value]).must_equal 12.0 - end - - it "queries and returns a float64 parameter (Infinity)" do - results = db.execute_query "SELECT @value AS value", params: { value: Float::INFINITY } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :FLOAT64 - _(results.rows.first[:value]).must_equal Float::INFINITY - end - - it "queries and returns a float64 parameter (-Infinity)" do - results = db.execute_query "SELECT @value AS value", params: { value: -Float::INFINITY } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :FLOAT64 - _(results.rows.first[:value]).must_equal(-Float::INFINITY) - end - - it "queries and returns a float64 parameter (-NaN)" do - results = db.execute_query "SELECT @value AS value", params: { value: Float::NAN } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :FLOAT64 - returned_value = results.rows.first[:value] - _(returned_value).must_be_kind_of Float - _(returned_value).must_be :nan? - end - - it "queries and returns a NULL float64 parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :FLOAT64 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :FLOAT64 - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of float64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [1.0, 2.2, 3.5] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:FLOAT64] - _(results.rows.first[:value]).must_equal [1.0, 2.2, 3.5] - end - - it "queries and returns an array of special float64 parameters" do - results = db.execute_query "SELECT @value AS value", - params: { value: [Float::INFINITY, -Float::INFINITY, -Float::NAN] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:FLOAT64] - float_array = results.rows.first[:value] - _(float_array.size).must_equal 3 - _(float_array[0]).must_equal Float::INFINITY - _(float_array[1]).must_equal(-Float::INFINITY) - _(float_array[2]).must_be :nan? - end - - it "queries and returns an array of float64 parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", params: { value: [nil, 1.0, 2.2, 3.5] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:FLOAT64] - _(results.rows.first[:value]).must_equal [nil, 1.0, 2.2, 3.5] - end - - it "queries and returns an empty array of float64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:FLOAT64] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:FLOAT64] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of float64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:FLOAT64] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:FLOAT64] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/int64_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/int64_test.rb deleted file mode 100644 index bf0017cdc756..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/int64_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :int64, :spanner do - let(:db) { spanner_client } - - it "queries and returns a int64 parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: 99 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :INT64 - _(results.rows.first[:value]).must_equal 99 - end - - it "queries and returns a NULL int64 parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :INT64 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :INT64 - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of int64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [1, 2, 3] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:INT64] - _(results.rows.first[:value]).must_equal [1, 2, 3] - end - - it "queries and returns an array of int64 parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", params: { value: [nil, 1, 2, 3] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:INT64] - _(results.rows.first[:value]).must_equal [nil, 1, 2, 3] - end - - it "queries and returns an empty array of int64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:INT64] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:INT64] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of int64 parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:INT64] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:INT64] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/json_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/json_test.rb deleted file mode 100644 index caa20e701bad..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/json_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :json, :spanner do - let(:db) { spanner_client } - let(:json_params) { { "venue" => "abc", "rating" => 10 } } - let :json_array_params do - 3.times.map do |i| - { "venue" => "abc-#{i}", "rating" => 10 + i } - end - end - - it "queries and returns a string parameter" do - skip if emulator_enabled? - - results = db.execute_query "SELECT @value AS value", params: { value: json_params }, types: { value: :JSON } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :JSON - _(results.rows.first[:value]).must_equal json_params - end - - it "queries and returns a NULL string parameter" do - skip if emulator_enabled? - - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :JSON } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :JSON - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of json parameters" do - skip if emulator_enabled? - - results = db.execute_query "SELECT @value AS value", params: { value: json_array_params }, types: { value: [:JSON] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal json_array_params - end - - it "queries and returns an array of json parameters with a nil value" do - skip if emulator_enabled? - - params = [nil].concat json_array_params - results = db.execute_query "SELECT @value AS value", params: { value: params }, types: { value: [:JSON] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal params - end - - it "queries and returns an empty array of json parameters" do - skip if emulator_enabled? - - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:JSON] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of json parameters" do - skip if emulator_enabled? - - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:JSON] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/pgjsonb_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/pgjsonb_test.rb deleted file mode 100644 index da6ac340d8a5..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/pgjsonb_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :pgjsonb, :spanner do - let(:db) { spanner_pg_client } - let(:json_params) { { "venue" => "abc", "rating" => 10 } } - let :json_array_params do - 3.times.map do |i| - { "venue" => "abc-#{i}", "rating" => 10 + i } - end - end - - before do - skip if emulator_enabled? - end - - it "queries and returns a string parameter" do - results = db.execute_query "SELECT $1 AS value", params: { p1: json_params }, types: { p1: :PG_JSONB } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :JSON - _(results.rows.first[:value]).must_equal json_params - end - - it "queries and returns a NULL string parameter" do - results = db.execute_query "SELECT $1 AS value", params: { p1: nil }, types: { p1: :PG_JSONB } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :JSON - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of json parameters" do - skip "Arrays not supported yet" - results = db.execute_query "SELECT $1 AS value", params: { p1: json_array_params }, types: { p1: [:PG_JSONB] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal json_array_params - end - - it "queries and returns an array of json parameters with a nil value" do - skip "Arrays not supported yet" - params = [nil].concat json_array_params - results = db.execute_query "SELECT $1 AS value", params: { p1: params }, types: { p1: [:PG_JSONB] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal params - end - - it "queries and returns an empty array of json parameters" do - skip "Arrays not supported yet" - results = db.execute_query "SELECT $1 AS value", params: { p1: [] }, types: { p1: [:PG_JSONB] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of json parameters" do - skip "Arrays not supported yet" - results = db.execute_query "SELECT $1 AS value", params: { p1: nil }, types: { p1: [:PG_JSONB] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:JSON] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/pgnumeric_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/pgnumeric_test.rb deleted file mode 100644 index 1e31867ac1f4..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/pgnumeric_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "bigdecimal" - -describe "Spanner Client", :params, :bool, :spanner do - let(:db) { spanner_pg_client } - - it "queries and returns a BigDecimal parameter" do - skip if emulator_enabled? - results = db.execute_query "SELECT $1 AS value", params: { p1: BigDecimal(1) }, types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :NUMERIC - _(results.rows.first[:value]).must_equal BigDecimal(1) - end - - it "queries and returns a NULL parameter" do - skip if emulator_enabled? - results = db.execute_query "SELECT $1 AS value", params: { p1: nil }, types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :NUMERIC - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns a NAN BigDecimal parameter" do - skip if emulator_enabled? - results = db.execute_query "SELECT $1 AS value", params: { p1: BigDecimal("NaN") }, types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :NUMERIC - _(results.rows.first[:value]).must_be :nan? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/string_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/string_test.rb deleted file mode 100644 index 9386359768c8..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/string_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :string, :spanner do - let(:db) { spanner_client } - - it "queries and returns a string parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: "hello" } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :STRING - _(results.rows.first[:value]).must_equal "hello" - end - - it "queries and returns a NULL string parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :STRING } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :STRING - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of string parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: ["foo", "bar", "baz"] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:STRING] - _(results.rows.first[:value]).must_equal ["foo", "bar", "baz"] - end - - it "queries and returns an array of string parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", params: { value: [nil, "foo", "bar", "baz"] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:STRING] - _(results.rows.first[:value]).must_equal [nil, "foo", "bar", "baz"] - end - - it "queries and returns an empty array of string parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:STRING] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:STRING] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns a NULL array of string parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:STRING] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:STRING] - _(results.rows.first[:value]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/struct_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/struct_test.rb deleted file mode 100644 index cac419eed79a..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/struct_test.rb +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :struct, :spanner do - let(:db) { spanner_client } - - describe "Struct Parameters Query Examples" do - # Simple field access. - # [parameters=STRUCT(1,"bob") AS struct_param, 10 as p4] - # SELECT @struct_param.userf, @p4; - it "Simple field access" do - results = db.execute "SELECT @struct_param.userf, @p4", - params: { struct_param: { threadf: 1, userf: "bob" }, p4: 10 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ userf: :STRING, 1 => :INT64 }) - _(results.rows.first.to_h).must_equal({ userf: "bob", 1 => 10 }) - end - - # # Simple field access on NULL struct value. - # [parameters=CAST(NULL AS STRUCT) AS struct_param] - # SELECT @struct_param.userf; - it "Simple field access on NULL struct value" do - struct_type = db.fields threadf: :INT64, userf: :STRING - results = db.execute "SELECT @struct_param.userf", - params: { struct_param: nil }, - types: { struct_param: struct_type } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ userf: :STRING }) - _(results.rows.first.to_h).must_equal({ userf: nil }) - end - - # # Nested struct field access. - # [parameters=STRUCT> (STRUCT("bob")) AS struct_param] - # SELECT @struct_param.structf.nestedf; - it "Nested struct field access" do - results = db.execute "SELECT @struct_param.structf.nestedf", - params: { struct_param: { structf: { nestedf: "bob" } } } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ nestedf: :STRING }) - _(results.rows.first.to_h).must_equal({ nestedf: "bob" }) - end - - # # Nested struct field access on NULL struct value. - # [parameters=CAST(STRUCT(null) AS STRUCT>) AS struct_param] - # SELECT @struct_param.structf.nestedf; - it "Nested struct field access on NULL struct value" do - struct_type = db.fields structf: db.fields(nestedf: :STRING) - results = db.execute "SELECT @struct_param.structf.nestedf", - params: { struct_param: nil }, - types: { struct_param: struct_type } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ nestedf: :STRING }) - _(results.rows.first.to_h).must_equal({ nestedf: nil }) - end - - # # Non-NULL struct with no fields (empty struct). - # [parameters=CAST(STRUCT() AS STRUCT<>) AS struct_param] - # SELECT @struct_param IS NULL; - it "Non-NULL struct with no fields (empty struct)" do - results = db.execute "SELECT @struct_param IS NULL", - params: { struct_param: {} } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => :BOOL }) - _(results.rows.first.to_h).must_equal({ 0 => false }) - end - - # # NULL struct with no fields. - # [parameters=CAST(NULL AS STRUCT<>) AS struct_param] - # SELECT @struct_param IS NULL - it "NULL struct with no fields" do - struct_type = db.fields({}) - results = db.execute "SELECT @struct_param IS NULL", - params: { struct_param: nil }, - types: { struct_param: struct_type } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => :BOOL }) - _(results.rows.first.to_h).must_equal({ 0 => true }) - end - - # # Struct with single NULL field. - # [parameters=STRUCT(NULL) AS struct_param] - # SELECT @struct_param.f1; - it "Struct with single NULL field" do - struct_type = db.fields f1: :INT64 - results = db.execute "SELECT @struct_param.f1", - params: { struct_param: { f1: nil } }, - types: { struct_param: struct_type } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ f1: :INT64 }) - _(results.rows.first.to_h).must_equal({ f1: nil }) - end - - # # Equality check. - # [parameters=STRUCT(1,"bob") AS struct_param] - # SELECT @struct_param=STRUCT(1,"bob"); - it "Equality check" do - struct_value = db.fields(threadf: :INT64, userf: :STRING).struct([1, "bob"]) - results = db.execute_query "SELECT @struct_param=STRUCT(1,\"bob\")", - params: { struct_param: struct_value } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => :BOOL }) - _(results.rows.first.to_h).must_equal({ 0 => true }) - end - - # # Nullness check. - # [parameters=ARRAY> [(1,"bob")] AS struct_arr_param] - # SELECT @struct_arr_param IS NULL; - it "Nullness check" do - struct_value = db.fields(threadf: :INT64, userf: :STRING).struct([1, "bob"]) - results = db.execute_query "SELECT @struct_arr_param IS NULL", - params: { struct_arr_param: [struct_value] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => :BOOL }) - _(results.rows.first.to_h).must_equal({ 0 => false }) - end - - # # Null array of struct field. - # [parameters=STRUCT>>\ - # (10,CAST(NULL AS ARRAY>)) AS struct_param] - # SELECT a.threadid FROM UNNEST(@struct_param.arraysf) a; - it "Null array of struct field" do - struct_value = db.fields(intf: :INT64, arraysf: [db.fields(threadid: :INT64)]).struct([10, nil]) - results = db.execute_query "SELECT a.threadid FROM UNNEST(@struct_param.arraysf) a", - params: { struct_param: struct_value } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ threadid: :INT64 }) - _(results.rows.count).must_equal 0 - end - - # # Null array of struct. - # [parameters=CAST(NULL AS ARRAY>) as struct_arr_param] - # SELECT a.threadid FROM UNNEST(@struct_arr_param) a; - it "Null array of struct" do - struct_type = db.fields threadid: :INT64 - results = db.execute_query "SELECT a.threadid FROM UNNEST(@struct_arr_param) a", - params: { struct_arr_param: nil }, - types: { struct_arr_param: [struct_type] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ threadid: :INT64 }) - _(results.rows.count).must_equal 0 - end - end - - it "queries and returns a struct parameter" do - results = db.execute "SELECT ARRAY(SELECT AS STRUCT message, repeat \ - FROM (SELECT @value.message AS message, @value.repeat AS repeat)) AS value", - params: { value: { message: "hello", repeat: 1 } } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ value: [db.fields(message: :STRING, repeat: :INT64)] }) - _(results.rows.first.to_h).must_equal({ value: [{ message: "hello", repeat: 1 }] }) - end - - it "queries a struct parameter and returns string and integer" do - results = db.execute_query "SELECT @value.message AS message, @value.repeat AS repeat", - params: { value: { message: "hello", repeat: 1 } } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ message: :STRING, repeat: :INT64 }) - _(results.rows.first.to_h).must_equal({ message: "hello", repeat: 1 }) - end - - it "queries and returns a struct array" do - struct_sql = "SELECT ARRAY(SELECT AS STRUCT message, repeat \ - FROM (SELECT 'hello' AS message, 1 AS repeat UNION ALL \ - SELECT 'hola' AS message, 2 AS repeat) ORDER BY repeat ASC)" - results = db.execute_query struct_sql - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => [db.fields(message: :STRING, repeat: :INT64)] }) - _(results.rows.first.to_h).must_equal({ 0 => [{ message: "hello", repeat: 1 }, { message: "hola", repeat: 2 }] }) - end - - it "queries and returns an empty struct array" do - struct_sql = "SELECT ARRAY(SELECT AS STRUCT * FROM (SELECT 'empty', 0) WHERE 0 = 1)" - results = db.execute_query struct_sql - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => [db.fields(0 => :STRING, 1 => :INT64)] }) - _(results.rows.first.to_h).must_equal({ 0 => [] }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/params/timestamp_test.rb b/google-cloud-spanner/acceptance/spanner/client/params/timestamp_test.rb deleted file mode 100644 index 40b56c25a53d..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/params/timestamp_test.rb +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :params, :timestamp, :spanner do - let(:db) { spanner_client } - let(:timestamp_value) { Time.now } - - it "queries and returns a timestamp parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: timestamp_value } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :TIMESTAMP - _(results.rows.first[:value]).must_equal timestamp_value - end - - it "queries and returns a NULL timestamp parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: :TIMESTAMP } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :TIMESTAMP - _(results.rows.first[:value]).must_be :nil? - end - - it "queries and returns an array of timestamp parameters" do - results = db.execute_query "SELECT @value AS value", - params: { value: [(timestamp_value - 180.0), timestamp_value, - (timestamp_value - 240.0)] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_equal [(timestamp_value - 180.0), timestamp_value, (timestamp_value - 240.0)] - end - - it "queries and returns an array of timestamp parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", - params: { value: [nil, (timestamp_value - 180.0), timestamp_value, - (timestamp_value - 240.0)] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_equal [nil, (timestamp_value - 180.0), timestamp_value, - (timestamp_value - 240.0)] - end - - it "queries and returns an empty array of timestamp parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: [] }, types: { value: [:TIMESTAMP] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_equal [] - end - - it "queries and returns an NULL array of timestamp parameters" do - results = db.execute_query "SELECT @value AS value", params: { value: nil }, types: { value: [:TIMESTAMP] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_be :nil? - end - - describe "using DateTime" do - let(:datetime_value) { timestamp_value.to_datetime } - - it "queries and returns a timestamp parameter" do - results = db.execute_query "SELECT @value AS value", params: { value: datetime_value } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal :TIMESTAMP - _(results.rows.first[:value]).must_equal timestamp_value - end - - it "queries and returns an array of timestamp parameters" do - results = db.execute_query "SELECT @value AS value", - params: { value: [(datetime_value - 1), datetime_value, (datetime_value + 1)] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_equal [(timestamp_value - 86_400), timestamp_value, (timestamp_value + 86_400)] - end - - it "queries and returns an array of timestamp parameters with a nil value" do - results = db.execute_query "SELECT @value AS value", - params: { value: [nil, (datetime_value - 1), datetime_value, (datetime_value + 1)] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields[:value]).must_equal [:TIMESTAMP] - _(results.rows.first[:value]).must_equal [nil, (timestamp_value - 86_400), timestamp_value, - (timestamp_value + 86_400)] - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/pdml_test.rb b/google-cloud-spanner/acceptance/spanner/client/pdml_test.rb deleted file mode 100644 index 181b8b448b65..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/pdml_test.rb +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "concurrent" - -describe "Spanner Client", :pdml, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - - before do - db[:gsql].commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - unless emulator_enabled? - db[:pg].commit do |c| - c.delete "accounts" - c.insert "accounts", default_pg_account_rows - end - end - end - - after do - db[:gsql].delete "accounts" - db[:pg].delete "accounts" unless emulator_enabled? - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "executes a simple Partitioned DML statement for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts WHERE active = TRUE" - _(prior_results.rows.count).must_equal 2 - - pdml_row_count = db[dialect].execute_partition_update "UPDATE accounts SET active = TRUE WHERE active = FALSE" - _(pdml_row_count).must_equal 1 - - post_results = db[dialect].execute_sql "SELECT * FROM accounts WHERE active = TRUE", single_use: { strong: true } - _(post_results.rows.count).must_equal 3 - end - - it "executes a simple Partitioned DML statement with query options for #{dialect}" do - prior_results = db[dialect].execute_sql "SELECT * FROM accounts WHERE active = TRUE" - _(prior_results.rows.count).must_equal 2 - - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - pdml_row_count = db[dialect].execute_partition_update "UPDATE accounts SET active = TRUE WHERE active = FALSE", - query_options: query_options - _(pdml_row_count).must_equal 1 - - post_results = db[dialect].execute_sql "SELECT * FROM accounts WHERE active = TRUE", single_use: { strong: true } - _(post_results.rows.count).must_equal 3 - end - - describe "request options for #{dialect}" do - it "execute Partitioned DML statement with priority options for #{dialect}" do - pdml_row_count = db[dialect].execute_partition_update "UPDATE accounts SET active = TRUE WHERE active = FALSE", - request_options: { priority: :PRIORITY_MEDIUM } - - _(pdml_row_count).must_equal 1 - end - end - - it "executes a Partitioned DML statement with request tagging option for #{dialect}" do - pdml_row_count = db[dialect].execute_partition_update "UPDATE accounts SET active = TRUE WHERE active = FALSE", - request_options: { tag: "Tag-P-1" } - _(pdml_row_count).must_equal 1 - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/read_test.rb b/google-cloud-spanner/acceptance/spanner/client/read_test.rb deleted file mode 100644 index 30eaf3b93e20..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/read_test.rb +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :read, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - let(:table_index) { "IsStuffsIdPrime" } - - before do - db.delete table_name # remove all data - db.insert table_name, [ - { id: 1, bool: false }, - { id: 2, bool: false }, - { id: 3, bool: true }, - { id: 4, bool: false }, - { id: 5, bool: true }, - { id: 6, bool: false }, - { id: 7, bool: true }, - { id: 8, bool: false }, - { id: 9, bool: false }, - { id: 10, bool: false }, - { id: 11, bool: true }, - { id: 12, bool: false } - ] - end - - after do - db.delete table_name # remove all data - end - - it "reads all by default" do - _(db.read(table_name, - [:id]).rows.map(&:to_h)).must_equal [{ id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - { id: 5 }, - { id: 6 }, - { id: 7 }, - { id: 8 }, - { id: 9 }, - { id: 10 }, - { id: 11 }, - { id: 12 }] - _(db.read(table_name, [:id], - limit: 5).rows.map(&:to_h)).must_equal [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }] - - _(db.read(table_name, [:id, :bool], - index: table_index).rows.map(&:to_h)).must_equal [{ id: 1, bool: false }, - { id: 2, bool: false }, - { id: 4, bool: false }, - { id: 6, bool: false }, - { id: 8, bool: false }, - { id: 9, bool: false }, - { id: 10, bool: false }, - { id: 12, bool: false }, - { id: 3, bool: true }, - { id: 5, bool: true }, - { id: 7, bool: true }, - { id: 11, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -limit: 5).rows.map(&:to_h)).must_equal [{ id: 1, bool: false }, { id: 2, bool: false }, { id: 4, bool: false }, - { id: 6, bool: false }, { id: 8, bool: false }] - end - - it "empty read works" do - random_id = SecureRandom.int64 - db.delete table_name, random_id - _(db.read(table_name, [:id], keys: random_id).rows.map(&:to_h)).must_equal [] - - db.delete table_name, 9997..9999 - _(db.read(table_name, [:id], keys: 9997..9999).rows.map(&:to_h)).must_equal [] - - _(db.read(table_name, [:id, :bool], index: table_index, keys: [[false, 3]]).rows.map(&:to_h)).must_equal [] - end - - it "reads with a list of keys" do - _(db.read(table_name, [:id], keys: 1).rows.map(&:to_h)).must_equal [{ id: 1 }] - _(db.read(table_name, [:id], keys: [1]).rows.map(&:to_h)).must_equal [{ id: 1 }] - _(db.read(table_name, [:id], keys: [3, 4, 5]).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], - keys: [3, 5, 7, 11]).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 5 }, { id: 7 }, { id: 11 }] - - _(db.read(table_name, [:id], keys: [3, 5, 7, 11], limit: 2).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 5 }] - end - - it "reads with range key sets" do - _(db.read(table_name, [:id], keys: 3..5).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], keys: 3...5).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }] - _(db.read(table_name, [:id], - keys: db.range(3, 5, exclude_begin: true)).rows.map(&:to_h)).must_equal [{ id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], - keys: db.range(3, 5, exclude_begin: true, exclude_end: true)).rows.map(&:to_h)).must_equal [{ id: 4 }] - _(db.read(table_name, [:id], - keys: [7]..[]).rows.map(&:to_h)).must_equal [{ id: 7 }, { id: 8 }, { id: 9 }, { id: 10 }, { id: 11 }, - { id: 12 }] - _(db.read(table_name, [:id], - keys: db.range([7], [], exclude_begin: true)).rows.map(&:to_h)).must_equal [{ id: 8 }, - { id: 9 }, - { id: 10 }, - { id: 11 }, - { id: 12 }] - _(db.read(table_name, [:id], - keys: []..[5]).rows.map(&:to_h)).must_equal [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], - keys: []...[5]).rows.map(&:to_h)).must_equal [{ id: 1 }, { id: 2 }, { id: 3 }, { id: 4 }] - end - - it "reads with range key sets and limit" do - _(db.read(table_name, [:id], keys: 3..9, limit: 2).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }] - _(db.read(table_name, [:id], keys: 3...9, limit: 2).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }] - _(db.read(table_name, [:id], keys: db.range(3, 9, exclude_begin: true), -limit: 2).rows.map(&:to_h)).must_equal [{ id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], keys: db.range(3, 9, exclude_begin: true, exclude_end: true), -limit: 2).rows.map(&:to_h)).must_equal [{ id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], keys: [3]..[], limit: 2).rows.map(&:to_h)).must_equal [{ id: 3 }, { id: 4 }] - _(db.read(table_name, [:id], keys: db.range([3], [], exclude_begin: true), -limit: 2).rows.map(&:to_h)).must_equal [{ id: 4 }, { id: 5 }] - _(db.read(table_name, [:id], keys: []..[9], limit: 2).rows.map(&:to_h)).must_equal [{ id: 1 }, { id: 2 }] - _(db.read(table_name, [:id], keys: []...[9], limit: 2).rows.map(&:to_h)).must_equal [{ id: 1 }, { id: 2 }] - end - - it "reads from index with a list of composite keys" do - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [[false, 1]]).rows.map(&:to_h)).must_equal [{ id: 1, bool: false }] - # Provide 3 keys, but only get 2 results... - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [[true, 3], [true, 4], [true, 5]]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [[true, 3], [true, 5], [true, 7], [true, 11]]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, - { id: 5, bool: true }, - { id: 7, bool: true }, - { id: 11, bool: true }] - - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [[false, 1], [false, 2], [false, 3], [false, 4], [false, 5], [false, 6]], limit: 3).rows.map(&:to_h)).must_equal [ - { id: 1, bool: false }, { id: 2, bool: false }, { id: 4, bool: false } -] - end - - it "reads from index with range key sets" do - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [true, 3]..[true, 7]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }, - { id: 7, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [true, 3]...[true, 7]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: db.range([true, 3], [true, 7], exclude_begin: true)).rows.map(&:to_h)).must_equal [{ id: 5, bool: true }, - { id: 7, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: db.range([true, 3], [true, 7], exclude_begin: true, exclude_end: true)).rows.map(&:to_h)).must_equal [{ id: 5, -bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [true, 7]..[]).rows.map(&:to_h)).must_equal [{ id: 7, bool: true }, { id: 11, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: db.range([true, 7], [], exclude_begin: true)).rows.map(&:to_h)).must_equal [{ id: 11, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [true]..[true, 7]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }, - { id: 7, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: [true]...[true, 7]).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - end - - it "reads from index with range key sets and limit" do - _(db.read(table_name, [:id, :bool], index: table_index, keys: [true, 3]..[true, 11], -limit: 2).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, keys: [true, 3]...[true, 11], -limit: 2).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, keys: db.range([true, 3], [true, 7], exclude_begin: true), -limit: 2).rows.map(&:to_h)).must_equal [{ id: 5, bool: true }, { id: 7, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, -keys: db.range([true, 3], [true, 7], exclude_begin: true, exclude_end: true), limit: 2).rows.map(&:to_h)).must_equal [{ - id: 5, bool: true -}] - _(db.read(table_name, [:id, :bool], index: table_index, keys: [true, 5]..[], -limit: 2).rows.map(&:to_h)).must_equal [{ id: 5, bool: true }, { id: 7, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, keys: db.range([true, 5], [], exclude_begin: true), -limit: 2).rows.map(&:to_h)).must_equal [{ id: 7, bool: true }, { id: 11, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, keys: [true]..[true, 11], -limit: 2).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - _(db.read(table_name, [:id, :bool], index: table_index, keys: [true]...[true, 11], -limit: 2).rows.map(&:to_h)).must_equal [{ id: 3, bool: true }, { id: 5, bool: true }] - end - - it "reads with request tag option" do - request_options = { tag: "Tag-R-1" } - _(db.read(table_name, [:id], - request_options: request_options).rows.map(&:to_h)).must_equal [{ id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - { id: 5 }, - { id: 6 }, - { id: 7 }, - { id: 8 }, - { id: 9 }, - { id: 10 }, - { id: 11 }, - { id: 12 }] - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/reset_test.rb b/google-cloud-spanner/acceptance/spanner/client/reset_test.rb deleted file mode 100644 index 15280a227132..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/reset_test.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :reset, :spanner do - let(:db) { spanner_client } - - it "closes all sessions and creates new sessions" do - _(db.reset).must_equal true - _(db.execute_query("SELECT 1").rows.first.values).must_equal [1] - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb b/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb deleted file mode 100644 index 96d832c534e3..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/single_use_test.rb +++ /dev/null @@ -1,223 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :single_use, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - let :columns do - [:account_id, :username, :friends, :active, :reputation, :avatar] - end - let :fields_hash do - { account_id: :INT64, username: :STRING, friends: [:INT64], active: :BOOL, reputation: :FLOAT64, avatar: :BYTES } - end - - before do - setup_timestamp_gsql = db[:gsql].commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - unless emulator_enabled? - setup_timestamp_pg = db[:pg].commit do |c| - c.delete "accounts" - c.insert "accounts", default_pg_account_rows - end - end - @setup_timestamp = { gsql: setup_timestamp_gsql, pg: setup_timestamp_pg } - @default_rows = { gsql: default_account_rows, pg: default_pg_account_rows } - end - - after do - db[:gsql].delete "accounts" - db[:pg].delete "accounts" unless emulator_enabled? - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "runs a query with strong option for #{dialect}" do - results = db[dialect].execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", single_use: { strong: true } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a read with strong option for #{dialect}" do - results = db[dialect].read "accounts", columns, single_use: { strong: true } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a query with timestamp option for #{dialect}" do - results = db[dialect].execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", - single_use: { timestamp: @setup_timestamp[dialect] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 1 - end - - it "runs a read with timestamp option for #{dialect}" do - results = db[dialect].read "accounts", columns, single_use: { timestamp: @setup_timestamp[dialect] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 1 - end - - it "runs a query with staleness option for #{dialect}" do - results = db[dialect].execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", - single_use: { staleness: 0.0001 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a read with staleness option for #{dialect}" do - results = db[dialect].read "accounts", columns, single_use: { staleness: 0.0001 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a query with bounded_timestamp option for #{dialect}" do - results = db[dialect].execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", - single_use: { bounded_timestamp: @setup_timestamp[dialect] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a read with bounded_timestamp option for #{dialect}" do - results = db[dialect].read "accounts", columns, - single_use: { bounded_timestamp: @setup_timestamp[dialect] } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a query with bounded_staleness option for #{dialect}" do - results = db[dialect].execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", - single_use: { bounded_staleness: 0.0001 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - - it "runs a read with bounded_staleness option for #{dialect}" do - results = db[dialect].read "accounts", columns, single_use: { bounded_staleness: 0.0001 } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - - _(results.timestamp).wont_be :nil? - _(results.timestamp).must_be_close_to @setup_timestamp[dialect], 3 # within 3 seconds? - end - end - - def assert_accounts_equal expected, actual - if actual[:account_id].nil? - _(expected[:account_id]).must_be :nil? - else - _(expected[:account_id]).must_equal actual[:account_id] - end - - if actual[:username].nil? - _(expected[:username]).must_be :nil? - else - _(expected[:username]).must_equal actual[:username] - end - - if actual[:reputation].nil? - _(expected[:reputation]).must_be :nil? - else - _(expected[:reputation]).must_equal actual[:reputation] - end - - if actual[:active].nil? - _(expected[:active]).must_be :nil? - else - _(expected[:active]).must_equal actual[:active] - end - - if expected[:avatar] && actual[:avatar] - _(expected[:avatar].read).must_equal actual[:avatar].read - end - - if actual[:friends].nil? - _(expected[:friends]).must_be :nil? - else - _(expected[:friends]).must_equal actual[:friends] - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/snapshot_test.rb b/google-cloud-spanner/acceptance/spanner/client/snapshot_test.rb deleted file mode 100644 index 547942c765ce..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/snapshot_test.rb +++ /dev/null @@ -1,487 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :snapshot, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - let :columns do - [:account_id, :username, :friends, :active, :reputation, :avatar] - end - let :fields_hash do - { account_id: :INT64, username: :STRING, friends: [:INT64], active: :BOOL, reputation: :FLOAT64, avatar: :BYTES } - end - let :select_dql do - { gsql: "SELECT account_id, username FROM accounts WHERE account_id = @id", - pg: "SELECT account_id, username FROM accounts WHERE account_id = $1" } - end - - let :select_params do - { gsql: { id: 1 }, pg: { p1: 1 } } - end - - before do - setup_timestamp_gsql = db[:gsql].commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - unless emulator_enabled? - setup_timestamp_pg = db[:pg].commit do |c| - c.delete "accounts" - c.insert "accounts", default_pg_account_rows - end - end - @setup_timestamp = { gsql: setup_timestamp_gsql, pg: setup_timestamp_pg } - @default_rows = { gsql: default_account_rows, pg: default_pg_account_rows } - end - - after do - db[:gsql].delete "accounts" - db[:pg].delete "accounts" unless emulator_enabled? - end - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "runs a query for #{dialect}" do - results = nil - db[dialect].snapshot do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql "SELECT * FROM accounts ORDER BY account_id ASC" - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a query with query options for #{dialect}" do - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - results = nil - db[dialect].snapshot do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql "SELECT * FROM accounts ORDER BY account_id ASC", query_options: query_options - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a read for #{dialect}" do - results = nil - db[dialect].snapshot do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", columns - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a query with strong option for #{dialect}" do - results = nil - db[dialect].snapshot strong: true do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql "SELECT * FROM accounts ORDER BY account_id ASC" - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a read with strong option for #{dialect}" do - results = nil - db[dialect].snapshot strong: true do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", columns - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a query with timestamp option for #{dialect}" do - results = nil - db[dialect].snapshot timestamp: @setup_timestamp[dialect] do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql "SELECT * FROM accounts ORDER BY account_id ASC" - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a read with timestamp option for #{dialect}" do - results = nil - db[dialect].snapshot timestamp: @setup_timestamp[dialect] do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", columns - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a query with staleness option for #{dialect}" do - results = nil - db[dialect].snapshot staleness: 0.0001 do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql "SELECT * FROM accounts ORDER BY account_id ASC" - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "runs a read with staleness option for #{dialect}" do - results = nil - db[dialect].snapshot staleness: 0.0001 do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", columns - end - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(@default_rows[dialect]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - - it "strong reads are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot strong: true do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: sample_row[:account_id] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.read "accounts", [:account_id, :username], keys: modified_row[:account_id] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "strong queries are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot strong: true do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "timestamp reads are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot timestamp: @setup_timestamp[dialect] do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: sample_row[:account_id] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.read "accounts", [:account_id, :username], keys: modified_row[:account_id] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "timestamp queries are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot timestamp: @setup_timestamp[dialect] do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "staleness reads are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot staleness: 0.0001 do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: sample_row[:account_id] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.read "accounts", [:account_id, :username], keys: modified_row[:account_id] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "staleness queries are consistent even when updates happen for #{dialect}" do - first_row = @default_rows[dialect].first - sample_row = { account_id: first_row[:account_id], username: first_row[:username] } - modified_row = { account_id: first_row[:account_id], username: first_row[:username].reverse } - - db[dialect].snapshot staleness: 0.0001 do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the row we were expecting - _(results.rows.first.to_h).must_equal sample_row - - # outside of the snapshot, update the row! - db[dialect].update "accounts", modified_row - - results2 = snp.execute_sql select_dql[dialect], params: select_params[dialect] - # verify we got the previous row, not the modified row - _(results2.rows.first.to_h).must_equal sample_row - end - end - - it "multiuse snapshot reads are consistent even when delete happen for #{dialect}" do - keys = @default_rows[dialect].map { |row| row[:account_id] } - - db[dialect].snapshot do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: keys - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - rows = results.rows.to_a - _(rows.count).must_equal @default_rows[dialect].count - rows.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - - # outside of the snapshot, delete rows - db[dialect].delete "accounts", keys - - # read rows and from snaphot and verify rows got from the snapshot - results2 = snp.read "accounts", [:account_id, :username], keys: keys - _(results2).must_be_kind_of Google::Cloud::Spanner::Results - rows2 = results2.rows.to_a - - _(rows2.count).must_equal @default_rows[dialect].count - rows2.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - end - - # outside of snapshot check all rows are deleted - rows3 = db[dialect].execute_sql("SELECT * FROM accounts").rows.to_a - _(rows3.count).must_equal 0 - end - - it "multiuse snapshot reads with read timestamp are consistent even when delete happen for #{dialect}" do - keys = @default_rows[dialect].map { |row| row[:account_id] } - - db[dialect].snapshot read_timestamp: @setup_timestamp[dialect] do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: keys - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - rows = results.rows.to_a - _(rows.count).must_equal @default_rows[dialect].count - rows.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - - # outside of the snapshot, delete rows - db[dialect].delete "accounts", keys - - # read rows and from snaphot and verify rows got from the snapshot - results2 = snp.read "accounts", [:account_id, :username], keys: keys - _(results2).must_be_kind_of Google::Cloud::Spanner::Results - rows2 = results2.rows.to_a - _(rows2.count).must_equal @default_rows[dialect].count - rows2.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - end - - # outside of snapshot check all rows are deleted - rows3 = db[dialect].execute_sql("SELECT * FROM accounts").rows.to_a - _(rows3.count).must_equal 0 - end - - it "multiuse snapshot reads with exact staleness are consistent even when delete happen for #{dialect}" do - keys = @default_rows[dialect].map { |row| row[:account_id] } - - sleep 1 - delta = 0.001 - - db[dialect].snapshot exact_staleness: delta do |snp| - _(snp.transaction_id).wont_be :nil? - _(snp.timestamp).wont_be :nil? - - results = snp.read "accounts", [:account_id, :username], keys: keys - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - rows = results.rows.to_a - _(rows.count).must_equal @default_rows[dialect].count - rows.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - - # outside of the snapshot, delete rows - db[dialect].delete "accounts", keys - - # read rows and from snaphot and verify rows got from the snapshot - results2 = snp.read "accounts", [:account_id, :username], keys: keys - _(results2).must_be_kind_of Google::Cloud::Spanner::Results - rows2 = results2.rows.to_a - _(rows2.count).must_equal @default_rows[dialect].count - rows2.zip(@default_rows[dialect]).each do |expected, actual| - _(expected[:account_id]).must_equal actual[:account_id] - _(expected[:username]).must_equal actual[:username] - end - end - - # outside of snapshot check all rows are deleted - rows3 = db[dialect].execute_sql("SELECT * FROM accounts").rows.to_a - _(rows3.count).must_equal 0 - end - end - - - def assert_accounts_equal expected, actual - if actual[:account_id].nil? - _(expected[:account_id]).must_be :nil? - else - _(expected[:account_id]).must_equal actual[:account_id] - end - - if actual[:username].nil? - _(expected[:username]).must_be :nil? - else - _(expected[:username]).must_equal actual[:username] - end - - if actual[:reputation].nil? - _(expected[:reputation]).must_be :nil? - else - _(expected[:reputation]).must_equal actual[:reputation] - end - - if actual[:active].nil? - _(expected[:active]).must_be :nil? - else - _(expected[:active]).must_equal actual[:active] - end - - if expected[:avatar] && actual[:avatar] - _(expected[:avatar].read).must_equal actual[:avatar].read - end - - if actual[:friends].nil? - _(expected[:friends]).must_be :nil? - else - _(expected[:friends]).must_equal actual[:friends] - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/transaction_test.rb b/google-cloud-spanner/acceptance/spanner/client/transaction_test.rb deleted file mode 100644 index c594860dc07a..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/transaction_test.rb +++ /dev/null @@ -1,306 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "concurrent" - -describe "Spanner Client", :transaction, :spanner do - let(:db) { spanner_client } - let(:columns) { [:account_id, :username, :friends, :active, :reputation, :avatar] } - let :fields_hash do - { account_id: :INT64, username: :STRING, friends: [:INT64], active: :BOOL, reputation: :FLOAT64, avatar: :BYTES } - end - let(:additional_account) { { account_id: 4, username: "swcloud", reputation: 99.894, active: true, friends: [1, 2] } } - let(:query_reputation) { "SELECT reputation FROM accounts WHERE account_id = 1 LIMIT 1" } - - before do - db.commit do |c| - c.delete "accounts" - c.insert "accounts", default_account_rows - end - end - - after do - db.delete "accounts" - end - - it "modifies accounts and verifies data with reads" do - timestamp = db.transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - tx_results = tx.read "accounts", columns - _(tx_results).must_be_kind_of Google::Cloud::Spanner::Results - _(tx_results.fields.to_h).must_equal fields_hash - tx_results.rows.zip(default_account_rows).each do |expected, actual| - assert_accounts_equal expected, actual - end - - reversed_update_rows = default_account_rows.map do |row| - { account_id: row[:account_id], username: row[:username].reverse } - end - tx.update "accounts", reversed_update_rows - tx.insert "accounts", additional_account - end - _(timestamp).must_be_kind_of Time - - # outside of transaction, verify the new account was added - results = db.read "accounts", columns - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - # new data fixtures to match updated rows - reversed_account_rows = default_account_rows.map do |row| - row[:username] = row[:username].reverse - row - end - results.rows.zip(reversed_account_rows + [additional_account]).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "can rollback a transaction without passing on using Rollback" do - timestamp = db.transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - tx_results = tx.read "accounts", columns - _(tx_results).must_be_kind_of Google::Cloud::Spanner::Results - _(tx_results.fields.to_h).must_equal fields_hash - tx_results.rows.zip(default_account_rows).each do |expected, actual| - assert_accounts_equal expected, actual - end - - reversed_account_rows = default_account_rows.map do |row| - { id: row[:id], username: row[:username].reverse } - end - tx.upsert "accounts", reversed_account_rows - tx.insert "accounts", additional_account - - raise Google::Cloud::Spanner::Rollback - end - _(timestamp).must_be :nil? - - # outside of transaction, the new account was NOT added - results = db.read "accounts", columns - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(default_account_rows).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "can rollback a transaction and pass on the error" do - assert_raises ZeroDivisionError do - db.transaction do |tx| - _(tx.transaction_id).wont_be :nil? - - tx_results = tx.read "accounts", columns - _(tx_results).must_be_kind_of Google::Cloud::Spanner::Results - _(tx_results.fields.to_h).must_equal fields_hash - tx_results.rows.zip(default_account_rows).each do |expected, actual| - assert_accounts_equal expected, actual - end - - reversed_account_rows = default_account_rows.map do |row| - { id: row[:id], username: row[:username].reverse } - end - tx.upsert "accounts", reversed_account_rows - tx.insert "accounts", additional_account - - 1 / 0 - end - end - - # outside of transaction, the new account was NOT added - results = db.read "accounts", columns - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal fields_hash - results.rows.zip(default_account_rows).each do |expected, actual| - assert_accounts_equal expected, actual - end - end - - it "supports tx isolation with read and update" do - skip "The emulator only supports one transaction at a time" if emulator_enabled? - - results = db.read "accounts", [:reputation], keys: 1, limit: 1 - original_val = results.rows.first[:reputation] - begin - read_latch = Concurrent::CountDownLatch.new 1 - commit_latch = Concurrent::CountDownLatch.new 1 - thr_1 = Thread.new do - db.transaction do |tx| - tx_results = tx.read "accounts", [:reputation], keys: 1, limit: 1 - tx_val = tx_results.rows.first[:reputation] - # puts "read 1: #{tx_val}" - read_latch.count_down # Let thread 2 read now - commit_latch.wait # Let thread 2 read second but write and commit first - new_val = tx_val + 1 - tx.update "accounts", [{ account_id: 1, reputation: new_val }] - # puts "write 1" - end - # puts "commit 1" - end - thr_2 = Thread.new do - db.transaction do |tx| - read_latch.wait # Let thread 1 read first - tx_results = tx.read "accounts", [:reputation], keys: 1, limit: 1 - tx_val = tx_results.rows.first[:reputation] - # puts "read 2: #{tx_val}" - new_val = tx_val + 1 - tx.update "accounts", [{ account_id: 1, reputation: new_val }] - # puts "write 2" - end - commit_latch.count_down # Let thread 1 commit now - # puts "commit 2" - end - ensure - thr_1.join - thr_2.join - end - - results = db.read "accounts", [:reputation], keys: 1, limit: 1 - _(results.rows.first[:reputation]).must_equal original_val + 2 - end - - it "supports tx isolation with query and update" do - results = db.execute_sql query_reputation - original_val = results.rows.first[:reputation] - begin - thr_1 = Thread.new do - query_and_update db - end - thr_2 = Thread.new do - query_and_update db - end - ensure - thr_1.join - thr_2.join - end - - results = db.execute_sql query_reputation - _(results.rows.first[:reputation]).must_equal original_val + 2 - end - - it "execute transaction with tagging options" do - timestamp = db.transaction request_options: { tag: "Tag-1" } do |tx| - tx.execute_query "SELECT * from accounts", request_options: { tag: "Tag-1-1" } - tx.batch_update request_options: { tag: "Tag-1-2" } do |b| - b.batch_update( - "UPDATE accounts SET username = 'Charlie' WHERE account_id = 1" - ) - end - - tx.read "accounts", columns, request_options: { tag: "Tag-1-3" } - tx.insert "accounts", additional_account - end - - _(timestamp).must_be_kind_of Time - end - - it "can execute sql with query options" do - query_options = { optimizer_version: "3", optimizer_statistics_package: "latest" } - db.transaction do |tx| - tx_results = tx.execute_sql query_reputation, query_options: query_options - _(tx_results.rows.first[:reputation]).must_equal 63.5 - end - end - - it "execute transaction and return commit stats" do - skip if emulator_enabled? - - commit_options = { return_commit_stats: true } - commit_resp = db.transaction commit_options: commit_options do |tx| - _(tx.transaction_id).wont_be :nil? - - tx.insert "accounts", additional_account - end - - assert_commit_response commit_resp, commit_options - end - - describe "request options" do - it "execute transaction with priority options" do - timestamp = db.transaction request_options: { priority: :PRIORITY_MEDIUM } do |tx| - tx_results = tx.read "accounts", columns - _(tx_results.rows.count).must_equal default_account_rows.length - tx.insert "accounts", additional_account - end - _(timestamp).must_be_kind_of Time - end - - it "execute query with priority options" do - timestamp = db.transaction do |tx| - tx_results = tx.execute_sql query_reputation, - request_options: { priority: :PRIORITY_MEDIUM } - _(tx_results.rows.count).must_be :>, 0 - end - _(timestamp).must_be_kind_of Time - end - end - - def read_and_update db - db.transaction do |tx| - tx_results = tx.read "accounts", [:reputation], keys: 1, limit: 1 - tx_val = tx_results.rows.first[:reputation] - sleep 1 # ensure that both threads would have read same value if not read locked - new_val = tx_val + 1 - tx.update "accounts", [{ account_id: 1, reputation: new_val }] - end - end - - def query_and_update db - db.transaction do |tx| - tx_results = tx.execute_sql query_reputation - tx_val = tx_results.rows.first[:reputation] - sleep 1 # ensure that both threads would have read same value if not read locked - new_val = tx_val + 1 - tx.update "accounts", [{ account_id: 1, reputation: new_val }] - end - end - - def assert_accounts_equal expected, actual - if actual[:account_id].nil? - _(expected[:account_id]).must_be :nil? - else - _(expected[:account_id]).must_equal actual[:account_id] - end - - if actual[:username].nil? - _(expected[:username]).must_be :nil? - else - _(expected[:username]).must_equal actual[:username] - end - - if actual[:reputation].nil? - _(expected[:reputation]).must_be :nil? - else - _(expected[:reputation]).must_equal actual[:reputation] - end - - if actual[:active].nil? - _(expected[:active]).must_be :nil? - else - _(expected[:active]).must_equal actual[:active] - end - - if expected[:avatar] && actual[:avatar] - _(expected[:avatar].read).must_equal actual[:avatar].read - end - - if actual[:friends].nil? - _(expected[:friends]).must_be :nil? - else - _(expected[:friends]).must_equal actual[:friends] - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/bool_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/bool_test.rb deleted file mode 100644 index 2e5c51d6b45f..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/bool_test.rb +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :bool, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - it "writes and reads bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bool: true } - results = db.read table_name, [:id, :bool], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bool: :BOOL }) - _(results.rows.first.to_h).must_equal({ id: id, bool: true }) - end - - it "writes and queries bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bool: true } - results = db.execute_query "SELECT id, bool FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bool: :BOOL }) - _(results.rows.first.to_h).must_equal({ id: id, bool: true }) - end - - it "writes and reads NULL bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bool: nil } - results = db.read table_name, [:id, :bool], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bool: :BOOL }) - _(results.rows.first.to_h).must_equal({ id: id, bool: nil }) - end - - it "writes and queries NULL bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bool: nil } - results = db.execute_query "SELECT id, bool FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bool: :BOOL }) - _(results.rows.first.to_h).must_equal({ id: id, bool: nil }) - end - - it "writes and reads array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [true, false, true] } - results = db.read table_name, [:id, :bools], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [true, false, true] }) - end - - it "writes and queries array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [true, false, true] } - results = db.execute_query "SELECT id, bools FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [true, false, true] }) - end - - it "writes and reads array of bool with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [nil, true, false, true] } - results = db.read table_name, [:id, :bools], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [nil, true, false, true] }) - end - - it "writes and queries array of bool with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [nil, true, false, true] } - results = db.execute_query "SELECT id, bools FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [nil, true, false, true] }) - end - - it "writes and reads empty array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [] } - results = db.read table_name, [:id, :bools], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [] }) - end - - it "writes and queries empty array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: [] } - results = db.execute_query "SELECT id, bools FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: [] }) - end - - it "writes and reads NULL array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: nil } - results = db.read table_name, [:id, :bools], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: nil }) - end - - it "writes and queries NULL array of bool" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bools: nil } - results = db.execute_query "SELECT id, bools FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bools: [:BOOL] }) - _(results.rows.first.to_h).must_equal({ id: id, bools: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/bytes_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/bytes_test.rb deleted file mode 100644 index bbf41278acc1..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/bytes_test.rb +++ /dev/null @@ -1,200 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :bytes, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - it "writes and reads bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, byte: StringIO.new("hello") } - results = db.read table_name, [:id, :byte], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be_kind_of StringIO - _(returned_value.read).must_equal "hello" - end - - it "writes and queries bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, byte: StringIO.new("hello") } - results = db.execute_query "SELECT id, byte FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be_kind_of StringIO - _(returned_value.read).must_equal "hello" - end - - it "writes and reads random bytes" do - id = SecureRandom.int64 - random_bytes = StringIO.new SecureRandom.random_bytes(rand(1024..4096)) - db.upsert table_name, { id: id, byte: random_bytes } - results = db.read table_name, [:id, :byte], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be_kind_of StringIO - random_bytes.rewind - _(returned_value.read).must_equal random_bytes.read - end - - it "writes and queries random bytes" do - id = SecureRandom.int64 - random_bytes = StringIO.new SecureRandom.random_bytes(rand(1024..4096)) - db.upsert table_name, { id: id, byte: random_bytes } - results = db.execute_query "SELECT id, byte FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be_kind_of StringIO - random_bytes.rewind - _(returned_value.read).must_equal random_bytes.read - end - - it "writes and reads NULL bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, byte: nil } - results = db.read table_name, [:id, :byte], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be :nil? - end - - it "writes and queries NULL bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, byte: nil } - results = db.execute_query "SELECT id, byte FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, byte: :BYTES }) - returned_value = results.rows.first[:byte] - _(returned_value).must_be :nil? - end - - it "writes and reads array of bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [StringIO.new("howdy"), StringIO.new("hola"), StringIO.new("hello")] } - results = db.read table_name, [:id, :bytes], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - returned_values = results.rows.first[:bytes] - _(returned_values[0]).must_be_kind_of StringIO - _(returned_values[0].read).must_equal "howdy" - _(returned_values[1]).must_be_kind_of StringIO - _(returned_values[1].read).must_equal "hola" - _(returned_values[2]).must_be_kind_of StringIO - _(returned_values[2].read).must_equal "hello" - end - - it "writes and queries array of bytes" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [StringIO.new("howdy"), StringIO.new("hola"), StringIO.new("hello")] } - results = db.execute_query "SELECT id, bytes FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - returned_values = results.rows.first[:bytes] - _(returned_values[0]).must_be_kind_of StringIO - _(returned_values[0].read).must_equal "howdy" - _(returned_values[1]).must_be_kind_of StringIO - _(returned_values[1].read).must_equal "hola" - _(returned_values[2]).must_be_kind_of StringIO - _(returned_values[2].read).must_equal "hello" - end - - it "writes and reads array of byte with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [nil, StringIO.new("howdy"), StringIO.new("hola"), StringIO.new("hello")] } - results = db.read table_name, [:id, :bytes], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - returned_values = results.rows.first[:bytes] - _(returned_values[0]).must_be :nil? - _(returned_values[1]).must_be_kind_of StringIO - _(returned_values[1].read).must_equal "howdy" - _(returned_values[2]).must_be_kind_of StringIO - _(returned_values[2].read).must_equal "hola" - _(returned_values[3]).must_be_kind_of StringIO - _(returned_values[3].read).must_equal "hello" - end - - it "writes and queries array of byte with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [nil, StringIO.new("howdy"), StringIO.new("hola"), StringIO.new("hello")] } - results = db.execute_query "SELECT id, bytes FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - returned_values = results.rows.first[:bytes] - _(returned_values[0]).must_be :nil? - _(returned_values[1]).must_be_kind_of StringIO - _(returned_values[1].read).must_equal "howdy" - _(returned_values[2]).must_be_kind_of StringIO - _(returned_values[2].read).must_equal "hola" - _(returned_values[3]).must_be_kind_of StringIO - _(returned_values[3].read).must_equal "hello" - end - - it "writes and reads empty array of byte" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [] } - results = db.read table_name, [:id, :bytes], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - _(results.rows.first[:bytes]).must_equal [] - end - - it "writes and queries empty array of byte" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: [] } - results = db.execute_query "SELECT id, bytes FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - _(results.rows.first[:bytes]).must_equal [] - end - - it "writes and reads NULL array of byte" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: nil } - results = db.read table_name, [:id, :bytes], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - _(results.rows.first[:bytes]).must_be :nil? - end - - it "writes and queries NULL array of byte" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, bytes: nil } - results = db.execute_query "SELECT id, bytes FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, bytes: [:BYTES] }) - _(results.rows.first[:bytes]).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/date_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/date_test.rb deleted file mode 100644 index 0b1c98cf841e..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/date_test.rb +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :date, :spanner do - let :db do - { gsql: spanner_client, pg: spanner_pg_client } - end - let :date_query do - { gsql: "SELECT id, date FROM #{table_name} WHERE id = @value", - pg: "SELECT id, date FROM #{table_name} WHERE id = $1" } - end - let :dates_query do - { gsql: "SELECT id, dates FROM #{table_name} WHERE id = @value", - pg: "SELECT id, dates FROM #{table_name} WHERE id = $1" } - end - let(:table_name) { "stuffs" } - - dialects = [:gsql] - dialects.push :pg unless emulator_enabled? - - dialects.each do |dialect| - it "writes and reads date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, date: Date.parse("2017-01-01") } - results = db[dialect].read table_name, [:id, :date], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, date: :DATE }) - _(results.rows.first.to_h).must_equal({ id: id, date: Date.parse("2017-01-01") }) - end - - it "writes and queries date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, date: Date.parse("2017-01-01") } - results = db[dialect].execute_query date_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, date: :DATE }) - _(results.rows.first.to_h).must_equal({ id: id, date: Date.parse("2017-01-01") }) - end - - it "writes and reads NULL date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, date: nil } - results = db[dialect].read table_name, [:id, :date], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, date: :DATE }) - _(results.rows.first.to_h).must_equal({ id: id, date: nil }) - end - - it "writes and queries NULL date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, date: nil } - results = db[dialect].execute_query date_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, date: :DATE }) - _(results.rows.first.to_h).must_equal({ id: id, date: nil }) - end - - it "writes and reads array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, - { id: id, - dates: [Date.parse("2016-12-30"), Date.parse("2016-12-31"), Date.parse("2017-01-01")] } - results = db[dialect].read table_name, [:id, :dates], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, - dates: [Date.parse("2016-12-30"), - Date.parse("2016-12-31"), - Date.parse("2017-01-01")] }) - end - - it "writes and queries array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, - { id: id, - dates: [Date.parse("2016-12-30"), Date.parse("2016-12-31"), Date.parse("2017-01-01")] } - results = db[dialect].execute_query dates_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, - dates: [Date.parse("2016-12-30"), - Date.parse("2016-12-31"), - Date.parse("2017-01-01")] }) - end - - it "writes and reads array of date with NULL #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, - { id: id, - dates: [nil, Date.parse("2016-12-30"), Date.parse("2016-12-31"), Date.parse("2017-01-01")] } - results = db[dialect].read table_name, [:id, :dates], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, - dates: [nil, - Date.parse("2016-12-30"), - Date.parse("2016-12-31"), - Date.parse("2017-01-01")] }) - end - - it "writes and queries array of date with NULL #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, - { id: id, - dates: [nil, Date.parse("2016-12-30"), Date.parse("2016-12-31"), Date.parse("2017-01-01")] } - results = db[dialect].execute_query dates_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, - dates: [nil, - Date.parse("2016-12-30"), - Date.parse("2016-12-31"), - Date.parse("2017-01-01")] }) - end - - it "writes and reads empty array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, dates: [] } - results = db[dialect].read table_name, [:id, :dates], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, dates: [] }) - end - - it "writes and queries empty array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, dates: [] } - results = db[dialect].execute_query dates_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, dates: [] }) - end - - it "writes and reads NULL array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, dates: nil } - results = db[dialect].read table_name, [:id, :dates], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, dates: nil }) - end - - it "writes and queries NULL array of date #{dialect}" do - id = SecureRandom.int64 - db[dialect].upsert table_name, { id: id, dates: nil } - results = db[dialect].execute_query dates_query[dialect], params: make_params(dialect, id) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, dates: [:DATE] }) - _(results.rows.first.to_h).must_equal({ id: id, dates: nil }) - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/float64_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/float64_test.rb deleted file mode 100644 index 0e59015d2cd7..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/float64_test.rb +++ /dev/null @@ -1,206 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :float64, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - it "writes and reads float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: 99.99 } - results = db.read table_name, [:id, :float], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: 99.99 }) - end - - it "writes and queries float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: 99.99 } - results = db.execute_sql "SELECT id, float FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: 99.99 }) - end - - it "writes and reads Infinity float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: Float::INFINITY } - results = db.read table_name, [:id, :float], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: Float::INFINITY }) - end - - it "writes and queries Infinity float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: Float::INFINITY } - results = db.execute_sql "SELECT id, float FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: Float::INFINITY }) - end - - it "writes and reads -Infinity float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: -Float::INFINITY } - results = db.read table_name, [:id, :float], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: -Float::INFINITY }) - end - - it "writes and queries -Infinity float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: -Float::INFINITY } - results = db.execute_sql "SELECT id, float FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: -Float::INFINITY }) - end - - it "writes and reads NaN float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: Float::NAN } - results = db.read table_name, [:id, :float], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - returned_hash = results.rows.first.to_h - returned_value = returned_hash[:float] - _(returned_value).must_be_kind_of Float - _(returned_value).must_be :nan? - end - - it "writes and queries NaN float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: Float::NAN } - results = db.execute_sql "SELECT id, float FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - returned_hash = results.rows.first.to_h - returned_value = returned_hash[:float] - _(returned_value).must_be_kind_of Float - _(returned_value).must_be :nan? - end - - it "writes and reads NULL float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: nil } - results = db.read table_name, [:id, :float], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: nil }) - end - - it "writes and queries NULL float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, float: nil } - results = db.execute_sql "SELECT id, float FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, float: :FLOAT64 }) - _(results.rows.first.to_h).must_equal({ id: id, float: nil }) - end - - it "writes and reads array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [77.77, 88.88, 99.99] } - results = db.read table_name, [:id, :floats], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [77.77, 88.88, 99.99] }) - end - - it "writes and queries array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [77.77, 88.88, 99.99] } - results = db.execute_sql "SELECT id, floats FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [77.77, 88.88, 99.99] }) - end - - it "writes and reads array of float64 with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [nil, 77.77, 88.88, 99.99] } - results = db.read table_name, [:id, :floats], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [nil, 77.77, 88.88, 99.99] }) - end - - it "writes and queries array of float64 with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [nil, 77.77, 88.88, 99.99] } - results = db.execute_sql "SELECT id, floats FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [nil, 77.77, 88.88, 99.99] }) - end - - it "writes and reads empty array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [] } - results = db.read table_name, [:id, :floats], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [] }) - end - - it "writes and queries empty array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: [] } - results = db.execute_sql "SELECT id, floats FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: [] }) - end - - it "writes and reads NULL array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: nil } - results = db.read table_name, [:id, :floats], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: nil }) - end - - it "writes and queries NULL array of float64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, floats: nil } - results = db.execute_sql "SELECT id, floats FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, floats: [:FLOAT64] }) - _(results.rows.first.to_h).must_equal({ id: id, floats: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/int64_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/int64_test.rb deleted file mode 100644 index 94a44321e014..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/int64_test.rb +++ /dev/null @@ -1,140 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :int64, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - it "writes and reads int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, int: 9999 } - results = db.read table_name, [:id, :int], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, int: :INT64 }) - _(results.rows.first.to_h).must_equal({ id: id, int: 9999 }) - end - - it "writes and queries int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, int: 9999 } - results = db.execute_query "SELECT id, int FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, int: :INT64 }) - _(results.rows.first.to_h).must_equal({ id: id, int: 9999 }) - end - - it "writes and reads NULL int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, int: nil } - results = db.read table_name, [:id, :int], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, int: :INT64 }) - _(results.rows.first.to_h).must_equal({ id: id, int: nil }) - end - - it "writes and queries NULL int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, int: nil } - results = db.execute_query "SELECT id, int FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, int: :INT64 }) - _(results.rows.first.to_h).must_equal({ id: id, int: nil }) - end - - it "writes and reads array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [9997, 9998, 9999] } - results = db.read table_name, [:id, :ints], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [9997, 9998, 9999] }) - end - - it "writes and queries array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [9997, 9998, 9999] } - results = db.execute_query "SELECT id, ints FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [9997, 9998, 9999] }) - end - - it "writes and reads array of int64 with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [nil, 9997, 9998, 9999] } - results = db.read table_name, [:id, :ints], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [nil, 9997, 9998, 9999] }) - end - - it "writes and queries array of int64 with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [nil, 9997, 9998, 9999] } - results = db.execute_query "SELECT id, ints FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [nil, 9997, 9998, 9999] }) - end - - it "writes and reads empty array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [] } - results = db.read table_name, [:id, :ints], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [] }) - end - - it "writes and queries empty array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: [] } - results = db.execute_query "SELECT id, ints FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: [] }) - end - - it "writes and reads NULL array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: nil } - results = db.read table_name, [:id, :ints], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: nil }) - end - - it "writes and queries NULL array of int64" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, ints: nil } - results = db.execute_query "SELECT id, ints FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, ints: [:INT64] }) - _(results.rows.first.to_h).must_equal({ id: id, ints: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/json_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/json_test.rb deleted file mode 100644 index 8489833c9a54..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/json_test.rb +++ /dev/null @@ -1,173 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :json, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - let(:table_types) { stuffs_table_types } - let(:json_params) { { "venue" => "abc", "rating" => 10 } } - let :json_array_params do - 3.times.map do |i| - { "venue" => "abc-#{i}", "rating" => 10 + i } - end - end - - it "writes and reads json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: json_params } - results = db.read table_name, [:id, :json], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: json_params }) - end - - it "writes and queries json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: json_params } - results = db.execute_query "SELECT id, json FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: json_params }) - end - - it "writes and reads NULL json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: nil } - results = db.read table_name, [:id, :json], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: nil }) - end - - it "writes and queries NULL json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: nil } - results = db.execute_query "SELECT id, json FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: nil }) - end - - it "writes and reads array of json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: json_array_params } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: json_array_params }) - end - - it "writes and queries array of json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: json_array_params } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: json_array_params }) - end - - it "writes and reads array of json with NULL" do - skip if emulator_enabled? - - id = SecureRandom.int64 - params = [nil].concat json_array_params - db.upsert table_name, { id: id, json_array: params } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: params }) - end - - it "writes and queries array of json with NULL" do - skip if emulator_enabled? - - id = SecureRandom.int64 - params = [nil].concat json_array_params - db.upsert table_name, { id: id, json_array: params } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: params }) - end - - it "writes and reads empty array of json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: [] } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: [] }) - end - - it "writes and queries empty array of json array" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: [] } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: [] }) - end - - it "writes and reads NULL array of json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: nil } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: nil }) - end - - it "writes and queries NULL array of json" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: nil } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/numeric_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/numeric_test.rb deleted file mode 100644 index 70e0e7e58538..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/numeric_test.rb +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "bigdecimal" - -describe "Spanner Client", :types, :numeric, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - - it "writes and reads numeric" do - skip if emulator_enabled? - - num = BigDecimal("0.123456789") - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: num } - results = db.read table_name, [:id, :numeric], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: num }) - end - - it "writes and queries numeric" do - skip if emulator_enabled? - - num = BigDecimal("0.123456789") - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: num } - results = db.execute_sql "SELECT id, numeric FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: num }) - end - - it "writes and reads NULL numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: nil } - results = db.read table_name, [:id, :numeric], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: nil }) - end - - it "writes and queries NULL numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: nil } - results = db.execute_sql "SELECT id, numeric FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: nil }) - end - - it "writes and reads array of numeric" do - skip if emulator_enabled? - - nums = [BigDecimal("0.123456789"), BigDecimal("1.23456789"), BigDecimal("12.3456789")] - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nums } - results = db.read table_name, [:id, :numerics], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nums }) - end - - it "writes and queries array of numeric" do - skip if emulator_enabled? - - nums = [BigDecimal("0.123456789"), BigDecimal("1.23456789"), BigDecimal("12.3456789")] - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nums } - results = db.execute_sql "SELECT id, numerics FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nums }) - end - - it "writes and reads array of numeric with NULL" do - skip if emulator_enabled? - - nums = [nil, BigDecimal("0.123456789"), BigDecimal("1.23456789"), BigDecimal("12.3456789")] - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nums } - results = db.read table_name, [:id, :numerics], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nums }) - end - - it "writes and queries array of numeric with NULL" do - skip if emulator_enabled? - - nums = [nil, BigDecimal("0.123456789"), BigDecimal("1.23456789"), BigDecimal("12.3456789")] - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nums } - results = db.execute_sql "SELECT id, numerics FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nums }) - end - - it "writes and reads empty array of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: [] } - results = db.read table_name, [:id, :numerics], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: [] }) - end - - it "writes and queries empty array of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: [] } - results = db.execute_sql "SELECT id, numerics FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: [] }) - end - - it "writes and reads NULL array of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nil } - results = db.read table_name, [:id, :numerics], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nil }) - end - - it "writes and queries NULL array of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numerics: nil } - results = db.execute_sql "SELECT id, numerics FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numerics: [:NUMERIC] }) - _(results.rows.first.to_h).must_equal({ id: id, numerics: nil }) - end - - it "writes and queries primary key as a numeric" do - skip - - id = BigDecimal(SecureRandom.int64) - db.upsert "boxes", { id: id, name: "box-1" } - - results = db.read "boxes", [:id, :name], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :NUMERIC, name: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, name: "box-1" }) - end - - it "writes and queries composite numeric primary key" do - skip - - id = SecureRandom.int64 - box_id = BigDecimal(SecureRandom.int64) - - db.upsert "box_items", { id: id, box_id: box_id, name: "box-item-1" } - - results = db.execute_sql( - "SELECT id, box_id, name FROM box_items WHERE id = @id AND box_id = @box_id", - params: { id: id, box_id: box_id } - ) - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, box_id: :NUMERIC, name: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, box_id: box_id, name: "box-item-1" }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/pgjsonb_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/pgjsonb_test.rb deleted file mode 100644 index 651ad7a3b385..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/pgjsonb_test.rb +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :json, :spanner do - let(:db) { spanner_pg_client } - let(:table_name) { "stuffs" } - let(:json_params) { { "venue" => "abc", "rating" => 10 } } - let :json_array_params do - 3.times.map do |i| - { "venue" => "abc-#{i}", "rating" => 10 + i } - end - end - - before do - skip if emulator_enabled? - end - - it "writes and reads json" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: json_params } - results = db.read table_name, [:id, :json], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: json_params }) - end - - it "writes and queries json" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: json_params } - results = db.execute_query "SELECT id, json FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: json_params }) - end - - it "writes and reads NULL json" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: nil } - results = db.read table_name, [:id, :json], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: nil }) - end - - it "writes and queries NULL json" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, json: nil } - results = db.execute_query "SELECT id, json FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json: :JSON }) - _(results.rows.first.to_h).must_equal({ id: id, json: nil }) - end - - it "writes and reads array of json" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: json_array_params } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: json_array_params }) - end - - it "writes and queries array of json" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: json_array_params } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: json_array_params }) - end - - it "writes and reads array of json with NULL" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - params = [nil].concat json_array_params - db.upsert table_name, { id: id, json_array: params } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: params }) - end - - it "writes and queries array of json with NULL" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - params = [nil].concat json_array_params - db.upsert table_name, { id: id, json_array: params } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: params }) - end - - it "writes and reads empty array of json" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: [] } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: [] }) - end - - it "writes and queries empty array of json array" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: [] } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: [] }) - end - - it "writes and reads NULL array of json" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: nil } - results = db.read table_name, [:id, :json_array], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: nil }) - end - - it "writes and queries NULL array of json" do - skip "Arrays not supported yet" - id = SecureRandom.int64 - db.upsert table_name, { id: id, json_array: nil } - results = db.execute_query "SELECT id, json_array FROM #{table_name} WHERE id = $1", params: { p1: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, json_array: [:JSON] }) - _(results.rows.first.to_h).must_equal({ id: id, json_array: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/pgnumeric_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/pgnumeric_test.rb deleted file mode 100644 index d8fe35ad1f98..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/pgnumeric_test.rb +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "bigdecimal" - -describe "Spanner Client", :types, :numeric, :spanner do - let(:db) { spanner_pg_client } - let(:table_name) { "stuffs" } - - it "writes and reads numeric" do - skip if emulator_enabled? - - num = BigDecimal("0.123456789") - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: num } - results = db.read table_name, [:id, :numeric], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: num }) - end - - it "writes and queries numeric" do - skip if emulator_enabled? - - num = BigDecimal("0.123456789") - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: num } - results = db.execute_sql "SELECT id, numeric FROM #{table_name} WHERE id = $1", params: { p1: id }, -types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: num }) - end - - it "writes and reads NULL numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: nil } - results = db.read table_name, [:id, :numeric], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: nil }) - end - - it "writes and queries NULL numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: nil } - results = db.execute_sql "SELECT id, numeric FROM #{table_name} WHERE id = $1", params: { p1: id }, -types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h).must_equal({ id: id, numeric: nil }) - end - - it "writes and reads nan of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: BigDecimal("NaN") } - results = db.read table_name, [:id, :numeric], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h[:numeric]).must_be :nan? - end - - it "writes and queries nan of numeric" do - skip if emulator_enabled? - - id = SecureRandom.int64 - db.upsert table_name, { id: id, numeric: BigDecimal("NaN") } - results = db.execute_sql "SELECT id, numeric FROM #{table_name} WHERE id = $1", params: { p1: id }, -types: { p1: :PG_NUMERIC } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, numeric: :NUMERIC }) - _(results.rows.first.to_h[:numeric]).must_be :nan? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/string_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/string_test.rb deleted file mode 100644 index 05bda608a5bd..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/string_test.rb +++ /dev/null @@ -1,141 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :string, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - let(:table_types) { stuffs_table_types } - - it "writes and reads string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, string: "hello" } - results = db.read table_name, [:id, :string], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, string: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, string: "hello" }) - end - - it "writes and queries string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, string: "hello" } - results = db.execute_query "SELECT id, string FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, string: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, string: "hello" }) - end - - it "writes and reads NULL string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, string: nil } - results = db.read table_name, [:id, :string], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, string: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, string: nil }) - end - - it "writes and queries NULL string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, string: nil } - results = db.execute_query "SELECT id, string FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, string: :STRING }) - _(results.rows.first.to_h).must_equal({ id: id, string: nil }) - end - - it "writes and reads array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: ["howdy", "hola", "hello"] } - results = db.read table_name, [:id, :strings], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: ["howdy", "hola", "hello"] }) - end - - it "writes and queries array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: ["howdy", "hola", "hello"] } - results = db.execute_query "SELECT id, strings FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: ["howdy", "hola", "hello"] }) - end - - it "writes and reads array of string with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: [nil, "howdy", "hola", "hello"] } - results = db.read table_name, [:id, :strings], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: [nil, "howdy", "hola", "hello"] }) - end - - it "writes and queries array of string with NULL" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: [nil, "howdy", "hola", "hello"] } - results = db.execute_query "SELECT id, strings FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: [nil, "howdy", "hola", "hello"] }) - end - - it "writes and reads empty array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: [] } - results = db.read table_name, [:id, :strings], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: [] }) - end - - it "writes and queries empty array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: [] } - results = db.execute_query "SELECT id, strings FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: [] }) - end - - it "writes and reads NULL array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: nil } - results = db.read table_name, [:id, :strings], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: nil }) - end - - it "writes and queries NULL array of string" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, strings: nil } - results = db.execute_query "SELECT id, strings FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, strings: [:STRING] }) - _(results.rows.first.to_h).must_equal({ id: id, strings: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/struct_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/struct_test.rb deleted file mode 100644 index 588088a3e1b7..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/struct_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :struct, :spanner do - let(:db) { spanner_client } - - it "queries a nested struct" do - nested_sql = "SELECT ARRAY(SELECT AS STRUCT C1, C2 " \ - "FROM (SELECT 'a' AS C1, 1 AS C2 UNION ALL SELECT 'b' AS C1, 2 AS C2) " \ - "ORDER BY C1 ASC)" - results = db.execute_query nested_sql - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => [db.fields(C1: :STRING, C2: :INT64)] }) - _(results.rows.first.to_h).must_equal({ 0 => [{ C1: "a", C2: 1 }, { C1: "b", C2: 2 }] }) - end - - it "queries an empty struct" do - empty_sql = "SELECT ARRAY(SELECT AS STRUCT * FROM (SELECT 'a', 1) WHERE 0 = 1)" - results = db.execute_query empty_sql - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ 0 => [db.fields(0 => :STRING, 1 => :INT64)] }) - _(results.rows.first.to_h).must_equal({ 0 => [] }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/client/types/timestamp_test.rb b/google-cloud-spanner/acceptance/spanner/client/types/timestamp_test.rb deleted file mode 100644 index 36a9011c0558..000000000000 --- a/google-cloud-spanner/acceptance/spanner/client/types/timestamp_test.rb +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License 00:00:00Z"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Client", :types, :timestamp, :spanner do - let(:db) { spanner_client } - let(:table_name) { "stuffs" } - let(:table_types) { stuffs_table_types } - - it "writes and reads timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamp: Time.parse("2017-01-01 00:00:00Z") } - results = db.read table_name, [:id, :timestamp], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: Time.parse("2017-01-01 00:00:00Z") }) - end - - it "writes and reads commit_timestamp timestamp" do - id = SecureRandom.int64 - commit_timestamp = db.upsert table_name, { id: id, timestamp: db.commit_timestamp } - results = db.read table_name, [:id, :timestamp], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: commit_timestamp }) - end - - it "writes and queries timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamp: Time.parse("2017-01-01 00:00:00Z") } - results = db.execute_query "SELECT id, timestamp FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: Time.parse("2017-01-01 00:00:00Z") }) - end - - it "writes and queries commit_timestamp timestamp" do - id = SecureRandom.int64 - commit_timestamp = db.upsert table_name, { id: id, timestamp: db.commit_timestamp } - results = db.execute_query "SELECT id, timestamp FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: commit_timestamp }) - end - - it "writes and reads NULL timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamp: nil } - results = db.read table_name, [:id, :timestamp], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: nil }) - end - - it "writes and queries NULL timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamp: nil } - results = db.execute_query "SELECT id, timestamp FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamp: :TIMESTAMP }) - _(results.rows.first.to_h).must_equal({ id: id, timestamp: nil }) - end - - it "writes and reads array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, - { id: id, -timestamps: [Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] } - results = db.read table_name, [:id, :timestamps], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, -timestamps: [Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] }) - end - - it "writes and queries array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, - { id: id, -timestamps: [Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] } - results = db.execute_query "SELECT id, timestamps FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, -timestamps: [Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] }) - end - - it "writes and reads array of timestamp with NULL" do - id = SecureRandom.int64 - db.upsert table_name, - { id: id, -timestamps: [nil, Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] } - results = db.read table_name, [:id, :timestamps], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, -timestamps: [nil, Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] }) - end - - it "writes and queries array of timestamp with NULL" do - id = SecureRandom.int64 - db.upsert table_name, - { id: id, -timestamps: [nil, Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] } - results = db.execute_query "SELECT id, timestamps FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, -timestamps: [nil, Time.parse("2016-12-30 00:00:00Z"), Time.parse("2016-12-31 00:00:00Z"), - Time.parse("2017-01-01 00:00:00Z")] }) - end - - it "writes and reads empty array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamps: [] } - results = db.read table_name, [:id, :timestamps], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, timestamps: [] }) - end - - it "writes and queries empty array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamps: [] } - results = db.execute_query "SELECT id, timestamps FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, timestamps: [] }) - end - - it "writes and reads NULL array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamps: nil } - results = db.read table_name, [:id, :timestamps], keys: id - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, timestamps: nil }) - end - - it "writes and queries NULL array of timestamp" do - id = SecureRandom.int64 - db.upsert table_name, { id: id, timestamps: nil } - results = db.execute_query "SELECT id, timestamps FROM #{table_name} WHERE id = @id", params: { id: id } - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - _(results.fields.to_h).must_equal({ id: :INT64, timestamps: [:TIMESTAMP] }) - _(results.rows.first.to_h).must_equal({ id: id, timestamps: nil }) - end -end diff --git a/google-cloud-spanner/acceptance/spanner/database_client_test.rb b/google-cloud-spanner/acceptance/spanner/database_client_test.rb deleted file mode 100644 index 1b5440a3c3b9..000000000000 --- a/google-cloud-spanner/acceptance/spanner/database_client_test.rb +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" -require "google/cloud/spanner/admin/database" - -describe "Spanner Databases Client", :spanner do - let(:instance_id) { $spanner_instance_id } - let(:database_id) { "#{$spanner_database_id}-crud" } - let(:pg_database_id) { "#{$spanner_pg_database_id}-crud" } - - it "creates, gets, updates, and drops a database" do - client = Google::Cloud::Spanner::Admin::Database.database_admin project_id: spanner.project - - instance_path = \ - client.instance_path project: spanner.project, instance: instance_id - - db_path = client.database_path project: spanner.project, - instance: instance_id, - database: database_id - - job = client.create_database parent: instance_path, - create_statement: "CREATE DATABASE `#{database_id}`" - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - database = job.results - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::Database - _(database.name).must_equal db_path - _(database.encryption_config).must_be :nil? - _(database.encryption_info).must_be_kind_of Google::Protobuf::RepeatedField - - database = client.get_database name: db_path - _(database).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::Database - - add_users_table_sql = "CREATE TABLE users (id INT64 NOT NULL) PRIMARY KEY(id)" - job2 = client.update_database_ddl database: db_path, - statements: [add_users_table_sql] - - _(job2).wont_be :done? unless emulator_enabled? - job2.wait_until_done! - - _(job2).must_be :done? - - client.drop_database database: db_path - assert_raises Google::Cloud::NotFoundError do - client.get_database name: db_path - end - end - - it "creates, gets, updates, and drops a database with pg dialect" do - skip if emulator_enabled? - client = Google::Cloud::Spanner::Admin::Database.database_admin project_id: spanner.project - - instance_path = \ - client.instance_path project: spanner.project, instance: instance_id - - db_path = client.database_path project: spanner.project, - instance: instance_id, - database: pg_database_id - - job = client.create_database parent: instance_path, - create_statement: "CREATE DATABASE \"#{pg_database_id}\"", - database_dialect: :POSTGRESQL - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - database = job.results - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::Database - _(database.name).must_equal db_path - _(database.encryption_config).must_be :nil? - _(database.encryption_info).must_be_kind_of Google::Protobuf::RepeatedField - - database = client.get_database name: db_path - _(database).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::Database - - add_users_table_sql = "CREATE TABLE users (id bigint NOT NULL, PRIMARY KEY(id));" - job2 = client.update_database_ddl database: db_path, - statements: [add_users_table_sql] - - _(job2).wont_be :done? unless emulator_enabled? - job2.wait_until_done! - - _(job2).must_be :done? - - client.drop_database database: db_path - assert_raises Google::Cloud::NotFoundError do - client.get_database name: db_path - end - end - - it "lists databases" do - client = Google::Cloud::Spanner::Admin::Database.database_admin project_id: spanner.project - - instance_path = \ - client.instance_path project: spanner.project, instance: instance_id - all_databases = client.list_databases parent: instance_path - _(all_databases.response).wont_be :nil? - all_databases.each do |database| - _(database).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::Database - _(database.encryption_info).must_be_kind_of Google::Protobuf::RepeatedField - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/database_operations_test.rb b/google-cloud-spanner/acceptance/spanner/database_operations_test.rb deleted file mode 100644 index 9120a2a7dc84..000000000000 --- a/google-cloud-spanner/acceptance/spanner/database_operations_test.rb +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "spanner_helper" - -describe "Spanner Database Operations", :spanner do - let(:instance_id) { $spanner_instance_id } - let(:database_id) { $spanner_database_id } - - it "list database operations" do - skip if emulator_enabled? - - instance = spanner.instance instance_id - _(instance).wont_be :nil? - - # All - jobs = instance.database_operations.all.to_a - _(jobs).wont_be :empty? - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - - if job.database - _(job.database).must_be_kind_of Google::Cloud::Spanner::Database - end - end - - # Filter completed jobs - filter = "done:true" - jobs = instance.database_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job).must_be :done? - end - - # Filter by metdata type - filter = "metadata.@type:CreateDatabaseMetadata" - jobs = instance.database_operations(filter: filter).all.to_a - _(jobs).wont_be :empty? - jobs.each do |job| - _(job.grpc.metadata).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner/database_test.rb b/google-cloud-spanner/acceptance/spanner/database_test.rb deleted file mode 100644 index 902d959d7f55..000000000000 --- a/google-cloud-spanner/acceptance/spanner/database_test.rb +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Databases", :spanner do - let(:instance_id) { $spanner_instance_id } - let(:database_id) { "#{$spanner_database_id}-crud" } - - it "creates, updates, and drops a database" do - _(spanner.database(instance_id, database_id)).must_be :nil? - - job = spanner.create_database instance_id, database_id - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - _(database.database_id).must_equal database_id - _(database.instance_id).must_equal instance_id - _(database.project_id).must_equal spanner.project - _(database.encryption_config).must_be :nil? - _(database.encryption_info).must_be_kind_of Array - - _(spanner.database(instance_id, database_id)).wont_be :nil? - - job2 = database.update statements: "CREATE TABLE users (id INT64 NOT NULL) PRIMARY KEY(id)" - - _(job2).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job2).wont_be :done? unless emulator_enabled? - job2.wait_until_done! - - _(job2).must_be :done? - _(job2.database).must_be :nil? - - database.drop - _(spanner.database(instance_id, database_id)).must_be :nil? - end - - it "lists and gets databases" do - all_databases = spanner.databases(instance_id).all.to_a - _(all_databases).wont_be :empty? - all_databases.each do |database| - _(database).must_be_kind_of Google::Cloud::Spanner::Database - _(database.encryption_info).must_be_kind_of Array - end - - first_database = spanner.database all_databases.first.instance_id, all_databases.first.database_id - _(first_database).must_be_kind_of Google::Cloud::Spanner::Database - end - - it "creates database with pitr retention period" do - skip if emulator_enabled? - - _(spanner.database(instance_id, database_id)).must_be :nil? - - # Invalid - retention_period = "0d" - assert_raises Google::Cloud::InvalidArgumentError do - spanner.create_database instance_id, database_id, - statements: ["ALTER DATABASE `#{database_id}` SET OPTIONS \ - (version_retention_period = '#{retention_period}')"] - end - - # Success - retention_period = "7d" - job = spanner.create_database instance_id, database_id, - statements: ["ALTER DATABASE `#{database_id}` SET OPTIONS \ - (version_retention_period = '#{retention_period}')"] - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - database = job.database - database.drop - _(spanner.database(instance_id, database_id)).must_be :nil? - end - - it "update database ddl with pitr retention period" do - skip if emulator_enabled? - - _(spanner.database(instance_id, database_id)).must_be :nil? - - job = spanner.create_database instance_id, database_id - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? unless emulator_enabled? - job.wait_until_done! - - _(job).must_be :done? - raise Google::Cloud::Error.from_error(job.error) if job.error? - - database = job.database - _(spanner.database(instance_id, database_id)).wont_be :nil? - - # Invalid - retention_period = "0d" - assert_raises Google::Cloud::InvalidArgumentError do - database.update statements: "ALTER DATABASE `#{database_id}` SET OPTIONS \ - (version_retention_period = '#{retention_period}')" - end - - # Success - retention_period = "7d" - job2 = database.update statements: "ALTER DATABASE `#{database_id}` SET OPTIONS \ - (version_retention_period = '#{retention_period}')" - _(job2).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job2).wont_be :done? unless emulator_enabled? - job2_result = job2.wait_until_done! - - _(job2).must_be :done? - _(job2.database).must_be :nil? - _(job2_result.metadata).wont_be :nil? - _(job2_result.metadata.throttled).must_equal false - - database.drop - _(spanner.database(instance_id, database_id)).must_be :nil? - end -end diff --git a/google-cloud-spanner/acceptance/spanner/fine_grain_access_control_test.rb b/google-cloud-spanner/acceptance/spanner/fine_grain_access_control_test.rb deleted file mode 100644 index 11de75db3cde..000000000000 --- a/google-cloud-spanner/acceptance/spanner/fine_grain_access_control_test.rb +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "spanner_helper" - -describe "Fine Grained Access Control", :spanner do - let(:table_name) { "stuffs" } - let(:db) { spanner } - let(:db_client) { spanner_client } - let(:admin) { $spanner_db_admin } - let(:instance_id) { $spanner_instance_id } - let(:database_id) { $spanner_database_id } - let(:role) { "selector" } - - before do - skip if emulator_enabled? - db_client.delete table_name # remove all data - db_client.insert table_name, [ - { id: 1, bool: false }, - { id: 2, bool: false }, - { id: 3, bool: true }, - { id: 4, bool: false }, - { id: 5, bool: true } - ] - - db_path = admin.database_path project: db.project_id, - instance: instance_id, - database: database_id - - db_job = admin.update_database_ddl database: db_path, statements: [ - "CREATE ROLE #{role}", - "GRANT SELECT ON TABLE #{table_name} TO ROLE #{role}" - ] - db_job.wait_until_done! - end - - it "should be able to do granted actions for role" do - skip if emulator_enabled? - selector_client = db.client $spanner_instance_id, $spanner_database_id, database_role: role - _(selector_client.read(table_name, [:id]).rows.map(&:to_h)).must_equal [{ id: 1 }, - { id: 2 }, - { id: 3 }, - { id: 4 }, - { id: 5 }] - end - - it "should give error for actions without access" do - skip if emulator_enabled? - selector_client = db.client $spanner_instance_id, $spanner_database_id, database_role: role - error = assert_raises Google::Cloud::PermissionDeniedError do - selector_client.insert table_name, [ - { id: 1, bool: false } - ] - end - - assert_includes error.message, "Role selector does not have required privileges on table #{table_name}" - end - - it "should give error when database role does not exists" do - skip if emulator_enabled? - - error = assert_raises Google::Cloud::PermissionDeniedError do - db.client $spanner_instance_id, $spanner_database_id, database_role: "unknown" - end - - assert_includes error.message, "Role not found: unknown" - end -end diff --git a/google-cloud-spanner/acceptance/spanner/instance_config_test.rb b/google-cloud-spanner/acceptance/spanner/instance_config_test.rb deleted file mode 100644 index 8f1266eb03eb..000000000000 --- a/google-cloud-spanner/acceptance/spanner/instance_config_test.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Instance Configs", :spanner do - it "lists and gets instance configs" do - all_configs = spanner.instance_configs.all.to_a - _(all_configs).wont_be :empty? - all_configs.each do |config| - _(config).must_be_kind_of Google::Cloud::Spanner::Instance::Config - end - - first_configs = spanner.instance_config all_configs.first.instance_config_id - _(first_configs).must_be_kind_of Google::Cloud::Spanner::Instance::Config - end -end diff --git a/google-cloud-spanner/acceptance/spanner/instance_test.rb b/google-cloud-spanner/acceptance/spanner/instance_test.rb deleted file mode 100644 index a0112bbf3f55..000000000000 --- a/google-cloud-spanner/acceptance/spanner/instance_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "spanner_helper" - -describe "Spanner Instances", :spanner do - it "lists and gets instances" do - all_instances = spanner.instances.all.to_a - _(all_instances).wont_be :empty? - all_instances.each do |instance| - _(instance).must_be_kind_of Google::Cloud::Spanner::Instance - end - - first_instance = spanner.instance all_instances.first.instance_id - _(first_instance).must_be_kind_of Google::Cloud::Spanner::Instance - end - - describe "IAM Policies and Permissions" do - let(:service_account) { spanner.service.credentials.client.issuer } - - it "allows policy to be updated on an instance" do - skip if emulator_enabled? - - all_instances = spanner.instances.all.to_a - instance = spanner.instance all_instances.first.instance_id - # Check permissions first - roles = ["spanner.instances.getIamPolicy", "spanner.instances.setIamPolicy"] - permissions = instance.test_permissions roles - skip "Don't have permissions to get/set topic's policy" unless permissions == roles - - _(instance.policy).must_be_kind_of Google::Cloud::Spanner::Policy - - # We need a valid service account in order to update the policy - _(service_account).wont_be :nil? - role = "roles/viewer" - member = "serviceAccount:#{service_account}" - instance.policy do |p| - p.add role, member - p.add role, member # duplicate member will not be added to request - end - - role_member = instance.policy.role(role).select { |x| x == member } - _(role_member.size).must_equal 1 - end - end -end diff --git a/google-cloud-spanner/acceptance/spanner_helper.rb b/google-cloud-spanner/acceptance/spanner_helper.rb deleted file mode 100644 index a9247d9f2dc2..000000000000 --- a/google-cloud-spanner/acceptance/spanner_helper.rb +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "simplecov" - -gem "minitest" -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" - -require "google/cloud/spanner" -require "google/cloud/spanner/admin/database" - -require "data/fixtures" - -# define SecureRandom.int64 -require "securerandom" -# SecureRandom.int64 generates a random signed 64-bit integer. -# -# The result will be an integer between the values -9,223,372,036,854,775,808 -# and 9,223,372,036,854,775,807. -def SecureRandom.int64 - random_bytes(8).unpack1("q") -end - -def emulator_enabled? - ENV["SPANNER_EMULATOR_HOST"] -end - -def make_params dialect, value - key = dialect == :gsql ? :value : :p1 - { key => value } -end - -# Create shared spanner object so we don't create new for each test -$spanner = Google::Cloud::Spanner.new -$spanner_db_admin = Google::Cloud::Spanner::Admin::Database.database_admin - -module Acceptance - ## - # Test class for running against a Spanner instance. - # Ensures that there is an active connection for the tests to use. - # - # This class can be used with the spec DSL. - # To do so, add :spanner to describe: - # - # describe "My Spanner Test", :spanner do - # it "does a thing" do - # your.code.must_be :thing? - # end - # end - class SpannerTest < Minitest::Test - attr_accessor :spanner - attr_accessor :spanner_client - attr_accessor :spanner_pg_client - - ## - # Setup project based on available ENV variables - def setup - @spanner = $spanner - - refute_nil @spanner, "You do not have an active spanner to run the tests." - - @spanner_client = $spanner_client - - refute_nil @spanner_client, "You do not have an active client to run the tests." - - @spanner_pg_client = $spanner_pg_client - - super - end - - # Add spec DSL - extend Minitest::Spec::DSL - - # Register this spec type for when :spanner is used. - register_spec_type self do |_desc, *addl| - addl.include? :spanner - end - - # def self.run_one_method klass, method_name, reporter - # result = nil - # reporter.prerecord klass, method_name - # (1..3).each do |try| - # result = Minitest.run_one_method(klass, method_name) - # break if (result.passed? || result.skipped?) - # puts "Retrying #{klass}##{method_name} (#{try})" - # end - # reporter.record result - # end - - include Fixtures - - def assert_commit_response resp, commit_options = {} - _(resp.timestamp).must_be_kind_of Time - - if commit_options[:return_commit_stats] - _(resp.stats).must_be_kind_of Google::Cloud::Spanner::CommitResponse::CommitStats - _(resp.stats.mutation_count).must_be :>, 0 - else - _(resp.stats).must_be :nil? - end - end - end -end - -# Create buckets to be shared with all the tests -require "date" -$spanner_instance_id = "google-cloud-ruby-tests" -# $spanner_database_id is already 22 characters, can only add 7 additional characters -$spanner_database_id = "gcruby-#{Date.today.strftime '%y%m%d'}-#{SecureRandom.hex 4}" -$spanner_pg_database_id = "gcruby-pg-#{Date.today.strftime '%y%m%d'}-#{SecureRandom.hex 4}" - -# Setup main instance and database for the tests -fixture = Object.new -fixture.extend Acceptance::Fixtures - -instance = $spanner.instance $spanner_instance_id - -instance ||= begin - inst_job = $spanner.create_instance $spanner_instance_id, name: "google-cloud-ruby-tests", -config: "regional-us-central1", nodes: 1 - inst_job.wait_until_done! - raise GRPC::BadStatus.new(inst_job.error.code, inst_job.error.message) if inst_job.error? - inst_job.instance -end - -db_job = instance.create_database $spanner_database_id, statements: fixture.schema_ddl_statements -db_job.wait_until_done! -raise GRPC::BadStatus.new(db_job.error.code, db_job.error.message) if db_job.error? - -unless emulator_enabled? - instance_path = $spanner_db_admin.instance_path project: $spanner.project_id, instance: $spanner_instance_id - db_job = $spanner_db_admin.create_database parent: instance_path, - create_statement: "CREATE DATABASE \"#{$spanner_pg_database_id}\"", - database_dialect: :POSTGRESQL - db_job.wait_until_done! - raise GRPC::BadStatus.new(db_job.error.code, db_job.error.message) if db_job.error? - db_path = $spanner_db_admin.database_path project: $spanner.project_id, - instance: $spanner_instance_id, - database: $spanner_pg_database_id - - db_job = $spanner_db_admin.update_database_ddl database: db_path, statements: fixture.schema_pg_ddl_statements - db_job.wait_until_done! - raise GRPC::BadStatus.new(db_job.error.code, db_job.error.message) if db_job.error? -end - -# Create one client for all tests, to minimize resource usage -$spanner_client = $spanner.client $spanner_instance_id, $spanner_database_id -$spanner_pg_client = $spanner.client $spanner_instance_id, $spanner_pg_database_id unless emulator_enabled? - -def clean_up_spanner_objects - puts "Cleaning up instances and databases after spanner tests." - $spanner.instance($spanner_instance_id).database($spanner_database_id).drop - $spanner.instance($spanner_instance_id).database($spanner_pg_database_id).drop unless emulator_enabled? - - puts "Closing the Spanner Client." - $spanner_client.close - $spanner_pg_client.close unless emulator_enabled? - - puts "Cleaning up instances databases and backups after spanner tests." - instance = $spanner.instance $spanner_instance_id - - # Delete test database backups. - unless emulator_enabled? - instance.backups(filter: "name:#{$spanner_database_id}").all.each(&:delete) - end - - # Delete test restored database. - restored_db = instance.database "restore-#{$spanner_database_id}" - restored_db&.drop -rescue StandardError => e - puts "Error while cleaning up instances and databases after spanner tests.\n\n#{e}" -end - -Minitest.after_run do - clean_up_spanner_objects -end diff --git a/google-cloud-spanner/benchmark/benchwrapper/README.md b/google-cloud-spanner/benchmark/benchwrapper/README.md deleted file mode 100644 index 46a021b6ba34..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Benchwrapper - -A small gRPC wrapper around the spanner client library. This allows the -benchmarking code to prod at spanner without speaking Ruby. - -## Running - -```bash -cd google-cloud-spanner/benchmark/benchwrapper -export SPANNER_EMULATOR_HOST=localhost:9010 -bundle exec benchwrapper.rb --port=8081 -``` - -## Generating ProtoBuf code - -```bash -cd google-cloud-spanner/benchmark/benchwrapper -bundle install -bundle exec grpc_tools_ruby_protoc --ruby_out=. --grpc_out=. spanner.proto -``` diff --git a/google-cloud-spanner/benchmark/benchwrapper/benchwrapper.rb b/google-cloud-spanner/benchmark/benchwrapper/benchwrapper.rb deleted file mode 100755 index 033b9835763e..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/benchwrapper.rb +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env ruby -# -*- coding: utf-8 -*- - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -this_dir = File.expand_path(File.dirname(__FILE__)) -$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) - -require 'optparse' -require 'grpc' -require 'spanner_services_pb' -require "google/cloud/spanner" - -include SpannerBench - -# ServerImpl provides an implementation of the SpannerBenchWrapper service. -class ServerImpl < SpannerBench::SpannerBenchWrapper::Service - def initialize() - @spanner = Google::Cloud::Spanner.new project: "someproject" - @client = @spanner.client "someinstance", "somedatabase" - end - - def read(read_query, _call) - @client.execute(read_query.query).rows.each do |row| - # Just iterate over all rows. - end - EmptyResponse.new - end - - def insert(insert_query, _call) - rows = insert_query.singers.map do |singer| - { - SingerId: singer.id, - FirstName: singer.first_name, - LastName: singer.last_name - } - end - - @client.commit do |c| - c.insert "Singers", rows - end - EmptyResponse.new - end - - def update(update_query, _call) - row_counts = nil - @client.transaction do |transaction| - row_counts = transaction.batch_update do |b| - update_query.queries.each do |query| - b.batch_update query - end - end - end - statement_count = row_counts.count - EmptyResponse.new - end -end - -def main - port = nil - OptionParser.new do |opts| - opts.banner = "Usage: benchwrapper.rb [options]" - opts.on('-p', '--port PORT', "Specify the port") do |v| - port = v - end - end.parse! - - if ENV["SPANNER_EMULATOR_HOST"].nil? - fail "This benchmarking server only works when connected to an emulator. Please set SPANNER_EMULATOR_HOST." - end - - if port.nil? || port.to_i.to_s != port - fail "Please specify a valid port, e.g., -p 5000 or --port 5000." - end - - addr = "0.0.0.0:#{port}" - s = GRPC::RpcServer.new - s.add_http2_port(addr, :this_port_is_insecure) - puts "starting benchwrapper for Spanner on localhost:#{addr}" - s.handle(ServerImpl.new) - # Runs the server with SIGHUP, SIGINT and SIGQUIT signal handlers to - # gracefully shutdown. - # User could also choose to run server via call to run_till_terminated - s.run_till_terminated_or_interrupted([1, 'int', 'SIGQUIT']) -end - -main \ No newline at end of file diff --git a/google-cloud-spanner/benchmark/benchwrapper/benchwrapper_test_client.rb b/google-cloud-spanner/benchmark/benchwrapper/benchwrapper_test_client.rb deleted file mode 100644 index 5e5d35b6a817..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/benchwrapper_test_client.rb +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env ruby -# -*- coding: utf-8 -*- - -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -this_dir = File.expand_path(File.dirname(__FILE__)) -$LOAD_PATH.unshift(this_dir) unless $LOAD_PATH.include?(this_dir) - -require 'optparse' -require "spanner_services_pb" - -include SpannerBench - -def main - port = nil - OptionParser.new do |opts| - opts.banner = "Usage: benchwrapper.rb [options]" - opts.on('-p', '--port PORT', "Specify the port") do |v| - port = v - end - end.parse! - - if port.nil? || port.to_i.to_s != port - fail "Please specify a valid port, e.g., -p 5000 or --port 5000." - end - - puts "connecting to localhost:#{port}" - - stub = SpannerBench::SpannerBenchWrapper::Stub.new("localhost:#{port}", :this_channel_is_insecure) - - stub.read(ReadQuery.new(Query: "SELECT 1 AS COL1 UNION ALL SELECT 2 AS COL1")) - - stub.insert(InsertQuery.new(users: [ - User.new(name: "foo", age: 50), - User.new(name: "bar", age: 40), - ])) - - resp = stub.update(UpdateQuery.new(Queries: [ - "UPDATE sometable SET foo=1 WHERE bar=2", - "UPDATE sometable SET foo=2 WHERE bar=1", - ])) -end - -main \ No newline at end of file diff --git a/google-cloud-spanner/benchmark/benchwrapper/kokoro/benchwrapper.sh b/google-cloud-spanner/benchmark/benchwrapper/kokoro/benchwrapper.sh deleted file mode 100755 index 459460b3aa84..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/kokoro/benchwrapper.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Fail on any error. -set -e - -# Display commands being run. -set -x - -# Install gems in the user directory because the default install directory -# is in a read-only location. -export GEM_HOME=$HOME/.gem -export PATH=$GEM_HOME/bin:$PATH - -# install bundler using gem so an up-to-date version is available. -gem install --no-document bundler - -export SPANNER_EMULATOR_HOST=localhost:9010 -cd $PROJECT_ROOT/google-cloud-spanner/benchmark/benchwrapper -bundle install -bundle exec benchwrapper.rb --port=8081 diff --git a/google-cloud-spanner/benchmark/benchwrapper/spanner.proto b/google-cloud-spanner/benchmark/benchwrapper/spanner.proto deleted file mode 100644 index 7894fdc7c3bd..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/spanner.proto +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package spanner_bench; - -message Singer { - int64 id = 1; - string first_name = 2; - string last_name = 3; - string singer_info = 4; -} - -message Album { - int64 id = 1; - int64 singer_id = 2; - string album_title = 3; -} - -message ReadQuery { - // The query to use in the read call. - string query = 1; -} - -message InsertQuery { - // The query to use in the insert call. - repeated Singer singers = 1; - repeated Album albums = 2; -} - -message UpdateQuery { - // The queries to use in the update call. - repeated string queries = 1; -} - -message EmptyResponse {} - -service SpannerBenchWrapper{ - // Read represents operations like Go's ReadOnlyTransaction.Query, Java's - // ReadOnlyTransaction.executeQuery, Python's snapshot.read, and Node's - // Transaction.Read. - // - // It will typically be used to read many items. - rpc Read(ReadQuery) returns (EmptyResponse){} - - // Insert represents operations like Go's Client.Apply, Java's - // DatabaseClient.writeAtLeastOnce, Python's transaction.commit, and Node's - // Transaction.Commit. - // - // It will typically be used to insert many items. - rpc Insert(InsertQuery) returns (EmptyResponse){} - - // Update represents operations like Go's ReadWriteTransaction.BatchUpdate, - // Java's TransactionRunner.run, Python's Batch.update, and Node's - // Transaction.BatchUpdate. - // - // It will typically be used to update many items. - rpc Update(UpdateQuery) returns (EmptyResponse){} -} \ No newline at end of file diff --git a/google-cloud-spanner/benchmark/benchwrapper/spanner_pb.rb b/google-cloud-spanner/benchmark/benchwrapper/spanner_pb.rb deleted file mode 100644 index c88f047d839f..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/spanner_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: spanner.proto - -require 'google/protobuf' - -Google::Protobuf::DescriptorPool.generated_pool.build do - add_file("spanner.proto", :syntax => :proto3) do - add_message "spanner_bench.Singer" do - optional :id, :int64, 1 - optional :first_name, :string, 2 - optional :last_name, :string, 3 - optional :singer_info, :string, 4 - end - add_message "spanner_bench.Album" do - optional :id, :int64, 1 - optional :singer_id, :int64, 2 - optional :album_title, :string, 3 - end - add_message "spanner_bench.ReadQuery" do - optional :query, :string, 1 - end - add_message "spanner_bench.InsertQuery" do - repeated :singers, :message, 1, "spanner_bench.Singer" - repeated :albums, :message, 2, "spanner_bench.Album" - end - add_message "spanner_bench.UpdateQuery" do - repeated :queries, :string, 1 - end - add_message "spanner_bench.EmptyResponse" do - end - end -end - -module SpannerBench - Singer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.Singer").msgclass - Album = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.Album").msgclass - ReadQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.ReadQuery").msgclass - InsertQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.InsertQuery").msgclass - UpdateQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.UpdateQuery").msgclass - EmptyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("spanner_bench.EmptyResponse").msgclass -end diff --git a/google-cloud-spanner/benchmark/benchwrapper/spanner_services_pb.rb b/google-cloud-spanner/benchmark/benchwrapper/spanner_services_pb.rb deleted file mode 100644 index 0ada3f008643..000000000000 --- a/google-cloud-spanner/benchmark/benchwrapper/spanner_services_pb.rb +++ /dev/null @@ -1,54 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: spanner.proto for package 'spanner_bench' -# Original file comments: -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -require 'grpc' -require 'spanner_pb' - -module SpannerBench - module SpannerBenchWrapper - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'spanner_bench.SpannerBenchWrapper' - - # Read represents operations like Go's ReadOnlyTransaction.Query, Java's - # ReadOnlyTransaction.executeQuery, Python's snapshot.read, and Node's - # Transaction.Read. - # - # It will typically be used to read many items. - rpc :Read, ::SpannerBench::ReadQuery, ::SpannerBench::EmptyResponse - # Insert represents operations like Go's Client.Apply, Java's - # DatabaseClient.writeAtLeastOnce, Python's transaction.commit, and Node's - # Transaction.Commit. - # - # It will typically be used to insert many items. - rpc :Insert, ::SpannerBench::InsertQuery, ::SpannerBench::EmptyResponse - # Update represents operations like Go's ReadWriteTransaction.BatchUpdate, - # Java's TransactionRunner.run, Python's Batch.update, and Node's - # Transaction.BatchUpdate. - # - # It will typically be used to update many items. - rpc :Update, ::SpannerBench::UpdateQuery, ::SpannerBench::EmptyResponse - end - - Stub = Service.rpc_stub_class - end -end diff --git a/google-cloud-spanner/benchmark/bin/ycsb b/google-cloud-spanner/benchmark/bin/ycsb deleted file mode 100755 index 6ec65bce448c..000000000000 --- a/google-cloud-spanner/benchmark/bin/ycsb +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# A YCSB-like executable that can be integrated into PerfKitBenchmarker. -# -# It is intended to be run in a VM that is brought up by PerfKitBenchmarker -# with Ruby, RVM, and google-cloud-ruby installed. The environment can be -# configured as follows: -# -# gpg --keyserver hkp://keys.gnupg.net \ -# --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 \ -# 7D2BAF1CF37B13E2069D6956105BD0E739499BDB -# curl -sSL https://get.rvm.io | bash -s stable --ruby -# source $HOME/.rvm/scripts/rvm; gem install bundler -# sudo apt-get install -y git -# git clone https://github.com/googleapis/google-cloud-ruby.git -# cd google-cloud-ruby; bundle install - -source $HOME/.rvm/scripts/rvm - -cd $HOME/google-cloud-ruby - -bundle exec ruby google-cloud-spanner/benchmark/ycsb.rb "${@:1}" diff --git a/google-cloud-spanner/benchmark/ycsb.rb b/google-cloud-spanner/benchmark/ycsb.rb deleted file mode 100644 index 923f04a21112..000000000000 --- a/google-cloud-spanner/benchmark/ycsb.rb +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# See usage at https://github.com/haih-g/YCSBClientCloudSpanner - -# To make a package so it can work with PerfKitBenchmarker: -# $ cd google-cloud-spanner; tar -cvzf ycsb-ruby.0.0.1.tar.gz benchmark/ - -require "google/cloud/spanner" -require "optparse" -require "set" -require "securerandom" - -OPERATIONS = ["readproportion", "updateproportion", "scanproportion", "insertproportion"].to_set - -command = ARGV.shift -if command != "run" - puts "command not supported: #{command}" - exit 1 -end - -options = { - num_bucket: 1000, - num_worker: '1', -} -OptionParser.new do |opts| - opts.on("-P", "--workload FILE", "path to YCSB workload file") do |fname| - File.open(fname, "r") do |file| - while (line = file.gets) - pos = line.index("=") - next if pos.nil? || !OPERATIONS.include?(line[0...pos]) - options[line[0...pos].strip.to_sym] = line[pos+1..-1].strip - end - end - end - opts.on("-p", "--parameter PARAM", "the key=value pair of parameter") do |p| - pos = p.index("=") - fail "require key=value format, found #{p}" if pos.nil? - options[p[0...pos].to_sym] = p[pos+1..-1] - end - opts.on("-b", "--num_bucket BUCKET", "the number of buckets in output") do |b| - options[:num_bucket] = b - end -end.parse! - -puts options - -spanner = Google::Cloud::Spanner.new project: options[:"cloudspanner.project"] -database = spanner.client options[:"cloudspanner.instance"], - options[:"cloudspanner.database"], - pool: { - threads: options[:num_worker].to_i - } - -# Load keys -keys = [] -results = database.execute "SELECT u.id FROM #{options[:table]} u" -results.rows.each do |row| - keys << row[0] -end - -# Run workload -total_weight = 0.0 -weights = [] -operations = [] -OPERATIONS.each do |op| - weight = options[op.to_sym].to_f - next if weight <= 0.0 - total_weight += weight - op_code = op.split("proportion")[0] - operations << op_code - weights << total_weight -end - -class Workload - attr_reader :latencies_ms - - def initialize database, options, total_weight, weights, operations, keys - @database = database - @options = options - @total_weight = total_weight - @weights = weights - @operations = operations - @latencies_ms = {} - @keys = keys - operations.each do |op| - @latencies_ms[op] = [] - end - end - - def run - i = 0 - operation_count = @options[:operationcount].to_i - while i < operation_count - i += 1 - weight = rand * @total_weight - (0...@weights.count).each do |j| - if weight <= @weights[j] then - do_operation @database, - @options[:table], - @operations[j], - @latencies_ms - break - end - end - end - end - - def do_operation(database, table, operation, latencies_ms) - key = @keys[rand @keys.count] - start = Time.now - if operation == "read" - do_read(database, table, key) - elsif operation == "update" - do_update(database, table, key) - else - fail "unsupported operation: #{operation}" - end - latencies_ms[operation] << (Time.now - start)*1000 - end - - def do_read database, table, key - results = database.execute "SELECT u.* FROM #{table} u WHERE u.id=\"#{key}\"" - results.rows.each do |row| - key = row[0] - (1...10).each do |i| - field = row[i] - end - end - end - - def do_update database, table, key - field = rand 0...10 - value = SecureRandom.hex(100) - database.commit do |c| - c.update table, [{ "id" => key, "field#{field}" => value }] - end - end -end - -start = Time.now -workloads = [] -threads = [] -options[:num_worker].to_i.times do - workload = Workload.new database, - options, - total_weight, - weights, - operations, - keys - workloads << workload - threads << Thread.new(workload) { |wl| wl.run } -end - -threads.each do |t| - t.join -end - -overall_duration = Time.now - start - -merge_latencies_ms = {} -workloads.each do |wl| - merge_latencies_ms.merge!(wl.latencies_ms) { |key, a, b| a.concat(b) } -end - -overall_op_count = merge_latencies_ms.values.map { |l| l.count }.reduce(:+) - -puts "[OVERALL], RunTime(ms), #{overall_duration*1000}" -puts "[OVERALL], Throughput(ops/sec), #{overall_op_count.to_f/overall_duration}" -merge_latencies_ms.keys.each do |op| - latencies_ms = merge_latencies_ms[op].sort - count = latencies_ms.count - opup = op.upcase - puts "[#{opup}], Operations, #{count}" - puts "[#{opup}], AverageLatency(us), #{latencies_ms.reduce(:+)*1000/count}" - puts "[#{opup}], MinLatency(us), #{latencies_ms.first*1000}" - puts "[#{opup}], MaxLatency(us), #{latencies_ms.last*1000}" - - percentile = -> (pc) { latencies_ms[(latencies_ms.count*pc).round-1]*1000 } - puts "[#{opup}], 95thPercentileLatency(us), #{percentile.call 0.95}" - puts "[#{opup}], 99thPercentileLatency(us), #{percentile.call 0.99}" - puts "[#{opup}], 99.9thPercentileLatency(us), #{percentile.call 0.999}" - puts "[#{opup}], Return=OK, #{count}" - (0...options[:num_bucket]).each do |j| - hi = latencies_ms.bsearch_index { |l| l >= j+1 } || count - lo = latencies_ms.bsearch_index { |l| l >= j } || count - puts "[#{opup}], #{j}, #{hi - lo}" - end - lo = latencies_ms.bsearch_index { |l| l >= options[:num_bucket] } || count - puts "[#{opup}], >#{options[:num_bucket]}, #{count - lo}" -end diff --git a/google-cloud-spanner/google-cloud-spanner.gemspec b/google-cloud-spanner/google-cloud-spanner.gemspec deleted file mode 100644 index d8a12b867119..000000000000 --- a/google-cloud-spanner/google-cloud-spanner.gemspec +++ /dev/null @@ -1,40 +0,0 @@ -# -*- encoding: utf-8 -*- -require File.expand_path("../lib/google/cloud/spanner/version", __FILE__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-spanner" - gem.version = Google::Cloud::Spanner::VERSION - - gem.authors = ["Mike Moore", "Chris Smith"] - gem.email = ["mike@blowmage.com", "quartzmo@gmail.com"] - gem.description = "google-cloud-spanner is the official library for Google Cloud Spanner API." - gem.summary = "API Client library for Google Cloud Spanner API" - gem.homepage = "https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner" - gem.license = "Apache-2.0" - - gem.files = `git ls-files -- lib/*`.split("\n") + - ["OVERVIEW.md", "AUTHENTICATION.md", "LOGGING.md", "CONTRIBUTING.md", "TROUBLESHOOTING.md", "CHANGELOG.md", "CODE_OF_CONDUCT.md", "LICENSE", ".yardopts"] - gem.require_paths = ["lib"] - - gem.required_ruby_version = ">= 2.6" - - gem.add_dependency "google-cloud-core", "~> 1.5" - gem.add_dependency "google-cloud-spanner-admin-database-v1", "~> 0.1" - gem.add_dependency "google-cloud-spanner-admin-instance-v1", "~> 0.1" - gem.add_dependency "google-cloud-spanner-v1", "~> 0.2" - gem.add_dependency "concurrent-ruby", "~> 1.0" - - gem.add_development_dependency "gapic-common", ">= 0.11.0" - gem.add_development_dependency "google-style", "~> 1.26.1" - gem.add_development_dependency "minitest", "~> 5.16" - gem.add_development_dependency "minitest-autotest", "~> 1.0" - gem.add_development_dependency "minitest-focus", "~> 1.1" - gem.add_development_dependency "minitest-rg", "~> 5.2" - gem.add_development_dependency "autotest-suffix", "~> 1.1" - gem.add_development_dependency "redcarpet", "~> 3.0" - gem.add_development_dependency "simplecov", "~> 0.9" - gem.add_development_dependency "yard", "~> 0.9" - gem.add_development_dependency "yard-doctest", "~> 0.1.13" - gem.add_development_dependency "grpc", "~> 1.36" - gem.add_development_dependency "grpc-tools", "~> 1.36" -end diff --git a/google-cloud-spanner/lib/google-cloud-spanner.rb b/google-cloud-spanner/lib/google-cloud-spanner.rb deleted file mode 100644 index b1caf2744276..000000000000 --- a/google-cloud-spanner/lib/google-cloud-spanner.rb +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -## -# This file is here to be autorequired by bundler, so that the -# Google::Cloud.spanner and Google::Cloud#spanner methods can be available, but -# the library and all dependencies won't be loaded until required and used. - - -gem "google-cloud-core" -require "google/cloud" unless defined? Google::Cloud.new -require "google/cloud/config" -require "googleauth" - -module Google - module Cloud - ## - # Creates a new object for connecting to the Spanner service. - # Each call creates a new connection. - # - # For more information on connecting to Google Cloud see the - # {file:AUTHENTICATION.md Authentication Guide}. - # - # @param [String, Array] scope The OAuth 2.0 scopes controlling the - # set of resources and operations that the connection can access. See - # [Using OAuth 2.0 to Access Google - # APIs](https://developers.google.com/identity/protocols/OAuth2). - # - # The default scopes are: - # - # * `https://www.googleapis.com/auth/spanner` - # * `https://www.googleapis.com/auth/spanner.data` - # @param [Integer] timeout Default timeout to use in requests. Optional. - # @param [String] lib_name Library name. This will be added as a prefix - # to the API call tracking header `x-goog-api-client` with provided - # lib version for telemetry. Optional. For example prefix looks like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # @param [String] lib_version Library version. This will be added as a - # prefix to the API call tracking header `x-goog-api-client` with - # provided lib name for telemetry. Optional. For example prefix look like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # - # @return [Google::Cloud::Spanner::Project] - # - # @example - # require "google/cloud" - # - # gcloud = Google::Cloud.new - # spanner = gcloud.spanner - # - # @example The default scope can be overridden with the `scope` option: - # require "google/cloud" - # - # gcloud = Google::Cloud.new - # platform_scope = "https://www.googleapis.com/auth/cloud-platform" - # spanner = gcloud.spanner scope: platform_scope - # - def spanner scope: nil, timeout: nil, lib_name: nil, lib_version: nil - Google::Cloud.spanner @project, @keyfile, scope: scope, - timeout: (timeout || @timeout), - lib_name: lib_name, - lib_version: lib_version - end - - ## - # Creates a new object for connecting to the Spanner service. - # Each call creates a new connection. - # - # For more information on connecting to Google Cloud see the - # {file:AUTHENTICATION.md Authentication Guide}. - # - # @param [String] project_id Project identifier for the Spanner service you - # are connecting to. If not present, the default project for the - # credentials is used. - # @param [String, Hash, Google::Auth::Credentials] credentials The path to - # the keyfile as a String, the contents of the keyfile as a Hash, or a - # Google::Auth::Credentials object. (See {Spanner::Credentials}) - # @param [String, Array] scope The OAuth 2.0 scopes controlling the - # set of resources and operations that the connection can access. See - # [Using OAuth 2.0 to Access Google - # APIs](https://developers.google.com/identity/protocols/OAuth2). - # - # The default scopes are: - # - # * `https://www.googleapis.com/auth/spanner` - # * `https://www.googleapis.com/auth/spanner.data` - # @param [Integer] timeout Default timeout to use in requests. Optional. - # @param [String] lib_name Library name. This will be added as a prefix - # to the API call tracking header `x-goog-api-client` with provided - # lib version for telemetry. Optional. For example prefix looks like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # @param [String] lib_version Library version. This will be added as a - # prefix to the API call tracking header `x-goog-api-client` with - # provided lib name for telemetry. Optional. For example prefix look like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # - # @return [Google::Cloud::Spanner::Project] - # - # @example - # require "google/cloud" - # - # spanner = Google::Cloud.spanner - # - def self.spanner project_id = nil, credentials = nil, scope: nil, - timeout: nil, lib_name: nil, lib_version: nil - require "google/cloud/spanner" - Google::Cloud::Spanner.new project_id: project_id, - credentials: credentials, - scope: scope, timeout: timeout, - lib_name: lib_name, lib_version: lib_version - end - end -end - -# rubocop:disable Metrics/BlockLength - -# Set the default spanner configuration -Google::Cloud.configure.add_config! :spanner do |config| - default_project = Google::Cloud::Config.deferred do - ENV["SPANNER_PROJECT"] - end - default_creds = Google::Cloud::Config.deferred do - Google::Cloud::Config.credentials_from_env( - "SPANNER_CREDENTIALS", "SPANNER_CREDENTIALS_JSON", - "SPANNER_KEYFILE", "SPANNER_KEYFILE_JSON" - ) - end - default_emulator = Google::Cloud::Config.deferred do - ENV["SPANNER_EMULATOR_HOST"] - end - - default_query_options = Google::Cloud::Config.deferred do - query_options = {} - optimizer_version = ENV["SPANNER_OPTIMIZER_VERSION"] - optimizer_stats_pkg = ENV["SPANNER_OPTIMIZER_STATISTICS_PACKAGE"] - query_options[:optimizer_version] = optimizer_version if optimizer_version - query_options[:optimizer_statistics_package] = optimizer_stats_pkg if optimizer_stats_pkg - query_options = nil if query_options.empty? - query_options - end - - default_scopes = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.admin", - "https://www.googleapis.com/auth/spanner.data" - ] - - config.add_field! :project_id, default_project, match: String, allow_nil: true - config.add_alias! :project, :project_id - config.add_field! :credentials, default_creds, - match: [String, Hash, Google::Auth::Credentials], - allow_nil: true - config.add_alias! :keyfile, :credentials - config.add_field! :scope, default_scopes, match: [String, Array] - config.add_field! :quota_project, nil, match: String - config.add_field! :timeout, nil, match: Integer - config.add_field! :endpoint, "spanner.googleapis.com", match: String - config.add_field! :emulator_host, default_emulator, match: String, allow_nil: true - config.add_field! :lib_name, nil, match: String, allow_nil: true - config.add_field! :lib_version, nil, match: String, allow_nil: true - config.add_field! :query_options, default_query_options, match: Hash, allow_nil: true -end - -# rubocop:enable Metrics/BlockLength diff --git a/google-cloud-spanner/lib/google/cloud/spanner.rb b/google-cloud-spanner/lib/google/cloud/spanner.rb deleted file mode 100644 index 674158a62058..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner.rb +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google-cloud-spanner" -require "google/cloud/spanner/project" -require "google/cloud/config" -require "google/cloud/env" - -module Google - module Cloud - ## - # # Cloud Spanner - # - # Cloud Spanner is a fully managed, mission-critical, relational database - # service that offers transactional consistency at global scale, schemas, - # SQL (ANSI 2011 with extensions), and automatic, synchronous replication - # for high availability. - # - # For more information about Cloud Spanner, read the [Cloud - # Spanner Documentation](https://cloud.google.com/spanner/docs/). - # - # See {file:OVERVIEW.md Spanner Overview}. - # - module Spanner - # rubocop:disable Metrics/MethodLength,Metrics/AbcSize - - ## - # Creates a new object for connecting to the Spanner service. - # Each call creates a new connection. - # - # For more information on connecting to Google Cloud see the - # {file:AUTHENTICATION.md Authentication Guide}. - # - # @param [String] project_id Project identifier for the Spanner service - # you are connecting to. If not present, the default project for the - # credentials is used. - # @param [String, Hash, Google::Auth::Credentials] credentials The path to - # the keyfile as a String, the contents of the keyfile as a Hash, or a - # Google::Auth::Credentials object. (See {Spanner::Credentials}) - # If `emulator_host` is present, this becomes optional and the value is - # internally overriden with `:this_channel_is_insecure`. - # @param [String, Array] scope The OAuth 2.0 scopes controlling - # the set of resources and operations that the connection can access. - # See [Using OAuth 2.0 to Access Google - # APIs](https://developers.google.com/identity/protocols/OAuth2). - # - # The default scopes are: - # - # * `https://www.googleapis.com/auth/spanner` - # * `https://www.googleapis.com/auth/spanner.data` - # @param [Integer] timeout Default timeout to use in requests. Optional. - # @param [String] endpoint Override of the endpoint host name. Optional. - # If the param is nil, uses `emulator_host` or the default endpoint. - # @param [String] project Alias for the `project_id` argument. Deprecated. - # @param [String] keyfile Alias for the `credentials` argument. - # Deprecated. - # @param [String] emulator_host Spanner emulator host. Optional. - # If the param is nil, uses the value of the `emulator_host` config. - # @param [String] lib_name Library name. This will be added as a prefix - # to the API call tracking header `x-goog-api-client` with provided - # lib version for telemetry. Optional. For example prefix looks like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # @param [String] lib_version Library version. This will be added as a - # prefix to the API call tracking header `x-goog-api-client` with - # provided lib name for telemetry. Optional. For example prefix look like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # - # @return [Google::Cloud::Spanner::Project] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - def self.new project_id: nil, credentials: nil, scope: nil, timeout: nil, - endpoint: nil, project: nil, keyfile: nil, - emulator_host: nil, lib_name: nil, lib_version: nil - project_id ||= project || default_project_id - scope ||= configure.scope - timeout ||= configure.timeout - emulator_host ||= configure.emulator_host - endpoint ||= emulator_host || configure.endpoint - credentials ||= keyfile - lib_name ||= configure.lib_name - lib_version ||= configure.lib_version - - if emulator_host - credentials = :this_channel_is_insecure - else - credentials ||= default_credentials scope: scope - unless credentials.is_a? Google::Auth::Credentials - credentials = Spanner::Credentials.new credentials, scope: scope - end - - if credentials.respond_to? :project_id - project_id ||= credentials.project_id - end - end - - project_id = project_id.to_s # Always cast to a string - raise ArgumentError, "project_id is missing" if project_id.empty? - - Spanner::Project.new( - Spanner::Service.new( - project_id, credentials, quota_project: configure.quota_project, - host: endpoint, timeout: timeout, lib_name: lib_name, - lib_version: lib_version - ), - query_options: configure.query_options - ) - end - - # rubocop:enable Metrics/MethodLength,Metrics/AbcSize - - ## - # Configure the Google Cloud Spanner library. - # - # The following Spanner configuration parameters are supported: - # - # * `project_id` - (String) Identifier for a Spanner project. (The - # parameter `project` is considered deprecated, but may also be used.) - # * `credentials` - (String, Hash, Google::Auth::Credentials) The path to - # the keyfile as a String, the contents of the keyfile as a Hash, or a - # Google::Auth::Credentials object. (See {Spanner::Credentials}) (The - # parameter `keyfile` is considered deprecated, but may also be used.) - # * `scope` - (String, Array) The OAuth 2.0 scopes controlling - # the set of resources and operations that the connection can access. - # * `quota_project` - (String) The project ID for a project that can be - # used by client libraries for quota and billing purposes. - # * `timeout` - (Integer) Default timeout to use in requests. - # * `endpoint` - (String) Override of the endpoint host name, or `nil` - # to use the default endpoint. - # * `emulator_host` - (String) Host name of the emulator. Defaults to - # `ENV["SPANNER_EMULATOR_HOST"]`. - # * `lib_name` - (String) Override the lib name , or `nil` - # to use the default lib name without prefix in agent tracking - # header. - # * `lib_version` - (String) Override the lib version , or `nil` - # to use the default version lib name without prefix in agent - # tracking header. - # - # @return [Google::Cloud::Config] The configuration object the - # Google::Cloud::Spanner library uses. - # - def self.configure - yield Google::Cloud.configure.spanner if block_given? - - Google::Cloud.configure.spanner - end - - ## - # @private Default project. - def self.default_project_id - Google::Cloud.configure.spanner.project_id || - Google::Cloud.configure.project_id || - Google::Cloud.env.project_id - end - - ## - # @private Default credentials. - def self.default_credentials scope: nil - Google::Cloud.configure.spanner.credentials || - Google::Cloud.configure.credentials || - Spanner::Credentials.default(scope: scope) - end - end - end - - # @private - Spanner = Cloud::Spanner unless const_defined? :Spanner -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/admin/database.rb b/google-cloud-spanner/lib/google/cloud/spanner/admin/database.rb deleted file mode 100644 index 2cf6bbdc53ae..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/admin/database.rb +++ /dev/null @@ -1,324 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "google-cloud-spanner" -require "google/cloud/config" - -module Google - module Cloud - module Spanner - module Admin - module Database - ## - # Create a new client object for a DatabaseAdmin. - # - # This returns an instance of - # [Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client](https://googleapis.dev/ruby/google-cloud-spanner-admin-database-v1/latest/Google/Cloud/Spanner/Admin/Database/V1/DatabaseAdmin/Client.html) - # for version V1 of the API. - # - # ## About DatabaseAdmin - # - # Google Cloud Spanner Database Admin Service - # - # The Cloud Spanner Database Admin API can be used to create, drop, and - # list databases. It also enables updating the schema of pre-existing - # databases. It can be also used to create, delete and list backups for a - # database and to restore from an existing backup. - # - # For more information on connecting to Google Cloud see the - # {file:AUTHENTICATION.md Authentication Guide}. - # - # @param [String] project_id Project identifier for the Spanner service - # you are connecting to. If not present, the default project for the - # credentials is used. - # @param [String, Hash, Google::Auth::Credentials] credentials The path to - # the keyfile as a String, the contents of the keyfile as a Hash, or a - # Google::Auth::Credentials object. (See {Spanner::Credentials}) - # If `emulator_host` is present, this becomes optional and the value is - # internally overriden with `:this_channel_is_insecure`. - # @param [String, Array] scope The OAuth 2.0 scopes controlling - # the set of resources and operations that the connection can access. - # See [Using OAuth 2.0 to Access Google - # APIs](https://developers.google.com/identity/protocols/OAuth2). - # - # The default scopes are: - # - # * `https://www.googleapis.com/auth/spanner` - # * `https://www.googleapis.com/auth/spanner.data` - # @param [Integer] timeout Default timeout to use in requests. Optional. - # @param [String] endpoint Override of the endpoint host name. Optional. - # If the param is nil, uses `emulator_host` or the default endpoint. - # @param [String] project Alias for the `project_id` argument. Deprecated. - # @param [String] keyfile Alias for the `credentials` argument. - # Deprecated. - # @param [String] emulator_host Spanner emulator host. Optional. - # If the param is nil, uses the value of the `emulator_host` config. - # @param [String] lib_name Library name. This will be added as a prefix - # to the API call tracking header `x-goog-api-client` with provided - # lib version for telemetry. Optional. For example prefix looks like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # @param [String] lib_version Library version. This will be added as a - # prefix to the API call tracking header `x-goog-api-client` with - # provided lib name for telemetry. Optional. For example prefix look like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # - # @return [Admin::Database::V1::DatabaseAdmin::Client] A client object of version V1. - # - # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength - def self.database_admin project_id: nil, - credentials: nil, - scope: nil, - timeout: nil, - endpoint: nil, - project: nil, - keyfile: nil, - emulator_host: nil, - lib_name: nil, - lib_version: nil - project_id ||= project || default_project_id - scope ||= configure.scope - timeout ||= configure.timeout - emulator_host ||= configure.emulator_host - endpoint ||= emulator_host || configure.endpoint - credentials ||= keyfile - lib_name ||= configure.lib_name - lib_version ||= configure.lib_version - - if emulator_host - credentials = :this_channel_is_insecure - else - credentials ||= default_credentials scope: scope - unless credentials.is_a? Google::Auth::Credentials - credentials = Spanner::Credentials.new credentials, scope: scope - end - - if credentials.respond_to? :project_id - project_id ||= credentials.project_id - end - end - - project_id = project_id.to_s # Always cast to a string - raise ArgumentError, "project_id is missing" if project_id.empty? - - configure.quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = channel endpoint, credentials - config.quota_project = configure.quota_project - config.timeout = timeout if timeout - config.endpoint = endpoint if endpoint - config.lib_name = lib_name_with_prefix lib_name, lib_version - config.lib_version = Google::Cloud::Spanner::VERSION - config.metadata = { "google-cloud-resource-prefix" => "projects/#{project_id}" } - end - end - # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength - - ## - # Configure the Google Cloud Spanner Database Admin library. This configuration can be - # applied globally to all clients. - # - # @example - # - # Modify the global config, setting the timeout to 10 seconds for all admin databases. - # - # require "google/cloud/spanner/admin/database" - # - # ::Google::Cloud::Spanner::Admin::Database.configure do |config| - # config.timeout = 10.0 - # end - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `emulator_host` - (String) Host name of the emulator. Defaults to - # `ENV["SPANNER_EMULATOR_HOST"]`. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional gRPC headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Database::Configuration.new parent_config - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private Default project. - def self.default_project_id - Google::Cloud.configure.spanner.project_id || - Google::Cloud.configure.project_id || - Google::Cloud.env.project_id - end - - ## - # @private Default credentials. - def self.default_credentials scope: nil - Google::Cloud.configure.spanner.credentials || - Google::Cloud.configure.credentials || - Spanner::Credentials.default(scope: scope) - end - - ## - # @private gRPC channel. - def self.channel host, credentials - require "grpc" - GRPC::Core::Channel.new host, chan_args, chan_creds(credentials) - end - - ## - # @private gRPC channel args. - def self.chan_args - { "grpc.service_config_disable_resolution" => 1 } - end - - ## - # @private gRPC channel credentials - def self.chan_creds credentials - return credentials if credentials == :this_channel_is_insecure - require "grpc" - GRPC::Core::ChannelCredentials.new.compose \ - GRPC::Core::CallCredentials.new credentials.client.updater_proc - end - - ## - # @private Spanner client library version with the prefix. - def self.lib_name_with_prefix lib_name, lib_version - return "gccl" if [nil, "gccl"].include? lib_name - - value = lib_name.dup - value << "/#{lib_version}" if lib_version - value << " gccl" - end - - ## - # Configuration class for the Spanner Admin Database. - # - # This class provides control over timeouts, retry behavior, - # query options, and other low-level controls. - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"spanner.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - config_attr :endpoint, "spanner.googleapis.com", ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :project_id, nil, ::String, nil - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :quota_project, nil, ::String, nil - config_attr :emulator_host, nil, ::String, nil - config_attr :query_options, nil, ::Hash, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/admin/database/credentials.rb b/google-cloud-spanner/lib/google/cloud/spanner/admin/database/credentials.rb deleted file mode 100644 index d3bb3c0708f9..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/admin/database/credentials.rb +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/admin/database/v1/database_admin/credentials" - -module Google - module Cloud - module Spanner - module Admin - module Database - ## - # @deprecated Use version-specific credentials classes - # - Credentials = V1::DatabaseAdmin::Credentials - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/admin/instance.rb b/google-cloud-spanner/lib/google/cloud/spanner/admin/instance.rb deleted file mode 100644 index a8099292727c..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/admin/instance.rb +++ /dev/null @@ -1,324 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "google-cloud-spanner" -require "google/cloud/config" -require "gapic/config" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # Create a new client object for a InstanceAdmin. - # - # This returns an instance of - # Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client - # for version V1 of the API. - # - # ## About InstanceAdmin - # - # Google Cloud Spanner Instance Admin Service - # - # The Cloud Spanner Instance Admin API can be used to create, delete, - # modify and list instances. Instances are dedicated Cloud Spanner - # serving and storage resources to be used by Cloud Spanner databases. - # - # For more information on connecting to Google Cloud see the - # {file:AUTHENTICATION.md Authentication Guide}. - # - # @param [String] project_id Project identifier for the Spanner service - # you are connecting to. If not present, the default project for the - # credentials is used. - # @param [String, Hash, Google::Auth::Credentials] credentials The path to - # the keyfile as a String, the contents of the keyfile as a Hash, or a - # Google::Auth::Credentials object. (See {Spanner::Credentials}) - # If `emulator_host` is present, this becomes optional and the value is - # internally overriden with `:this_channel_is_insecure`. - # @param [String, Array] scope The OAuth 2.0 scopes controlling - # the set of resources and operations that the connection can access. - # See [Using OAuth 2.0 to Access Google - # APIs](https://developers.google.com/identity/protocols/OAuth2). - # - # The default scopes are: - # - # * `https://www.googleapis.com/auth/spanner` - # * `https://www.googleapis.com/auth/spanner.data` - # @param [Integer] timeout Default timeout to use in requests. Optional. - # @param [String] endpoint Override of the endpoint host name. Optional. - # If the param is nil, uses `emulator_host` or the default endpoint. - # @param [String] project Alias for the `project_id` argument. Deprecated. - # @param [String] keyfile Alias for the `credentials` argument. - # Deprecated. - # @param [String] emulator_host Spanner emulator host. Optional. - # If the param is nil, uses the value of the `emulator_host` config. - # @param [String] lib_name Library name. This will be added as a prefix - # to the API call tracking header `x-goog-api-client` with provided - # lib version for telemetry. Optional. For example prefix looks like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # @param [String] lib_version Library version. This will be added as a - # prefix to the API call tracking header `x-goog-api-client` with - # provided lib name for telemetry. Optional. For example prefix look like - # `spanner-activerecord/0.0.1 gccl/1.13.1`. Here, - # `spanner-activerecord/0.0.1` is provided custom library name and - # version and `gccl/1.13.1` represents the Cloud Spanner Ruby library - # with version. - # - # @return [Admin::Instance::V1::InstanceAdmin::Client] A client object of version V1. - # - # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength - def self.instance_admin project_id: nil, - credentials: nil, - scope: nil, - timeout: nil, - endpoint: nil, - project: nil, - keyfile: nil, - emulator_host: nil, - lib_name: nil, - lib_version: nil - project_id ||= project || default_project_id - scope ||= configure.scope - timeout ||= configure.timeout - emulator_host ||= configure.emulator_host - endpoint ||= emulator_host || configure.endpoint - credentials ||= keyfile - lib_name ||= configure.lib_name - lib_version ||= configure.lib_version - - if emulator_host - credentials = :this_channel_is_insecure - else - credentials ||= default_credentials scope: scope - unless credentials.is_a? Google::Auth::Credentials - credentials = Spanner::Credentials.new credentials, scope: scope - end - - if credentials.respond_to? :project_id - project_id ||= credentials.project_id - end - end - - project_id = project_id.to_s # Always cast to a string - raise ArgumentError, "project_id is missing" if project_id.empty? - - configure.quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id - - Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = channel endpoint, credentials - config.quota_project = configure.quota_project - config.timeout = timeout if timeout - config.endpoint = endpoint if endpoint - config.lib_name = lib_name_with_prefix lib_name, lib_version - config.lib_version = Google::Cloud::Spanner::VERSION - config.metadata = { "google-cloud-resource-prefix" => "projects/#{project_id}" } - end - end - # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength - - ## - # Configure the Google Cloud Spanner Instance Admin library. This configuration can be - # applied globally to all clients. - # - # @example - # - # Modify the global config, setting the timeout to 10 seconds for all admin instances. - # - # require "google/cloud/spanner/admin/instance" - # - # ::Google::Cloud::Spanner::Admin::Instance.configure do |config| - # config.timeout = 10.0 - # end - # - # The following configuration parameters are supported: - # - # * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) - - # The path to the keyfile as a String, the contents of the keyfile as a - # Hash, or a Google::Auth::Credentials object. - # * `lib_name` (*type:* `String`) - - # The library name as recorded in instrumentation and logging. - # * `lib_version` (*type:* `String`) - - # The library version as recorded in instrumentation and logging. - # * `interceptors` (*type:* `Array`) - - # An array of interceptors that are run before calls are executed. - # * `timeout` (*type:* `Numeric`) - - # Default timeout in seconds. - # * `emulator_host` - (String) Host name of the emulator. Defaults to - # `ENV["SPANNER_EMULATOR_HOST"]`. - # * `metadata` (*type:* `Hash{Symbol=>String}`) - - # Additional gRPC headers to be sent with the call. - # * `retry_policy` (*type:* `Hash`) - - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - - # The error codes that should trigger a retry. - # - # @return [::Google::Cloud::Config] The default configuration used by this library - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Spanner"] - parent_config = while namespace.any? - parent_name = namespace.join "::" - parent_const = const_get parent_name - break parent_const.configure if parent_const.respond_to? :configure - namespace.pop - end - - default_config = Instance::Configuration.new parent_config - default_config - end - yield @configure if block_given? - @configure - end - - ## - # @private Default project. - def self.default_project_id - Google::Cloud.configure.spanner.project_id || - Google::Cloud.configure.project_id || - Google::Cloud.env.project_id - end - - ## - # @private Default credentials. - def self.default_credentials scope: nil - Google::Cloud.configure.spanner.credentials || - Google::Cloud.configure.credentials || - Spanner::Credentials.default(scope: scope) - end - - ## - # @private gRPC channel. - def self.channel host, credentials - require "grpc" - GRPC::Core::Channel.new host, chan_args, chan_creds(credentials) - end - - ## - # @private gRPC channel args. - def self.chan_args - { "grpc.service_config_disable_resolution" => 1 } - end - - ## - # @private gRPC channel credentials - def self.chan_creds credentials - return credentials if credentials == :this_channel_is_insecure - require "grpc" - GRPC::Core::ChannelCredentials.new.compose \ - GRPC::Core::CallCredentials.new credentials.client.updater_proc - end - - ## - # @private Spanner client library version with the prefix. - def self.lib_name_with_prefix lib_name, lib_version - return "gccl" if [nil, "gccl"].include? lib_name - - value = lib_name.dup - value << "/#{lib_version}" if lib_version - value << " gccl" - end - - ## - # Configuration class for the Spanner Admin Instance. - # - # This class provides control over timeouts, retry behavior, - # query options, and other low-level controls. - # - # @!attribute [rw] endpoint - # The hostname or hostname:port of the service endpoint. - # Defaults to `"spanner.googleapis.com"`. - # @return [::String] - # @!attribute [rw] credentials - # Credentials to send with calls. You may provide any of the following types: - # * (`String`) The path to a service account key file in JSON format - # * (`Hash`) A service account key as a Hash - # * (`Google::Auth::Credentials`) A googleauth credentials object - # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) - # * (`Signet::OAuth2::Client`) A signet oauth2 client object - # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) - # * (`GRPC::Core::Channel`) a gRPC channel with included credentials - # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object - # * (`nil`) indicating no credentials - # @return [::Object] - # @!attribute [rw] scope - # The OAuth scopes - # @return [::Array<::String>] - # @!attribute [rw] lib_name - # The library name as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] lib_version - # The library version as recorded in instrumentation and logging - # @return [::String] - # @!attribute [rw] interceptors - # An array of interceptors that are run before calls are executed. - # @return [::Array<::GRPC::ClientInterceptor>] - # @!attribute [rw] timeout - # The call timeout in seconds. - # @return [::Numeric] - # @!attribute [rw] metadata - # Additional gRPC headers to be sent with the call. - # @return [::Hash{::Symbol=>::String}] - # @!attribute [rw] retry_policy - # The retry policy. The value is a hash with the following keys: - # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. - # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. - # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (*type:* `Array`) - The error codes that should - # trigger a retry. - # @return [::Hash] - # @!attribute [rw] quota_project - # A separate project against which to charge quota. - # @return [::String] - # - class Configuration - extend ::Gapic::Config - - config_attr :endpoint, "spanner.googleapis.com", ::String - config_attr :credentials, nil do |value| - allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] - allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC - allowed.any? { |klass| klass === value } - end - config_attr :project_id, nil, ::String, nil - config_attr :scope, nil, ::String, ::Array, nil - config_attr :lib_name, nil, ::String, nil - config_attr :lib_version, nil, ::String, nil - config_attr :interceptors, nil, ::Array, nil - config_attr :timeout, nil, ::Numeric, nil - config_attr :quota_project, nil, ::String, nil - config_attr :emulator_host, nil, ::String, nil - config_attr :query_options, nil, ::Hash, nil - config_attr :metadata, nil, ::Hash, nil - config_attr :retry_policy, nil, ::Hash, nil - - # @private - def initialize parent_config = nil - @parent_config = parent_config unless parent_config.nil? - - yield self if block_given? - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/admin/instance/credentials.rb b/google-cloud-spanner/lib/google/cloud/spanner/admin/instance/credentials.rb deleted file mode 100644 index acf557d98365..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/admin/instance/credentials.rb +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/admin/instance/v1/instance_admin/credentials" - -module Google - module Cloud - module Spanner - module Admin - module Instance - ## - # @deprecated Use version-specific credentials classes - # - Credentials = V1::InstanceAdmin::Credentials - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/backup.rb b/google-cloud-spanner/lib/google/cloud/spanner/backup.rb deleted file mode 100644 index 3c649db983a7..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/backup.rb +++ /dev/null @@ -1,400 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/backup/job" -require "google/cloud/spanner/backup/list" -require "google/cloud/spanner/backup/restore/job" - -module Google - module Cloud - module Spanner - ## - # # Backup - # - # NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for - # mananging backups will only be available through the - # [google-cloud-spanner-admin-database-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-database-v1) - # client. See the - # [README](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner#google-cloud-spanner) - # for further details. - # - # A backup is a representation of Cloud Spanner database backup. - # - # See {Google::Cloud::Spanner::Instance#backups}, - # {Google::Cloud::Spanner::Instance#backup}, and - # {Google::Cloud::Spanner::Database#create_backup}. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin} - # instead. - # - # @example - # require "google/cloud" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # backup = job.backup - # end - # - class Backup - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private Creates a new Backup instance. - def initialize grpc, service - @grpc = grpc - @service = service - end - - ## - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.name.split("/")[1] - end - - ## - # The unique identifier for the instance. - # @return [String] - def instance_id - @grpc.name.split("/")[3] - end - - ## - # The unique identifier for the backup. - # @return [String] - def backup_id - @grpc.name.split("/")[5] - end - - ## - # Name of the database from which this backup was created. - # @return [String] - def database_id - @grpc.database.split("/")[5] - end - - # Encryption information for a given resource. - # @return [Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo, nil] - def encryption_info - @grpc.encryption_info - end - - ## - # The full path for the backup. Values are of the form - # `projects//instances//backups/`. - # @return [String] - def path - @grpc.name - end - - ## - # The current backup state. Possible values are `:CREATING` and - # `:READY`. - # @return [Symbol] - def state - @grpc.state - end - - ## - # The backup is still being created. A backup is not yet available - # for the database restore operation. - # @return [Boolean] - def creating? - state == :CREATING - end - - ## - # The backup is created and can be used to restore a database. - # @return [Boolean] - def ready? - state == :READY - end - - ## - # The expiration time of the backup, with microseconds granularity. - # @return [Time] - def expire_time - Convert.timestamp_to_time @grpc.expire_time - end - - ## - # Update backup expiration time. - # - # Set expiration time of the backup, with microseconds granularity - # that must be at least 6 hours and at most 366 days from the time the - # request is received. Once the `expire_time` has passed, Cloud Spanner - # will delete the backup and free the resources used by the backup. - # - # @param [Time] time Backup expiration time. - # @raise [Google::Cloud::Error] if expire time is in past or update - # call is aborted. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # backup.expire_time = Time.now + 36000 - # puts backup.expire_time - # - def expire_time= time - ensure_service! - - expire_time_was = @grpc.expire_time - @grpc.expire_time = Convert.time_to_timestamp time - update_mask = Google::Protobuf::FieldMask.new paths: ["expire_time"] - @grpc = service.update_backup @grpc, update_mask - rescue Google::Cloud::Error => e - @grpc.expire_time = expire_time_was - raise e - end - - ## - # The timestamp when a consistent copy of the database for the backup was - # taken. The version time has microseconds granularity. - # @return [Time] - def version_time - Convert.timestamp_to_time @grpc.version_time - end - - ## - # Create time is approximately the time when the backup request was - # received. - # @return [Time] - def create_time - Convert.timestamp_to_time @grpc.create_time - end - - ## - # Size of the backup in bytes. - # @return [Integer] - def size_in_bytes - @grpc.size_bytes - end - - ## - # The instances of the restored databases that reference the backup. - # Referencing databases may exist in different instances. - # The existence of any referencing database prevents the backup from - # being deleted. When a restored database from the backup enters the - # `READY` state, the reference to the backup is removed. - # - # @return [Array] Returns list of - # referencing database instances. - # - # @example - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # - # backup.referencing_databases.each do |database| - # puts database.database_id - # end - # - def referencing_databases - ensure_service! - - @grpc.referencing_databases.map do |referencing_database| - segments = referencing_database.split "/" - database_grpc = service.get_database segments[3], segments[5] - Database.from_grpc database_grpc, service - end - end - - ## - # Permanently deletes the backup. - # - # @return [Boolean] Returns `true` if the backup was deleted. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # backup.delete # true - # - def delete - ensure_service! - service.delete_backup instance_id, backup_id - true - end - - ## - # Restores deleted database from the backup. - # - # @param [String] database_id The unique identifier for the database, - # which cannot be changed after the database is created. Values are of - # the form `[a-z][a-z0-9_\-]*[a-z0-9]` and must be between 2 and 30 - # characters in length. Required. - # @param [String] instance_id The name of the instance in which to - # create the restored database. This instance must be in the same - # project and have the same instance configuration as the instance - # containing the source backup. Optional. Default value is same as a - # backup instance. - # @param [Hash] encryption_config An encryption configuration describing - # the encryption type and key resources in Cloud KMS used to - # encrypt/decrypt the database to restore to. If this field is not - # specified, the restored database will use the same encryption - # configuration as the backup by default. Optional. The following - # settings can be provided: - # - # * `:kms_key_name` (String) The name of KMS key to use which should - # be the full path, e.g., `projects//locations/\ - # /keyRings//cryptoKeys/` - # This field should be set only when encryption type - # `:CUSTOMER_MANAGED_ENCRYPTION`. - # * `:encryption_type` (Symbol) The encryption type of the backup. - # Valid values are: - # 1. `:USE_CONFIG_DEFAULT_OR_BACKUP_ENCRYPTION` - This is the default - # option when config is not specified. - # 2. `:GOOGLE_DEFAULT_ENCRYPTION` - Google default encryption. - # 3. `:CUSTOMER_MANAGED_ENCRYPTION` - Use customer managed encryption. - # If specified, `:kms_key_name` must contain a valid Cloud KMS key. - # - # @raise [ArgumentError] if `:CUSTOMER_MANAGED_ENCRYPTION` specified without - # customer managed kms key. - # - # @return [Database] Restored database. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - # @example Restore database in provided instance id - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore( - # "my-restored-database", - # instance_id: "other-instance" - # ) - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - # @example Restore database with encryption config - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # kms_key_name = "projects//locations//keyRings//cryptoKeys/" - # encryption_config = { - # kms_key_name: kms_key_name, - # encryption_type: :CUSTOMER_MANAGED_ENCRYPTION - # } - # job = backup.restore( - # "my-restored-database", - # encryption_config: encryption_config - # ) - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - def restore database_id, instance_id: nil, encryption_config: nil - ensure_service! - - instance_id ||= self.instance_id - - if encryption_config&.include?(:kms_key_name) && - encryption_config[:encryption_type] != :CUSTOMER_MANAGED_ENCRYPTION - raise Google::Cloud::InvalidArgumentError, - "kms_key_name only used with CUSTOMER_MANAGED_ENCRYPTION" - end - - grpc = service.restore_database \ - self.instance_id, - backup_id, - instance_id, - database_id, - encryption_config: encryption_config - Restore::Job.from_grpc grpc, service - end - - ## - # @private - # Creates a new Backup instance from a - # `Google::Cloud::Spanner::Admin::Database::V1::Backup`. - def self.from_grpc grpc, service - new grpc, service - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless service - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/backup/job.rb b/google-cloud-spanner/lib/google/cloud/spanner/backup/job.rb deleted file mode 100644 index 2c0df5b56500..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/backup/job.rb +++ /dev/null @@ -1,281 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/status" -require "google/cloud/spanner/backup/job/list" - -module Google - module Cloud - module Spanner - class Backup - ## - # # Job - # - # A resource representing the long-running, asynchronous processing of - # backup creation. The job can be refreshed to retrieve the backup - # object once the operation has been completed. - # - # See {Google::Cloud::Spanner::Database#create_backup} - # - # @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation - # Long-running Operation - # - # @deprecated Use the long-running operation returned by - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_backup} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # backup = job.backup - # end - # - class Job - ## - # @private The `Gapic::Operation` gRPC object. - attr_accessor :grpc - - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private Creates a new Backup::Job instance. - def initialize - @grpc = nil - @service = nil - end - - ## - # The backup is the object of the operation. - # - # @return [Backup, nil] The backup, or - # `nil` if the operation is not complete. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.reload! - # job.done? #=> true - # backup = job.backup - # - def backup - return nil unless done? - return nil unless @grpc.grpc_op.result == :response - Backup.from_grpc @grpc.results, service - end - - ## - # Checks if the processing of the backup operation is complete. - # - # @return [boolean] `true` when complete, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # - def done? - @grpc.done? - end - - ## - # Checks if the processing of the backup operation has errored. - # - # @return [boolean] `true` when errored, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.error? #=> false - # - def error? - @grpc.error? - end - - ## - # The status if the operation associated with this job produced an - # error. - # - # @return [Google::Cloud::Spanner::Status, nil] A status object with - # the status code and message, or `nil` if no error occurred. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.error? # true - # - # error = job.error - # - def error - return nil unless error? - Google::Cloud::Spanner::Status.from_grpc @grpc.error - end - - ## - # Reloads the job with current data from the long-running, - # asynchronous processing of a backup operation. - # - # @return [Google::Cloud::Spanner::Backup::Job] The same job - # instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - def reload! - @grpc.reload! - self - end - alias refresh! reload! - - ## - # Reloads the job until the operation is complete. The delay between - # reloads will incrementally increase. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.wait_until_done! - # job.done? #=> true - # - def wait_until_done! - @grpc.wait_until_done! - end - - ## - # Cancel the backup job. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # expire_time = Time.now + 36000 - # job = database.create_backup "my-backup", expire_time - # - # job.done? #=> false - # job.cancel - # - def cancel - @grpc.cancel - end - - ## - # The operation progress in percentage. - # - # @return [Integer] - def progress_percent - @grpc.metadata.progress.progress_percent - end - - ## - # The operation start time. - # - # @return [Time, nil] - def start_time - return nil unless @grpc.metadata.progress.start_time - Convert.timestamp_to_time @grpc.metadata.progress.start_time - end - - ## - # The operation end time. - # - # @return [Time, nil] - def end_time - return nil unless @grpc.metadata.progress.end_time - Convert.timestamp_to_time @grpc.metadata.progress.end_time - end - - ## - # The operation canceled time. - # - # @return [Time, nil] - def cancel_time - return nil unless @grpc.metadata.cancel_time - Convert.timestamp_to_time @grpc.metadata.cancel_time - end - - ## - # @private New Backup::Job from a `Gapic::Operation` object. - def self.from_grpc grpc, service - new.tap do |job| - job.instance_variable_set :@grpc, grpc - job.instance_variable_set :@service, service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/backup/job/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/backup/job/list.rb deleted file mode 100644 index a15d541bbb5a..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/backup/job/list.rb +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Backup - class Job - ## - # # List - # - # List is a special case Array with additional values for backup - # operations. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_backup_operations} - # instead. - # - class List < DelegateClass(::Array) - # @private - # The gRPC Service object. - attr_accessor :service - - # @private - # The gRPC page enumerable object. - attr_accessor :grpc - - ## - # @private Create a new Backup::Job::List with an array of - # Google::Lognrunning::Operation instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of backup jobs. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # if jobs.next? - # next_jobs = jobs.next - # end - # - def next? - grpc.next_page? - end - - ## - # Retrieve the next page of backup jobs. - # - # @return [Backup::Job::List] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # if jobs.next? - # next_jobs = jobs.next - # end - # - def next - ensure_service! - - return nil unless next? - grpc.next_page - self.class.from_grpc grpc, service - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining - # results are retrieved. (Unlike `#each`, for example, which merely - # iterates over the results returned by a single API call.) Use with - # caution. - # - # @yield [job] The block for accessing each backup job. - # @yieldparam [Google::Cloud::Spanner::Backup::Job] job The backup - # job object. - # - # @return [Enumerator] - # - # @example Iterating each backup job by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # jobs.all do |job| - # puts job.backup.backup_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # all_backup_ids = jobs.all.map do |job| - # job.backup.backup_id - # end - # - def all &block - return enum_for :all unless block_given? - - results = self - loop do - results.each(&block) - break unless next? - grpc.next_page - results = self.class.from_grpc grpc, service - end - end - - ## - # @private - # - # New Backup::Job::List from a - # `Gapic::PagedEnumerable` - # object. Operation object is a backup operation. - # - def self.from_grpc grpc, service - operations_client = \ - service.databases.instance_variable_get "@operations_client" - jobs = new(Array(grpc.response.operations).map do |job_grpc| - Job.from_grpc \ - Gapic::Operation.new(job_grpc, operations_client), - service - end) - jobs.grpc = grpc - jobs.service = service - jobs - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/backup/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/backup/list.rb deleted file mode 100644 index 47fd7b94e21f..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/backup/list.rb +++ /dev/null @@ -1,176 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Backup - ## - # # List - # - # Google::Cloud::Spanner::Backup::List is a special case Array with - # additional values. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_backups} - # instead. - # - class List < DelegateClass(::Array) - # @private - # The gRPC Service object. - attr_accessor :service - - # @private - # The gRPC page enumerable object. - attr_accessor :grpc - - ## - # @private Create a new Backup::List with an array of - # Backup instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of backups. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backups = instance.backups - # - # if backups.next? - # next_backups = backups.next - # end - # - def next? - grpc.next_page? - end - - ## - # Retrieve the next page of backups. - # - # @return [Google::Cloud::Spanner::Backup::List] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backups = instance.backups - - # if backups.next? - # next_backups = backups.next - # end - # - def next - ensure_service! - - return nil unless next? - grpc.next_page - self.class.from_grpc grpc, service - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining results - # are retrieved. (Unlike `#each`, for example, which merely iterates - # over the results returned by a single API call.) Use with caution. - # - # @yield [backup] The block for accessing each backup. - # @yieldparam [Google::Cloud::Spanner::Backup] backup The backup - # object. - # - # @return [Enumerator] - # - # @example Iterating each backup by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backups = instance.backups - # - # backups.all do |backup| - # puts backup.backup_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backups = instance.backups - # - # all_backup_ids = backups.all.map do |backup| - # backup.backup_id - # end - # - def all &block - return enum_for :all unless block_given? - - results = self - loop do - results.each(&block) - break unless next? - grpc.next_page - results = self.class.from_grpc grpc, service - end - end - - ## - # @private - # New Backup::List from a - # `Gapic::PagedEnumerable` - # object. - def self.from_grpc grpc, service - backups = List.new(Array(grpc.response.backups).map do |backup| - Backup.from_grpc backup, service - end) - - backups.grpc = grpc - backups.service = service - backups - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/backup/restore/job.rb b/google-cloud-spanner/lib/google/cloud/spanner/backup/restore/job.rb deleted file mode 100644 index 448a1f352759..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/backup/restore/job.rb +++ /dev/null @@ -1,253 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/status" - -module Google - module Cloud - module Spanner - class Backup - class Restore - ## - # # Job - # - # A resource representing the long-running, asynchronous processing of - # a backup restore. The job can be refreshed to retrieve the restored - # database object once the operation has been completed. - # - # See {Backup#restore} - # - # @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation - # Long-running Operation - # - # @deprecated Use the long-running operation returned by - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#restore_database} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - class Job - ## - # @private The `Gapic::Operation` gRPC object. - attr_accessor :grpc - - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private Creates a new Restore::Job instance. - def initialize - @grpc = nil - @service = nil - end - - ## - # The database is the object of the operation. - # - # @return [Database, nil] The database instance, or - # `nil` if the operation is not complete. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # job.reload! - # job.done? #=> true - # database = job.database - # - def database - return nil unless done? - return nil unless @grpc.grpc_op.result == :response - Database.from_grpc @grpc.results, service - end - - ## - # Checks if the processing of the restore operation is complete. - # - # @return [boolean] `true` when complete, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # - def done? - @grpc.done? - end - - ## - # Checks if the processing of the restore operation has errored. - # - # @return [boolean] `true` when errored, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.error? #=> false - # - def error? - @grpc.error? - end - - ## - # The status if the operation associated with this job produced an - # error. - # - # @return [Google::Cloud::Spanner::Status, nil] A status object with - # the status code and message, or `nil` if no error occurred. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.error? # true - # - # error = job.error - # - def error - return nil unless error? - Google::Cloud::Spanner::Status.from_grpc @grpc.error - end - - ## - # Reloads the job with current data from the long-running, - # asynchronous processing of a restore operation. - # - # @return [Backup::Job] The same job instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - def reload! - @grpc.reload! - self - end - alias refresh! reload! - - ## - # Reloads the job until the operation is complete. The delay between - # reloads will incrementally increase. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # job = backup.restore "my-restored-database" - # - # job.done? #=> false - # job.wait_until_done! - # job.done? #=> true - # - def wait_until_done! - @grpc.wait_until_done! - end - - ## - # The operation progress in percentage. - # - # @return [Integer] - def progress_percent - @grpc.metadata.progress.progress_percent - end - - ## - # The operation start time. - # - # @return [Time, nil] - def start_time - return nil unless @grpc.metadata.progress.start_time - Convert.timestamp_to_time @grpc.metadata.progress.start_time - end - - ## - # The operation end time. - # - # @return [Time, nil] - def end_time - return nil unless @grpc.metadata.progress.end_time - Convert.timestamp_to_time @grpc.metadata.progress.end_time - end - - ## - # @private New Restore::Job from a `Gapic::Operation` object. - def self.from_grpc grpc, service - new.tap do |job| - job.instance_variable_set :@grpc, grpc - job.instance_variable_set :@service, service - end - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/batch_client.rb b/google-cloud-spanner/lib/google/cloud/spanner/batch_client.rb deleted file mode 100644 index e58f8c47acc6..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/batch_client.rb +++ /dev/null @@ -1,433 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/project" -require "google/cloud/spanner/session" -require "google/cloud/spanner/batch_snapshot" - -module Google - module Cloud - module Spanner - ## - # # BatchClient - # - # Provides a batch client that can be used to read data from a Cloud - # Spanner database. An instance of this class is tied to a specific - # database. - # - # BatchClient is useful when one wants to read or query a large amount of - # data from Cloud Spanner across multiple processes, even across different - # machines. It allows to create partitions of Cloud Spanner database and - # then read or query over each partition independently yet at the same - # snapshot. - # - # See {Google::Cloud::Spanner::Project#batch_client}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - class BatchClient - ## - # @private Creates a new Spanner BatchClient instance. - def initialize project, instance_id, database_id, session_labels: nil, - query_options: nil - @project = project - @instance_id = instance_id - @database_id = database_id - @session_labels = session_labels - @query_options = query_options - end - - # The unique identifier for the project. - # @return [String] - def project_id - @project.service.project - end - - # The unique identifier for the instance. - # @return [String] - def instance_id - @instance_id - end - - # The unique identifier for the database. - # @return [String] - def database_id - @database_id - end - - # The Spanner project connected to. - # @return [Project] - def project - @project - end - - # The Spanner instance connected to. - # @return [Instance] - def instance - @project.instance instance_id - end - - # The Spanner database connected to. - # @return [Database] - def database - @project.database instance_id, database_id - end - - ## - # Returns a {BatchSnapshot} context in which multiple reads and/or - # queries can be performed. All reads/queries will use the same - # timestamp, and the timestamp can be inspected after this transaction - # is created successfully. This is a blocking method since it waits to - # finish the RPCs. - # - # @param [true, false] strong Read at a timestamp where all previously - # committed transactions are visible. - # @param [Time, DateTime] timestamp Executes all reads at the given - # timestamp. Unlike other modes, reads at a specific timestamp are - # repeatable; the same read at the same timestamp always returns the - # same data. If the timestamp is in the future, the read will block - # until the specified timestamp, modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or for - # coordinating many reads against a consistent snapshot of the data. - # (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # @param [Time, DateTime] read_timestamp Same as `timestamp`. - # @param [Numeric] staleness Executes all reads at a timestamp that is - # `staleness` seconds old. For example, the number 10.1 is translated - # to 10 seconds and 100 milliseconds. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud Spanner - # chooses the exact timestamp, this mode works even if the client's - # local clock is substantially skewed from Cloud Spanner commit - # timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of single-use `staleness`. (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # @param [Numeric] exact_staleness Same as `staleness`. - # - # @yield [snapshot] The block for reading and writing data. - # @yieldparam [Google::Cloud::Spanner::Snapshot] snapshot The Snapshot - # object. - # - # @return [Google::Cloud::Spanner::BatchSnapshot] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def batch_snapshot strong: nil, timestamp: nil, read_timestamp: nil, - staleness: nil, exact_staleness: nil - validate_snapshot_args! strong: strong, timestamp: timestamp, - read_timestamp: read_timestamp, - staleness: staleness, - exact_staleness: exact_staleness - - ensure_service! - snp_session = session - snp_grpc = @project.service.create_snapshot \ - snp_session.path, strong: strong, - timestamp: (timestamp || read_timestamp), - staleness: (staleness || exact_staleness) - BatchSnapshot.from_grpc snp_grpc, snp_session - end - - ## - # Returns a {BatchSnapshot} context in which multiple reads and/or - # queries can be performed. All reads/queries will use the same - # timestamp, and the timestamp can be inspected after this transaction - # is created successfully. This method does not perform an RPC. - # - # @param [String] serialized_snapshot The serialized representation of - # an existing batch snapshot. See {BatchSnapshot#dump}. - # - # @return [Google::Cloud::Spanner::BatchSnapshot] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def load_batch_snapshot serialized_snapshot - ensure_service! - - BatchSnapshot.load serialized_snapshot, service: @project.service, query_options: @query_options - end - - ## - # Returns a {Partition} from a serialized representation. See - # {Partition.load}. - # - # @param [String] serialized_partition The serialized representation of - # an existing batch partition. See {Partition#dump}. - # - # @return [Google::Cloud::Spanner::Partition] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def load_partition serialized_partition - Partition.load serialized_partition - end - - ## - # Creates a configuration object ({Fields}) that may be provided to - # queries or used to create STRUCT objects. (The STRUCT will be - # represented by the {Data} class.) See {Client#execute} and/or - # {Fields#struct}. - # - # For more information, see [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] types Accepts an array or hash types. - # - # Arrays can contain just the type value, or a sub-array of the - # field's name and type value. Hash keys must contain the field name - # as a `Symbol` or `String`, or the field position as an `Integer`. - # Hash values must contain the type value. If a Hash is used the - # fields will be created using the same order as the Hash keys. - # - # Supported type values incude: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @return [Fields] The fields of the given types. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # named_type = batch_client.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # anon_type = batch_client.fields [:INT64, :STRING, :BOOL] - # anon_data = anon_type.struct [42, nil, false] - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # dup_type = batch_client.fields( - # [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # ) - # dup_data = dup_type.struct [42, nil, false] - # - def fields types - Fields.new types - end - - ## - # Creates a Spanner Range. This can be used in place of a Ruby Range - # when needing to exclude the beginning value. - # - # @param [Object] beginning The object that defines the beginning of the - # range. - # @param [Object] ending The object that defines the end of the range. - # @param [Boolean] exclude_begin Determines if the range excludes its - # beginning value. Default is `false`. - # @param [Boolean] exclude_end Determines if the range excludes its - # ending value. Default is `false`. - # - # @return [Google::Cloud::Spanner::Range] The new Range instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # key_range = batch_client.range 1, 100 - # - # partitions = batch_snapshot.partition_read "users", [:id, :name], - # keys: key_range - # - def range beginning, ending, exclude_begin: false, exclude_end: false - Range.new beginning, ending, - exclude_begin: exclude_begin, - exclude_end: exclude_end - end - - # @private - def to_s - "(project_id: #{project_id}, instance_id: #{instance_id}, " \ - "database_id: #{database_id})" - end - - # @private - def inspect - "#<#{self.class.name} #{self}>" - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless @project.service - end - - ## - # New session for each use. - def session - ensure_service! - grpc = @project.service.create_session \ - V1::Spanner::Paths.database_path( - project: project_id, instance: instance_id, database: database_id - ), - labels: @session_labels - Session.from_grpc grpc, @project.service, query_options: @query_options - end - - ## - # Check for valid snapshot arguments - def validate_snapshot_args! strong: nil, - timestamp: nil, read_timestamp: nil, - staleness: nil, exact_staleness: nil - valid_args_count = [strong, timestamp, read_timestamp, staleness, - exact_staleness].compact.count - return true if valid_args_count <= 1 - raise ArgumentError, - "Can only provide one of the following arguments: " \ - "(strong, timestamp, read_timestamp, staleness, " \ - "exact_staleness)" - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/batch_snapshot.rb b/google-cloud-spanner/lib/google/cloud/spanner/batch_snapshot.rb deleted file mode 100644 index d8536e0ac2c0..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/batch_snapshot.rb +++ /dev/null @@ -1,822 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/convert" -require "google/cloud/spanner/session" -require "google/cloud/spanner/partition" -require "google/cloud/spanner/results" -require "json" -require "base64" - -module Google - module Cloud - module Spanner - ## - # # BatchSnapshot - # - # Represents a read-only transaction that can be configured to read at - # timestamps in the past and allows for exporting arbitrarily large - # amounts of data from Cloud Spanner databases. This is a snapshot which - # additionally allows to partition a read or query request. The read/query - # request can then be executed independently over each partition while - # observing the same snapshot of the database. A BatchSnapshot can also be - # shared across multiple processes/machines by passing around its - # serialized value and then recreating the transaction using {#dump}. - # - # Unlike locking read-write transactions, BatchSnapshot will never abort. - # They can fail if the chosen read timestamp is garbage collected; however - # any read or query activity within an hour on the transaction avoids - # garbage collection and most applications do not need to worry about this - # in practice. - # - # See {BatchClient#batch_snapshot} and {BatchClient#load_batch_snapshot}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # results = batch_snapshot.execute_partition partition - # - # batch_snapshot.close - # - class BatchSnapshot - # @private The transaction grpc object. - attr_reader :grpc - - # @private The Session object. - attr_reader :session - - ## - # @private Creates a BatchSnapshot object. - def initialize grpc, session - @grpc = grpc - @session = session - end - - ## - # Identifier of the batch snapshot transaction. - # @return [String] The transaction id. - def transaction_id - return nil if grpc.nil? - grpc.id - end - - ## - # The read timestamp chosen for batch snapshot. - # @return [Time] The chosen timestamp. - def timestamp - return nil if grpc.nil? - Convert.timestamp_to_time grpc.read_timestamp - end - - ## - # Returns a list of {Partition} objects to execute a batch query against - # a database. - # - # These partitions can be executed across multiple processes, even - # across different machines. The partition size and count can be - # configured, although the values given may not necessarily be honored - # depending on the query and options in the request. - # - # The query must have a single [distributed - # union](https://cloud.google.com/spanner/docs/query-execution-operators#distributed_union) - # operator at the root of the query plan. Such queries are - # root-partitionable. If a query cannot be partitioned at the root, - # Cloud Spanner cannot achieve the parallelism and in this case - # partition generation will fail. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Integer] partition_size_bytes The desired data size for each - # partition generated. This is only a hint. The actual size of each - # partition may be smaller or larger than this size request. - # @param [Integer] max_partitions The desired maximum number of - # partitions to return. For example, this may be set to the number of - # workers available. This is only a hint and may provide different - # results based on the request. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Array] The partitions - # created by the query partition. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # sql = "SELECT u.id, u.active FROM users AS u \ - # WHERE u.id < 2000 AND u.active = false" - # partitions = batch_snapshot.partition_query sql - # - # partition = partitions.first - # results = batch_snapshot.execute_partition partition - # - # batch_snapshot.close - # - def partition_query sql, params: nil, types: nil, - partition_size_bytes: nil, max_partitions: nil, - query_options: nil, call_options: nil - ensure_session! - - params, types = Convert.to_input_params_and_types params, types - - results = session.partition_query \ - sql, tx_selector, params: params, types: types, - partition_size_bytes: partition_size_bytes, - max_partitions: max_partitions, - call_options: call_options - results.partitions.map do |grpc| - # Convert partition protos to execute sql request protos - execute_sql_grpc = V1::ExecuteSqlRequest.new( - { - session: session.path, - sql: sql, - params: params, - param_types: types, - transaction: tx_selector, - partition_token: grpc.partition_token, - query_options: query_options - }.delete_if { |_, v| v.nil? } - ) - Partition.from_execute_sql_grpc execute_sql_grpc - end - end - - ## - # Returns a list of {Partition} objects to read zero or more rows from a - # database. - # - # These partitions can be executed across multiple processes, even - # across different machines. The partition size and count can be - # configured, although the values given may not necessarily be honored - # depending on the query and options in the request. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] partition_size_bytes The desired data size for each - # partition generated. This is only a hint. The actual size of each - # partition may be smaller or larger than this size request. - # @param [Integer] max_partitions The desired maximum number of - # partitions to return. For example, this may be set to the number of - # workers available. This is only a hint and may provide different - # results based on the request. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Array] The partitions - # created by the read partition. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # results = batch_snapshot.execute_partition partition - # - # batch_snapshot.close - # - def partition_read table, columns, keys: nil, index: nil, - partition_size_bytes: nil, max_partitions: nil, - call_options: nil - ensure_session! - - columns = Array(columns).map(&:to_s) - keys = Convert.to_key_set keys - - results = session.partition_read \ - table, columns, tx_selector, - keys: keys, index: index, - partition_size_bytes: partition_size_bytes, - max_partitions: max_partitions, - call_options: call_options - - results.partitions.map do |grpc| - # Convert partition protos to read request protos - read_grpc = V1::ReadRequest.new( - { - session: session.path, - table: table, - columns: columns, - key_set: keys, - index: index, - transaction: tx_selector, - partition_token: grpc.partition_token - }.delete_if { |_, v| v.nil? } - ) - Partition.from_read_grpc read_grpc - end - end - - ## - # Execute the partition to return a {Results}. The result returned - # could be zero or more rows. The row metadata may be absent if no rows - # are returned. - # - # @param [Google::Cloud::Spanner::Partition] partition The partition to - # be executed. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # results = batch_snapshot.execute_partition partition - # - # batch_snapshot.close - # - def execute_partition partition, call_options: nil - ensure_session! - - partition = Partition.load partition unless partition.is_a? Partition - # TODO: raise if partition.empty? - - # TODO: raise if session.path != partition.session - # TODO: raise if grpc.transaction != partition.transaction - - opts = { call_options: call_options } - if partition.execute? - execute_partition_query partition, **opts - elsif partition.read? - execute_partition_read partition, **opts - end - end - - ## - # Closes the batch snapshot and releases the underlying resources. - # - # This should only be called once the batch snapshot is no longer needed - # anywhere. In particular if this batch snapshot is being used across - # multiple machines, calling this method on any of the machines will - # render the batch snapshot invalid everywhere. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # results = batch_snapshot.execute_partition partition - # - # batch_snapshot.close - # - def close - ensure_session! - - session.release! - end - - ## - # Executes a SQL query. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the query - # execution. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # results = batch_snapshot.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # results = batch_snapshot.execute_query( - # "SELECT * FROM users " \ - # "WHERE active = @active", - # params: { active: true } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query with a SQL STRUCT query parameter as a Hash: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # user_hash = { id: 1, name: "Charlie", active: false } - # - # results = batch_snapshot.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Specify the SQL STRUCT type using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # user_type = batch_client.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # user_hash = { id: 1, name: nil, active: false } - # - # results = batch_snapshot.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash }, - # types: { user_struct: user_type } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Or, query with a SQL STRUCT as a typed Data object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # user_type = batch_client.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # user_data = user_type.struct id: 1, name: nil, active: false - # - # results = batch_snapshot.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_data } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # results = batch_snapshot.execute_query \ - # "SELECT * FROM users", - # query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # results = batch_snapshot.execute_query \ - # "SELECT * FROM users", - # call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def execute_query sql, params: nil, types: nil, query_options: nil, - call_options: nil - ensure_session! - - params, types = Convert.to_input_params_and_types params, types - - session.execute_query sql, params: params, types: types, - transaction: tx_selector, - query_options: query_options, - call_options: call_options - end - alias execute execute_query - alias query execute_query - alias execute_sql execute_query - - ## - # Read rows from a database table, as a simple alternative to - # {#execute_query}. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] limit If greater than zero, no more than this number - # of rows will be returned. The default is no limit. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the read - # operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # batch_client = spanner.batch_client "my-instance", "my-database" - # batch_snapshot = batch_client.batch_snapshot - # - # results = batch_snapshot.read "users", [:id, :name] - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def read table, columns, keys: nil, index: nil, limit: nil, - call_options: nil - ensure_session! - - columns = Array(columns).map(&:to_s) - keys = Convert.to_key_set keys - - session.read table, columns, keys: keys, index: index, limit: limit, - transaction: tx_selector, - call_options: call_options - end - - ## - # @private - # Converts the the batch snapshot object to a Hash ready for - # serialization. - # - # @return [Hash] A hash containing a representation of the batch - # snapshot object. - # - def to_h - { - session: Base64.strict_encode64(@session.grpc.to_proto), - transaction: Base64.strict_encode64(@grpc.to_proto) - } - end - - ## - # Serializes the batch snapshot object so it can be recreated on another - # process. See {BatchClient#load_batch_snapshot}. - # - # @return [String] The serialized representation of the batch snapshot. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def dump - JSON.dump to_h - end - alias serialize dump - - ## - # @private Loads the serialized batch snapshot. See - # {BatchClient#load_batch_snapshot}. - def self.load data, service: nil, query_options: nil - data = JSON.parse data, symbolize_names: true unless data.is_a? Hash - - session_grpc = V1::Session.decode Base64.decode64(data[:session]) - transaction_grpc = V1::Transaction.decode Base64.decode64(data[:transaction]) - - from_grpc transaction_grpc, Session.from_grpc(session_grpc, service, query_options: query_options) - end - - ## - # @private Creates a new BatchSnapshot instance from a - # `Google::Cloud::Spanner::V1::Transaction`. - def self.from_grpc grpc, session - new grpc, session - end - - protected - - # The TransactionSelector to be used for queries - def tx_selector - V1::TransactionSelector.new id: transaction_id - end - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_session! - raise "Must have active connection to service" unless session - end - - def execute_partition_query partition, call_options: nil - query_options = partition.execute.query_options - query_options = query_options.to_h unless query_options.nil? - session.execute_query \ - partition.execute.sql, - params: partition.execute.params, - types: partition.execute.param_types.to_h, - transaction: partition.execute.transaction, - partition_token: partition.execute.partition_token, - query_options: query_options, - call_options: call_options - end - - def execute_partition_read partition, call_options: nil - session.read partition.read.table, - partition.read.columns.to_a, - keys: partition.read.key_set, - index: partition.read.index, - transaction: partition.read.transaction, - partition_token: partition.read.partition_token, - call_options: call_options - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/batch_update.rb b/google-cloud-spanner/lib/google/cloud/spanner/batch_update.rb deleted file mode 100644 index dced2f066ac5..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/batch_update.rb +++ /dev/null @@ -1,170 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - ## - # # BatchUpdate - # - # Accepts DML statements and optional parameters and types of the - # parameters for a batch update. - # - # See {Google::Cloud::Spanner::Transaction#batch_update}. - # - class BatchUpdate - # @private - attr_reader :statements - - # @private - def initialize - @statements = [] - end - - ## - # Adds a DML statement to a batch update. See - # {Transaction#batch_update}. - # - # @param [String] sql The DML statement string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The DML statement string can contain parameter placeholders. A - # parameter placeholder consists of "@" followed by the parameter - # name. Parameter names consist of any combination of letters, - # numbers, and underscores. - # @param [Hash] params Parameters for the DML statement string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash can be used to - # specify the exact SQL type for some or all of the SQL query - # parameters. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # begin - # row_counts = tx.batch_update do |b| - # statement_count = b.batch_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1" - # ) - # end - # puts row_counts.inspect - # rescue Google::Cloud::Spanner::BatchUpdateError => err - # puts err.cause.message - # puts err.row_counts.inspect - # end - # end - # - # @example Update using SQL parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # begin - # row_counts = tx.batch_update do |b| - # statement_count = b.batch_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1", - # params: { id: 1, name: "Charlie" } - # ) - # end - # puts row_counts.inspect - # rescue Google::Cloud::Spanner::BatchUpdateError => err - # puts err.cause.message - # puts err.row_counts.inspect - # end - # end - # - def batch_update sql, params: nil, types: nil - @statements << Statement.new(sql, params: params, types: types) - true - end - - # @private - class Statement - attr_reader :sql - attr_reader :params - attr_reader :types - - def initialize sql, params: nil, types: nil - @sql = sql - @params = params - @types = types - end - - def to_grpc - converted_params, converted_types = \ - Convert.to_input_params_and_types params, types - # param_types is a grpc map field, can't be nil - converted_types ||= {} - V1::ExecuteBatchDmlRequest::Statement.new( - sql: sql, - params: converted_params, - param_types: converted_types - ) - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/client.rb b/google-cloud-spanner/lib/google/cloud/spanner/client.rb deleted file mode 100644 index 14ba8645f9b8..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/client.rb +++ /dev/null @@ -1,2273 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/project" -require "google/cloud/spanner/data" -require "google/cloud/spanner/pool" -require "google/cloud/spanner/session" -require "google/cloud/spanner/transaction" -require "google/cloud/spanner/snapshot" -require "google/cloud/spanner/range" -require "google/cloud/spanner/column_value" -require "google/cloud/spanner/convert" -require "google/cloud/spanner/commit_response" - -module Google - module Cloud - module Spanner - ## - # # Client - # - # A client is used to read and/or modify data in a Cloud Spanner database. - # - # See {Google::Cloud::Spanner::Project#client}. - # - # @example - # require "google/cloud" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - class Client - ## - # @private Creates a new Spanner Client instance. - def initialize project, instance_id, database_id, session_labels: nil, - pool_opts: {}, query_options: nil, database_role: nil - @project = project - @instance_id = instance_id - @database_id = database_id - @database_role = database_role - @session_labels = session_labels - @pool = Pool.new self, **pool_opts - @query_options = query_options - end - - # The unique identifier for the project. - # @return [String] - def project_id - @project.service.project - end - - # The unique identifier for the instance. - # @return [String] - def instance_id - @instance_id - end - - # The unique identifier for the database. - # @return [String] - def database_id - @database_id - end - - # The Spanner project connected to. - # @return [Project] - def project - @project - end - - # The Spanner instance connected to. - # @return [Instance] - def instance - @project.instance instance_id - end - - # The Spanner database connected to. - # @return [Database] - def database - @project.database instance_id, database_id - end - - # The Spanner session creator role. - # @return [String] - def database_role - @database_role - end - - # A hash of values to specify the custom query options for executing - # SQL query. - # @return [Hash] - def query_options - @query_options - end - - ## - # Executes a SQL query. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Hash] single_use Perform the read with a single-use snapshot - # (read-only transaction). (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # If no value is specified for this parameter, Cloud Spanner will use - # a single use read-only transaction with strong timestamp bound as - # default. - # The snapshot can be created by providing exactly one of the - # following options in the hash: - # - # * **Strong** - # * `:strong` (true, false) Read at a timestamp where all previously - # committed transactions are visible. - # * **Exact** - # * `:timestamp`/`:read_timestamp` (Time, DateTime) Executes all - # reads at the given timestamp. Unlike other modes, reads at a - # specific timestamp are repeatable; the same read at the same - # timestamp always returns the same data. If the timestamp is in - # the future, the read will block until the specified timestamp, - # modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or - # for coordinating many reads against a consistent snapshot of the - # data. - # * `:staleness`/`:exact_staleness` (Numeric) Executes all reads at - # a timestamp that is exactly the number of seconds provided old. - # The timestamp is chosen soon after the read is started. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud - # Spanner chooses the exact timestamp, this mode works even if the - # client's local clock is substantially skewed from Cloud Spanner - # commit timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of single-use - # `bounded_staleness`. - # * **Bounded** - # * `:bounded_timestamp`/`:min_read_timestamp` (Time, DateTime) - # Executes all reads at a timestamp greater than the value - # provided. - # - # This is useful for requesting fresher data than some previous - # read, or data that is fresh enough to observe the effects of - # some previously committed transaction whose timestamp is known. - # * `:bounded_staleness`/`:max_staleness` (Numeric) Read data at a - # timestamp greater than or equal to the number of seconds - # provided. Guarantees that all writes that have committed more - # than the specified number of seconds ago are visible. Because - # Cloud Spanner chooses the exact timestamp, this mode works even - # if the client's local clock is substantially skewed from Cloud - # Spanner commit timestamps. - # - # Useful for reading the freshest data available at a nearby - # replica, while bounding the possible staleness if the local - # replica has fallen behind. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] request_options Common request options. - # - # * `:priority` (Symbol) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the query - # execution. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query( - # "SELECT * FROM users WHERE active = @active", - # params: { active: true } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query with a SQL STRUCT query parameter as a Hash: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_hash = { id: 1, name: "Charlie", active: false } - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Specify the SQL STRUCT type using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_type = db.fields id: :INT64, name: :STRING, active: :BOOL - # user_hash = { id: 1, name: nil, active: false } - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash }, - # types: { user_struct: user_type } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Or, query with a SQL STRUCT as a typed Data object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_type = db.fields id: :INT64, name: :STRING, active: :BOOL - # user_data = user_type.struct id: 1, name: nil, active: false - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_data } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query \ - # "SELECT * FROM users", query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # results = db.execute_query \ - # "SELECT * FROM users", call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # results = db.execute_query "SELECT * FROM users", - # request_options: request_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using tag for request query statistics collection. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "Read-Users" } - # results = db.execute_query "SELECT * FROM users", - # request_options: request_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def execute_query sql, params: nil, types: nil, single_use: nil, - query_options: nil, request_options: nil, - call_options: nil - validate_single_use_args! single_use - ensure_service! - - params, types = Convert.to_input_params_and_types params, types - request_options = Convert.to_request_options request_options, - tag_type: :request_tag - single_use_tx = single_use_transaction single_use - results = nil - @pool.with_session do |session| - results = session.execute_query \ - sql, params: params, types: types, transaction: single_use_tx, - query_options: query_options, request_options: request_options, - call_options: call_options - end - results - end - alias execute execute_query - alias query execute_query - alias execute_sql execute_query - - ## - # Executes a Partitioned DML SQL statement. - # - # Partitioned DML is an alternate implementation with looser semantics - # to enable large-scale changes without running into transaction size - # limits or (accidentally) locking the entire table in one large - # transaction. At a high level, it partitions the keyspace and executes - # the statement on each partition in separate internal transactions. - # - # Partitioned DML does not guarantee database-wide atomicity of the - # statement - it guarantees row-based atomicity, which includes updates - # to any indices. Additionally, it does not guarantee that it will - # execute exactly one time against each row - it guarantees "at least - # once" semantics. - # - # Where DML statements must be executed using Transaction (see - # {Transaction#execute_update}), Partitioned DML statements are executed - # outside of a read/write transaction. - # - # Not all DML statements can be executed in the Partitioned DML mode and - # the backend will return an error for the statements which are not - # supported. - # - # DML statements must be fully-partitionable. Specifically, the - # statement must be expressible as the union of many statements which - # each access only a single row of the table. - # {Google::Cloud::InvalidArgumentError} is raised if the statement does - # not qualify. - # - # The method will block until the update is complete. Running a DML - # statement with this method does not offer exactly once semantics, and - # therefore the DML statement should be idempotent. The DML statement - # must be fully-partitionable. Specifically, the statement must be - # expressible as the union of many statements which each access only a - # single row of the table. This is a Partitioned DML transaction in - # which a single Partitioned DML statement is executed. Partitioned DML - # partitions the and runs the DML statement over each partition in - # parallel using separate, internal transactions that commit - # independently. Partitioned DML transactions do not need to be - # committed. - # - # Partitioned DML updates are used to execute a single DML statement - # with a different execution strategy that provides different, and often - # better, scalability properties for large, table-wide operations than - # DML in a {Transaction#execute_update} transaction. Smaller scoped - # statements, such as an OLTP workload, should prefer using - # {Transaction#execute_update}. - # - # That said, Partitioned DML is not a drop-in replacement for standard - # DML used in {Transaction#execute_update}. - # - # * The DML statement must be fully-partitionable. Specifically, the - # statement must be expressible as the union of many statements which - # each access only a single row of the table. - # * The statement is not applied atomically to all rows of the table. - # Rather, the statement is applied atomically to partitions of the - # table, in independent internal transactions. Secondary index rows - # are updated atomically with the base table rows. - # * Partitioned DML does not guarantee exactly-once execution semantics - # against a partition. The statement will be applied at least once to - # each partition. It is strongly recommended that the DML statement - # should be idempotent to avoid unexpected results. For instance, it - # is potentially dangerous to run a statement such as `UPDATE table - # SET column = column + 1` as it could be run multiple times against - # some rows. - # * The partitions are committed automatically - there is no support for - # Commit or Rollback. If the call returns an error, or if the client - # issuing the DML statement dies, it is possible that some rows had - # the statement executed on them successfully. It is also possible - # that statement was never executed against other rows. - # * If any error is encountered during the execution of the partitioned - # DML operation (for instance, a UNIQUE INDEX violation, division by - # zero, or a value that cannot be stored due to schema constraints), - # then the operation is stopped at that point and an error is - # returned. It is possible that at this point, some partitions have - # been committed (or even committed multiple times), and other - # partitions have not been run at all. - # - # Given the above, Partitioned DML is good fit for large, database-wide, - # operations that are idempotent, such as deleting old rows from a very - # large table. - # - # @param [String] sql The Partitioned DML statement string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The Partitioned DML statement string can contain parameter - # placeholders. A parameter placeholder consists of "@" followed by - # the parameter name. Parameter names consist of any combination of - # letters, numbers, and underscores. - # @param [Hash] params Parameters for the Partitioned DML statement - # string. The parameter placeholders, minus the "@", are the the hash - # keys, and the literal values are the hash values. If the query - # string contains something like "WHERE id > @msg_id", then the params - # must contain something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash can be used to - # specify the exact SQL type for some or all of the SQL query - # parameters. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # @return [Integer] The lower bound number of rows that were modified. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = false" - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = @active", - # params: { active: false } - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = false", - # query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = false", - # call_options: call_options - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = @active", - # params: { active: false }, request_options: request_options - # - # @example Query using tag for request query statistics collection. - # - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "Update-Users" } - # row_count = db.execute_partition_update \ - # "UPDATE users SET friends = NULL WHERE active = false", - # request_options: request_options - # - def execute_partition_update sql, params: nil, types: nil, - query_options: nil, request_options: nil, - call_options: nil - ensure_service! - - params, types = Convert.to_input_params_and_types params, types - request_options = Convert.to_request_options request_options, - tag_type: :request_tag - - results = nil - @pool.with_session do |session| - results = session.execute_query \ - sql, params: params, types: types, - transaction: pdml_transaction(session), - query_options: query_options, request_options: request_options, - call_options: call_options - end - # Stream all PartialResultSet to get ResultSetStats - results.rows.to_a - # Raise an error if there is not a row count returned - if results.row_count.nil? - raise Google::Cloud::InvalidArgumentError, - "Partitioned DML statement is invalid." - end - results.row_count - end - alias execute_pdml execute_partition_update - - ## - # Read rows from a database table, as a simple alternative to - # {#execute_query}. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] limit If greater than zero, no more than this number - # of rows will be returned. The default is no limit. - # @param [Hash] single_use Perform the read with a single-use snapshot - # (read-only transaction). (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # If no value is specified for this parameter, Cloud Spanner will use - # a single use read-only transaction with strong timestamp bound as - # default. - # The snapshot can be created by providing exactly one of the - # following options in the hash: - # - # * **Strong** - # * `:strong` (true, false) Read at a timestamp where all previously - # committed transactions are visible. - # * **Exact** - # * `:timestamp`/`:read_timestamp` (Time, DateTime) Executes all - # reads at the given timestamp. Unlike other modes, reads at a - # specific timestamp are repeatable; the same read at the same - # timestamp always returns the same data. If the timestamp is in - # the future, the read will block until the specified timestamp, - # modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or - # for coordinating many reads against a consistent snapshot of the - # data. - # * `:staleness`/`:exact_staleness` (Numeric) Executes all reads at - # a timestamp that is exactly the number of seconds provided old. - # The timestamp is chosen soon after the read is started. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud - # Spanner chooses the exact timestamp, this mode works even if the - # client's local clock is substantially skewed from Cloud Spanner - # commit timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of single-use - # `bounded_staleness`. - # * **Bounded** - # * `:bounded_timestamp`/`:min_read_timestamp` (Time, DateTime) - # Executes all reads at a timestamp greater than the value - # provided. - # - # This is useful for requesting fresher data than some previous - # read, or data that is fresh enough to observe the effects of - # some previously committed transaction whose timestamp is known. - # * `:bounded_staleness`/`:max_staleness` (Numeric) Read data at a - # timestamp greater than or equal to the number of seconds - # provided. Guarantees that all writes that have committed more - # than the specified number of seconds ago are visible. Because - # Cloud Spanner chooses the exact timestamp, this mode works even - # if the client's local clock is substantially skewed from Cloud - # Spanner commit timestamps. - # - # Useful for reading the freshest data available at a nearby - # replica, while bounding the possible staleness if the local - # replica has fallen behind. - # @param [Hash] request_options Common request options. - # - # * `:priority` (Symbol) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the read. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.read "users", [:id, :name] - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Use the `keys` option to pass keys and/or key ranges to read. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.read "users", [:id, :name], keys: 1..5 - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Read using custom timeout and retry. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # results = db.read "users", [:id, :name], call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # results = db.read "users", [:id, :name], - # request_options: request_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Read using tag for read statistics collection. - # - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "Read-Users-All" } - # results = db.read "users", [:id, :name], - # request_options: request_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def read table, columns, keys: nil, index: nil, limit: nil, - single_use: nil, request_options: nil, call_options: nil - validate_single_use_args! single_use - ensure_service! - - columns = Array(columns).map(&:to_s) - keys = Convert.to_key_set keys - single_use_tx = single_use_transaction single_use - request_options = Convert.to_request_options request_options, - tag_type: :request_tag - - results = nil - @pool.with_session do |session| - results = session.read \ - table, columns, keys: keys, index: index, limit: limit, - transaction: single_use_tx, - request_options: request_options, - call_options: call_options - end - results - end - - ## - # Inserts or updates rows in a table. If any of the rows already exist, - # then its column values are overwritten with the ones provided. Any - # column values not explicitly written are preserved. - # - # Changes are made immediately upon calling this method using a - # single-use transaction. To make multiple changes in the same - # single-use transaction use {#commit}. To make changes in a transaction - # that supports reads and automatic retry protection use {#transaction}. - # - # **Note:** This method does not feature replay protection present in - # {Transaction#upsert} (See {#transaction}). This method makes a single - # RPC, whereas {Transaction#upsert} requires two RPCs (one of which may - # be performed in advance), and so this method may be appropriate for - # latency sensitive and/or high throughput blind upserts. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the format: - # `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.upsert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.upsert "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # db.upsert "users", [{ id: 1, name: "Charlie", active: false }], - # request_options: request_options - # - # @example Upsert using tag for transaction statistics collection. - # - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "Bulk-Upsert" } - # db.upsert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # request_options: request_options - # - def upsert table, rows, commit_options: nil, request_options: nil - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_session do |session| - session.upsert table, rows, commit_options: commit_options, - request_options: request_options - end - end - alias save upsert - - ## - # Inserts new rows in a table. If any of the rows already exist, the - # write or request fails with {Google::Cloud::AlreadyExistsError}. - # - # Changes are made immediately upon calling this method using a - # single-use transaction. To make multiple changes in the same - # single-use transaction use {#commit}. To make changes in a transaction - # that supports reads and automatic retry protection use {#transaction}. - # - # **Note:** This method does not feature replay protection present in - # {Transaction#insert} (See {#transaction}). This method makes a single - # RPC, whereas {Transaction#insert} requires two RPCs (one of which may - # be performed in advance), and so this method may be appropriate for - # latency sensitive and/or high throughput blind inserts. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the - # format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.insert "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # db.insert "users", [{ id: 1, name: "Charlie", active: false }], - # request_options: request_options - # - # @example Insert using tag for transaction statistics collection. - # - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "BulkInsert-Users" } - # db.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # request_options: request_options - # - def insert table, rows, commit_options: nil, request_options: nil - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_session do |session| - session.insert table, rows, commit_options: commit_options, - request_options: request_options - end - end - - ## - # Updates existing rows in a table. If any of the rows does not already - # exist, the request fails with {Google::Cloud::NotFoundError}. - # - # Changes are made immediately upon calling this method using a - # single-use transaction. To make multiple changes in the same - # single-use transaction use {#commit}. To make changes in a transaction - # that supports reads and automatic retry protection use {#transaction}. - # - # **Note:** This method does not feature replay protection present in - # {Transaction#update} (See {#transaction}). This method makes a single - # RPC, whereas {Transaction#update} requires two RPCs (one of which may - # be performed in advance), and so this method may be appropriate for - # latency sensitive and/or high throughput blind updates. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the - # format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.update "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.update "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # db.update "users", [{ id: 1, name: "Charlie", active: false }], - # request_options: request_options - # - # @example Updte using tag for transaction statistics collection. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "BulkUpdate-Users" } - # db.update "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # request_options: request_options - # - def update table, rows, commit_options: nil, request_options: nil - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_session do |session| - session.update table, rows, commit_options: commit_options, - request_options: request_options - end - end - - ## - # Inserts or replaces rows in a table. If any of the rows already exist, - # it is deleted, and the column values provided are inserted instead. - # Unlike #upsert, this means any values not explicitly written become - # `NULL`. - # - # Changes are made immediately upon calling this method using a - # single-use transaction. To make multiple changes in the same - # single-use transaction use {#commit}. To make changes in a transaction - # that supports reads and automatic retry protection use {#transaction}. - # - # **Note:** This method does not feature replay protection present in - # {Transaction#replace} (See {#transaction}). This method makes a single - # RPC, whereas {Transaction#replace} requires two RPCs (one of which may - # be performed in advance), and so this method may be appropriate for - # latency sensitive and/or high throughput blind replaces. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the - # format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.replace "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.replace "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # db.replace "users", [{ id: 1, name: "Charlie", active: false }], - # request_options: request_options - # - # @example Replace using tag for transaction statistics collection. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "BulkReplace-Users" } - # db.replace "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # request_options: request_options - # - def replace table, rows, commit_options: nil, request_options: nil - @pool.with_session do |session| - session.replace table, rows, commit_options: commit_options, - request_options: request_options - end - end - - ## - # Deletes rows from a table. Succeeds whether or not the specified rows - # were present. - # - # Changes are made immediately upon calling this method using a - # single-use transaction. To make multiple changes in the same - # single-use transaction use {#commit}. To make changes in a transaction - # that supports reads and automatic retry protection use {#transaction}. - # - # **Note:** This method does not feature replay protection present in - # {Transaction#delete} (See {#transaction}). This method makes a single - # RPC, whereas {Transaction#delete} requires two RPCs (one of which may - # be performed in advance), and so this method may be appropriate for - # latency sensitive and/or high throughput blind deletions. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the - # format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.delete "users", [1, 2, 3] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.delete "users", [1, 2, 3], commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example With request optinos - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { priority: :PRIORITY_MEDIUM } - # db.delete "users", [1, 2, 3], request_options: request_options - # - # @example Delete using tag for transaction statistics collection. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "BulkDelete-Users" } - # db.delete "users", [1, 2, 3], request_options: request_options - # - def delete table, keys = [], commit_options: nil, request_options: nil, - call_options: nil - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_session do |session| - session.delete table, keys, commit_options: commit_options, - request_options: request_options, - call_options: call_options - end - end - - ## - # Creates and commits a transaction for writes that execute atomically - # at a single logical point in time across columns, rows, and tables in - # a database. - # - # All changes are accumulated in memory until the block completes. - # Unlike {#transaction}, which can also perform reads, this operation - # accepts only mutations and makes a single API request. - # - # **Note:** This method does not feature replay protection present in - # {#transaction}. This method makes a single RPC, whereas {#transaction} - # requires two RPCs (one of which may be performed in advance), and so - # this method may be appropriate for latency sensitive and/or high - # throughput blind changes. - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A tag used for statistics collection - # about transaction. A tag must be a valid identifier of the - # format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}`. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [commit] The block for mutating the data. - # @yieldparam [Google::Cloud::Spanner::Commit] commit The Commit object. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.commit commit_options: commit_options do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example With request options - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit request_options: { priority: :PRIORITY_MEDIUM } do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # @example Commit using tag for transaction statistics collection. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # request_options = { tag: "BulkManipulate-Users" } - # db.commit request_options: request_options do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - def commit commit_options: nil, request_options: nil, - call_options: nil, &block - raise ArgumentError, "Must provide a block" unless block_given? - - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_session do |session| - session.commit( - commit_options: commit_options, request_options: request_options, - call_options: call_options, &block - ) - end - end - - # rubocop:disable Metrics/AbcSize - # rubocop:disable Metrics/MethodLength - # rubocop:disable Metrics/BlockLength - - ## - # Creates a transaction for reads and writes that execute atomically at - # a single logical point in time across columns, rows, and tables in a - # database. - # - # The transaction will always commit unless an error is raised. If the - # error raised is {Rollback} the transaction method will return without - # passing on the error. All other errors will be passed on. - # - # All changes are accumulated in memory until the block completes. - # Transactions will be automatically retried when possible, until - # `deadline` is reached. This operation makes separate API requests to - # begin and commit the transaction. - # - # @param [Numeric] deadline The total amount of time in seconds the - # transaction has to succeed. The default is `120`. - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String)A tag used for statistics collection - # about transaction. The value of a transaction tag should be the - # same for all requests belonging to the same transaction. A tag must - # be a valid identifier of the format: `[a-zA-Z][a-zA-Z0-9_\-]{0,49}` - # - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [transaction] The block for reading and writing data. - # @yieldparam [Google::Cloud::Spanner::Transaction] transaction The - # Transaction object. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # @example Manually rollback the transaction using {Rollback}: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # - # if something_wrong? - # # Rollback the transaction without passing on the error - # # outside of the transaction method. - # raise Google::Cloud::Spanner::Rollback - # end - # end - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.transaction commit_options: commit_options do |tx| - # results = tx.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - # @example Using request options. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction request_options: { priority: :PRIORITY_MEDIUM } do |tx| - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # - # request_options = { priority: :PRIORITY_LOW } - # results = tx.execute_query "SELECT * FROM users", - # request_options: request_options - # end - # - # @example Tags for request and transaction statistics collection. - # - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # # Transaction tag will be set to "Users-Txn" - # db.transaction request_options: { tag: "Users-Txn" } do |tx| - # # The transaction tag set as "Users-Txn" - # # The request tag set as "Users-Txn-1" - # request_options = { tag: "Users-Txn-1" } - # results = tx.execute_query "SELECT * FROM users", - # request_options: request_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # # The transaction tag set as "Users-Txn" - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - def transaction deadline: 120, commit_options: nil, - request_options: nil, call_options: nil - ensure_service! - unless Thread.current[:transaction_id].nil? - raise "Nested transactions are not allowed" - end - - deadline = validate_deadline deadline - backoff = 1.0 - start_time = current_time - - request_options = Convert.to_request_options \ - request_options, tag_type: :transaction_tag - - @pool.with_transaction do |tx| - if request_options - tx.transaction_tag = request_options[:transaction_tag] - end - - begin - Thread.current[:transaction_id] = tx.transaction_id - yield tx - commit_resp = @project.service.commit \ - tx.session.path, tx.mutations, - transaction_id: tx.transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - resp = CommitResponse.from_grpc commit_resp - commit_options ? resp : resp.timestamp - rescue GRPC::Aborted, Google::Cloud::AbortedError => e - # Re-raise if deadline has passed - if current_time - start_time > deadline - if e.is_a? GRPC::BadStatus - e = Google::Cloud::Error.from_error e - end - raise e - end - # Sleep the amount from RetryDelay, or incremental backoff - sleep(delay_from_aborted(e) || backoff *= 1.3) - # Create new transaction on the session and retry the block - tx = tx.session.create_transaction - retry - rescue StandardError => e - # Rollback transaction when handling unexpected error - tx.session.rollback tx.transaction_id - # Return nil if raised with rollback. - return nil if e.is_a? Rollback - # Re-raise error. - raise e - ensure - Thread.current[:transaction_id] = nil - end - end - end - - # rubocop:enable Metrics/AbcSize - # rubocop:enable Metrics/MethodLength - # rubocop:enable Metrics/BlockLength - - ## - # Creates a snapshot read-only transaction for reads that execute - # atomically at a single logical point in time across columns, rows, and - # tables in a database. For transactions that only read, snapshot - # read-only transactions provide simpler semantics and are almost always - # faster than read-write transactions. - # - # @param [true, false] strong Read at a timestamp where all previously - # committed transactions are visible. - # @param [Time, DateTime] timestamp Executes all reads at the given - # timestamp. Unlike other modes, reads at a specific timestamp are - # repeatable; the same read at the same timestamp always returns the - # same data. If the timestamp is in the future, the read will block - # until the specified timestamp, modulo the read's deadline. - # - # Useful for large scale consistent reads such as mapreduces, or for - # coordinating many reads against a consistent snapshot of the data. - # (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # @param [Time, DateTime] read_timestamp Same as `timestamp`. - # @param [Numeric] staleness Executes all reads at a timestamp that is - # `staleness` seconds old. For example, the number 10.1 is translated - # to 10 seconds and 100 milliseconds. - # - # Guarantees that all writes that have committed more than the - # specified number of seconds ago are visible. Because Cloud Spanner - # chooses the exact timestamp, this mode works even if the client's - # local clock is substantially skewed from Cloud Spanner commit - # timestamps. - # - # Useful for reading at nearby replicas without the distributed - # timestamp negotiation overhead of single-use `staleness`. (See - # [TransactionOptions](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.v1#transactionoptions).) - # @param [Numeric] exact_staleness Same as `staleness`. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [snapshot] The block for reading and writing data. - # @yieldparam [Google::Cloud::Spanner::Snapshot] snapshot The Snapshot - # object. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def snapshot strong: nil, timestamp: nil, read_timestamp: nil, - staleness: nil, exact_staleness: nil, call_options: nil - validate_snapshot_args! strong: strong, timestamp: timestamp, - read_timestamp: read_timestamp, - staleness: staleness, - exact_staleness: exact_staleness - - ensure_service! - unless Thread.current[:transaction_id].nil? - raise "Nested snapshots are not allowed" - end - - @pool.with_session do |session| - snp_grpc = @project.service.create_snapshot \ - session.path, strong: strong, - timestamp: (timestamp || read_timestamp), - staleness: (staleness || exact_staleness), - call_options: call_options - Thread.current[:transaction_id] = snp_grpc.id - snp = Snapshot.from_grpc snp_grpc, session - yield snp if block_given? - ensure - Thread.current[:transaction_id] = nil - end - nil - end - - ## - # Creates a configuration object ({Fields}) that may be provided to - # queries or used to create STRUCT objects. (The STRUCT will be - # represented by the {Data} class.) See {Client#execute} and/or - # {Fields#struct}. - # - # For more information, see [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] types Accepts an array or hash types. - # - # Arrays can contain just the type value, or a sub-array of the - # field's name and type value. Hash keys must contain the field name - # as a `Symbol` or `String`, or the field position as an `Integer`. - # Hash values must contain the type value. If a Hash is used the - # fields will be created using the same order as the Hash keys. - # - # Supported type values include: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @return [Fields] The fields of the given types. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # named_type = db.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # anon_type = db.fields [:INT64, :STRING, :BOOL] - # anon_data = anon_type.struct [42, nil, false] - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # dup_type = db.fields [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # dup_data = dup_type.struct [42, nil, false] - # - def fields types - Fields.new types - end - - ## - # @private - # Executes a query to retrieve the field names and types for a table. - # - # @param [String] table The name of the table in the database to - # retrieve fields for. - # - # @return [Fields] The fields of the given table. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # users_types = db.fields_for "users" - # db.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # types: users_types - # - def fields_for table - execute_query("SELECT * FROM #{table} WHERE 1 = 0").fields - end - - ## - # Creates a Spanner Range. This can be used in place of a Ruby Range - # when needing to exclude the beginning value. - # - # @param [Object] beginning The object that defines the beginning of the - # range. - # @param [Object] ending The object that defines the end of the range. - # @param [Boolean] exclude_begin Determines if the range excludes its - # beginning value. Default is `false`. - # @param [Boolean] exclude_end Determines if the range excludes its - # ending value. Default is `false`. - # - # @return [Google::Cloud::Spanner::Range] The new Range instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # key_range = db.range 1, 100 - # results = db.read "users", [:id, :name], keys: key_range - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def range beginning, ending, exclude_begin: false, exclude_end: false - Range.new beginning, ending, - exclude_begin: exclude_begin, - exclude_end: exclude_end - end - - ## - # Creates a column value object representing setting a field's value to - # the timestamp of the commit. (See {ColumnValue.commit_timestamp}) - # - # This placeholder value can only be used for timestamp columns that - # have set the option "(allow_commit_timestamp=true)" in the schema. - # - # @return [ColumnValue] The commit timestamp column value object. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # # create column value object - # commit_timestamp = db.commit_timestamp - # - # db.commit do |c| - # c.insert "users", [ - # { id: 5, name: "Murphy", updated_at: commit_timestamp } - # ] - # end - # - def commit_timestamp - ColumnValue.commit_timestamp - end - - ## - # Closes the client connection and releases resources. - # - def close - @pool.close - end - - ## - # Reset the client sessions. - # - def reset - @pool.reset - end - - ## - # @private - # Creates a new session object every time. - def create_new_session - ensure_service! - grpc = @project.service.create_session \ - Admin::Database::V1::DatabaseAdmin::Paths.database_path( - project: project_id, instance: instance_id, database: database_id - ), - labels: @session_labels, - database_role: @database_role - Session.from_grpc grpc, @project.service, query_options: @query_options - end - - ## - # @private - # Creates a batch of new session objects of size `total`. - # Makes multiple RPCs if necessary. Returns empty array if total is 0. - def batch_create_new_sessions total - sessions = [] - remaining = total - while remaining.positive? - sessions += batch_create_sessions remaining - remaining = total - sessions.count - end - sessions - end - - ## - # @private - # The response may have fewer sessions than requested in the RPC. - # - def batch_create_sessions session_count - ensure_service! - resp = @project.service.batch_create_sessions \ - Admin::Database::V1::DatabaseAdmin::Paths.database_path( - project: project_id, instance: instance_id, database: database_id - ), - session_count, - labels: @session_labels, - database_role: @database_role - resp.session.map { |grpc| Session.from_grpc grpc, @project.service, query_options: @query_options } - end - - # @private - def to_s - "(project_id: #{project_id}, instance_id: #{instance_id}, " \ - "database_id: #{database_id})" - end - - # @private - def inspect - "#<#{self.class.name} #{self}>" - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless @project.service - end - - ## - # Check for valid snapshot arguments - def validate_single_use_args! opts - return true if opts.nil? || opts.empty? - valid_keys = %i[strong timestamp read_timestamp staleness - exact_staleness bounded_timestamp - min_read_timestamp bounded_staleness max_staleness] - if opts.keys.count == 1 && valid_keys.include?(opts.keys.first) - return true - end - raise ArgumentError, - "Must provide only one of the following single_use values: " \ - "#{valid_keys}" - end - - ## - # Create a single-use TransactionSelector - def single_use_transaction opts - return nil if opts.nil? || opts.empty? - - exact_timestamp = Convert.time_to_timestamp \ - opts[:timestamp] || opts[:read_timestamp] - exact_staleness = Convert.number_to_duration \ - opts[:staleness] || opts[:exact_staleness] - bounded_timestamp = Convert.time_to_timestamp \ - opts[:bounded_timestamp] || opts[:min_read_timestamp] - bounded_staleness = Convert.number_to_duration \ - opts[:bounded_staleness] || opts[:max_staleness] - - V1::TransactionSelector.new(single_use: - V1::TransactionOptions.new(read_only: - V1::TransactionOptions::ReadOnly.new({ - strong: opts[:strong], - read_timestamp: exact_timestamp, - exact_staleness: exact_staleness, - min_read_timestamp: bounded_timestamp, - max_staleness: bounded_staleness, - return_read_timestamp: true - }.delete_if { |_, v| v.nil? }))) - end - - def pdml_transaction session - pdml_tx_grpc = @project.service.create_pdml session.path - V1::TransactionSelector.new id: pdml_tx_grpc.id - end - - ## - # Check for valid snapshot arguments - def validate_snapshot_args! strong: nil, - timestamp: nil, read_timestamp: nil, - staleness: nil, exact_staleness: nil - valid_args_count = [strong, timestamp, read_timestamp, staleness, - exact_staleness].compact.count - return true if valid_args_count <= 1 - raise ArgumentError, - "Can only provide one of the following arguments: " \ - "(strong, timestamp, read_timestamp, staleness, " \ - "exact_staleness)" - end - - def validate_deadline deadline - return 120 unless deadline.is_a? Numeric - return 120 if deadline.negative? - deadline - end - - ## - # Defer to this method so we have something to mock for tests - def current_time - Time.now - end - - ## - # Retrieves the delay value from Google::Cloud::AbortedError or - # GRPC::Aborted - def delay_from_aborted err - return nil if err.nil? - if err.respond_to?(:metadata) && err.metadata["google.rpc.retryinfo-bin"] - retry_info = Google::Rpc::RetryInfo.decode err.metadata["google.rpc.retryinfo-bin"] - seconds = retry_info["retry_delay"].seconds - nanos = retry_info["retry_delay"].nanos - return seconds if nanos.zero? - return seconds + (nanos / 1_000_000_000.0) - end - # No metadata? Try the inner error - delay_from_aborted err.cause - rescue StandardError - # Any error indicates the backoff should be handled elsewhere - nil - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/column_value.rb b/google-cloud-spanner/lib/google/cloud/spanner/column_value.rb deleted file mode 100644 index b22b98406649..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/column_value.rb +++ /dev/null @@ -1,115 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -module Google - module Cloud - module Spanner - ## - # # ColumnValue - # - # Represents a change to be made to a row's column value by the Spanner - # API. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # # create column value object - # commit_timestamp = db.commit_timestamp - # - # db.commit do |c| - # c.insert "users", [ - # { id: 5, name: "Murphy", updated_at: commit_timestamp } - # ] - # end - # - class ColumnValue - ## - # @private Creates a column value object representing changes made to - # fields in document data. - def initialize type - @type = type - end - - ## - # @private - # The type of change to make to a row's column value. - # - # @return [Symbol] The type of the column value. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # # create column value object - # commit_timestamp = db.commit_timestamp - # - # db.commit do |c| - # c.insert "users", [ - # { id: 5, name: "Murphy", updated_at: commit_timestamp } - # ] - # end - # - def type - @type - end - - ## - # Creates a column value object representing setting a field's value to - # the timestamp of the commit. (See {Client#commit_timestamp} and - # {Transaction#commit_timestamp}) - # - # This placeholder value can only be used for timestamp columns that - # have set the option "(allow_commit_timestamp=true)" in the schema. - # - # @return [ColumnValue] The commit timestamp column value object. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # # create column value object - # commit_timestamp = \ - # Google::Cloud::Spanner::ColumnValue.commit_timestamp - # - # db.commit do |c| - # c.insert "users", [ - # { id: 5, name: "Murphy", updated_at: commit_timestamp } - # ] - # end - # - def self.commit_timestamp - new :commit_timestamp - end - - ## - # @private The actual value that is sent to Spanner for the field. - def to_column_value - # We only have one ColumnValue, so hard-code this for now. - "spanner.commit_timestamp()" - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/commit.rb b/google-cloud-spanner/lib/google/cloud/spanner/commit.rb deleted file mode 100644 index f2fcda2a727f..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/commit.rb +++ /dev/null @@ -1,356 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/data" -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - ## - # # Commit - # - # Accepts mutations for execution within a transaction. All writes will - # execute atomically at a single logical point in time across columns, - # rows, and tables in a database. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - class Commit - ## - # @private - def initialize - @mutations = [] - end - - ## - # Inserts or updates rows in a table. If any of the rows already exist, - # then its column values are overwritten with the ones provided. Any - # column values not explicitly written are preserved. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.upsert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def upsert table, *rows - rows = Array(rows).flatten - return rows if rows.empty? - rows.delete_if(&:nil?) - rows.delete_if(&:empty?) - @mutations += rows.map do |row| - V1::Mutation.new( - insert_or_update: V1::Mutation::Write.new( - table: table, columns: row.keys.map(&:to_s), - values: [Convert.object_to_grpc_value(row.values).list_value] - ) - ) - end - rows - end - alias save upsert - - ## - # Inserts new rows in a table. If any of the rows already exist, the - # write or request fails with error {Google::Cloud::AlreadyExistsError}. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def insert table, *rows - rows = Array(rows).flatten - return rows if rows.empty? - rows.delete_if(&:nil?) - rows.delete_if(&:empty?) - @mutations += rows.map do |row| - V1::Mutation.new( - insert: V1::Mutation::Write.new( - table: table, columns: row.keys.map(&:to_s), - values: [Convert.object_to_grpc_value(row.values).list_value] - ) - ) - end - rows - end - - ## - # Updates existing rows in a table. If any of the rows does not already - # exist, the request fails with error {Google::Cloud::NotFoundError}. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def update table, *rows - rows = Array(rows).flatten - return rows if rows.empty? - rows.delete_if(&:nil?) - rows.delete_if(&:empty?) - @mutations += rows.map do |row| - V1::Mutation.new( - update: V1::Mutation::Write.new( - table: table, columns: row.keys.map(&:to_s), - values: [Convert.object_to_grpc_value(row.values).list_value] - ) - ) - end - rows - end - - ## - # Inserts or replaces rows in a table. If any of the rows already exist, - # it is deleted, and the column values provided are inserted instead. - # Unlike #upsert, this means any values not explicitly written become - # `NULL`. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.replace "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def replace table, *rows - rows = Array(rows).flatten - return rows if rows.empty? - rows.delete_if(&:nil?) - rows.delete_if(&:empty?) - @mutations += rows.map do |row| - V1::Mutation.new( - replace: V1::Mutation::Write.new( - table: table, columns: row.keys.map(&:to_s), - values: [Convert.object_to_grpc_value(row.values).list_value] - ) - ) - end - rows - end - - ## - # Deletes rows from a table. Succeeds whether or not the specified rows - # were present. - # - # All changes are accumulated in memory until the block passed to - # {Client#commit} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.delete "users", [1, 2, 3] - # end - # - def delete table, keys = [] - @mutations += [ - V1::Mutation.new( - delete: V1::Mutation::Delete.new( - table: table, key_set: key_set(keys) - ) - ) - ] - keys - end - - # @private - def mutations - @mutations - end - - protected - - def key_set keys - return V1::KeySet.new all: true if keys.nil? - keys = [keys] unless keys.is_a? Array - return V1::KeySet.new all: true if keys.empty? - if keys_are_ranges? keys - key_ranges = keys.map do |r| - Convert.to_key_range r - end - return V1::KeySet.new ranges: key_ranges - end - key_list = keys.map do |key| - key = [key] unless key.is_a? Array - Convert.object_to_grpc_value(key).list_value - end - V1::KeySet.new keys: key_list - end - - def keys_are_ranges? keys - keys.each do |key| - return true if key.is_a? ::Range - return true if key.is_a? Google::Cloud::Spanner::Range - end - false - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/commit_response.rb b/google-cloud-spanner/lib/google/cloud/spanner/commit_response.rb deleted file mode 100644 index c4958b0d7d1d..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/commit_response.rb +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/commit_response/commit_stats" - -module Google - module Cloud - module Spanner - ## - # CommitResponse is a timestamp at which the transaction committed - # with additional attributes of commit stats. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # timestamp = db.commit do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # puts timestamp - # - # @example With commit stats. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.commit commit_options: commit_options do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - class CommitResponse - ## - # @private Creates a new CommitResponse instance. - def initialize grpc - @grpc = grpc - end - - ## - # The timestamp at which the transaction committed. - # @return [Time] - def timestamp - Convert.timestamp_to_time @grpc.commit_timestamp - end - - ## - # Additional statistics about a commit. - # @return [CommitStats, nil] Commit stats or nil if not stats not - # present. - def stats - CommitStats.from_grpc @grpc.commit_stats if @grpc.commit_stats - end - - ## - # @private - # Creates a new Commit responsee instance from a - # `Google::Cloud::Spanner::V1::CommitResponse`. - def self.from_grpc grpc - new grpc - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/commit_response/commit_stats.rb b/google-cloud-spanner/lib/google/cloud/spanner/commit_response/commit_stats.rb deleted file mode 100644 index 8f13aa02fe01..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/commit_response/commit_stats.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - class CommitResponse - ## - # # CommitStats - # - # Statistical information of a transaction commit. - # - class CommitStats - ## - # @private Creates a new CommitStats instance. - def initialize grpc - @grpc = grpc - end - - # The total number of the mutations for the transaction. - # @return [Integer] - def mutation_count - @grpc.mutation_count - end - - ## - # @private - # Creates a new CommitStats instance from a - # `Google::Cloud::Spanner::V1::CommitResponse::CommitStats`. - def self.from_grpc grpc - new grpc - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/convert.rb b/google-cloud-spanner/lib/google/cloud/spanner/convert.rb deleted file mode 100644 index 2f86eb696765..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/convert.rb +++ /dev/null @@ -1,360 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "time" -require "date" -require "stringio" -require "base64" -require "bigdecimal" -require "google/cloud/spanner/data" - -module Google - module Cloud - module Spanner - ## - # @private Helper module for converting Spanner values. - module Convert - # rubocop:disable all - - module ClassMethods - def to_query_params params, types = nil - types ||= {} - formatted_params = params.map do |key, obj| - [String(key), object_to_grpc_value_and_type(obj, types[key])] - end - Hash[formatted_params] - end - - def object_to_grpc_value_and_type obj, field = nil - obj = obj.to_column_value if obj.respond_to? :to_column_value - - if obj.respond_to? :to_grpc_value_and_type - return obj.to_grpc_value_and_type - end - - field ||= field_for_object obj - [object_to_grpc_value(obj, field), grpc_type_for_field(field)] - end - - def object_to_grpc_value obj, field = nil - obj = obj.to_column_value if obj.respond_to? :to_column_value - - if obj.respond_to? :to_grpc_value_and_type - return obj.to_grpc_value_and_type.first - end - - case obj - when NilClass - Google::Protobuf::Value.new null_value: :NULL_VALUE - when String - Google::Protobuf::Value.new string_value: obj.to_s - when Symbol - Google::Protobuf::Value.new string_value: obj.to_s - when TrueClass - Google::Protobuf::Value.new bool_value: true - when FalseClass - Google::Protobuf::Value.new bool_value: false - when Integer - Google::Protobuf::Value.new string_value: obj.to_s - # BigDecimal must be put before Numeric. - when BigDecimal - Google::Protobuf::Value.new string_value: obj.to_s("F") - when Numeric - if obj == Float::INFINITY - Google::Protobuf::Value.new string_value: "Infinity" - elsif obj == -Float::INFINITY - Google::Protobuf::Value.new string_value: "-Infinity" - elsif obj.respond_to?(:nan?) && obj.nan? - Google::Protobuf::Value.new string_value: "NaN" - else - Google::Protobuf::Value.new number_value: obj.to_f - end - when Time - Google::Protobuf::Value.new(string_value: - obj.to_time.utc.strftime("%FT%T.%NZ")) - when DateTime - Google::Protobuf::Value.new(string_value: - obj.to_time.utc.strftime("%FT%T.%NZ")) - when Date - Google::Protobuf::Value.new string_value: obj.to_s - when Array - arr_field = nil - arr_field = field.first if Array === field - Google::Protobuf::Value.new list_value: - Google::Protobuf::ListValue.new(values: - obj.map { |o| object_to_grpc_value(o, arr_field) }) - when Hash - if field.is_a? Fields - field.struct(obj).to_grpc_value - else - Google::Protobuf::Value.new string_value: obj.to_json - end - else - if obj.respond_to?(:read) && obj.respond_to?(:rewind) - obj.rewind - content = obj.read.force_encoding("ASCII-8BIT") - encoded_content = Base64.strict_encode64(content) - Google::Protobuf::Value.new(string_value: encoded_content) - else - raise ArgumentError, - "A value of type #{obj.class} is not supported." - end - end - end - - def field_for_object obj - case obj - when NilClass - raise ArgumentError, "Cannot determine type for nil values." - when String - :STRING - when Symbol - :STRING - when TrueClass - :BOOL - when FalseClass - :BOOL - when Integer - :INT64 - # BigDecimal must be put before Numeric. - when BigDecimal - :NUMERIC - when Numeric - :FLOAT64 - when Time - :TIMESTAMP - when DateTime - :TIMESTAMP - when Date - :DATE - when Array - if obj.empty? - raise ArgumentError, - "Cannot determine type for empty array values." - end - non_nil_fields = obj.compact.map { |e| field_for_object e }.compact - if non_nil_fields.empty? - raise ArgumentError, - "Cannot determine type for array of nil values." - end - if non_nil_fields.uniq.count > 1 - raise ArgumentError, - "Cannot determine type for array of different values." - end - [non_nil_fields.first] - when Hash - raw_type_pairs = obj.map do |key, value| - [key, field_for_object(value)] - end - Fields.new Hash[raw_type_pairs] - when Data - obj.fields - else - if obj.respond_to?(:read) && obj.respond_to?(:rewind) - :BYTES - else - raise ArgumentError, - "Cannot determine type for #{obj.class} values." - end - end - end - - def grpc_type_for_field field - return field.to_grpc_type if field.respond_to? :to_grpc_type - - case field - when Array - V1::Type.new( - code: :ARRAY, - array_element_type: grpc_type_for_field(field.first) - ) - when :PG_NUMERIC - V1::Type.new(code: :NUMERIC, type_annotation: :PG_NUMERIC) - when :PG_JSONB - V1::Type.new(code: :JSON, type_annotation: :PG_JSONB) - else - V1::Type.new(code: field) - end - end - - def grpc_value_to_object value, type - return nil if value.kind == :null_value - - case type.code - when :BOOL - value.bool_value - when :INT64 - Integer value.string_value - when :FLOAT64 - if value.kind == :string_value - if value.string_value == "Infinity" - Float::INFINITY - elsif value.string_value == "-Infinity" - -Float::INFINITY - elsif value.string_value == "NaN" - Float::NAN - else - Float value.string_value - end - else - value.number_value - end - when :TIMESTAMP - Time.parse value.string_value - when :DATE - Date.parse value.string_value - when :STRING - value.string_value - when :BYTES - StringIO.new Base64.decode64 value.string_value - when :ARRAY - value.list_value.values.map do |v| - grpc_value_to_object v, type.array_element_type - end - when :STRUCT - Data.from_grpc value.list_value.values, type.struct_type.fields - when :NUMERIC - BigDecimal value.string_value - when :JSON - JSON.parse value.string_value - end - end - - def row_to_pairs row_types, row - row_types.zip(row).map do |field, value| - [field.name.to_sym, grpc_value_to_object(value, field.type)] - end - end - - def row_to_object row_types, row - Hash[row_to_pairs(row_types, row)] - end - - def number_to_duration number - return nil if number.nil? - - Google::Protobuf::Duration.new \ - seconds: number.to_i, - nanos: (number.remainder(1) * 1000000000).round - end - - def duration_to_number duration - return nil if duration.nil? - - return duration.seconds if duration.nanos == 0 - - duration.seconds + (duration.nanos / 1000000000.0) - end - - def time_to_timestamp time - return nil if time.nil? - - # Force the object to be a Time object. - time = time.to_time - - Google::Protobuf::Timestamp.new \ - seconds: time.to_i, - nanos: time.nsec - end - - def timestamp_to_time timestamp - return nil if timestamp.nil? - - Time.at timestamp.seconds, Rational(timestamp.nanos, 1000) - end - - def to_key_range range - range_opts = { - start_closed: object_to_grpc_value(Array(range.begin)).list_value, - end_closed: object_to_grpc_value(Array(range.end)).list_value } - - if range.respond_to?(:exclude_begin?) && range.exclude_begin? - range_opts[:start_open] = range_opts[:start_closed] - range_opts.delete :start_closed - end - if range.exclude_end? - range_opts[:end_open] = range_opts[:end_closed] - range_opts.delete :end_closed - end - - V1::KeyRange.new range_opts - end - - def to_key_set keys - return V1::KeySet.new(all: true) if keys.nil? - keys = [keys] unless keys.is_a? Array - return V1::KeySet.new(all: true) if keys.empty? - - if keys_are_ranges? keys - key_ranges = keys.map { |r| to_key_range(r) } - return V1::KeySet.new(ranges: key_ranges) - end - - key_list = keys.map do |key| - key = [key] unless key.is_a? Array - object_to_grpc_value(key).list_value - end - V1::KeySet.new keys: key_list - end - - def keys_are_ranges? keys - keys.each do |key| - return true if key.is_a? ::Range - return true if key.is_a? Google::Cloud::Spanner::Range - end - false - end - - def to_input_params_and_types params, types - input_params = nil - input_param_types = nil - unless params.nil? - input_param_pairs = to_query_params params, types - input_params = Google::Protobuf::Struct.new \ - fields: Hash[input_param_pairs.map { |k, v| [k, v.first] }] - input_param_types = Hash[ - input_param_pairs.map { |k, v| [k, v.last] }] - end - - [input_params, input_param_types] - end - - ## - # Build request options by replacing tag to respecitve statistics - # collection tag type. - # - # @param [Hash] options Common request options. - # * `:tag` (String) A tag used for statistics collection. - # - # @param [Symbol] tag_type Request tag type. - # Possible values are `request_tag`, `transaction_tag` - # @return [Hash, nil] - # - def to_request_options options, tag_type: nil - return unless options - - return options unless options.key? :tag - - options.transform_keys { |k| k == :tag ? tag_type : k } - end - end - - # rubocop:enable all - - extend ClassMethods - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/credentials.rb b/google-cloud-spanner/lib/google/cloud/spanner/credentials.rb deleted file mode 100644 index 201f227e303a..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/credentials.rb +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/v1/spanner/credentials" - -module Google - module Cloud - module Spanner - ## - # # Credentials - # - # Represents the authentication and authorization used to connect to the - # Spanner API. - # - # @example - # require "google/cloud/spanner" - # - # keyfile = "/path/to/keyfile.json" - # creds = Google::Cloud::Spanner::Credentials.new keyfile - # - # spanner = Google::Cloud::Spanner.new( - # project_id: "my-project", - # credentials: creds - # ) - # - # spanner.project_id #=> "my-project" - # - class Credentials < Google::Cloud::Spanner::V1::Spanner::Credentials - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/data.rb b/google-cloud-spanner/lib/google/cloud/spanner/data.rb deleted file mode 100644 index 680fcf102f85..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/data.rb +++ /dev/null @@ -1,244 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/fields" -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - ## - # # Data - # - # Represents a row in a result from Cloud Spanner. Provides access to data - # in a hash-like structure. Values can be retrieved by name (String), or - # in cases in which values are unnamed, by zero-based index position - # (Integer). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - class Data - ## - # Returns the configuration object ({Fields}) of the names and types of - # the data. - # - # @return [Array] An array containing name and value pairs. - # - def fields - @fields ||= Fields.from_grpc @grpc_fields - end - - ## - # Returns the types of the data. - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @return [Array] An array containing the types of the values. - # - def types - fields.types - end - - ## - # Returns the names of values, or in cases in which values are unnamed, - # the zero-based index position of values. - # - # @return [Array<(String,Integer)>] An array containing the names - # (String) or position (Integer) for the corresponding values of the - # data. - # - def keys - fields.keys - end - - ## - # Returns the values of the data. - # - # @return [Array] An array containing the values. - # - def values - Array.new(keys.count) { |i| self[i] } - end - - ## - # Returns the names or positions and their corresponding values as an - # array of arrays. - # - # @return [Array] An array containing name/position and value - # pairs. - # - def pairs - keys.zip values - end - - ## - # Returns the value object for the provided name (String) or index - # (Integer). Do not pass a name to this method if the data has more than - # one member with the same name. - # - # @param [String, Integer] key The name (String) or zero-based index - # position (Integer) of the value. - # - # @raise [Google::Cloud::Spanner::DuplicateNameError] if the data - # contains duplicate names. - # - # @return [Object, nil] The value, or nil if no value is found. - # - def [] key - if key.is_a? Integer - return Convert.grpc_value_to_object(@grpc_values[key], - @grpc_fields[key].type) - end - name_count = @grpc_fields.find_all { |f| f.name == String(key) }.count - return nil if name_count.zero? - raise DuplicateNameError if name_count > 1 - index = @grpc_fields.find_index { |f| f.name == String(key) } - Convert.grpc_value_to_object(@grpc_values[index], - @grpc_fields[index].type) - end - - ## - # Returns the values as an array. This method will raise - # {DuplicateNameError} if nested data has more than one member with the - # same name, unless `skip_dup_check` is set to `true`, in which case it - # will lose values. - # - # @param [Boolean] skip_dup_check Skip the check for whether nested data - # contains duplicate names, which will improve performance. When - # skipped, the nested hash may lose values. Default is `false`. - # Optional. - # - # @raise [Google::Cloud::Spanner::DuplicateNameError] if nested data - # contains duplicate names. - # - # @return [Array] An array containing the values of the data. - # - def to_a skip_dup_check: nil - values.map do |value| - case value - when Data - value.to_h skip_dup_check: skip_dup_check - when Array - value.map do |v| - v.is_a?(Data) ? v.to_h(skip_dup_check: skip_dup_check) : v - end - else - value - end - end - end - - ## - # Returns the names or indexes and corresponding values of the data as a - # hash. This method will raise {DuplicateNameError} if the data has more - # than one member with the same name, unless `skip_dup_check` is set to - # `true`, in which case it will lose values. - # - # @param [Boolean] skip_dup_check Skip the check for whether the data - # contains duplicate names, which will improve performance. When - # skipped, the returned hash may lose values. Default is `false`. - # Optional. - # - # @raise [Google::Cloud::Spanner::DuplicateNameError] if the data - # contains duplicate names. - # - # @return [Hash<(String,Integer)=>Object>] A hash containing the names - # or indexes and corresponding values. - # - def to_h skip_dup_check: nil - raise DuplicateNameError if !skip_dup_check && fields.duplicate_names? - - keys.zip(to_a(skip_dup_check: skip_dup_check)).to_h - end - - # @private - def == other - return false unless other.is_a? Data - pairs == other.pairs - end - - # @private - def to_s - named_values = pairs.map do |key, value| - if key.is_a? Integer - value.inspect - else - "(#{key})#{value.inspect}" - end - end - "(#{named_values.join ', '})" - end - - # @private - def inspect - "#<#{self.class.name} #{self}>" - end - - ## - # @private - def to_grpc_value - if @grpc_values.nil? - return Google::Protobuf::Value.new null_value: :NULL_VALUE - end - - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: @grpc_values - ) - ) - end - - ## - # @private - def to_grpc_type - V1::Type.new( - code: :STRUCT, - struct_type: V1::StructType.new( - fields: @grpc_fields - ) - ) - end - - ## - # @private - def to_grpc_value_and_type - [to_grpc_value, to_grpc_type] - end - - ## - # @private Creates a new Data instance from - # Spanner values and fields. - def self.from_grpc grpc_values, grpc_fields - new.tap do |d| - d.instance_variable_set :@grpc_values, Array(grpc_values) - d.instance_variable_set :@grpc_fields, Array(grpc_fields) - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database.rb b/google-cloud-spanner/lib/google/cloud/spanner/database.rb deleted file mode 100644 index d48d98c53d43..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database.rb +++ /dev/null @@ -1,754 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/database/job" -require "google/cloud/spanner/database/list" -require "google/cloud/spanner/database/restore_info" -require "google/cloud/spanner/backup" -require "google/cloud/spanner/policy" - -module Google - module Cloud - module Spanner - ## - # # Database - # - # NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for - # mananging databases will only be available through the - # [google-cloud-spanner-admin-database-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-database-v1) - # client. See the - # [README](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner#google-cloud-spanner) - # for further details. - # - # Represents a Cloud Spanner database. To use Cloud Spanner's read and - # write operations, you must first create a database. A database belongs - # to a {Instance} and contains tables and indexes. You may create multiple - # databases in an {Instance}. - # - # See {Google::Cloud::Spanner::Instance#databases}, - # {Google::Cloud::Spanner::Instance#database}, and - # {Google::Cloud::Spanner::Instance#create_database}. - # - # To read and/or modify data in a Cloud Spanner database, use an instance - # of {Google::Cloud::Spanner::Client}. See - # {Google::Cloud::Spanner::Project#client}. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin} instead. - # - # @example - # require "google/cloud" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # job = instance.create_database "my-new-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - class Database - ## - # @private The gRPC Service object. - attr_accessor :service - - # @private Creates a new Database instance. - def initialize grpc, service - @grpc = grpc - @service = service - end - - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.name.split("/")[1] - end - - # The unique identifier for the instance. - # @return [String] - def instance_id - @grpc.name.split("/")[3] - end - - # The unique identifier for the database. - # @return [String] - def database_id - @grpc.name.split("/")[5] - end - - # The version retention period for a database. - # @return [String] - def version_retention_period - @grpc.version_retention_period - end - - # The earliest available version time for a database. - # @return [Time] - def earliest_version_time - Convert.timestamp_to_time @grpc.earliest_version_time - end - - ## - # The full path for the database resource. Values are of the form - # `projects//instances//databases/`. - # @return [String] - def path - @grpc.name - end - - ## - # The current database state. Possible values are `:CREATING` and - # `:READY`. - # @return [Symbol] - def state - @grpc.state - end - - ## - # Time at which the database creation started. - # @return [Time] - def create_time - Convert.timestamp_to_time @grpc.create_time - end - - # An encryption configuration describing the encryption type and key - # resources in Cloud KMS. - # - # @return [Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig, nil] - def encryption_config - @grpc.encryption_config - end - - # Encryption information for the database. - # - # For databases that are using customer managed encryption, this - # field contains the encryption information for the database, such as - # encryption state and the Cloud KMS key versions that are in use. - # - # For databases that are using Google default or other types of encryption, - # this field is empty. - # - # This field is propagated lazily from the backend. There might be a delay - # from when a key version is being used and when it appears in this field. - # - # @return [Array] - def encryption_info - @grpc.encryption_info.to_a - end - - ## - # The database is still being created. Operations on the database may - # raise with `FAILED_PRECONDITION` in this state. - # @return [Boolean] - def creating? - state == :CREATING - end - - ## - # The database is fully created and ready for use. - # @return [Boolean] - def ready? - state == :READY - end - - ## - # The database is fully created from backup and optimizing. - # @return [Boolean] - def ready_optimizing? - state == :READY_OPTIMIZING - end - - ## - # Retrieve the Data Definition Language (DDL) statements that define - # database structures. DDL statements are used to create, update, - # and delete tables and indexes. - # - # @see https://cloud.google.com/spanner/docs/data-definition-language - # Data Definition Language - # - # @param [Boolean] force Force the latest DDL statements to be retrieved - # from the Spanner service when `true`. Otherwise the DDL statements - # will be memoized to reduce the number of API calls made to the - # Spanner service. The default is `false`. - # - # @return [Array] The DDL statements. - # - # @example statements are memoized to reduce the number of API calls: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # statements = database.ddl # API call - # statements_2 = database.ddl # No API call - # - # @example Use `force` to retrieve the statements from the service: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # statements = database.ddl force: true # API call - # statements_2 = database.ddl force: true # API call - # - def ddl force: nil - return @ddl if @ddl && !force - ensure_service! - ddl_grpc = service.get_database_ddl instance_id, database_id - @ddl = ddl_grpc.statements - end - - ## - # Updates the database schema by adding Data Definition Language (DDL) - # statements to create, update, and delete tables and indexes. - # - # @see https://cloud.google.com/spanner/docs/data-definition-language - # Data Definition Language - # - # @param [Array] statements The DDL statements to be applied to - # the database. - # @param [String, nil] operation_id The operation ID used to perform the - # update. When `nil`, the update request is assigned an - # automatically-generated operation ID. Specifying an explicit value - # simplifies determining whether the statements were executed in the - # event that the update is replayed, or the return value is otherwise - # lost. This value should be unique within the database, and must be a - # valid identifier: `[a-z][a-z0-9_]*`. Will raise - # {Google::Cloud::AlreadyExistsError} if the named operation already - # exists. Optional. - # - # @return [Database::Job] The job representing the long-running, - # asynchronous processing of a database schema update operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # add_users_table_sql = %q( - # CREATE TABLE users ( - # id INT64 NOT NULL, - # username STRING(25) NOT NULL, - # name STRING(45) NOT NULL, - # email STRING(128), - # ) PRIMARY KEY(id) - # ) - # - # database.update statements: [add_users_table_sql] - # - def update statements: [], operation_id: nil - ensure_service! - grpc = service.update_database_ddl instance_id, database_id, - statements: statements, - operation_id: operation_id - Database::Job.from_grpc grpc, service - end - - ## - # Drops (deletes) the Cloud Spanner database. - # - # @return [Boolean] Returns `true` if the database was deleted. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # database.drop - # - def drop - ensure_service! - service.drop_database instance_id, database_id - true - end - - # @private - DATBASE_OPERATION_METADAT_FILTER_TEMPLATE = [ - "(metadata.@type:CreateDatabaseMetadata AND metadata.database:%s)", - "(metadata.@type:RestoreDatabaseMetadata AND metadata.name:%s)", - "(metadata.@type:UpdateDatabaseDdl AND metadata.database:%s)" - ].join(" OR ") - - ## - # Retrieves the list of database operations for the given database. - # - # @param filter [String] - # A filter expression that filters what operations are returned in the - # response. - # - # The response returns a list of - # `Google::Longrunning::Operation` long-running operations whose names - # are prefixed by a database name within the specified instance. - # The long-running operation - # `Google::Longrunning::Operation#metadata` metadata field type - # `metadata.type_url` describes the type of the metadata. - # - # The filter expression must specify the field name, - # a comparison operator, and the value that you want to use for - # filtering. The value must be a string, a number, or a boolean. - # The comparison operator must be - # <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator - # which is roughly synonymous with equality. Filter rules are case - # insensitive. - # - # The long-running operation fields eligible for filtering are: - # * `name` --> The name of the long-running operation - # * `done` --> False if the operation is in progress, else true. - # * `metadata.type_url` (using filter string `metadata.@type`) and - # fields in `metadata.value` (using filter string - # `metadata.`, where is a field in - # metadata.value) are eligible for filtering. - # * `error` --> Error associated with the long-running operation. - # * `response.type_url` (using filter string `response.@type`) and - # fields in `response.value` (using filter string - # `response.`, where is a field in - # response.value)are eligible for filtering. - # - # To filter on multiple expressions, provide each separate - # expression within parentheses. By default, each expression - # is an AND expression. However, you can include AND, OR, and NOT - # expressions explicitly. - # - # Some examples of using filters are: - # - # * `done:true` --> The operation is complete. - # * `(metadata.@type:type.googleapis.com/google.spanner.admin.\ - # database.v1.RestoreDatabaseMetadata) - # AND (metadata.source_type:BACKUP) - # AND (metadata.backup_info.backup:backup_howl) - # AND (metadata.name:restored_howl) - # AND (metadata.progress.start_time < \"2018-03-28T14:50:00Z\") - # AND (error:*)` - # --> Return RestoreDatabase operations from backups whose name - # contains "backup_howl", where the created database name - # contains the string "restored_howl", the start_time of the - # restore operation is before 2018-03-28T14:50:00Z, - # and the operation returned an error. - # @param page_size [Integer] - # The maximum number of resources contained in the underlying API - # response. If page streaming is performed per-resource, this - # parameter does not affect the return value. If page streaming is - # performed per-page, this determines the maximum number of - # resources in a page. - # - # @return [Array] List - # representing the long-running, asynchronous processing - # of a database operations. - # (See {Google::Cloud::Spanner::Database::Job::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # - # jobs = database.database_operations - # jobs.each do |job| - # if job.error? - # p job.error - # else - # p job.database.database_id - # end - # end - # - # @example Retrieve all - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # - # jobs = database.database_operations - # jobs.all do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - # @example List by page size - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # - # jobs = database.database_operations page_size: 10 - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - # @example Filter and list - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # database = spanner.database "my-instance", "my-database" - # - # jobs = database.database_operations filter: "done:true" - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - def database_operations filter: nil, page_size: nil - database_filter = format( - DATBASE_OPERATION_METADAT_FILTER_TEMPLATE, - database_id: database_id - ) - - if filter - database_filter = format( - "(%s) AND (%s)", - filter: filter, database_filter: database_filter - ) - end - - grpc = service.list_database_operations instance_id, - filter: database_filter, - page_size: page_size - Database::Job::List.from_grpc grpc, service - end - - ## - # Creates a database backup. - # - # @param [String] backup_id The unique identifier for the backup. - # Values are of the form `[a-z][a-z0-9_\-]*[a-z0-9]` and must be - # between 2 and 60 characters in length. Required. - # @param [Time] expire_time The expiration time of the backup, with - # microseconds granularity that must be at least 6 hours and at most - # 366 days from the time the request is received. Required. - # Once the `expire_time` has passed, Cloud Spanner will delete the - # backup and free the resources used by the backup. Required. - # @param [Time] version_time Specifies the time to have an externally - # consistent copy of the database. If no version time is specified, - # it will be automatically set to the backup create time. The version - # time can be as far in the past as specified by the database earliest - # version time. Optional. - # @param [Hash] encryption_config An encryption configuration describing - # the encryption type and key resources in Cloud KMS. Optional. The - # following settings can be provided: - # - # * `:kms_key_name` (String) The name of KMS key to use which should - # be the full path, e.g., `projects//locations/\ - # /keyRings//cryptoKeys/` - # This field should be set only when encryption type - # `:CUSTOMER_MANAGED_ENCRYPTION`. - # * `:encryption_type` (Symbol) The encryption type of the backup. - # Valid values are: - # 1. `:USE_DATABASE_ENCRYPTION` - Use the same encryption configuration as - # the database. - # 2. `:GOOGLE_DEFAULT_ENCRYPTION` - Google default encryption. - # 3. `:CUSTOMER_MANAGED_ENCRYPTION` - Use customer managed encryption. - # If specified, `:kms_key_name` must contain a valid Cloud KMS key. - # - # @raise [ArgumentError] if `:CUSTOMER_MANAGED_ENCRYPTION` specified without - # customer managed kms key. - # - # @return [Google::Cloud::Spanner::Backup::Job] The job representing - # the long-running, asynchronous processing of a backup create - # operation. - # - # @example Create backup with expiration time - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # backup_id = "my-backup" - # expire_time = Time.now + (24 * 60 * 60) # 1 day from now - # version_time = Time.now - (24 * 60 * 60) # 1 day ago (optional) - # - # job = database.create_backup backup_id, expire_time, version_time: version_time - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # backup = job.backup - # end - # - # @example Create backup with encryption config - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # kms_key_name = "projects//locations//keyRings//cryptoKeys/" - # encryption_config = { - # kms_key_name: kms_key_name, - # encryption_type: :CUSTOMER_MANAGED_ENCRYPTION - # } - # job = database.create_backup "my-backup", - # Time.now + 36000, - # encryption_config: encryption_config - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # backup = job.backup - # end - # - def create_backup backup_id, expire_time, - version_time: nil, encryption_config: nil - ensure_service! - - if encryption_config&.include?(:kms_key_name) && - encryption_config[:encryption_type] != :CUSTOMER_MANAGED_ENCRYPTION - raise Google::Cloud::InvalidArgumentError, - "kms_key_name only used with CUSTOMER_MANAGED_ENCRYPTION" - end - - grpc = service.create_backup \ - instance_id, - database_id, - backup_id, - expire_time, - version_time, - encryption_config: encryption_config - Backup::Job.from_grpc grpc, service - end - - ## - # Retrieves backups belonging to the database. - # - # @param [Integer] page_size Optional. Number of backups to be returned - # in the response. If 0 or less, defaults to the server's maximum - # allowed page size. - # @return [Array] Enumerable list of - # backups. (See {Google::Cloud::Spanner::Backup::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # database.backups.all.each do |backup| - # puts backup.backup_id - # end - # - # @example List backups by page size - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # database.backups(page_size: 5).all.each do |backup| - # puts backup.backup_id - # end - # - def backups page_size: nil - ensure_service! - grpc = service.list_backups \ - instance_id, - filter: "database:#{database_id}", - page_size: page_size - Backup::List.from_grpc grpc, service - end - - # Information about the source used to restore the database. - # - # @return [Google::Cloud::Spanner::Database::RestoreInfo, nil] - def restore_info - return nil unless @grpc.restore_info - RestoreInfo.from_grpc @grpc.restore_info - end - - ## - # Gets the [Cloud IAM](https://cloud.google.com/iam/) access control - # policy for this database. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Policy - # google.iam.v1.IAMPolicy - # - # @yield [policy] A block for updating the policy. The latest policy - # will be read from the Spanner service and passed to the block. After - # the block completes, the modified policy will be written to the - # service. - # @yieldparam [Policy] policy the current Cloud IAM Policy for this - # database - # - # @return [Policy] The current Cloud IAM Policy for this database. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # policy = database.policy - # - # @example Update the policy by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # database.policy do |p| - # p.add "roles/owner", "user:owner@example.com" - # end # 2 API calls - # - def policy - ensure_service! - grpc = service.get_database_policy instance_id, database_id - policy = Policy.from_grpc grpc - return policy unless block_given? - yield policy - update_policy policy - end - - ## - # Updates the [Cloud IAM](https://cloud.google.com/iam/) access control - # policy for this database. The policy should be read from {#policy}. - # See {Google::Cloud::Spanner::Policy} for an explanation of the policy - # `etag` property and how to modify policies. - # - # You can also update the policy by passing a block to {#policy}, which - # will call this method internally after the block completes. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Policy - # google.iam.v1.IAMPolicy - # - # @param [Policy] new_policy a new or modified Cloud IAM Policy for this - # database - # - # @return [Policy] The policy returned by the API update operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # policy = database.policy # API call - # - # policy.add "roles/owner", "user:owner@example.com" - # - # database.update_policy policy # API call - # - def update_policy new_policy - ensure_service! - grpc = service.set_database_policy \ - instance_id, database_id, new_policy.to_grpc - Policy.from_grpc grpc - end - alias policy= update_policy - - ## - # Tests the specified permissions against the [Cloud - # IAM](https://cloud.google.com/iam/) access control policy. - # - # @see https://cloud.google.com/iam/docs/managing-policies Managing - # Policies - # - # @param [String, Array] permissions The set of permissions to - # check access for. Permissions with wildcards (such as `*` or - # `storage.*`) are not allowed. - # - # The permissions that can be checked on a database are: - # - # * spanner.databases.beginPartitionedDmlTransaction - # * spanner.databases.create - # * spanner.databases.createBackup - # * spanner.databases.list - # * spanner.databases.update - # * spanner.databases.updateDdl - # * spanner.databases.get - # * spanner.databases.getDdl - # * spanner.databases.getIamPolicy - # * spanner.databases.setIamPolicy - # * spanner.databases.beginReadOnlyTransaction - # * spanner.databases.beginOrRollbackReadWriteTransaction - # * spanner.databases.read - # * spanner.databases.select - # * spanner.databases.write - # * spanner.databases.drop - # - # @return [Array] The permissions that have access. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # perms = database.test_permissions "spanner.databases.get", - # "spanner.databases.update" - # perms.include? "spanner.databases.get" #=> true - # perms.include? "spanner.databases.update" #=> false - # - def test_permissions *permissions - permissions = Array(permissions).flatten - permissions = Array(permissions).flatten - ensure_service! - grpc = service.test_database_permissions \ - instance_id, database_id, permissions - grpc.permissions - end - - ## - # @private Creates a new Database instance from a - # `Google::Cloud::Spanner::Admin::Database::V1::Database`. - def self.from_grpc grpc, service - new grpc, service - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless service - end - - def session_path instance_id, database_id, session_id - V1::SpannerClient.session_path( - project_id, instance_id, database_id, session_id - ) - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database/backup_info.rb b/google-cloud-spanner/lib/google/cloud/spanner/database/backup_info.rb deleted file mode 100644 index 90fc3366055f..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database/backup_info.rb +++ /dev/null @@ -1,119 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -module Google - module Cloud - module Spanner - class Database - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database::V1::BackupInfo} instead. - class BackupInfo - ## - # @private Creates a new Database::BackupInfo instance. - def initialize grpc - @grpc = grpc - end - - ## - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.backup.split("/")[1] - end - - ## - # The unique identifier for the instance. - # @return [String] - def instance_id - @grpc.backup.split("/")[3] - end - - ## - # The unique identifier for the backup. - # @return [String] - def backup_id - @grpc.backup.split("/")[5] - end - - ## - # The full path for the backup. Values are of the form - # `projects//instances//backups/`. - # @return [String] - def path - @grpc.backup - end - - ## - # Name of the database the backup was created from. - # @return [String] - def source_database_id - @grpc.source_database.split("/")[5] - end - - ## - # The unique identifier for the source database project. - # @return [String] - def source_database_project_id - @grpc.backup.split("/")[1] - end - - ## - # The unique identifier for the source database instance. - # @return [String] - def source_database_instance_id - @grpc.backup.split("/")[3] - end - - ## - # The full path for the source database the backup was created from. - # Values are of the form - # `projects//instances//database/`. - # @return [String] - def source_database_path - @grpc.source_database - end - - ## - # The timestamp indicating the creation of the backup. - # @return [Time] - def create_time - Convert.timestamp_to_time @grpc.create_time - end - - ## - # The backup contains an externally consistent copy of - # `source_database` at the timestamp specified by - # the `version_time` received. If no `version_time` was - # given during the creation of the backup, the `version_time` - # will be the same as the `create_time`. - # @return [Time] - def version_time - Convert.timestamp_to_time @grpc.version_time - end - - ## - # @private Creates a new Database::BackupInfo instance from a - # `Google::Cloud::Spanner::Admin::Database::V1::BackupInfo`. - def self.from_grpc grpc - new grpc - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database/job.rb b/google-cloud-spanner/lib/google/cloud/spanner/database/job.rb deleted file mode 100644 index 43f34714e206..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database/job.rb +++ /dev/null @@ -1,222 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/status" -require "google/cloud/spanner/database/job/list" - -module Google - module Cloud - module Spanner - class Database - ## - # # Job - # - # A resource representing the long-running, asynchronous processing of - # a database create or update operation. The job can be refreshed to - # retrieve the database object once the operation has been completed. - # - # See {Project#create_database} and {Database#update}. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation - # Long-running Operation - # - # @deprecated Use the long-running operation returned by - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_database} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - class Job - ## - # @private The `Gapic::Operation` gRPC object. - attr_accessor :grpc - - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private Creates a new Database::Job instance. - def initialize - @grpc = nil - @service = nil - end - - ## - # The database that is the object of the operation. - # - # @return [Google::Cloud::Spanner::Database, nil] The database, or - # `nil` if the operation is not complete. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # job.reload! - # job.done? #=> true - # database = job.database - # - def database - return nil unless done? - return nil unless @grpc.grpc_op.result == :response - return nil unless @grpc.results.instance_of? \ - Admin::Database::V1::Database - Database.from_grpc @grpc.results, service - end - - ## - # Checks if the processing of the database operation is complete. - # - # @return [boolean] `true` when complete, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # - def done? - @grpc.done? - end - - ## - # Checks if the processing of the database operation has errored. - # - # @return [boolean] `true` when errored, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.error? #=> false - # - def error? - @grpc.error? - end - - ## - # The status if the operation associated with this job produced an - # error. - # - # @return [Google::Cloud::Spanner::Status, nil] A status object with - # the status code and message, or `nil` if no error occurred. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.error? # true - # - # error = job.error - # - def error - return nil unless error? - Google::Cloud::Spanner::Status.from_grpc @grpc.error - end - - ## - # Reloads the job with current data from the long-running, - # asynchronous processing of a database operation. - # - # @return [Google::Cloud::Spanner::Database::Job] The same job - # instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - def reload! - @grpc.reload! - self - end - alias refresh! reload! - - ## - # Reloads the job until the operation is complete. The delay between - # reloads will incrementally increase. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # job.wait_until_done! - # job.done? #=> true - # - def wait_until_done! - @grpc.wait_until_done! - end - - ## - # @private New Database::Job from a `Gapic::Operation` object. - def self.from_grpc grpc, service - new.tap do |job| - job.instance_variable_set :@grpc, grpc - job.instance_variable_set :@service, service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database/job/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/database/job/list.rb deleted file mode 100644 index 899e6dd3a647..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database/job/list.rb +++ /dev/null @@ -1,184 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Database - class Job - ## - # # List - # - # List is a special case Array with additional values for database - # operations. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_database_operations} - # instead. - # - class List < DelegateClass(::Array) - # @private - # The gRPC Service object. - attr_accessor :service - - # @private - # The gRPC page enumerable object. - attr_accessor :grpc - - ## - # @private Create a new Database::Job::List with an array of - # Google::Lognrunning::Operation instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of database jobs. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # if jobs.next? - # next_jobs = jobs.next - # end - # - def next? - grpc.next_page? - end - - ## - # Retrieve the next page of database jobs. - # - # @return [Google::Cloud::Spanner::Database::Job::List] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # if jobs.next? - # next_jobs = jobs.next - # end - # - def next - ensure_service! - - return nil unless next? - grpc.next_page - self.class.from_grpc grpc, service - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining - # results are retrieved. (Unlike `#each`, for example, which merely - # iterates over the results returned by a single API call.) Use with - # caution. - # - # @yield [job] The block for accessing each database job. - # @yieldparam [Google::Cloud::Spanner::Database::Job] job The - # database job object. - # - # @return [Enumerator] - # - # @example Iterating each database job by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # jobs.all do |job| - # puts job.database.database_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # all_database_ids = jobs.all.map do |job| - # job.database.database_id - # end - # - def all &block - return enum_for :all unless block_given? - - results = self - loop do - results.each(&block) - break unless next? - grpc.next_page - results = self.class.from_grpc grpc, service - end - end - - ## - # @private - # - # New Database::Job::List from a - # `Gapic::PagedEnumerable` - # object. Operation object is a database operation. - # - def self.from_grpc grpc, service - operations_client = \ - service.databases.instance_variable_get "@operations_client" - jobs = new(Array(grpc.response.operations).map do |job_grpc| - Job.from_grpc \ - Gapic::Operation.new(job_grpc, operations_client), - service - end) - jobs.grpc = grpc - jobs.service = service - jobs - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/database/list.rb deleted file mode 100644 index 5d67f521a7cc..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database/list.rb +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Database - ## - # Database::List is a special case Array with additional - # values. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_databases} - # instead. - class List < DelegateClass(::Array) - ## - # If not empty, indicates that there are more records that match - # the request and this value should be passed to continue. - attr_accessor :token - - ## - # @private Create a new Database::List with an array of - # Database instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of databases. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # if databases.next? - # next_databases = databases.next - # end - def next? - !token.nil? - end - - ## - # Retrieve the next page of databases. - # - # @return [Database::List] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # if databases.next? - # next_databases = databases.next - # end - def next - return nil unless next? - ensure_service! - options = { token: token, max: @max } - grpc = @service.list_databases @instance_id, **options - self.class.from_grpc grpc, @service, @max - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining results - # are retrieved. (Unlike `#each`, for example, which merely iterates - # over the results returned by a single API call.) Use with caution. - # - # @param [Integer] request_limit The upper limit of API requests to - # make to load all databases. Default is no limit. - # @yield [database] The block for accessing each database. - # @yieldparam [Database] database The database object. - # - # @return [Enumerator] - # - # @example Iterating each database by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # databases.all do |database| - # puts database.database_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # all_database_ids = databases.all.map do |database| - # database.database_id - # end - # - # @example Limit the number of API calls made: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # databases.all(request_limit: 10) do |database| - # puts database.database_id - # end - # - def all request_limit: nil, &block - request_limit = request_limit.to_i if request_limit - unless block_given? - return enum_for :all, request_limit: request_limit - end - results = self - loop do - results.each(&block) - if request_limit - request_limit -= 1 - break if request_limit.negative? - end - break unless results.next? - results = results.next - end - end - - ## - # @private New Database::List from a - # `Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse` - # object. - def self.from_grpc grpc, service, instance_id, max = nil - databases = List.new(Array(grpc.databases).map do |database| - Database.from_grpc database, service - end) - databases.instance_variable_set :@instance_id, instance_id - token = grpc.next_page_token - token = nil if token == "".freeze - databases.instance_variable_set :@token, token - databases.instance_variable_set :@service, service - databases.instance_variable_set :@max, max - databases - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/database/restore_info.rb b/google-cloud-spanner/lib/google/cloud/spanner/database/restore_info.rb deleted file mode 100644 index 2394e177be8e..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/database/restore_info.rb +++ /dev/null @@ -1,68 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/database/backup_info" - -module Google - module Cloud - module Spanner - class Database - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo} instead. - class RestoreInfo - ## - # @private Creates a new Database::RestoreInfo instance. - def initialize grpc - @grpc = grpc - end - - ## - # The database restored from source type `:BACKUP`. - # @return [Symbol] - def source_type - @grpc.source_type - end - - ## - # Database restored from backup. - # - # @return [Boolean] - def source_backup? - @grpc.source_type == :BACKUP - end - - # Information about the backup used to restore the database. - # The backup may no longer exist. - # - # @return [Google::Cloud::Spanner::Database::BackupInfo, nil] - def backup_info - return nil unless @grpc.backup_info - BackupInfo.from_grpc @grpc.backup_info - end - - ## - # @private Creates a new Database::RestoreInfo instance from a - # `Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo` - def self.from_grpc grpc - new grpc - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/errors.rb b/google-cloud-spanner/lib/google/cloud/spanner/errors.rb deleted file mode 100644 index 5f0c4643c089..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/errors.rb +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/errors" - -module Google - module Cloud - module Spanner - ## - # # Rollback - # - # Used to rollback a transaction without passing on the exception. See - # {Client#transaction}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - # - # if something_wrong? - # # Rollback the transaction without passing on the error - # # outside of the transaction method. - # raise Google::Cloud::Spanner::Rollback - # end - # end - # - class Rollback < Google::Cloud::Error - end - - ## - # # DuplicateNameError - # - # Data accessed by name (typically by calling - # {Google::Cloud::Spanner::Data#[]} with a key or calling - # {Google::Cloud::Spanner::Data#to_h}) has more than one occurrence of the - # same name. Such data should be accessed by position rather than by name. - # - class DuplicateNameError < Google::Cloud::Error - end - - ## - # # SessionLimitError - # - # More sessions have been allocated than configured for. - class SessionLimitError < Google::Cloud::Error - end - - ## - # # ClientClosedError - # - # The client is closed and can no longer be used. - class ClientClosedError < Google::Cloud::Error - end - - ## - # # BatchUpdateError - # - # Includes the cause and the partial result set of row counts from a - # failed batch DML operation. Contains a cause error that provides service - # error type and message, and a list with the exact number of rows that - # were modified for each successful statement before the error. - # - # See {Google::Cloud::Spanner::Transaction#batch_update}. - # - # @attr_reader [Array] row_counts A list with the exact number of - # rows that were modified for each successful statement. - class BatchUpdateError < Google::Cloud::Error - attr_reader :row_counts - - ## - # @private New Status from a Google::Rpc::Status object. - def self.from_grpc grpc - row_counts = grpc.result_sets.map do |rs| - rs.stats.row_count_exact - end - new.tap do |result| - result.instance_variable_set :@row_counts, row_counts - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/fields.rb b/google-cloud-spanner/lib/google/cloud/spanner/fields.rb deleted file mode 100644 index 366726b296d6..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/fields.rb +++ /dev/null @@ -1,450 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - ## - # # Fields - # - # Represents the field names and types of data returned by Cloud Spanner. - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.fields.pairs.each do |name, type| - # puts "Column #{name} is type #{type}" - # end - # - class Fields - ## - # Creates {Fields} object from types. See {Client#fields}. - # - # This object can be used to create {Data} objects by providing values - # that match the field types. See {Fields#struct}. - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] types Accepts an array or hash types. - # - # Arrays can contain just the type value, or a sub-array of the - # field's name and type value. Hash keys must contain the field name - # as a `Symbol` or `String`, or the field position as an `Integer`. - # Hash values must contain the type value. If a Hash is used the - # fields will be created using the same order as the Hash keys. - # - # Supported type values include: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @return [Fields] The fields of the given types. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # named_type = Google::Cloud::Spanner::Fields.new( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # anon_type = Google::Cloud::Spanner::Fields.new( - # [:INT64, :STRING, :BOOL] - # ) - # anon_data = anon_type.struct [42, nil, false] - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # dup_type = Google::Cloud::Spanner::Fields.new( - # [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # ) - # dup_data = dup_type.struct [42, nil, false] - # - def initialize types - types = types.to_a if types.is_a? Hash - - unless types.is_a? Array - raise ArgumentError, "can only accept Array or Hash" - end - - sorted_types, unsorted_types = types.partition do |type| - type.is_a?(Array) && type.count == 2 && type.first.is_a?(Integer) - end - - verify_sorted_types! sorted_types, types.count - - @grpc_fields = Array.new types.count do |index| - sorted_type = sorted_types.assoc index - if sorted_type - to_grpc_field sorted_type.last - else - to_grpc_field unsorted_types.shift - end - end - end - - ## - # Returns the types of the data. - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @return [Array] An array containing the types of the data. - # - def types - @grpc_fields.map(&:type).map do |type| - case type.code - when :ARRAY - if type.array_element_type.code == :STRUCT - [Fields.from_grpc(type.array_element_type.struct_type.fields)] - else - [type.array_element_type.code] - end - when :STRUCT - Fields.from_grpc type.struct_type.fields - else - type.code - end - end - end - - ## - # Returns the names of the data values, or in cases in which values are - # unnamed, the zero-based index position of values. - # - # @return [Array<(String,Integer)>] An array containing the names - # (String) or position (Integer) for the corresponding values of the - # data. - # - def keys - @grpc_fields.map.with_index do |field, index| - if field.name.empty? - index - else - field.name.to_sym - end - end - end - - ## - # Detects duplicate names in the keys for the fields. - # - # @return [Boolean] Returns `true` if there are duplicate names. - # - def duplicate_names? - keys.group_by { |e| e }.select { |_k, v| v.size > 1 }.any? - end - - ## - # Returns the names or positions and their corresponding types as an - # array of arrays. - # - # @return [Array] An array containing name/position and types - # pairs. - # - def pairs - keys.zip types - end - - ## - # Returns the type code for the provided name (String) or index - # (Integer). Do not pass a name to this method if the data has more than - # one member with the same name. (See {#duplicate_names?}) - # - # @param [String, Integer] key The name (String) or zero-based index - # position (Integer) of the value. - # - # @raise [Google::Cloud::Spanner::DuplicateNameError] if the data - # contains duplicate names. - # - # @return [Symbol, nil] The type code, or nil if no value is found. - # - def [] key - return types[key] if key.is_a? Integer - name_count = @grpc_fields.find_all { |f| f.name == String(key) }.count - return nil if name_count.zero? - raise DuplicateNameError if name_count > 1 - index = @grpc_fields.find_index { |f| f.name == String(key) } - types[index] - end - - # rubocop:disable all - - ## - # Creates a new {Data} object given the data values matching the fields. - # Can be provided as either an Array of values, or a Hash where the hash - # keys match the field name or match the index position of the field. - # - # For more information, see [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] data Accepts an array or hash data values. - # - # Arrays can contain just the data value, nested arrays will be - # treated as lists of values. Values must be provided in the same - # order as the fields, and there is no way to associate values to the - # field names. - # - # Hash keys must contain the field name as a `Symbol` or `String`, or - # the field position as an `Integer`. Hash values must contain the - # data value. Hash values will be matched to the fields, so they don't - # need to match the same order as the fields. - # - # @return [Data] A new Data object. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # named_type = db.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # anon_type = db.fields [:INT64, :STRING, :BOOL] - # anon_data = anon_type.struct [42, nil, false] - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # dup_type = db.fields [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # dup_data = dup_type.struct [42, nil, false] - # - def struct data - # create local copy of types so they are parsed just once. - cached_types = types - if data.nil? - return Data.from_grpc nil, @grpc_fields - elsif data.is_a? Array - # Convert data in the order it was recieved - values = data.map.with_index do |datum, index| - Convert.object_to_grpc_value_and_type(datum, cached_types[index]).first - end - return Data.from_grpc values, @grpc_fields - elsif data.is_a? Hash - # Pull values from hash in order of the fields, - # we can't always trust the Hash to be in order. - values = @grpc_fields.map.with_index do |field, index| - if data.key? index - Convert.object_to_grpc_value_and_type(data[index], - cached_types[index]).first - elsif !field.name.to_s.empty? - if data.key? field.name.to_s - Convert.object_to_grpc_value_and_type(data[field.name.to_s], - cached_types[index]).first - elsif data.key? field.name.to_s.to_sym - Convert.object_to_grpc_value_and_type(data[field.name.to_s.to_sym], - cached_types[index]).first - else - raise "data value for field #{field.name} missing" - end - else - raise "data value for field #{index} missing" - end - end - return Data.from_grpc values, @grpc_fields - end - raise ArgumentError, "can only accept Array or Hash" - end - alias data struct - alias new struct - - # rubocop:enable all - - ## - # Returns the type codes as an array. Do not use this method if the data - # has more than one member with the same name. (See {#duplicate_names?}) - # - # @return [Array|Fields|Array>] An array - # containing the type codes. - # - def to_a - types - end - - ## - # Returns the names or indexes and corresponding type codes as a hash. - # - # @raise [Google::Cloud::Spanner::DuplicateNameError] if the data - # contains duplicate names. - # - # @return [Hash<(Symbol|Integer) => - # (Symbol|Array|Fields|Array)] A hash containing the - # names or indexes and corresponding types. - # - def to_h - raise DuplicateNameError if duplicate_names? - pairs.to_h - end - - # @private - def count - @grpc_fields.count - end - alias size count - - # @private - def == other - return false unless other.is_a? Fields - pairs == other.pairs - end - alias eql? == - - # @private - def hash - # The Protobuf object looks to maintain consistent hash values - # for objects with the same configuration. - to_grpc_type.hash - end - - # @private - def to_s - named_types = pairs.map do |key, type| - if key.is_a? Integer - type.inspect - else - "(#{key})#{type.inspect}" - end - end - "(#{named_types.join ', '})" - end - - # @private - def inspect - "#<#{self.class.name} #{self}>" - end - - ## - # @private - def to_grpc_type - V1::Type.new( - code: :STRUCT, - struct_type: V1::StructType.new( - fields: @grpc_fields - ) - ) - end - - ## - # @private Creates a new Fields instance from a - # V1::Metadata::Row_type::Fields. - def self.from_grpc fields - new([]).tap do |f| - f.instance_variable_set :@grpc_fields, Array(fields) - end - end - - protected - - # rubocop:disable all - - def verify_sorted_types! sorted_types, total_count - sorted_unique_positions = sorted_types.map(&:first).uniq.sort - return if sorted_unique_positions.empty? - - if sorted_unique_positions.first < 0 - raise ArgumentError, "cannot specify position less than 0" - end - if sorted_unique_positions.last >= total_count - raise ArgumentError, "cannot specify position more than field count" - end - if sorted_types.count != sorted_unique_positions.count - raise ArgumentError, "cannot specify position more than once" - end - end - - def to_grpc_field pair - if pair.is_a?(Array) - if pair.count == 2 - if pair.first.is_a?(Integer) - V1::StructType::Field.new( - type: Convert.grpc_type_for_field(pair.last) - ) - else - V1::StructType::Field.new( - name: String(pair.first), - type: Convert.grpc_type_for_field(pair.last) - ) - end - else - V1::StructType::Field.new( - type: V1::Type.new( - code: :ARRAY, - array_element_type: Convert.grpc_type_for_field(pair.last) - ) - ) - end - else - # TODO: Handle Fields object - # TODO: Handle Hash by creating Fields object - unless pair.is_a?(Symbol) - raise ArgumentError, "type must be a symbol" - end - V1::StructType::Field.new( - type: Convert.grpc_type_for_field(pair) - ) - end - - # rubocop:enable all - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/instance.rb b/google-cloud-spanner/lib/google/cloud/spanner/instance.rb deleted file mode 100644 index 34246a71fed3..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/instance.rb +++ /dev/null @@ -1,977 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/instance/job" -require "google/cloud/spanner/instance/list" -require "google/cloud/spanner/instance/config" -require "google/cloud/spanner/database" -require "google/cloud/spanner/policy" - -module Google - module Cloud - module Spanner - ## - # # Instance - # - # NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for - # mananging instances will only be available through the - # [google-cloud-spanner-admin-instance-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-instance-v1) - # client. See the - # [README](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner#google-cloud-spanner) - # for further details. - # - # Represents a Cloud Spanner instance. Instances are dedicated Cloud - # Spanner serving and storage resources to be used by Cloud Spanner - # databases. Instances offer isolation: problems with databases in one - # instance will not affect other instances. However, within an instance - # databases can affect each other. For example, if one database in an - # instance receives a lot of requests and consumes most of the instance - # resources, fewer resources are available for other databases in that - # instance, and their performance may suffer. - # - # See {Google::Cloud::Spanner::Project#instances}, - # {Google::Cloud::Spanner::Project#instance}, and - # {Google::Cloud::Spanner::Project#create_instance}. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # instance = job.instance - # end - # - class Instance - ## - # @private The gRPC Service object. - attr_accessor :service - - # @private Creates a new Instance instance. - def initialize grpc, service - @grpc = grpc - @service = service - @current_values = grpc.to_h - end - - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.name.split("/")[1] - end - - # The unique identifier for the instance. - # @return [String] - def instance_id - @grpc.name.split("/")[3] - end - - ## - # The full path for the instance resource. Values are of the form - # `projects//instances/`. - # @return [String] - def path - @grpc.name - end - - ## - # The descriptive name for this instance as it appears in UIs. Must be - # unique per project and between 4 and 30 characters in length. - # @return [String] - def name - @grpc.display_name - end - alias display_name name - - ## - # The instance configuration resource. - # @return [Instance::Config] - def config - ensure_service! - config_grpc = service.get_instance_config @grpc.config - Instance::Config.from_grpc config_grpc - rescue Google::Cloud::NotFoundError - @grpc.config - end - - ## - # Updates the descriptive name for this instance as it appears in UIs. - # @param display_name [String] The descriptive name for this instance. - def name= display_name - @grpc.display_name = display_name - end - alias display_name= name= - - ## - # The number of nodes allocated to this instance. - # @return [Integer] - def nodes - @grpc.node_count - end - alias node_count nodes - - ## - # Updates the number of nodes allocated to this instance. - # @param nodes [Integer] The number of nodes allocated to this instance. - def nodes= nodes - @grpc.node_count = nodes - end - alias node_count= nodes= - - ## - # The number of processing units allocated to this instance. - # - # @return [Integer] - def processing_units - @grpc.processing_units - end - - ## - # Updates number of processing units allocated to this instance. - # - # @param units [Integer] The number of processing units allocated - # to this instance. - def processing_units= units - @grpc.processing_units = units - end - - ## - # The current instance state. Possible values are `:CREATING` and - # `:READY`. - # @return [Symbol] - def state - @grpc.state - end - - ## - # The instance is still being created. Resources may not be available - # yet, and operations such as database creation may not work. - # @return [Boolean] - def creating? - state == :CREATING - end - - ## - # The instance is fully created and ready to do work such as creating - # databases. - # @return [Boolean] - def ready? - state == :READY - end - - ## - # Cloud Labels are a flexible and lightweight mechanism for organizing - # cloud resources into groups that reflect a customer's organizational - # needs and deployment strategies. Cloud Labels can be used to filter - # collections of resources. They can be used to control how resource - # metrics are aggregated. And they can be used as arguments to policy - # management rules (e.g. route, firewall, load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must conform - # to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must - # conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given resource. - # - # @return [Hash{String=>String}] The label keys and values in a hash. - # - def labels - @grpc.labels - end - - ## - # Updates the Cloud Labels. - # @param labels [Hash{String=>String}] The Cloud Labels. - def labels= labels - @grpc.labels = Google::Protobuf::Map.new( - :string, :string, - labels.to_h { |k, v| [String(k), String(v)] } - ) - end - - ## - # Update changes. - # `display_name`, `labels`, `nodes`, `processing_units` can be - # updated. `processing_units` and `nodes` can be used interchangeably - # to update. - # - # @return [Instance::Job] The job representing the long-running, - # asynchronous processing of an instance update operation. - # @raise [ArgumentError] if both processing_units or nodes are specified. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # instance.display_name = "prod-instance" - # instance.labels = { env: "prod", app: "api" } - # instance.nodes = 2 - # # OR - # # instance.processing_units = 500 - # - # job = instance.save - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # instance = job.instance - # end - # - def save - ensure_service! - - field_mask = [] - @current_values.each do |field, value| - field_mask << field unless @grpc[field.to_s] == value - end - - job_grpc = service.update_instance @grpc, field_mask: field_mask - @current_values = @grpc.to_h - Instance::Job.from_grpc job_grpc, service - end - alias update save - - ## - # Permanently deletes the instance. - # - # Immediately upon completion of the request: - # - # * Billing ceases for all of the instance's reserved resources. - # - # Soon afterward: - # - # * The instance and all of its databases immediately and irrevocably - # disappear from the API. All data in the databases is permanently - # deleted. - # - # @return [Boolean] Returns `true` if the instance was deleted. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # instance.delete - # - def delete - ensure_service! - service.delete_instance path - true - end - - ## - # Retrieves the list of databases for the given instance. - # - # @param [String] token The `token` value returned by the last call to - # `databases`; indicates that this is a continuation of a call, - # and that the system should return the next page of data. - # @param [Integer] max Maximum number of databases to return. - # - # @return [Array] (See - # {Google::Cloud::Spanner::Database::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # databases = instance.databases - # databases.each do |database| - # puts database.database_id - # end - # - # @example Retrieve all: (See {Instance::Config::List#all}) - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # databases = instance.databases - # databases.all do |database| - # puts database.database_id - # end - # - def databases token: nil, max: nil - ensure_service! - grpc = service.list_databases instance_id, token: token, max: max - Database::List.from_grpc grpc, service, instance_id, max - end - - ## - # Retrieves a database belonging to the instance by identifier. - # - # @param [String] database_id The unique identifier for the database. - # - # @return [Google::Cloud::Spanner::Database, nil] Returns `nil` - # if database does not exist. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # database = instance.database "my-database" - # - # @example Will return `nil` if instance does not exist. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # database = instance.database "my-database" # nil - # - def database database_id - ensure_service! - grpc = service.get_database instance_id, database_id - Database.from_grpc grpc, service - rescue Google::Cloud::NotFoundError - nil - end - - ## - # Creates a database and starts preparing it to begin serving. - # - # See {Database::Job}. - # - # @param [String] database_id The unique identifier for the database, - # which cannot be changed after the database is created. Values are of - # the form `[a-z][a-z0-9_\-]*[a-z0-9]` and must be between 2 and 30 - # characters in length. Required. - # @param [Array] statements DDL statements to run inside the - # newly created database. Statements can create tables, indexes, etc. - # These statements execute atomically with the creation of the - # database: if there is an error in any statement, the database is not - # created. Optional. - # @param [Hash] encryption_config An encryption configuration describing - # the encryption type and key resources in Cloud KMS. Optional. The - # following settings can be provided: - # - # * `:kms_key_name` (String) The name of KMS key to use which should - # be the full path, e.g., `projects//locations/\ - # /keyRings//cryptoKeys/` - # - # @return [Database::Job] The job representing the long-running, - # asynchronous processing of a database create operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # job = instance.create_database "my-new-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - # @example Create with encryption config - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # kms_key_name = "projects//locations//keyRings//cryptoKeys/" - # job = instance.create_database "my-new-database", encryption_config: { kms_key_name: kms_key_name } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - def create_database database_id, statements: [], encryption_config: nil - grpc = service.create_database instance_id, database_id, - statements: statements, - encryption_config: encryption_config - Database::Job.from_grpc grpc, service - end - - ## - # Retrieves the list of database operations for the given instance. - # - # @param filter [String] - # A filter expression that filters what operations are returned in the - # response. - # - # The response returns a list of - # `Google::Longrunning::Operation` long-running operations whose names - # are prefixed by a database name within the specified instance. - # The long-running operation - # `Google::Longrunning::Operation#metadata` metadata field type - # `metadata.type_url` describes the type of the metadata. - # - # The filter expression must specify the field name, - # a comparison operator, and the value that you want to use for - # filtering. The value must be a string, a number, or a boolean. - # The comparison operator must be - # <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator - # which is roughly synonymous with equality. Filter rules are case - # insensitive. - # - # The long-running operation fields eligible for filtering are: - # * `name` --> The name of the long-running operation - # * `done` --> False if the operation is in progress, else true. - # * `metadata.type_url` (using filter string `metadata.@type`) and - # fields in `metadata.value` (using filter string - # `metadata.`, where is a field in - # metadata.value) are eligible for filtering. - # * `error` --> Error associated with the long-running operation. - # * `response.type_url` (using filter string `response.@type`) and - # fields in `response.value` (using filter string - # `response.`, where is a field in - # response.value)are eligible for filtering. - # - # To filter on multiple expressions, provide each separate - # expression within parentheses. By default, each expression - # is an AND expression. However, you can include AND, OR, and NOT - # expressions explicitly. - # - # Some examples of using filters are: - # - # * `done:true` --> The operation is complete. - # * `(metadata.@type:type.googleapis.com/google.spanner.admin.\ - # database.v1.RestoreDatabaseMetadata) - # AND (metadata.source_type:BACKUP) - # AND (metadata.backup_info.backup:backup_howl) - # AND (metadata.name:restored_howl) - # AND (metadata.progress.start_time < \"2018-03-28T14:50:00Z\") - # AND (error:*)` - # --> Return RestoreDatabase operations from backups whose name - # contains "backup_howl", where the created database name - # contains the string "restored_howl", the start_time of the - # restore operation is before 2018-03-28T14:50:00Z, - # and the operation returned an error. - # @param page_size [Integer] - # The maximum number of resources contained in the underlying API - # response. If page streaming is performed per-resource, this - # parameter does not affect the return value. If page streaming is - # performed per-page, this determines the maximum number of - # resources in a page. - # - # @return [Array] List - # representing the long-running, asynchronous processing - # of a database operations. - # (See {Google::Cloud::Spanner::Database::Job::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # jobs.each do |job| - # if job.error? - # p job.error - # else - # p job.database.database_id - # end - # end - # - # @example Retrieve all - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations - # jobs.all do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - # @example List by page size - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # jobs = instance.database_operations page_size: 10 - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - # @example Filter and list - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # filter = "metadata.@type:CreateDatabaseMetadata" - # jobs = instance.database_operations filter: filter - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.database.database_id - # end - # end - # - def database_operations filter: nil, page_size: nil - grpc = service.list_database_operations \ - instance_id, - filter: filter, - page_size: page_size - Database::Job::List.from_grpc grpc, service - end - - ## - # Retrieves backups belonging to the instance. - # - # @param [String] filter Optional. A filter expression that filters - # backups listed in the response. The expression must specify the - # field name, a comparison operator, and the value that you want to - # use for filtering. The value must be a string, a number, or a - # boolean. The comparison operator must be - # <, >, <=, >=, !=, =, or :. Colon ':' represents a HAS operator - # which is roughly synonymous with equality. - # Filter rules are case insensitive. - # - # The fields eligible for filtering are: - # * `name` - # * `database` - # * `state` - # * `create_time`(and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `expire_time`(and values are of the format YYYY-MM-DDTHH:MM:SSZ) - # * `size_bytes` - # - # To filter on multiple expressions, provide each separate expression - # within parentheses. By default, each expression is an AND - # expression. However, you can include AND, OR, and NOT expressions - # explicitly. - # - # Some examples of using filters are: - # - # * `name:Howl` --> The backup's name contains the string "howl". - # * `database:prod` - # --> The database's name contains the string "prod". - # * `state:CREATING` --> The backup is pending creation. - # * `state:READY` --> The backup is fully created and ready for use. - # * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` - # --> The backup name contains the string "howl" and - # `create_time` of the backup is before - # 2018-03-28T14:50:00Z. - # * `expire_time < \"2018-03-28T14:50:00Z\"` - # --> The backup `expire_time` is before 2018-03-28T14:50:00Z. - # * `size_bytes > 10000000000` --> - # The backup's size is greater than 10GB - # @param [Integer] page_size Optional. Number of backups to be returned - # in the response. If 0 or less, defaults to the server's maximum - # allowed page size. - # @return [Array] Enumerable list of - # backups. (See {Google::Cloud::Spanner::Backup::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # instance.backups.all.each do |backup| - # puts backup.backup_id - # end - # - # @example List backups by page size - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # instance.backups(page_size: 5).all.each do |backup| - # puts backup.backup_id - # end - # - # @example Filter and list backups - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # # filter backups by name. - # instance.backups(filter: "name:my-backup").all.each do |backup| - # puts backup.backup_id - # end - # - # # filter backups by database name. - # instance.backups(filter: "database:prod-db").all.each do |backup| - # puts backup.backup_id - # end - # - def backups filter: nil, page_size: nil - ensure_service! - grpc = service.list_backups \ - instance_id, - filter: filter, - page_size: page_size - Backup::List.from_grpc grpc, service - end - - ## - # Retrieves a backup belonging to the instance by identifier. - # - # @param [String] backup_id The unique identifier for the backup. - # - # @return [Google::Cloud::Spanner::Backup, nil] Returns `nil` - # if database does not exist. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # backup = instance.backup "my-backup" - # - # @example Will return `nil` if backup does not exist. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # backup = instance.backup "non-existing-backup" # nil - # - def backup backup_id - ensure_service! - grpc = service.get_backup instance_id, backup_id - Backup.from_grpc grpc, service - rescue Google::Cloud::NotFoundError - nil - end - - ## - # Retrieves the list of database backup operations for the given - # instance. - # - # @param filter [String] - # A filter expression that filters what operations are returned in the - # response. - # - # The response returns a list of - # `Google::Longrunning::Operation` long-running operations whose names - # are prefixed by a backup name within the specified instance. - # The long-running operation - # `Google::Longrunning::Operation#metadata` metadata field type - # `metadata.type_url` describes the type of the metadata. - # - # The filter expression must specify the field name of an operation, a - # comparison operator, and the value that you want to use for - # filtering. - # The value must be a string, a number, or a boolean. The comparison - # operator must be - # <, >, <=, >=, !=, =, or :. Colon ':'' represents a HAS operator - # which is roughly synonymous with equality. Filter rules are case - # insensitive. - # - # The long-running operation fields eligible for filtering are: - # * `name` --> The name of the long-running operation - # * `done` --> False if the operation is in progress, else true. - # * `metadata.type_url` (using filter string `metadata.@type`) and - # fields in `metadata.value` (using filter string - # `metadata.`, where is a field in - # metadata.value) are eligible for filtering. - # * `error` --> Error associated with the long-running operation. - # * `response.type_url` (using filter string `response.@type`) and - # fields in `response.value` (using filter string - # `response.`, where is a field in - # response.value) are eligible for filtering. - # - # To filter on multiple expressions, provide each separate - # expression within parentheses. By default, each expression is an - # AND expression. However, you can include AND, OR, and NOT - # expressions explicitly. - # - # Some examples of using filters are: - # - # * `done:true` --> The operation is complete. - # * `metadata.database:prod` - # --> The database the backup was taken from has a name containing - # the string "prod". - # * `(metadata.@type:type.googleapis.com/google.spanner.admin.\ - # database.v1.CreateBackupMetadata) - # AND (metadata.name:howl) - # AND (metadata.progress.start_time < \"2018-03-28T14:50:00Z\") - # AND (error:*)` - # --> Return CreateBackup operations where the created backup name - # contains the string "howl", the progress.start_time of the - # backup operation is before 2018-03-28T14:50:00Z, and the - # operation returned an error. - # @param page_size [Integer] - # The maximum number of resources contained in the underlying API - # response. If page streaming is performed per-resource, this - # parameter does not affect the return value. If page streaming is - # performed per-page, this determines the maximum number of - # resources in a page. - # - # @return [Array] List representing - # the long-running, asynchronous processing of a backup operations. - # (See {Google::Cloud::Spanner::Backup::Job::List}) - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # jobs.each do |job| - # if job.error? - # p job.error - # else - # p job.backup.backup_id - # end - # end - # - # @example Retrieve all - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations - # jobs.all do |job| - # if job.error? - # p job.error - # else - # p job.backup.backup_id - # end - # end - # - # @example List by page size - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # jobs = instance.backup_operations page_size: 10 - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.backup.backup_id - # end - # end - # - # @example Filter and list - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance = spanner.instance "my-instance" - # - # filter = "metadata.@type:CreateBackupMetadata" - # jobs = instance.backup_operations filter: filter - # jobs.each do |job| - # if job.error? - # p job.error - # else - # puts job.backup.backup_id - # end - # end - # - def backup_operations filter: nil, page_size: nil - grpc = service.list_backup_operations \ - instance_id, - filter: filter, - page_size: page_size - Backup::Job::List.from_grpc grpc, service - end - - ## - # Gets the [Cloud IAM](https://cloud.google.com/iam/) access control - # policy for this instance. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Policy - # google.iam.v1.IAMPolicy - # - # @yield [policy] A block for updating the policy. The latest policy - # will be read from the Spanner service and passed to the block. After - # the block completes, the modified policy will be written to the - # service. - # @yieldparam [Policy] policy the current Cloud IAM Policy for this - # instance - # - # @return [Policy] The current Cloud IAM Policy for this instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy - # - # @example Update the policy by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # instance.policy do |p| - # p.add "roles/owner", "user:owner@example.com" - # end # 2 API calls - # - def policy - ensure_service! - grpc = service.get_instance_policy path - policy = Policy.from_grpc grpc - return policy unless block_given? - yield policy - update_policy policy - end - - ## - # Updates the [Cloud IAM](https://cloud.google.com/iam/) access control - # policy for this instance. The policy should be read from {#policy}. - # See {Google::Cloud::Spanner::Policy} for an explanation of the policy - # `etag` property and how to modify policies. - # - # You can also update the policy by passing a block to {#policy}, which - # will call this method internally after the block completes. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Policy - # google.iam.v1.IAMPolicy - # - # @param [Policy] new_policy a new or modified Cloud IAM Policy for this - # instance - # - # @return [Policy] The policy returned by the API update operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy # API call - # - # policy.add "roles/owner", "user:owner@example.com" - # - # instance.update_policy policy # API call - # - def update_policy new_policy - ensure_service! - grpc = service.set_instance_policy path, new_policy.to_grpc - Policy.from_grpc grpc - end - alias policy= update_policy - - ## - # Tests the specified permissions against the [Cloud - # IAM](https://cloud.google.com/iam/) access control policy. - # - # @see https://cloud.google.com/iam/docs/managing-policies Managing - # Policies - # - # @param [String, Array] permissions The set of permissions to - # check access for. Permissions with wildcards (such as `*` or - # `storage.*`) are not allowed. - # - # The permissions that can be checked on a instance are: - # - # * pubsub.instances.create - # * pubsub.instances.list - # * pubsub.instances.get - # * pubsub.instances.getIamPolicy - # * pubsub.instances.update - # * pubsub.instances.setIamPolicy - # * pubsub.instances.delete - # - # @return [Array] The permissions that have access. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # perms = instance.test_permissions "spanner.instances.get", - # "spanner.instances.update" - # perms.include? "spanner.instances.get" #=> true - # perms.include? "spanner.instances.update" #=> false - # - def test_permissions *permissions - permissions = Array(permissions).flatten - permissions = Array(permissions).flatten - ensure_service! - grpc = service.test_instance_permissions path, permissions - grpc.permissions - end - - ## - # @private Creates a new Instance instance from a - # `Google::Cloud::Spanner::Admin::Instance::V1::Instance`. - def self.from_grpc grpc, service - new grpc, service - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless service - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/instance/config.rb b/google-cloud-spanner/lib/google/cloud/spanner/instance/config.rb deleted file mode 100644 index f86d1657b98f..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/instance/config.rb +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/instance/config/list" - -module Google - module Cloud - module Spanner - class Instance - ## - # # Instance Config - # - # Represents a Cloud Spanner instance configuration. Instance - # configurations define the geographic placement of nodes and their - # replication. - # - # See {Google::Cloud::Spanner::Project#instance_configs} and - # {Google::Cloud::Spanner::Project#instance_config}. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance_configs = spanner.instance_configs - # instance_configs.each do |config| - # puts config.instance_config_id - # end - # - class Config - ## - # @private Creates a new Instance::Config instance. - def initialize grpc - @grpc = grpc - end - - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.name.split("/")[1] - end - - ## - # A unique identifier for the instance configuration. - # @return [String] - def instance_config_id - @grpc.name.split("/")[3] - end - - ## - # The full path for the instance config resource. Values are of the - # form `projects//instanceConfigs/`. - # @return [String] - def path - @grpc.name - end - - ## - # The name of this instance configuration as it appears in UIs. - # @return [String] - def name - @grpc.display_name - end - alias display_name name - - ## - # @private Creates a new Instance::Config instance from a - # `Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig`. - def self.from_grpc grpc - new grpc - end - - protected - - ## - # @private Raise an error unless an active connection to the service - # is available. - def ensure_service! - raise "Must have active connection to service" unless service - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/instance/config/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/instance/config/list.rb deleted file mode 100644 index 652c21a3a732..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/instance/config/list.rb +++ /dev/null @@ -1,178 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Instance - class Config - ## - # Instance::Config::List is a special case Array with additional - # values. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instance_configs} - # instead. - class List < DelegateClass(::Array) - ## - # If not empty, indicates that there are more records that match - # the request and this value should be passed to continue. - attr_accessor :token - - ## - # @private Create a new Instance::Config::List with an array of - # Instance::Config instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of instance configs. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # configs = spanner.instance_configs - # if configs.next? - # next_configs = configs.next - # end - def next? - !token.nil? - end - - ## - # Retrieve the next page of instance configurations. - # - # @return [Instance::Config::List] The list of instance - # configurations. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # configs = spanner.instance_configs - # if configs.next? - # next_configs = configs.next - # end - def next - return nil unless next? - ensure_service! - options = { token: token, max: @max } - grpc = @service.list_instance_configs(**options) - self.class.from_grpc grpc, @service, @max - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining - # results are retrieved. (Unlike `#each`, for example, which merely - # iterates over the results returned by a single API call.) Use with - # caution. - # - # @param [Integer] request_limit The upper limit of API requests to - # make to load all configs. Default is no limit. - # @yield [config] The block for accessing each instance config. - # @yieldparam [Instance::Config] config The instance config object. - # - # @return [Enumerator] - # - # @example Iterating each instance config by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # spanner.instance_configs.all do |config| - # puts config.instance_config_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # all_config_ids = spanner.instance_configs.all.map do |config| - # config.instance_config_id - # end - # - # @example Limit the number of API calls made: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # spanner.instance_configs.all(request_limit: 10) do |config| - # puts config.instance_config_id - # end - # - def all request_limit: nil, &block - request_limit = request_limit.to_i if request_limit - unless block_given? - return enum_for :all, request_limit: request_limit - end - results = self - loop do - results.each(&block) - if request_limit - request_limit -= 1 - break if request_limit.negative? - end - break unless results.next? - results = results.next - end - end - - ## - # @private New Instance::Config::List from a - # `Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse` - # object. - def self.from_grpc grpc, service, max = nil - configs = List.new(Array(grpc.instance_configs).map do |config| - Instance::Config.from_grpc config - end) - token = grpc.next_page_token - token = nil if token == "".freeze - configs.instance_variable_set :@token, token - configs.instance_variable_set :@service, service - configs.instance_variable_set :@max, max - configs - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/instance/job.rb b/google-cloud-spanner/lib/google/cloud/spanner/instance/job.rb deleted file mode 100644 index 5f2d46509b5f..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/instance/job.rb +++ /dev/null @@ -1,240 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "google/cloud/spanner/status" - -module Google - module Cloud - module Spanner - class Instance - ## - # # Job - # - # A resource representing the long-running, asynchronous processing of - # an instance create or update operation. The job can be refreshed to - # retrieve the instance object once the operation has been completed. - # - # See {Project#create_instance} and {Instance#update}. - # - # @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation - # Long-running Operation - # - # @deprecated Use the long-running operation returned by - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#create_instance} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # instance = job.instance - # end - # - class Job - ## - # @private The `Gapic::Operation` gRPC object. - attr_accessor :grpc - - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private Creates a new Instance::Job instance. - def initialize - @grpc = nil - @service = nil - end - - ## - # The instance that is the object of the operation. - # - # @return [Google::Cloud::Spanner::Instance, nil] The instance, or - # `nil` if the operation is not complete. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! - # job.done? #=> true - # instance = job.instance - # - def instance - return nil unless done? - return nil unless @grpc.grpc_op.result == :response - Instance.from_grpc @grpc.results, service - end - - ## - # Checks if the processing of the instance operation is complete. - # - # @return [boolean] `true` when complete, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # - def done? - @grpc.done? - end - - ## - # Checks if the processing of the instance operation has errored. - # - # @return [boolean] `true` when errored, `false` otherwise. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.error? #=> false - # - def error? - @grpc.error? - end - - ## - # The status if the operation associated with this job produced an - # error. - # - # @return [Google::Cloud::Spanner::Status, nil] A status object with - # the status code and message, or `nil` if no error occurred. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.error? # true - # - # error = job.error - # - def error - return nil unless error? - Google::Cloud::Spanner::Status.from_grpc @grpc.error - end - - ## - # Reloads the job with current data from the long-running, - # asynchronous processing of an instance operation. - # - # @return [Google::Cloud::Spanner::Instance::Job] The same job - # instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - def reload! - @grpc.reload! - self - end - alias refresh! reload! - - ## - # Reloads the job until the operation is complete. The delay between - # reloads will incrementally increase. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.wait_until_done! - # job.done? #=> true - # - def wait_until_done! - @grpc.wait_until_done! - end - - ## - # @private New Instance::Job from a `Gapic::Operation` object. - def self.from_grpc grpc, service - new.tap do |job| - job.instance_variable_set :@grpc, grpc - job.instance_variable_set :@service, service - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/instance/list.rb b/google-cloud-spanner/lib/google/cloud/spanner/instance/list.rb deleted file mode 100644 index c102b317ae57..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/instance/list.rb +++ /dev/null @@ -1,174 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class -# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards. - - -require "delegate" - -module Google - module Cloud - module Spanner - class Instance - ## - # Instance::List is a special case Array with additional - # values. - # - # @deprecated Use the result of - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instances} - # instead. - class List < DelegateClass(::Array) - ## - # If not empty, indicates that there are more records that match - # the request and this value should be passed to continue. - attr_accessor :token - - ## - # @private Create a new Instance::List with an array of - # Instance instances. - def initialize arr = [] - super arr - end - - ## - # Whether there is a next page of instances. - # - # @return [Boolean] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instances = spanner.instances - # if instances.next? - # next_instances = instances.next - # end - def next? - !token.nil? - end - - ## - # Retrieve the next page of instances. - # - # @return [Instance::List] The list of instances. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instances = spanner.instances - # if instances.next? - # next_instances = instances.next - # end - def next - return nil unless next? - ensure_service! - options = { token: token, max: @max } - grpc = @service.list_instances(**options) - self.class.from_grpc grpc, @service, @max - end - - ## - # Retrieves remaining results by repeatedly invoking {#next} until - # {#next?} returns `false`. Calls the given block once for each - # result, which is passed as the argument to the block. - # - # An Enumerator is returned if no block is given. - # - # This method will make repeated API calls until all remaining results - # are retrieved. (Unlike `#each`, for example, which merely iterates - # over the results returned by a single API call.) Use with caution. - # - # @param [Integer] request_limit The upper limit of API requests to - # make to load all instances. Default is no limit. - # @yield [instance] The block for accessing each instance. - # @yieldparam [Instance] instance The instance object. - # - # @return [Enumerator] - # - # @example Iterating each instance by passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # spanner.instances.all do |instance| - # puts instance.instance_id - # end - # - # @example Using the enumerator by not passing a block: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # all_instance_ids = spanner.instances.all.map do |instance| - # instance.instance_id - # end - # - # @example Limit the number of API calls made: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # spanner.instances.all(request_limit: 10) do |instance| - # puts instance.instance_id - # end - # - def all request_limit: nil, &block - request_limit = request_limit.to_i if request_limit - unless block_given? - return enum_for :all, request_limit: request_limit - end - results = self - loop do - results.each(&block) - if request_limit - request_limit -= 1 - break if request_limit.negative? - end - break unless results.next? - results = results.next - end - end - - ## - # @private New Instance::List from a - # `Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse` - # object. - def self.from_grpc grpc, service, max = nil - instances = List.new(Array(grpc.instances).map do |instance| - Instance.from_grpc instance, service - end) - token = grpc.next_page_token - token = nil if token == "".freeze - instances.instance_variable_set :@token, token - instances.instance_variable_set :@service, service - instances.instance_variable_set :@max, max - instances - end - - protected - - ## - # Raise an error unless an active service is available. - def ensure_service! - raise "Must have active connection" unless @service - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/partition.rb b/google-cloud-spanner/lib/google/cloud/spanner/partition.rb deleted file mode 100644 index 52b70f2e6b7b..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/partition.rb +++ /dev/null @@ -1,217 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "json" -require "base64" - -module Google - module Cloud - module Spanner - ## - # # Partition - # - # Defines the segments of data to be read in a batch read/query context. A - # Partition instance can be serialized and used across several different - # machines or processes. - # - # See {BatchSnapshot#partition_read}, {BatchSnapshot#partition_query}, and - # {BatchSnapshot#execute_partition}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # results = batch_snapshot.execute_partition partition - # - class Partition - # @ private - attr_reader :execute - attr_reader :read - - ## - # @private Creates a Partition object. - def initialize - end - - ## - # Whether the partition was created for an execute_query/query - # operation. - # @return [Boolean] - def execute_query? - !@execute.nil? - end - alias execute? execute_query? - alias execute_sql? execute_query? - alias query? execute_query? - - ## - # Whether the partition was created for a read operation. - # @return [Boolean] - def read? - !@read.nil? - end - - ## - # @private - # Whether the partition does not have an execute_query or read - # operation. - # @return [Boolean] - def empty? - @execute.nil? && @read.nil? - end - - ## - # @private - # Converts the the batch partition object to a Hash ready for - # serialization. - # - # @return [Hash] A hash containing a representation of the batch - # partition object. - # - def to_h - {}.tap do |h| - h[:execute] = Base64.strict_encode64 @execute.to_proto if @execute - h[:read] = Base64.strict_encode64 @read.to_proto if @read - end - end - - ## - # Serializes the batch partition object so it can be recreated on - # another process. See {Partition.load} and - # {BatchClient#load_partition}. - # - # @return [String] The serialized representation of the batch partition. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def dump - JSON.dump to_h - end - alias serialize dump - - ## - # Returns a {Partition} from a serialized representation. - # - # @param [String] data The serialized representation of an existing - # batch partition. See {Partition#dump}. - # - # @return [Google::Cloud::Spanner::Partition] - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # - # serialized_snapshot = batch_snapshot.dump - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = Google::Cloud::Spanner::Partition.load \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def self.load data - data = JSON.parse data, symbolize_names: true unless data.is_a? Hash - - # TODO: raise if hash[:execute_query].nil? && hash[:read].nil? - new.tap do |p| - if data[:execute] - execute_sql_grpc = \ - V1::ExecuteSqlRequest.decode( - Base64.decode64(data[:execute]) - ) - p.instance_variable_set :@execute, execute_sql_grpc - end - if data[:read] - read_grpc = V1::ReadRequest.decode \ - Base64.decode64(data[:read]) - p.instance_variable_set :@read, read_grpc - end - end - end - - # @private - def inspect - status = "empty" - status = "execute" if execute? - status = "read" if read? - "#<#{self.class.name} #{status}>" - end - - ## - # @private New Partition from a `Google::Cloud::Spanner::V1::ExecuteSqlRequest` - # object. - def self.from_execute_sql_grpc grpc - new.tap do |p| - p.instance_variable_set :@execute, grpc - end - end - - ## - # @private New Partition from a `Google::Cloud::Spanner::V1::ReadRequest` object. - def self.from_read_grpc grpc - new.tap do |p| - p.instance_variable_set :@read, grpc - end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/policy.rb b/google-cloud-spanner/lib/google/cloud/spanner/policy.rb deleted file mode 100644 index 5c6b0a7b5f7a..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/policy.rb +++ /dev/null @@ -1,188 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" - -module Google - module Cloud - module Spanner - ## - # # Policy - # - # Represents a Cloud IAM Policy for the Spanner service. - # - # A common pattern for updating a resource's metadata, such as its Policy, - # is to read the current data from the service, update the data locally, - # and then send the modified data for writing. This pattern may result in - # a conflict if two or more processes attempt the sequence simultaneously. - # IAM solves this problem with the {Google::Cloud::Spanner::Policy#etag} - # property, which is used to verify whether the policy has changed since - # the last request. When you make a request to with an `etag` value, Cloud - # IAM compares the `etag` value in the request with the existing `etag` - # value associated with the policy. It writes the policy only if the - # `etag` values match. - # - # When you update a policy, first read the policy (and its current `etag`) - # from the service, then modify the policy locally, and then write the - # modified policy to the service. See - # {Google::Cloud::Spanner::Instance#policy} and - # {Google::Cloud::Spanner::Instance#policy=} and - # {Google::Cloud::Spanner::Database#policy} and - # {Google::Cloud::Spanner::Database#policy=}. - # - # @see https://cloud.google.com/iam/docs/managing-policies Managing - # policies - # @see https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Policy - # google.iam.v1.IAMPolicy - # - # @attr [String] etag Used to verify whether the policy has changed since - # the last request. The policy will be written only if the `etag` values - # match. - # @attr [Hash{String => Array}] roles The bindings that associate - # roles with an array of members. See [Understanding - # Roles](https://cloud.google.com/iam/docs/understanding-roles) for a - # listing of primitive and curated roles. - # See [Binding](https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Binding) - # for a listing of values and patterns for members. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy do |p| - # p.remove "roles/owner", "user:owner@example.com" - # p.add "roles/owner", "user:newowner@example.com" - # p.roles["roles/viewer"] = ["allUsers"] - # end - # - class Policy - attr_reader :etag - attr_reader :roles - - ## - # @private Creates a Policy object. - def initialize etag, roles - @etag = etag - @roles = roles - end - - ## - # Convenience method for adding a member to a binding on this policy. - # See [Understanding - # Roles](https://cloud.google.com/iam/docs/understanding-roles) for a - # listing of primitive and curated roles. - # See [Binding](https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Binding) - # for a listing of values and patterns for members. - # - # @param [String] role_name A Cloud IAM role, such as - # `"roles/spanner.admin"`. - # @param [String] member A Cloud IAM identity, such as - # `"user:owner@example.com"`. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy do |p| - # p.add "roles/owner", "user:newowner@example.com" - # end - # - def add role_name, member - role(role_name) << member - end - - ## - # Convenience method for removing a member from a binding on this - # policy. See [Understanding - # Roles](https://cloud.google.com/iam/docs/understanding-roles) for a - # listing of primitive and curated roles. See - # [Binding](https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Binding) - # for a listing of values and patterns for members. - # - # @param [String] role_name A Cloud IAM role, such as - # `"roles/spanner.admin"`. - # @param [String] member A Cloud IAM identity, such as - # `"user:owner@example.com"`. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy do |p| - # p.remove "roles/owner", "user:owner@example.com" - # end - # - def remove role_name, member - role(role_name).delete member - end - - ## - # Convenience method returning the array of members bound to a role in - # this policy, or an empty array if no value is present for the role in - # {#roles}. See [Understanding - # Roles](https://cloud.google.com/iam/docs/understanding-roles) for a - # listing of primitive and curated roles. See - # [Binding](https://cloud.google.com/spanner/reference/rpc/google.iam.v1#google.iam.v1.Binding) - # for a listing of values and patterns for members. - # - # @return [Array] The members strings, or an empty array. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # policy = instance.policy do |p| - # p.role("roles/viewer") << "user:viewer@example.com" - # end - # - def role role_name - roles[role_name] ||= [] - end - - ## - # @private Convert the Policy to a `Google::Iam::V1::Policy` object. - def to_grpc - Google::Iam::V1::Policy.new( - etag: etag, - bindings: roles.keys.map do |role_name| - next if roles[role_name].empty? - Google::Iam::V1::Binding.new( - role: role_name, - members: roles[role_name] - ) - end.compact - ) - end - - ## - # @private New Policy from a `Google::Iam::V1::Policy` object. - def self.from_grpc grpc - roles = grpc.bindings.each_with_object({}) do |binding, memo| - memo[binding.role] = binding.members.to_a - end - new grpc.etag, roles - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/pool.rb b/google-cloud-spanner/lib/google/cloud/spanner/pool.rb deleted file mode 100644 index 8b21888dee5b..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/pool.rb +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "concurrent" -require "google/cloud/spanner/errors" -require "google/cloud/spanner/session" - -module Google - module Cloud - module Spanner - ## - # @private - # - # # Pool - # - # Implements a pool for managing and reusing - # {Google::Cloud::Spanner::Session} instances. - # - class Pool - attr_accessor :all_sessions - attr_accessor :session_queue - attr_accessor :transaction_queue - - def initialize client, min: 10, max: 100, keepalive: 1800, - write_ratio: 0.3, fail: true, threads: nil - @client = client - @min = min - @max = max - @keepalive = keepalive - @write_ratio = write_ratio - @write_ratio = 0 if write_ratio.negative? - @write_ratio = 1 if write_ratio > 1 - @fail = fail - @threads = threads || [2, Concurrent.processor_count * 2].max - - @mutex = Mutex.new - @resource = ConditionVariable.new - - # initialize pool and availability queue - init - end - - def with_session - session = checkout_session - begin - yield session - ensure - checkin_session session - end - end - - def checkout_session - action = nil - @mutex.synchronize do - loop do - raise ClientClosedError if @closed - - # Use LIFO to ensure sessions are used from backend caches, which - # will reduce the read / write latencies on user requests. - read_session = session_queue.pop # LIFO - return read_session if read_session - write_transaction = transaction_queue.pop # LIFO - return write_transaction.session if write_transaction - - if can_allocate_more_sessions? - action = :new - break - end - - raise SessionLimitError if @fail - - @resource.wait @mutex - end - end - - return new_session! if action == :new - end - - def checkin_session session - @mutex.synchronize do - unless all_sessions.include? session - raise ArgumentError, "Cannot checkin session" - end - - session_queue.push session - - @resource.signal - end - - nil - end - - def with_transaction - tx = checkout_transaction - begin - yield tx - ensure - future do - # Create and checkin a new transaction - tx = tx.session.create_transaction - checkin_transaction tx - end - end - end - - def checkout_transaction - action = nil - @mutex.synchronize do - loop do - raise ClientClosedError if @closed - - write_transaction = transaction_queue.pop # LIFO - return write_transaction if write_transaction - read_session = session_queue.pop - if read_session - action = read_session - break - end - - if can_allocate_more_sessions? - action = :new - break - end - - raise SessionLimitError if @fail - - @resource.wait @mutex - end - end - if action.is_a? Google::Cloud::Spanner::Session - return action.create_transaction - end - return new_transaction! if action == :new - end - - def checkin_transaction txn - @mutex.synchronize do - unless all_sessions.include? txn.session - raise ArgumentError, "Cannot checkin session" - end - - transaction_queue.push txn - - @resource.signal - end - - nil - end - - def reset - close - init - - @mutex.synchronize do - @closed = false - end - - true - end - - def close - shutdown - @thread_pool.wait_for_termination - - true - end - - def keepalive_or_release! - to_keepalive = [] - to_release = [] - - @mutex.synchronize do - available_count = session_queue.count + transaction_queue.count - release_count = @min - available_count - release_count = 0 if release_count.negative? - - to_keepalive += (session_queue + transaction_queue).select do |x| - x.idle_since? @keepalive - end - - # Remove a random portion of the sessions and transactions - to_release = to_keepalive.sample release_count - to_keepalive -= to_release - - # Remove those to be released from circulation - @all_sessions -= to_release.map(&:session) - @session_queue -= to_release - @transaction_queue -= to_release - end - - to_release.each { |x| future { x.release! } } - to_keepalive.each { |x| future { x.keepalive! } } - end - - private - - def init - # init the thread pool - @thread_pool = Concurrent::ThreadPoolExecutor.new \ - max_threads: @threads - # init the queues - @new_sessions_in_process = 0 - @transaction_queue = [] - # init the keepalive task - create_keepalive_task! - # init session queue - @all_sessions = @client.batch_create_new_sessions @min - sessions = @all_sessions.dup - num_transactions = (@min * @write_ratio).round - pending_transactions = sessions.shift num_transactions - # init transaction queue - pending_transactions.each do |transaction| - future { checkin_transaction transaction.create_transaction } - end - @session_queue = sessions - end - - def shutdown - @mutex.synchronize do - @closed = true - end - @keepalive_task.shutdown - # Unblock all waiting threads - @resource.broadcast - # Delete all sessions - @mutex.synchronize do - @all_sessions.each { |s| future { s.release! } } - @all_sessions = [] - @session_queue = [] - @transaction_queue = [] - end - # shutdown existing thread pool - @thread_pool.shutdown - end - - def new_session! - @mutex.synchronize do - @new_sessions_in_process += 1 - end - - begin - session = @client.create_new_session - rescue StandardError => e - @mutex.synchronize do - @new_sessions_in_process -= 1 - end - raise e - end - - @mutex.synchronize do - @new_sessions_in_process -= 1 - all_sessions << session - end - - session - end - - def new_transaction! - new_session!.create_transaction - end - - def can_allocate_more_sessions? - # This is expected to be called from within a synchronize block - all_sessions.size + @new_sessions_in_process < @max - end - - def create_keepalive_task! - @keepalive_task = Concurrent::TimerTask.new execution_interval: 300 do - keepalive_or_release! - end - @keepalive_task.execute - end - - def future &block - Concurrent::Future.new(executor: @thread_pool, &block).execute - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/project.rb b/google-cloud-spanner/lib/google/cloud/spanner/project.rb deleted file mode 100644 index c2b5a5e3fb40..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/project.rb +++ /dev/null @@ -1,684 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/service" -require "google/cloud/spanner/client" -require "google/cloud/spanner/batch_client" -require "google/cloud/spanner/instance" -require "google/cloud/spanner/database" -require "google/cloud/spanner/range" - -module Google - module Cloud - module Spanner - ## - # # Project - # - # Projects are top-level containers in Google Cloud Platform. They store - # information about billing and authorized users, and they contain - # Cloud Spanner data. Each project has a friendly name and a unique ID. - # - # Google::Cloud::Spanner::Project is the main object for interacting with - # Cloud Spanner. - # - # {Google::Cloud::Spanner::Instance} and - # {Google::Cloud::Spanner::Database} objects are created, - # accessed, and managed by Google::Cloud::Spanner::Project. - # - # A {Google::Cloud::Spanner::Client} obtained from a project can be used - # to read and/or modify data in a Cloud Spanner database. - # - # See {Google::Cloud::Spanner.new} and {Google::Cloud#spanner}. - # - # @example Obtaining an instance and a database from a project. - # require "google/cloud" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # database = instance.database "my-database" - # - # @example Obtaining a client for use with a database. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - class Project - ## - # @private The Service object. - attr_accessor :service, :query_options - - ## - # @private Creates a new Spanner Project instance. - def initialize service, query_options: nil - @service = service - @query_options = query_options - end - - ## - # The identifier for the Cloud Spanner project. - # - # @example - # require "google/cloud" - # - # spanner = Google::Cloud::Spanner.new( - # project_id: "my-project", - # credentials: "/path/to/keyfile.json" - # ) - # - # spanner.project_id #=> "my-project" - # - def project_id - service.project - end - alias project project_id - - ## - # Retrieves the list of Cloud Spanner instances for the project. - # - # @param [String] token The `token` value returned by the last call to - # `instances`; indicates that this is a continuation of a call, - # and that the system should return the next page of data. - # @param [Integer] max Maximum number of instances to return. - # - # @return [Array] The list of - # instances. (See {Google::Cloud::Spanner::Instance::List}) - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instances} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instances = spanner.instances - # instances.each do |instance| - # puts instance.instance_id - # end - # - # @example Retrieve all: (See {Instance::Config::List#all}) - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instances = spanner.instances - # instances.all do |instance| - # puts instance.instance_id - # end - # - def instances token: nil, max: nil - ensure_service! - grpc = service.list_instances token: token, max: max - Instance::List.from_grpc grpc, service, max - end - - ## - # Retrieves a Cloud Spanner instance by unique identifier. - # - # @param [String] instance_id The unique identifier for the instance. - # - # @return [Google::Cloud::Spanner::Instance, nil] The instance, or `nil` - # if the instance does not exist. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#get_instance} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "my-instance" - # - # @example Will return `nil` if instance does not exist. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # instance = spanner.instance "non-existing" # nil - # - def instance instance_id - ensure_service! - grpc = service.get_instance instance_id - Instance.from_grpc grpc, service - rescue Google::Cloud::NotFoundError - nil - end - - ## - # Creates a Cloud Spanner instance and starts preparing it to begin - # serving. - # - # See {Instance::Job}. - # - # @param [String] instance_id The unique identifier for the instance, - # which cannot be changed after the instance is created. Values are of - # the form `[a-z][-a-z0-9]*[a-z0-9]` and must be between 6 and 30 - # characters in length. Required. - # @param [String] name The descriptive name for this instance as it - # appears in UIs. Must be unique per project and between 4 and 30 - # characters in length. Required. - # @param [String, Instance::Config] config The name of the instance's - # configuration. Values can be the `instance_config_id`, the full - # path, or an {Instance::Config} object. Required. - # @param [Integer] nodes The number of nodes allocated to this instance. - # Optional. Specify either `nodes` or `processing_units` - # @param [Integer] processing_units The number of processing units - # allocated to this instance. Optional. Specify either `nodes` - # or `processing_units` - # @param [Hash] labels Cloud Labels are a flexible and lightweight - # mechanism for organizing cloud resources into groups that reflect a - # customer's organizational needs and deployment strategies. Cloud - # Labels can be used to filter collections of resources. They can be - # used to control how resource metrics are aggregated. And they can be - # used as arguments to policy management rules (e.g. route, firewall, - # load balancing, etc.). - # - # * Label keys must be between 1 and 63 characters long and must - # conform to the following regular expression: - # `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must - # conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given resource. - # - # @return [Instance::Job] The job representing the long-running, - # asynchronous processing of an instance create operation. - # @raise [ArgumentError] if both processing_units or nodes are specified. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#create_instance} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # nodes: 5, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # instance = job.instance - # end - # - # @example Create instance using processsing units - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_instance "my-new-instance", - # name: "My New Instance", - # config: "regional-us-central1", - # processing_units: 500, - # labels: { production: :env } - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # instance = job.instance - # end - # - def create_instance instance_id, name: nil, config: nil, nodes: nil, - processing_units: nil, labels: nil - config = config.path if config.respond_to? :path - - # Convert from possible Google::Protobuf::Map - labels = labels.to_h { |k, v| [String(k), String(v)] } if labels - grpc = service.create_instance \ - instance_id, name: name, config: config, nodes: nodes, - processing_units: processing_units, labels: labels - Instance::Job.from_grpc grpc, service - end - - ## - # Retrieves the list of instance configurations for the project. - # - # @param [String] token The `token` value returned by the last call to - # `instance_configs`; indicates that this is a continuation of a call, - # and that the system should return the next page of data. - # @param [Integer] max Maximum number of instance configs to return. - # - # @return [Array] The list of - # instance configurations. (See - # {Google::Cloud::Spanner::Instance::Config::List}) - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instance_configs} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance_configs = spanner.instance_configs - # instance_configs.each do |config| - # puts config.instance_config_id - # end - # - # @example Retrieve all: (See {Instance::Config::List#all}) - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # instance_configs = spanner.instance_configs - # instance_configs.all do |config| - # puts config.instance_config_id - # end - # - def instance_configs token: nil, max: nil - ensure_service! - grpc = service.list_instance_configs token: token, max: max - Instance::Config::List.from_grpc grpc, service, max - end - - ## - # Retrieves an instance configuration by unique identifier. - # - # @param [String] instance_config_id The instance configuration - # identifier. Values can be the `instance_config_id`, or the full - # path. - # - # @return [Google::Cloud::Spanner::Instance::Config, nil] The instance - # configuration, or `nil` if the instance configuration does not - # exist. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#get_instance_config} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # config = spanner.instance_config "regional-us-central1" - # - # @example Will return `nil` if instance config does not exist. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # config = spanner.instance_config "non-existing" # nil - # - def instance_config instance_config_id - ensure_service! - grpc = service.get_instance_config instance_config_id - Instance::Config.from_grpc grpc - rescue Google::Cloud::NotFoundError - nil - end - - ## - # Retrieves the list of databases for the project. - # - # @param [String] instance_id The unique identifier for the instance. - # @param [String] token The `token` value returned by the last call to - # `databases`; indicates that this is a continuation of a call, - # and that the system should return the next page of data. - # @param [Integer] max Maximum number of databases to return. - # - # @return [Array] The list of - # databases. (See {Google::Cloud::Spanner::Database::List}) - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_databases} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # databases.each do |database| - # puts database.database_id - # end - # - # @example Retrieve all: (See {Instance::Config::List#all}) - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # databases = spanner.databases "my-instance" - # databases.all do |database| - # puts database.database_id - # end - # - def databases instance_id, token: nil, max: nil - ensure_service! - grpc = service.list_databases instance_id, token: token, max: max - Database::List.from_grpc grpc, service, instance_id, max - end - - ## - # Retrieves a database by unique identifier. - # - # @param [String] instance_id The unique identifier for the instance. - # @param [String] database_id The unique identifier for the database. - # - # @return [Google::Cloud::Spanner::Database, nil] The database, or `nil` - # if the database does not exist. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#get_database} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" - # - # @example Will return `nil` if instance does not exist. - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # database = spanner.database "my-instance", "my-database" # nil - # - def database instance_id, database_id - ensure_service! - grpc = service.get_database instance_id, database_id - Database.from_grpc grpc, service - rescue Google::Cloud::NotFoundError - nil - end - - ## - # Creates a database and starts preparing it to begin serving. - # - # See {Database::Job}. - # - # @param [String] instance_id The unique identifier for the instance. - # Required. - # @param [String] database_id The unique identifier for the database, - # which cannot be changed after the database is created. Values are of - # the form `[a-z][a-z0-9_\-]*[a-z0-9]` and must be between 2 and 30 - # characters in length. Required. - # @param [Array] statements DDL statements to run inside the - # newly created database. Statements can create tables, indexes, etc. - # These statements execute atomically with the creation of the - # database: if there is an error in any statement, the database is not - # created. Optional. - # @param [Hash] encryption_config An encryption configuration describing - # the encryption type and key resources in Cloud KMS. Optional. The - # following settings can be provided: - # - # * `:kms_key_name` (String) The name of KMS key to use which should - # be the full path, e.g., `projects//locations/\ - # /keyRings//cryptoKeys/` - # - # @return [Database::Job] The job representing the long-running, - # asynchronous processing of a database create operation. - # - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_database} - # instead. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - # @example Create with encryption config - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # kms_key_name = "projects//locations//keyRings//cryptoKeys/" - # encryption_config = { kms_key_name: kms_key_name } - # job = spanner.create_database "my-instance", - # "my-new-database", - # encryption_config: encryption_config - # - # job.done? #=> false - # job.reload! # API call - # job.done? #=> true - # - # if job.error? - # status = job.error - # else - # database = job.database - # end - # - def create_database instance_id, database_id, statements: [], - encryption_config: nil - grpc = service.create_database instance_id, database_id, - statements: statements, - encryption_config: encryption_config - Database::Job.from_grpc grpc, service - end - - ## - # Creates a Cloud Spanner client. A client is used to read and/or modify - # data in a Cloud Spanner database. - # - # @param [String] instance_id The unique identifier for the instance. - # Required. - # @param [String] database_id The unique identifier for the database. - # Required. - # @param [Hash] pool Settings to control how and when sessions are - # managed by the client. The following settings can be provided: - # - # * `:min` (Integer) Minimum number of sessions that the client will - # maintain at any point in time. The default is 10. - # * `:max` (Integer) Maximum number of sessions that the client will - # have at any point in time. The default is 100. - # * `:keepalive` (Numeric) The amount of time a session can be idle - # before an attempt is made to prevent the idle sessions from being - # closed by the Cloud Spanner service. The default is 1800 (30 - # minutes). - # * `:write_ratio` (Float) The ratio of sessions with pre-allocated - # transactions to those without. Pre-allocating transactions - # improves the performance of writes made by the client. The higher - # the value, the more transactions are pre-allocated. The value must - # be >= 0 and <= 1. The default is 0.3. - # * `:fail` (true/false) When `true` the client raises a - # {SessionLimitError} when the client has allocated the `max` number - # of sessions. When `false` the client blocks until a session - # becomes available. The default is `true`. - # * `:threads` (Integer) The number of threads in the thread pool. The - # default is twice the number of available CPUs. - # @param [Hash] labels The labels to be applied to all sessions - # created by the client. Cloud Labels are a flexible and lightweight - # mechanism for organizing cloud resources into groups that reflect a - # customer's organizational needs and deployment strategies. Cloud - # Labels can be used to filter collections of resources. They can be - # used to control how resource metrics are aggregated. And they can be - # used as arguments to policy management rules (e.g. route, firewall, - # load balancing, etc.). Optional. The default is `nil`. - # - # * Label keys must be between 1 and 63 characters long and must - # conform to the following regular expression: - # `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must - # conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given resource. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # - # @return [Client] The newly created client. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def client instance_id, database_id, pool: {}, labels: nil, - query_options: nil, database_role: nil - # Convert from possible Google::Protobuf::Map - labels = labels.to_h { |k, v| [String(k), String(v)] } if labels - # Configs set by environment variables take over client-level configs. - if query_options.nil? - query_options = @query_options - else - query_options = query_options.merge @query_options unless @query_options.nil? - end - Client.new self, instance_id, database_id, - session_labels: labels, - pool_opts: valid_session_pool_options(pool), - query_options: query_options, - database_role: database_role - end - - ## - # Creates a Cloud Spanner batch client. A batch client is used to read - # data across multiple machines or processes. - # - # @param [String] instance_id The unique identifier for the instance. - # Required. - # @param [String] database_id The unique identifier for the database. - # Required. - # @param [Hash] labels The labels to be applied to all sessions - # created by the batch client. Labels are a flexible and lightweight - # mechanism for organizing cloud resources into groups that reflect a - # customer's organizational needs and deployment strategies. Cloud - # Labels can be used to filter collections of resources. They can be - # used to control how resource metrics are aggregated. And they can be - # used as arguments to policy management rules (e.g. route, firewall, - # load balancing, etc.). Optional. The default is `nil`. - # - # * Label keys must be between 1 and 63 characters long and must - # conform to the following regular expression: - # `[a-z]([-a-z0-9]*[a-z0-9])?`. - # * Label values must be between 0 and 63 characters long and must - # conform to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`. - # * No more than 64 labels can be associated with a given resource. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # - # @return [Client] The newly created client. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # batch_client = spanner.batch_client "my-instance", "my-database" - # - # batch_snapshot = batch_client.batch_snapshot - # serialized_snapshot = batch_snapshot.dump - # - # partitions = batch_snapshot.partition_read "users", [:id, :name] - # - # partition = partitions.first - # serialized_partition = partition.dump - # - # # In a separate process - # new_batch_snapshot = batch_client.load_batch_snapshot \ - # serialized_snapshot - # - # new_partition = batch_client.load_partition \ - # serialized_partition - # - # results = new_batch_snapshot.execute_partition \ - # new_partition - # - def batch_client instance_id, database_id, labels: nil, - query_options: nil - # Convert from possible Google::Protobuf::Map - labels = labels.to_h { |k, v| [String(k), String(v)] } if labels - BatchClient.new self, instance_id, database_id, session_labels: labels, - query_options: query_options - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless service - end - - # @deprecated Use - # {Google::Cloud::Spanner::Admin::Database#database_admin Client#database_path} - # instead. - def database_path instance_id, database_id - Admin::Database::V1::DatabaseAdminClient.database_path( - project, instance_id, database_id - ) - end - - def valid_session_pool_options opts = {} - { - min: opts[:min], max: opts[:max], keepalive: opts[:keepalive], - write_ratio: opts[:write_ratio], fail: opts[:fail], - threads: opts[:threads] - }.delete_if { |_k, v| v.nil? } - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/range.rb b/google-cloud-spanner/lib/google/cloud/spanner/range.rb deleted file mode 100644 index 3a19b9859410..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/range.rb +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -module Google - module Cloud - module Spanner - ## - # # Range - # - # Represents a range of rows in a table or index. A range has a start key - # and an end key. These keys can be open or closed, indicating if the - # range includes rows with that key. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # key_range = db.range 1, 100 - # results = db.read "users", [:id, :name], keys: key_range - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - class Range - ## - # Returns the object that defines the beginning of the range. - attr_reader :begin - - ## - # Returns the object that defines the end of the range. - attr_reader :end - - ## - # Creates a Spanner Range. This can be used in place of a Ruby Range - # when needing to exclude the beginning value. - # - # @param [Object] beginning The object that defines the beginning of the - # range. - # @param [Object] ending The object that defines the end of the range. - # @param [Boolean] exclude_begin Determines if the range excludes its - # beginning value. Default is `false`. - # @param [Boolean] exclude_end Determines if the range excludes its - # ending value. Default is `false`. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # key_range = Google::Cloud::Spanner::Range.new 1, 100 - # results = db.read "users", [:id, :name], keys: key_range - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def initialize beginning, ending, exclude_begin: false, - exclude_end: false - @begin = beginning - @end = ending - @exclude_begin = exclude_begin - @exclude_end = exclude_end - end - - ## - # Returns `true` if the range excludes its beginning value. - # @return [Boolean] - def exclude_begin? - @exclude_begin - end - - ## - # Returns `true` if the range excludes its end value. - # @return [Boolean] - def exclude_end? - @exclude_end - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/results.rb b/google-cloud-spanner/lib/google/cloud/spanner/results.rb deleted file mode 100644 index 9b03206bbc22..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/results.rb +++ /dev/null @@ -1,408 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/data" - -module Google - module Cloud - module Spanner - ## - # # Results - # - # Represents the result set from an operation returning data. - # - # See {Google::Cloud::Spanner::Client#execute_query} and - # {Google::Cloud::Spanner::Client#read}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.fields.pairs.each do |name, type| - # puts "Column #{name} is type #{type}" - # end - # - class Results - RST_STREAM_INTERNAL_ERROR = "Received RST_STREAM".freeze - EOS_INTERNAL_ERROR = "Received unexpected EOS on DATA frame from server".freeze - ## - # The read timestamp chosen for single-use snapshots (read-only - # transactions). - # @return [Time] The chosen timestamp. - def timestamp - return nil if @metadata.nil? || @metadata.transaction.nil? - Convert.timestamp_to_time @metadata.transaction.read_timestamp - end - - ## - # Returns the configuration object ({Fields}) of the names and types of - # the rows in the returned data. - # - # @return [Fields] The fields of the returned data. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.fields.pairs.each do |name, type| - # puts "Column #{name} is type #{type}" - # end - # - def fields - @fields ||= Fields.from_grpc @metadata.row_type.fields - end - - # rubocop:disable all - - ## - # The values returned from the request. - # - # @yield [row] An enumerator for the rows. - # @yieldparam [Data] row object that contains the data values. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def rows - return nil if @closed - - unless block_given? - return enum_for(:rows) - end - - fields = @metadata.row_type.fields - values = [] - buffered_responses = [] - buffer_upper_bound = 10 - chunked_value = nil - resume_token = nil - should_resume_request = false - should_retry_request = false - - # Cannot call Enumerator#each because it won't return the first - # value that was already identified when calling Enumerator#peek. - # Iterate only using Enumerator#next and break on StopIteration. - loop do - begin - if should_resume_request - @enum = resume_request(resume_token) - buffered_responses = [] - should_resume_request = false - elsif should_retry_request - @enum = retry_request() - buffered_responses = [] - should_retry_request = false - end - - grpc = @enum.next - # metadata should be set before the first iteration... - @metadata ||= grpc.metadata - @stats ||= grpc.stats - - buffered_responses << grpc - - if (grpc.resume_token && grpc.resume_token != "") || - buffered_responses.size >= buffer_upper_bound - # This can set the resume_token to nil - resume_token = grpc.resume_token - - if fields.count > 0 - buffered_responses.each do |resp| - if chunked_value - resp.values.unshift merge(chunked_value, resp.values.shift) - chunked_value = nil - end - to_iterate = values + Array(resp.values) - chunked_value = to_iterate.pop if resp.chunked_value - values = to_iterate.pop(to_iterate.count % fields.count) - to_iterate.each_slice(fields.count) do |slice| - yield Data.from_grpc(slice, fields) - end - end - end - - # Flush the buffered responses now that they are all handled - buffered_responses = [] - end - # TODO: once the generated client throws only Google Cloud errors, remove - # the GRPC errors from the rescue block - rescue GRPC::Aborted, - GRPC::Cancelled, - GRPC::DeadlineExceeded, - GRPC::Internal, - GRPC::ResourceExhausted, - GRPC::Unauthenticated, - GRPC::Unavailable, - GRPC::Core::CallError, - Google::Cloud::AbortedError, - Google::Cloud::CanceledError, - Google::Cloud::DeadlineExceededError, - Google::Cloud::InternalError, - Google::Cloud::ResourceExhaustedError, - Google::Cloud::UnauthenticatedError, - Google::Cloud::UnavailableError => err - - if resumable?(resume_token) - should_resume_request = true - elsif retryable?(err) - should_retry_request = true - elsif err.is_a?(Google::Cloud::Error) - raise err - else - raise Google::Cloud::Error.from_error(err) - end - - # TODO: once the generated client throws only Google Cloud errors, remove - # this rescue block (for GRPC::BadStatus) - rescue GRPC::BadStatus => err - raise Google::Cloud::Error.from_error(err) - rescue StopIteration - break - end - end - - # clear out any remaining values left over - if fields.count > 0 - buffered_responses.each do |resp| - if chunked_value - resp.values.unshift merge(chunked_value, resp.values.shift) - chunked_value = nil - end - to_iterate = values + Array(resp.values) - chunked_value = to_iterate.pop if resp.chunked_value - values = to_iterate.pop(to_iterate.count % fields.count) - to_iterate.each_slice(fields.count) do |slice| - yield Data.from_grpc(slice, fields) - end - end - values.each_slice(fields.count) do |slice| - yield Data.from_grpc(slice, fields) - end - end - - # If we get this far then we can release the session - @closed = true - nil - end - - # rubocop:enable all - - ## - # @private - # Checks if a request can be resumed by inspecting the resume token - def resumable? resume_token - resume_token && !resume_token.empty? - end - - ## - # @private - # Checks if a request can be retried. This is based on the error returned. - # Retryable errors are: - # - Unavailable error - # - Internal EOS error - # - Internal RST_STREAM error - def retryable? err - err.instance_of?(Google::Cloud::UnavailableError) || - err.instance_of?(GRPC::Unavailable) || - (err.instance_of?(Google::Cloud::InternalError) && err.message.include?(EOS_INTERNAL_ERROR)) || - (err.instance_of?(GRPC::Internal) && err.details.include?(EOS_INTERNAL_ERROR)) || - (err.instance_of?(Google::Cloud::InternalError) && err.message.include?(RST_STREAM_INTERNAL_ERROR)) || - (err.instance_of?(GRPC::Internal) && err.details.include?(RST_STREAM_INTERNAL_ERROR)) - end - - ## - # @private - # Resumes a request, by re-executing it with a resume token. - def resume_request resume_token - if @execute_query_options - @service.execute_streaming_sql( - @session_path, - @sql, - **@execute_query_options.merge(resume_token: resume_token) - ) - else - @service.streaming_read_table( - @session_path, - @table, - @columns, - **@read_options.merge(resume_token: resume_token) - ) - end - end - - ## - # @private - # Retries a request, by re-executing it from scratch. - def retry_request - if @execute_query_options - @service.execute_streaming_sql @session_path, @sql, **@execute_query_options - else - @service.streaming_read_table @session_path, @table, @columns, **@read_options - end - end - - ## - # @private - # Get row count from stats. This will be the exact row count for DML - # statements, and the lower bound row count for PDML statements. - def row_count - return @stats.row_count_lower_bound if row_count_lower_bound? - return @stats.row_count_exact if row_count_exact? - nil - end - - ## - # @private - # Whether the row count is the lower bound row count for PDML - # statements. - def row_count_lower_bound? - return nil if @stats.nil? - @stats.row_count == :row_count_lower_bound - end - - ## - # @private - # Whether the row count is the exact row count for DML statements. - def row_count_exact? - return nil if @stats.nil? - @stats.row_count == :row_count_exact - end - - # @private - def self.from_enum enum, service - grpc = enum.peek - new.tap do |results| - results.instance_variable_set :@metadata, grpc.metadata - results.instance_variable_set :@stats, grpc.stats - results.instance_variable_set :@enum, enum - results.instance_variable_set :@service, service - end - rescue GRPC::BadStatus => e - raise Google::Cloud::Error.from_error(e) - end - - # @private - - def self.execute_query service, session_path, sql, params: nil, - types: nil, transaction: nil, - partition_token: nil, seqno: nil, - query_options: nil, request_options: nil, - call_options: nil - execute_query_options = { - transaction: transaction, params: params, types: types, - partition_token: partition_token, seqno: seqno, - query_options: query_options, request_options: request_options, - call_options: call_options - } - enum = service.execute_streaming_sql session_path, sql, - **execute_query_options - from_enum(enum, service).tap do |results| - results.instance_variable_set :@session_path, session_path - results.instance_variable_set :@sql, sql - results.instance_variable_set :@execute_query_options, - execute_query_options - end - end - - # @private - def self.read service, session_path, table, columns, keys: nil, - index: nil, limit: nil, transaction: nil, - partition_token: nil, request_options: nil, - call_options: nil - read_options = { - keys: keys, index: index, limit: limit, - transaction: transaction, - partition_token: partition_token, - request_options: request_options, - call_options: call_options - } - enum = service.streaming_read_table \ - session_path, table, columns, **read_options - from_enum(enum, service).tap do |results| - results.instance_variable_set :@session_path, session_path - results.instance_variable_set :@table, table - results.instance_variable_set :@columns, columns - results.instance_variable_set :@read_options, read_options - end - end - - # @private - def to_s - "(#{fields.inspect} streaming)" - end - - # @private - def inspect - "#<#{self.class.name} #{self}>" - end - - protected - - # rubocop:disable all - - # @private - def merge left, right - if left.kind != right.kind - raise "Can't merge #{left.kind} and #{right.kind} values" - end - if left.kind == :string_value - left.string_value = left.string_value + right.string_value - return left - elsif left.kind == :list_value - left_val = left.list_value.values.pop - right_val = right.list_value.values.shift - if (left_val.kind == right_val.kind) && - (left_val.kind == :list_value || left_val.kind == :string_value) - left.list_value.values << merge(left_val, right_val) - else - left.list_value.values << left_val - left.list_value.values << right_val - end - right.list_value.values.each { |val| left.list_value.values << val } - return left - elsif left.kind == :struct_value - # Don't worry about this yet since Spanner isn't return STRUCT - raise "STRUCT not implemented yet" - else - raise "Can't merge #{left.kind} values" - end - end - - # rubocop:enable all - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/service.rb b/google-cloud-spanner/lib/google/cloud/spanner/service.rb deleted file mode 100644 index 7af25a9f02ad..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/service.rb +++ /dev/null @@ -1,657 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/credentials" -require "google/cloud/spanner/version" -require "google/cloud/spanner/v1" -require "google/cloud/spanner/admin/instance/v1" -require "google/cloud/spanner/admin/database/v1" -require "google/cloud/spanner/convert" - -module Google - module Cloud - module Spanner - ## - # @private Represents the gRPC Spanner service, including all the API - # methods. - class Service - attr_accessor :project - attr_accessor :credentials - attr_accessor :timeout - attr_accessor :host - attr_accessor :lib_name - attr_accessor :lib_version - attr_accessor :quota_project - - ## - # Creates a new Service instance. - def initialize project, credentials, quota_project: nil, - host: nil, timeout: nil, lib_name: nil, lib_version: nil - @project = project - @credentials = credentials - @quota_project = quota_project || (credentials.quota_project_id if credentials.respond_to? :quota_project_id) - @host = host - @timeout = timeout - @lib_name = lib_name - @lib_version = lib_version - end - - def channel - require "grpc" - GRPC::Core::Channel.new host, chan_args, chan_creds - end - - def chan_args - { "grpc.service_config_disable_resolution" => 1 } - end - - def chan_creds - return credentials if insecure? - require "grpc" - GRPC::Core::ChannelCredentials.new.compose \ - GRPC::Core::CallCredentials.new credentials.client.updater_proc - end - - def service - return mocked_service if mocked_service - @service ||= \ - V1::Spanner::Client.new do |config| - config.credentials = channel - config.quota_project = @quota_project - config.timeout = timeout if timeout - config.endpoint = host if host - config.lib_name = lib_name_with_prefix - config.lib_version = Google::Cloud::Spanner::VERSION - config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" } - end - end - attr_accessor :mocked_service - - def instances - return mocked_instances if mocked_instances - @instances ||= \ - Admin::Instance::V1::InstanceAdmin::Client.new do |config| - config.credentials = channel - config.quota_project = @quota_project - config.timeout = timeout if timeout - config.endpoint = host if host - config.lib_name = lib_name_with_prefix - config.lib_version = Google::Cloud::Spanner::VERSION - config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" } - end - end - attr_accessor :mocked_instances - - def databases - return mocked_databases if mocked_databases - @databases ||= \ - Admin::Database::V1::DatabaseAdmin::Client.new do |config| - config.credentials = channel - config.quota_project = @quota_project - config.timeout = timeout if timeout - config.endpoint = host if host - config.lib_name = lib_name_with_prefix - config.lib_version = Google::Cloud::Spanner::VERSION - config.metadata = { "google-cloud-resource-prefix" => "projects/#{@project}" } - end - end - attr_accessor :mocked_databases - - def insecure? - credentials == :this_channel_is_insecure - end - - def list_instances token: nil, max: nil, call_options: nil - opts = default_options call_options: call_options - request = { - parent: project_path, - page_size: max, - page_token: token - } - paged_enum = instances.list_instances request, opts - paged_enum.response - end - - def get_instance name, call_options: nil - opts = default_options call_options: call_options - request = { name: instance_path(name) } - instances.get_instance request, opts - end - - def create_instance instance_id, name: nil, config: nil, nodes: nil, - processing_units: nil, labels: nil, - call_options: nil - opts = default_options call_options: call_options - labels = labels.to_h { |k, v| [String(k), String(v)] } if labels - - create_obj = Admin::Instance::V1::Instance.new({ - display_name: name, config: instance_config_path(config), - node_count: nodes, processing_units: processing_units, - labels: labels - }.delete_if { |_, v| v.nil? }) - - request = { - parent: project_path, - instance_id: instance_id, - instance: create_obj - } - instances.create_instance request, opts - end - - def update_instance instance, field_mask: nil, call_options: nil - opts = default_options call_options: call_options - - if field_mask.nil? || field_mask.empty? - field_mask = %w[display_name node_count labels] - end - - request = { - instance: instance, - field_mask: Google::Protobuf::FieldMask.new(paths: field_mask) - } - instances.update_instance request, opts - end - - def delete_instance name, call_options: nil - opts = default_options call_options: call_options - request = { name: instance_path(name) } - instances.delete_instance request, opts - end - - def get_instance_policy name, call_options: nil - opts = default_options call_options: call_options - request = { resource: instance_path(name) } - instances.get_iam_policy request, opts - end - - def set_instance_policy name, new_policy, call_options: nil - opts = default_options call_options: call_options - request = { - resource: instance_path(name), - policy: new_policy - } - instances.set_iam_policy request, opts - end - - def test_instance_permissions name, permissions, call_options: nil - opts = default_options call_options: call_options - request = { - resource: instance_path(name), - permissions: permissions - } - instances.test_iam_permissions request, opts - end - - def list_instance_configs token: nil, max: nil, call_options: nil - opts = default_options call_options: call_options - request = { parent: project_path, page_size: max, page_token: token } - paged_enum = instances.list_instance_configs request, opts - paged_enum.response - end - - def get_instance_config name, call_options: nil - opts = default_options call_options: call_options - request = { name: instance_config_path(name) } - instances.get_instance_config request, opts - end - - def list_databases instance_id, token: nil, max: nil, call_options: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(instance_id), - page_size: max, - page_token: token - } - paged_enum = databases.list_databases request, opts - paged_enum.response - end - - def get_database instance_id, database_id, call_options: nil - opts = default_options call_options: call_options - request = { name: database_path(instance_id, database_id) } - databases.get_database request, opts - end - - def create_database instance_id, database_id, statements: [], - call_options: nil, encryption_config: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(instance_id), - create_statement: "CREATE DATABASE `#{database_id}`", - extra_statements: Array(statements), - encryption_config: encryption_config - } - databases.create_database request, opts - end - - def drop_database instance_id, database_id, call_options: nil - opts = default_options call_options: call_options - request = { database: database_path(instance_id, database_id) } - databases.drop_database request, opts - end - - def get_database_ddl instance_id, database_id, call_options: nil - opts = default_options call_options: call_options - request = { database: database_path(instance_id, database_id) } - databases.get_database_ddl request, opts - end - - def update_database_ddl instance_id, database_id, statements: [], - operation_id: nil, call_options: nil - opts = default_options call_options: call_options - request = { - database: database_path(instance_id, database_id), - statements: Array(statements), - operation_id: operation_id - } - databases.update_database_ddl request, opts - end - - def get_database_policy instance_id, database_id, call_options: nil - opts = default_options call_options: call_options - request = { resource: database_path(instance_id, database_id) } - databases.get_iam_policy request, opts - end - - def set_database_policy instance_id, database_id, new_policy, - call_options: nil - opts = default_options call_options: call_options - request = { - resource: database_path(instance_id, database_id), - policy: new_policy - } - databases.set_iam_policy request, opts - end - - def test_database_permissions instance_id, database_id, permissions, - call_options: nil - opts = default_options call_options: call_options - request = { - resource: database_path(instance_id, database_id), - permissions: permissions - } - databases.test_iam_permissions request, opts - end - - def get_session session_name, call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - service.get_session({ name: session_name }, opts) - end - - def create_session database_name, labels: nil, - call_options: nil, database_role: nil - opts = default_options session_name: database_name, - call_options: call_options - session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role - service.create_session( - { database: database_name, session: session }, opts - ) - end - - def batch_create_sessions database_name, session_count, labels: nil, - call_options: nil, database_role: nil - opts = default_options session_name: database_name, - call_options: call_options - session = V1::Session.new labels: labels, creator_role: database_role if labels || database_role - # The response may have fewer sessions than requested in the RPC. - request = { - database: database_name, - session_count: session_count, - session_template: session - } - service.batch_create_sessions request, opts - end - - def delete_session session_name, call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - service.delete_session({ name: session_name }, opts) - end - - def execute_streaming_sql session_name, sql, transaction: nil, - params: nil, types: nil, resume_token: nil, - partition_token: nil, seqno: nil, - query_options: nil, request_options: nil, - call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, - sql: sql, - transaction: transaction, - params: params, - param_types: types, - resume_token: resume_token, - partition_token: partition_token, - seqno: seqno, - query_options: query_options, - request_options: request_options - } - service.execute_streaming_sql request, opts - end - - def execute_batch_dml session_name, transaction, statements, seqno, - request_options: nil, call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - statements = statements.map(&:to_grpc) - request = { - session: session_name, - transaction: transaction, - statements: statements, - seqno: seqno, - request_options: request_options - } - results = service.execute_batch_dml request, opts - - if results.status.code.zero? - results.result_sets.map { |rs| rs.stats.row_count_exact } - else - begin - raise Google::Cloud::Error.from_error results.status - rescue Google::Cloud::Error - raise Google::Cloud::Spanner::BatchUpdateError.from_grpc results - end - end - end - - def streaming_read_table session_name, table_name, columns, keys: nil, - index: nil, transaction: nil, limit: nil, - resume_token: nil, partition_token: nil, - request_options: nil, call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, table: table_name, columns: columns, - key_set: keys, transaction: transaction, index: index, - limit: limit, resume_token: resume_token, - partition_token: partition_token, request_options: request_options - } - service.streaming_read request, opts - end - - def partition_read session_name, table_name, columns, transaction, - keys: nil, index: nil, partition_size_bytes: nil, - max_partitions: nil, call_options: nil - partition_opts = partition_options partition_size_bytes, - max_partitions - - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, table: table_name, key_set: keys, - transaction: transaction, index: index, columns: columns, - partition_options: partition_opts - } - service.partition_read request, opts - end - - def partition_query session_name, sql, transaction, params: nil, - types: nil, partition_size_bytes: nil, - max_partitions: nil, call_options: nil - partition_opts = partition_options partition_size_bytes, - max_partitions - - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, sql: sql, transaction: transaction, - params: params, param_types: types, - partition_options: partition_opts - } - service.partition_query request, opts - end - - def commit session_name, mutations = [], transaction_id: nil, - commit_options: nil, request_options: nil, call_options: nil - tx_opts = nil - if transaction_id.nil? - tx_opts = V1::TransactionOptions.new( - read_write: V1::TransactionOptions::ReadWrite.new - ) - end - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, transaction_id: transaction_id, - single_use_transaction: tx_opts, mutations: mutations, - request_options: request_options - } - - if commit_options - request[:return_commit_stats] = commit_options[:return_commit_stats] - end - - service.commit request, opts - end - - def rollback session_name, transaction_id, call_options: nil - opts = default_options session_name: session_name, - call_options: call_options - request = { session: session_name, transaction_id: transaction_id } - service.rollback request, opts - end - - def begin_transaction session_name, request_options: nil, - call_options: nil - tx_opts = V1::TransactionOptions.new( - read_write: V1::TransactionOptions::ReadWrite.new - ) - opts = default_options session_name: session_name, - call_options: call_options - request = { - session: session_name, - options: tx_opts, - request_options: request_options - } - service.begin_transaction request, opts - end - - def create_snapshot session_name, strong: nil, timestamp: nil, - staleness: nil, call_options: nil - tx_opts = V1::TransactionOptions.new( - read_only: V1::TransactionOptions::ReadOnly.new( - { - strong: strong, - read_timestamp: Convert.time_to_timestamp(timestamp), - exact_staleness: Convert.number_to_duration(staleness), - return_read_timestamp: true - }.delete_if { |_, v| v.nil? } - ) - ) - opts = default_options session_name: session_name, - call_options: call_options - request = { session: session_name, options: tx_opts } - service.begin_transaction request, opts - end - - def create_pdml session_name, call_options: nil - tx_opts = V1::TransactionOptions.new( - partitioned_dml: V1::TransactionOptions::PartitionedDml.new - ) - opts = default_options session_name: session_name, - call_options: call_options - request = { session: session_name, options: tx_opts } - service.begin_transaction request, opts - end - - def create_backup instance_id, database_id, backup_id, expire_time, - version_time, call_options: nil, - encryption_config: nil - opts = default_options call_options: call_options - backup = { - database: database_path(instance_id, database_id), - expire_time: expire_time, - version_time: version_time - } - request = { - parent: instance_path(instance_id), - backup_id: backup_id, - backup: backup, - encryption_config: encryption_config - } - databases.create_backup request, opts - end - - def get_backup instance_id, backup_id, call_options: nil - opts = default_options call_options: call_options - request = { name: backup_path(instance_id, backup_id) } - databases.get_backup request, opts - end - - def update_backup backup, update_mask, call_options: nil - opts = default_options call_options: call_options - request = { backup: backup, update_mask: update_mask } - databases.update_backup request, opts - end - - def delete_backup instance_id, backup_id, call_options: nil - opts = default_options call_options: call_options - request = { name: backup_path(instance_id, backup_id) } - databases.delete_backup request, opts - end - - def list_backups instance_id, - filter: nil, page_size: nil, page_token: nil, - call_options: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(instance_id), - filter: filter, - page_size: page_size, - page_token: page_token - } - databases.list_backups request, opts - end - - def list_database_operations instance_id, - filter: nil, - page_size: nil, - page_token: nil, - call_options: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(instance_id), - filter: filter, - page_size: page_size, - page_token: page_token - } - databases.list_database_operations request, opts - end - - def list_backup_operations instance_id, - filter: nil, page_size: nil, - page_token: nil, - call_options: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(instance_id), - filter: filter, - page_size: page_size, - page_token: page_token - } - databases.list_backup_operations request, opts - end - - def restore_database backup_instance_id, backup_id, - database_instance_id, database_id, - call_options: nil, encryption_config: nil - opts = default_options call_options: call_options - request = { - parent: instance_path(database_instance_id), - database_id: database_id, - backup: backup_path(backup_instance_id, backup_id), - encryption_config: encryption_config - } - databases.restore_database request, opts - end - - def inspect - "#{self.class}(#{@project})" - end - - protected - - def lib_name_with_prefix - return "gccl" if [nil, "gccl"].include? lib_name - - value = lib_name.dup - value << "/#{lib_version}" if lib_version - value << " gccl" - end - - def default_options session_name: nil, call_options: nil - opts = {} - if session_name - default_prefix = session_name.split("/sessions/").first - opts[:metadata] = { "google-cloud-resource-prefix" => default_prefix } - end - if call_options - opts[:timeout] = call_options[:timeout] if call_options[:timeout] - opts[:retry_policy] = call_options[:retry_policy] if call_options[:retry_policy] - end - ::Gapic::CallOptions.new(**opts) - end - - def partition_options partition_size_bytes, max_partitions - return nil unless partition_size_bytes || max_partitions - partition_opts = V1::PartitionOptions.new - if partition_size_bytes - partition_opts.partition_size_bytes = partition_size_bytes - end - partition_opts.max_partitions = max_partitions if max_partitions - partition_opts - end - - def project_path - Admin::Instance::V1::InstanceAdmin::Paths.project_path \ - project: project - end - - def instance_path name - return name if name.to_s.include? "/" - - Admin::Instance::V1::InstanceAdmin::Paths.instance_path \ - project: project, instance: name - end - - def instance_config_path name - return name if name.to_s.include? "/" - - Admin::Instance::V1::InstanceAdmin::Paths.instance_config_path \ - project: project, instance_config: name - end - - def database_path instance_id, database_id - Admin::Database::V1::DatabaseAdmin::Paths.database_path \ - project: project, instance: instance_id, database: database_id - end - - def session_path instance_id, database_id, session_id - V1::Spanner::Paths.session_path \ - project: project, instance: instance_id, database: database_id, - session: session_id - end - - def backup_path instance_id, backup_id - Admin::Database::V1::DatabaseAdmin::Paths.backup_path \ - project: project, instance: instance_id, backup: backup_id - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/session.rb b/google-cloud-spanner/lib/google/cloud/spanner/session.rb deleted file mode 100644 index a1cb5d151bbe..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/session.rb +++ /dev/null @@ -1,1250 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/data" -require "google/cloud/spanner/results" -require "google/cloud/spanner/commit" -require "google/cloud/spanner/commit_response" -require "google/cloud/spanner/batch_update" - -module Google - module Cloud - module Spanner - ## - # @private - # - # # Session - # - # A session can be used to perform transactions that read and/or modify - # data in a Cloud Spanner database. Sessions are meant to be reused for - # many consecutive transactions. - # - # Sessions can only execute one transaction at a time. To execute multiple - # concurrent read-write/write-only transactions, create multiple sessions. - # Note that standalone reads and queries use a transaction internally, and - # count toward the one transaction limit. - # - # Cloud Spanner limits the number of sessions that can exist at any given - # time; thus, it is a good idea to delete idle and/or unneeded sessions. - # Aside from explicit deletes, Cloud Spanner can delete sessions for which - # no operations are sent for more than an hour. - # - class Session - ## - # @private The `Google::Cloud::Spanner::V1::Session` object - attr_accessor :grpc - - ## - # @private The gRPC Service object. - attr_accessor :service - - ## - # @private The hash of query options. - attr_accessor :query_options - - # @private Creates a new Session instance. - def initialize grpc, service, query_options: nil - @grpc = grpc - @service = service - @query_options = query_options - end - - # The unique identifier for the project. - # @return [String] - def project_id - @grpc.name.split("/")[1] - end - - # The unique identifier for the instance. - # @return [String] - def instance_id - @grpc.name.split("/")[3] - end - - # The unique identifier for the database. - # @return [String] - def database_id - @grpc.name.split("/")[5] - end - - # The unique identifier for the session. - # @return [String] - def session_id - @grpc.name.split("/")[7] - end - - ## - # The full path for the session resource. Values are of the form - # `projects//instances//databases//sessions/`. - # @return [String] - def path - @grpc.name - end - - ## - # Executes a SQL query. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The - # transaction selector value to send. Only used for single-use - # transactions. - # @param [Integer] seqno A per-transaction sequence number used to - # identify this request. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the query - # execution. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query( - # "SELECT * FROM users WHERE active = @active", - # params: { active: true } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query with a SQL STRUCT query parameter as a Hash: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_hash = { id: 1, name: "Charlie", active: false } - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Specify the SQL STRUCT type using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_type = db.fields id: :INT64, name: :STRING, active: :BOOL - # user_hash = { id: 1, name: nil, active: false } - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash }, - # types: { user_struct: user_type } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Or, query with a SQL STRUCT as a typed Data object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # user_type = db.fields id: :INT64, name: :STRING, active: :BOOL - # user_data = user_type.struct id: 1, name: nil, active: false - # - # results = db.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_struct } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.execute_query \ - # "SELECT * FROM users", query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # results = db.execute_query \ - # "SELECT * FROM users", call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def execute_query sql, params: nil, types: nil, transaction: nil, - partition_token: nil, seqno: nil, query_options: nil, - request_options: nil, call_options: nil - ensure_service! - if query_options.nil? - query_options = @query_options - else - query_options = @query_options.merge query_options unless @query_options.nil? - end - results = Results.execute_query service, path, sql, - params: params, - types: types, - transaction: transaction, - partition_token: partition_token, - seqno: seqno, - query_options: query_options, - request_options: request_options, - call_options: call_options - @last_updated_at = Time.now - results - end - - ## - # Executes DML statements in a batch. - # - # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The - # transaction selector value to send. Only used for single-use - # transactions. - # @param [Integer] seqno A per-transaction sequence number used to - # identify this request. - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [batch_update] a batch update object - # @yieldparam [Google::Cloud::Spanner::BatchUpdate] batch_update a batch - # update object accepting DML statements and optional parameters and - # types of the parameters. - # - # @raise [Google::Cloud::Spanner::BatchUpdateError] If an error occurred - # while executing a statement. The error object contains a cause error - # with the service error type and message, and a list with the exact - # number of rows that were modified for each successful statement - # before the error. - # - # @return [Array] A list with the exact number of rows that - # were modified for each DML statement. - # - def batch_update transaction, seqno, request_options: nil, - call_options: nil - ensure_service! - - raise ArgumentError, "block is required" unless block_given? - batch = BatchUpdate.new - - yield batch - - results = service.execute_batch_dml path, transaction, - batch.statements, seqno, - request_options: request_options, - call_options: call_options - @last_updated_at = Time.now - results - end - - ## - # Read rows from a database table, as a simple alternative to - # {#execute_query}. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] limit If greater than zero, no more than this number - # of rows will be returned. The default is no limit. - # @param [Google::Cloud::Spanner::V1::TransactionSelector] transaction The - # transaction selector value to send. Only used for single-use - # transactions. - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the read - # operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # results = db.read "users", [:id, :name] - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # - def read table, columns, keys: nil, index: nil, limit: nil, - transaction: nil, partition_token: nil, request_options: nil, - call_options: nil - ensure_service! - - results = Results.read service, path, table, columns, - keys: keys, index: index, limit: limit, - transaction: transaction, - partition_token: partition_token, - request_options: request_options, - call_options: call_options - @last_updated_at = Time.now - results - end - - def partition_query sql, transaction, params: nil, types: nil, - partition_size_bytes: nil, max_partitions: nil, - call_options: nil - ensure_service! - - results = service.partition_query \ - path, sql, transaction, params: params, types: types, - partition_size_bytes: partition_size_bytes, - max_partitions: max_partitions, - call_options: call_options - - @last_updated_at = Time.now - - results - end - - def partition_read table, columns, transaction, keys: nil, - index: nil, partition_size_bytes: nil, - max_partitions: nil, call_options: nil - ensure_service! - - results = service.partition_read \ - path, table, columns, transaction, - keys: keys, index: index, - partition_size_bytes: partition_size_bytes, - max_partitions: max_partitions, - call_options: call_options - - @last_updated_at = Time.now - - results - end - - ## - # Creates changes to be applied to rows in the database. - # - # @param [String] transaction_id The identifier of previously-started - # transaction to be used instead of starting a new transaction. - # Optional. - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # - # transaction. Default it is `false`. - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [commit] The block for mutating the data. - # @yieldparam [Google::Cloud::Spanner::Commit] commit The Commit object. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.commit do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.commit commit_options: commit_options do |c| - # c.update "users", [{ id: 1, name: "Charlie", active: false }] - # c.insert "users", [{ id: 2, name: "Harvey", active: true }] - # end - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def commit transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - ensure_service! - commit = Commit.new - yield commit - commit_resp = service.commit path, commit.mutations, - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - @last_updated_at = Time.now - resp = CommitResponse.from_grpc commit_resp - commit_options ? resp : resp.timestamp - end - - ## - # Inserts or updates rows in a table. If any of the rows already exist, - # then its column values are overwritten with the ones provided. Any - # column values not explicitly written are preserved. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.upsert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.upsert "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def upsert table, *rows, transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - opts = { - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - } - commit(**opts) do |c| - c.upsert table, rows - end - end - alias save upsert - - ## - # Inserts new rows in a table. If any of the rows already exist, the - # write or request fails with error `ALREADY_EXISTS`. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.insert "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def insert table, *rows, transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - opts = { - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - } - commit(**opts) do |c| - c.insert table, rows - end - end - - ## - # Updates existing rows in a table. If any of the rows does not already - # exist, the request fails with error `NOT_FOUND`. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.update "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.update "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def update table, *rows, transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - opts = { - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - } - commit(**opts) do |c| - c.update table, rows - end - end - - ## - # Inserts or replaces rows in a table. If any of the rows already exist, - # it is deleted, and the column values provided are inserted instead. - # Unlike #upsert, this means any values not explicitly written become - # `NULL`. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false`. - # - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.replace "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # records = [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # commit_options = { return_commit_stats: true } - # commit_resp = db.replace "users", records, commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def replace table, *rows, transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - opts = { - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - } - commit(**opts) do |c| - c.replace table, rows - end - end - - ## - # Deletes rows from a table. Succeeds whether or not the specified rows - # were present. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [Hash] commit_options A hash of commit options. - # e.g., return_commit_stats. Commit options are optional. - # The following options can be provided: - # - # * `:return_commit_stats` (Boolean) A boolean value. If `true`, - # then statistics related to the transaction will be included in - # {CommitResponse}. Default value is `false` - # - # @param [Hash] request_options Common request options. - # - # * `:request_tag` (String) A per-request tag which can be applied - # to queries or reads, used for statistics collection. Both - # request_tag and transaction_tag can be specified for a read or - # query that belongs to a transaction. This field is ignored for - # requests where it's not applicable (e.g. CommitRequest). - # `request_tag` must be a valid identifier of the form: - # `[a-zA-Z][a-zA-Z0-9_\-]` between 2 and 64 characters in length. - # * `:transaction_tag` (String) A tag used for statistics collection - # about this transaction. Both request_tag and transaction_tag can - # be specified for a read or query that belongs to a transaction. - # The value of transaction_tag should be the same for all requests - # belonging to the same transaction. If this request doesn't belong - # to any transaction, transaction_tag will be ignored. - # `transaction_tag` must be a valid identifier of the format: - # [a-zA-Z][a-zA-Z0-9_\-]{0,49} - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Time, CommitResponse] The timestamp at which the operation - # committed. If commit options are set it returns {CommitResponse}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.delete "users", [1, 2, 3] - # - # @example Get commit stats - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # commit_options = { return_commit_stats: true } - # commit_resp = db.delete "users", [1,2,3], commit_options: commit_options - # - # puts commit_resp.timestamp - # puts commit_resp.stats.mutation_count - # - def delete table, keys = [], transaction_id: nil, commit_options: nil, - request_options: nil, call_options: nil - opts = { - transaction_id: transaction_id, - commit_options: commit_options, - request_options: request_options, - call_options: call_options - } - commit(**opts) do |c| - c.delete table, keys - end - end - - ## - # Rolls back the transaction, releasing any locks it holds. - def rollback transaction_id - service.rollback path, transaction_id - @last_updated_at = Time.now - true - end - - ## - # @private - # Creates a new transaction object every time. - def create_transaction - tx_grpc = service.begin_transaction path - Transaction.from_grpc tx_grpc, self - end - - ## - # Reloads the session resource. Useful for determining if the session is - # still valid on the Spanner API. - def reload! - ensure_service! - @grpc = service.get_session path - @last_updated_at = Time.now - self - rescue Google::Cloud::NotFoundError - labels = @grpc.labels.to_h unless @grpc.labels.to_h.empty? - @grpc = service.create_session \ - V1::Spanner::Paths.database_path( - project: project_id, instance: instance_id, database: database_id - ), - labels: labels - @last_updated_at = Time.now - self - end - - ## - # @private - # Keeps the session alive by executing `"SELECT 1"`. - def keepalive! - ensure_service! - execute_query "SELECT 1" - true - rescue Google::Cloud::NotFoundError - labels = @grpc.labels.to_h unless @grpc.labels.to_h.empty? - @grpc = service.create_session \ - V1::Spanner::Paths.database_path( - project: project_id, instance: instance_id, database: database_id - ), - labels: labels - false - end - - ## - # Permanently deletes the session. - def release! - ensure_service! - service.delete_session path - end - - ## - # @private - # Determines if the session has been idle longer than the given - # duration. - def idle_since? duration - return true if @last_updated_at.nil? - Time.now > @last_updated_at + duration - end - - ## - # @private Creates a new Session instance from a - # `Google::Cloud::Spanner::V1::Session`. - def self.from_grpc grpc, service, query_options: nil - new grpc, service, query_options: query_options - end - - ## - # @private - def session - self - end - - protected - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_service! - raise "Must have active connection to service" unless service - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/snapshot.rb b/google-cloud-spanner/lib/google/cloud/spanner/snapshot.rb deleted file mode 100644 index b6cb83928d2e..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/snapshot.rb +++ /dev/null @@ -1,504 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/convert" -require "google/cloud/spanner/results" - -module Google - module Cloud - module Spanner - ## - # # Snapshot - # - # A snapshot in Cloud Spanner is a set of reads that execute atomically at - # a single logical point in time across columns, rows, and tables in a - # database. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - class Snapshot - # @private The Session object. - attr_accessor :session - - ## - # Identifier of the transaction results were run in. - # @return [String] The transaction id. - def transaction_id - return nil if @grpc.nil? - @grpc.id - end - - ## - # The read timestamp chosen for snapshots. - # @return [Time] The chosen timestamp. - def timestamp - return nil if @grpc.nil? - Convert.timestamp_to_time @grpc.read_timestamp - end - - ## - # Executes a SQL query. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the query - # execution. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.execute_query "SELECT * FROM users " \ - # "WHERE active = @active", - # params: { active: true } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query with a SQL STRUCT query parameter as a Hash: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # user_hash = { id: 1, name: "Charlie", active: false } - # - # results = snp.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Specify the SQL STRUCT type using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # user_type = snp.fields id: :INT64, name: :STRING, active: :BOOL - # user_hash = { id: 1, name: nil, active: false } - # - # results = snp.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash }, - # types: { user_struct: user_type } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Or, query with a SQL STRUCT as a typed Data object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # user_type = snp.fields id: :INT64, name: :STRING, active: :BOOL - # user_data = user_type.struct id: 1, name: nil, active: false - # - # results = snp.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_data } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.execute_query \ - # "SELECT * FROM users", query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # db.snapshot do |snp| - # results = snp.execute_query \ - # "SELECT * FROM users", call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def execute_query sql, params: nil, types: nil, query_options: nil, - call_options: nil - ensure_session! - - params, types = Convert.to_input_params_and_types params, types - session.execute_query sql, params: params, types: types, - transaction: tx_selector, - query_options: query_options, - call_options: call_options - end - alias execute execute_query - alias query execute_query - alias execute_sql execute_query - - ## - # Read rows from a database table, as a simple alternative to - # {#execute_query}. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] limit If greater than zero, no more than this number - # of rows will be returned. The default is no limit. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the read - # operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # results = snp.read "users", [:id, :name] - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def read table, columns, keys: nil, index: nil, limit: nil, - call_options: nil - ensure_session! - - columns = Array(columns).map(&:to_s) - keys = Convert.to_key_set keys - - session.read table, columns, keys: keys, index: index, limit: limit, - transaction: tx_selector, - call_options: call_options - end - - ## - # Creates a configuration object ({Fields}) that may be provided to - # queries or used to create STRUCT objects. (The STRUCT will be - # represented by the {Data} class.) See {Client#execute} and/or - # {Fields#struct}. - # - # For more information, see [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] types Accepts an array or hash types. - # - # Arrays can contain just the type value, or a sub-array of the - # field's name and type value. Hash keys must contain the field name - # as a `Symbol` or `String`, or the field position as an `Integer`. - # Hash values must contain the type value. If a Hash is used the - # fields will be created using the same order as the Hash keys. - # - # Supported type values include: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @return [Fields] The fields of the given types. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # named_type = snp.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # end - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # anon_type = snp.fields [:INT64, :STRING, :BOOL] - # anon_data = anon_type.struct [42, nil, false] - # end - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # dup_type = snp.fields [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # dup_data = dup_type.struct [42, nil, false] - # end - # - def fields types - Fields.new types - end - - ## - # Creates a Cloud Spanner Range. This can be used in place of a Ruby - # Range when needing to exclude the beginning value. - # - # @param [Object] beginning The object that defines the beginning of the - # range. - # @param [Object] ending The object that defines the end of the range. - # @param [Boolean] exclude_begin Determines if the range excludes its - # beginning value. Default is `false`. - # @param [Boolean] exclude_end Determines if the range excludes its - # ending value. Default is `false`. - # - # @return [Google::Cloud::Spanner::Range] The new Range instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.snapshot do |snp| - # key_range = db.range 1, 100 - # results = snp.read "users", [:id, :name], keys: key_range - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def range beginning, ending, exclude_begin: false, exclude_end: false - Range.new beginning, ending, - exclude_begin: exclude_begin, - exclude_end: exclude_end - end - - ## - # @private Creates a new Snapshot instance from a - # `Google::Cloud::Spanner::V1::Transaction`. - def self.from_grpc grpc, session - new.tap do |s| - s.instance_variable_set :@grpc, grpc - s.instance_variable_set :@session, session - end - end - - protected - - # The TransactionSelector to be used for queries - def tx_selector - return nil if transaction_id.nil? - V1::TransactionSelector.new id: transaction_id - end - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_session! - raise "Must have active connection to service" unless session - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/status.rb b/google-cloud-spanner/lib/google/cloud/spanner/status.rb deleted file mode 100644 index 66685d3ca648..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/status.rb +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" - -module Google - module Cloud - module Spanner - ## - # # Status - # - # Represents a logical error model from the Spanner service, containing an - # error code, an error message, and optional error details. - # - # @attr [Integer] code The status code, which should be an enum value of - # [google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto). - # @attr [String] description The human-readable description for the status - # code, which should be an enum value of - # [google.rpc.Code](https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto). - # For example, `INVALID_ARGUMENT`. - # @attr [String] message A developer-facing error message, which should be - # in English. - # @attr [Array, nil] details A list of messages that carry the error - # details. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # job = spanner.create_database "my-instance", - # "my-new-database" - # job.wait_until_done! - # - # if job.error? - # status = job.error - # end - # - class Status - attr_reader :code - attr_reader :description - attr_reader :message - attr_reader :details - - ## - # @private Creates a Status object. - def initialize code, description, message, details - @code = code - @description = description - @message = message - @details = details - end - - ## - # @private New Status from a Google::Rpc::Status object. - def self.from_grpc grpc - new grpc.code, description_for(grpc.code), grpc.message, grpc.details - end - - # @private Get a descriptive symbol for a google.rpc.Code integer - def self.description_for code - descriptions = %w[ - OK CANCELLED UNKNOWN INVALID_ARGUMENT DEADLINE_EXCEEDED NOT_FOUND - ALREADY_EXISTS PERMISSION_DENIED RESOURCE_EXHAUSTED - FAILED_PRECONDITION ABORTED OUT_OF_RANGE UNIMPLEMENTED INTERNAL - UNAVAILABLE DATA_LOSS UNAUTHENTICATED - ] - descriptions[code] - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/transaction.rb b/google-cloud-spanner/lib/google/cloud/spanner/transaction.rb deleted file mode 100644 index 8d46b6359b5a..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/transaction.rb +++ /dev/null @@ -1,1149 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "google/cloud/spanner/errors" -require "google/cloud/spanner/convert" -require "google/cloud/spanner/results" -require "google/cloud/spanner/commit" - -module Google - module Cloud - module Spanner - ## - # # Transaction - # - # A transaction in Cloud Spanner is a set of reads and writes that execute - # atomically at a single logical point in time across columns, rows, and - # tables in a database. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. Transactions will be automatically - # retried when possible. See {Client#transaction}. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # # Read the second album budget. - # second_album_result = tx.read "Albums", ["marketing_budget"], - # keys: [[2, 2]], limit: 1 - # second_album_row = second_album_result.rows.first - # second_album_budget = second_album_row.values.first - # - # transfer_amount = 200000 - # - # if second_album_budget < 300000 - # # Raising an exception will automatically roll back the - # # transaction. - # raise "The second album doesn't have enough funds to transfer" - # end - # - # # Read the first album's budget. - # first_album_result = tx.read "Albums", ["marketing_budget"], - # keys: [[1, 1]], limit: 1 - # first_album_row = first_album_result.rows.first - # first_album_budget = first_album_row.values.first - # - # # Update the budgets. - # second_album_budget -= transfer_amount - # first_album_budget += transfer_amount - # puts "Setting first album's budget to #{first_album_budget} and " \ - # "the second album's budget to #{second_album_budget}." - # - # # Update the rows. - # rows = [ - # {singer_id: 1, album_id: 1, marketing_budget: first_album_budget}, - # {singer_id: 2, album_id: 2, marketing_budget: second_album_budget} - # ] - # tx.update "Albums", rows - # end - # - class Transaction - # @private The Session object. - attr_accessor :session - - # @private Transaction tag for statistics collection. - attr_accessor :transaction_tag - - def initialize - @commit = Commit.new - @seqno = 0 - end - - ## - # Identifier of the transaction results were run in. - # @return [String] The transaction id. - def transaction_id - return nil if @grpc.nil? - @grpc.id - end - - ## - # Executes a SQL query. - # - # @param [String] sql The SQL query string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The SQL query string can contain parameter placeholders. A parameter - # placeholder consists of "@" followed by the parameter name. - # Parameter names consist of any combination of letters, numbers, and - # underscores. - # @param [Hash] params SQL parameters for the query string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash must be used to - # specify the SQL type for these values. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Types for STRUCT values (`Hash`/{Data} objects) are - # specified using a {Fields} object. - # - # Types are optional. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the query - # execution. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query "SELECT * FROM users" - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using query parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query( - # "SELECT * FROM users WHERE active = @active", - # params: { active: true } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query with a SQL STRUCT query parameter as a Hash: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # user_hash = { id: 1, name: "Charlie", active: false } - # - # results = tx.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Specify the SQL STRUCT type using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # user_type = tx.fields id: :INT64, name: :STRING, active: :BOOL - # user_hash = { id: 1, name: nil, active: false } - # - # results = tx.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_hash }, - # types: { user_struct: user_type } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Or, query with a SQL STRUCT as a typed Data object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # user_type = tx.fields id: :INT64, name: :STRING, active: :BOOL - # user_data = user_type.struct id: 1, name: nil, active: false - # - # results = tx.execute_query( - # "SELECT * FROM users WHERE " \ - # "ID = @user_struct.id " \ - # "AND name = @user_struct.name " \ - # "AND active = @user_struct.active", - # params: { user_struct: user_data } - # ) - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using query options: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.execute_query \ - # "SELECT * FROM users", query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - # @example Query using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # db.transaction do |tx| - # results = tx.execute_query \ - # "SELECT * FROM users", call_options: call_options - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def execute_query sql, params: nil, types: nil, query_options: nil, - request_options: nil, call_options: nil - ensure_session! - - @seqno += 1 - - params, types = Convert.to_input_params_and_types params, types - request_options = build_request_options request_options - session.execute_query sql, params: params, types: types, - transaction: tx_selector, seqno: @seqno, - query_options: query_options, - request_options: request_options, - call_options: call_options - end - alias execute execute_query - alias query execute_query - alias execute_sql execute_query - - ## - # Executes a DML statement. - # - # @param [String] sql The DML statement string. See [Query - # syntax](https://cloud.google.com/spanner/docs/query-syntax). - # - # The DML statement string can contain parameter placeholders. A - # parameter placeholder consists of "@" followed by the parameter - # name. Parameter names consist of any combination of letters, - # numbers, and underscores. - # @param [Hash] params Parameters for the DML statement string. The - # parameter placeholders, minus the "@", are the the hash keys, and - # the literal values are the hash values. If the query string contains - # something like "WHERE id > @msg_id", then the params must contain - # something like `:msg_id => 1`. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # | `STRUCT` | `Hash`, {Data} | | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # See [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # @param [Hash] types Types of the SQL parameters in `params`. It is not - # always possible for Cloud Spanner to infer the right SQL type from a - # value in `params`. In these cases, the `types` hash can be used to - # specify the exact SQL type for some or all of the SQL query - # parameters. - # - # The keys of the hash should be query string parameter placeholders, - # minus the "@". The values of the hash should be Cloud Spanner type - # codes from the following list: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # @param [Hash] query_options A hash of values to specify the custom - # query options for executing SQL query. Query options are optional. - # The following settings can be provided: - # - # * `:optimizer_version` (String) The version of optimizer to use. - # Empty to use database default. "latest" to use the latest - # available optimizer version. - # * `:optimizer_statistics_package` (String) Statistics package to - # use. Empty to use the database default. - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Integer] The exact number of rows that were modified. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # row_count = tx.execute_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1" - # ) - # end - # - # @example Update using SQL parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # row_count = tx.execute_update( - # "UPDATE users SET name = @name WHERE id = @id", - # params: { id: 1, name: "Charlie" } - # ) - # end - # - # @example Update using query options - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # row_count = tx.execute_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1", - # query_options: { - # optimizer_version: "1", - # optimizer_statistics_package: "auto_20191128_14_47_22UTC" - # } - # ) - # end - # - # @example Update using custom timeout and retry policy: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # timeout = 30.0 - # retry_policy = { - # initial_delay: 0.25, - # max_delay: 32.0, - # multiplier: 1.3, - # retry_codes: ["UNAVAILABLE"] - # } - # call_options = { timeout: timeout, retry_policy: retry_policy } - # - # db.transaction do |tx| - # row_count = tx.execute_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1", - # call_options: call_options - # ) - # end - # - def execute_update sql, params: nil, types: nil, query_options: nil, - request_options: nil, call_options: nil - results = execute_query sql, params: params, types: types, - query_options: query_options, - request_options: request_options, - call_options: call_options - # Stream all PartialResultSet to get ResultSetStats - results.rows.to_a - # Raise an error if there is not a row count returned - if results.row_count.nil? - raise Google::Cloud::InvalidArgumentError, - "DML statement is invalid." - end - results.row_count - end - - ## - # Executes DML statements in a batch. - # - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @yield [batch_update] a batch update object - # @yieldparam [Google::Cloud::Spanner::BatchUpdate] batch_update a batch - # update object accepting DML statements and optional parameters and - # types of the parameters. - # - # @raise [Google::Cloud::Spanner::BatchUpdateError] If an error occurred - # while executing a statement. The error object contains a cause error - # with the service error type and message, and a list with the exact - # number of rows that were modified for each successful statement - # before the error. - # - # @return [Array] A list with the exact number of rows that - # were modified for each DML statement. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # begin - # row_counts = tx.batch_update do |b| - # statement_count = b.batch_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1" - # ) - # end - # puts row_counts.inspect - # rescue Google::Cloud::Spanner::BatchUpdateError => err - # puts err.cause.message - # puts err.row_counts.inspect - # end - # end - # - # @example Update using SQL parameters: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # begin - # row_counts = tx.batch_update do |b| - # statement_count = b.batch_update( - # "UPDATE users SET name = 'Charlie' WHERE id = 1", - # params: { id: 1, name: "Charlie" } - # ) - # end - # puts row_counts.inspect - # rescue Google::Cloud::Spanner::BatchUpdateError => err - # puts err.cause.message - # puts err.row_counts.inspect - # end - # end - # - def batch_update request_options: nil, call_options: nil, &block - ensure_session! - @seqno += 1 - - request_options = build_request_options request_options - session.batch_update tx_selector, @seqno, - request_options: request_options, - call_options: call_options, &block - end - - ## - # Read rows from a database table, as a simple alternative to - # {#execute_query}. - # - # @param [String] table The name of the table in the database to be - # read. - # @param [Array] columns The columns of table to be - # returned for each row matching this request. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # @param [String] index The name of an index to use instead of the - # table's primary key when interpreting `id` and sorting result rows. - # Optional. - # @param [Integer] limit If greater than zero, no more than this number - # of rows will be returned. The default is no limit. - # @param [Hash] request_options Common request options. - # - # * `:priority` (String) The relative priority for requests. - # The priority acts as a hint to the Cloud Spanner scheduler - # and does not guarantee priority or order of execution. - # Valid values are `:PRIORITY_LOW`, `:PRIORITY_MEDIUM`, - # `:PRIORITY_HIGH`. If priority not set then default is - # `PRIORITY_UNSPECIFIED` is equivalent to `:PRIORITY_HIGH`. - # * `:tag` (String) A per-request tag which can be applied to - # queries or reads, used for statistics collection. Tag must be a - # valid identifier of the form: `[a-zA-Z][a-zA-Z0-9_\-]` between 2 - # and 64 characters in length. - # @param [Hash] call_options A hash of values to specify the custom - # call options, e.g., timeout, retries, etc. Call options are - # optional. The following settings can be provided: - # - # * `:timeout` (Numeric) A numeric value of custom timeout in seconds - # that overrides the default setting. - # * `:retry_policy` (Hash) A hash of values that overrides the default - # setting of retry policy with the following keys: - # * `:initial_delay` (`Numeric`) - The initial delay in seconds. - # * `:max_delay` (`Numeric`) - The max delay in seconds. - # * `:multiplier` (`Numeric`) - The incremental backoff multiplier. - # * `:retry_codes` (`Array`) - The error codes that should - # trigger a retry. - # - # @return [Google::Cloud::Spanner::Results] The results of the read - # operation. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # results = tx.read "users", [:id, :name] - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def read table, columns, keys: nil, index: nil, limit: nil, - request_options: nil, call_options: nil - ensure_session! - - columns = Array(columns).map(&:to_s) - keys = Convert.to_key_set keys - request_options = build_request_options request_options - session.read table, columns, keys: keys, index: index, limit: limit, - transaction: tx_selector, - request_options: request_options, - call_options: call_options - end - - ## - # Inserts or updates rows in a table. If any of the rows already exist, - # then its column values are overwritten with the ones provided. Any - # column values not explicitly written are preserved. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.upsert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def upsert table, *rows - ensure_session! - @commit.upsert table, rows - end - alias save upsert - - ## - # Inserts new rows in a table. If any of the rows already exist, the - # write or request fails with error {Google::Cloud::AlreadyExistsError}. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def insert table, *rows - ensure_session! - @commit.insert table, rows - end - - ## - # Updates existing rows in a table. If any of the rows does not already - # exist, the request fails with error {Google::Cloud::NotFoundError}. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.update "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def update table, *rows - ensure_session! - @commit.update table, rows - end - - ## - # Inserts or replaces rows in a table. If any of the rows already exist, - # it is deleted, and the column values provided are inserted instead. - # Unlike #upsert, this means any values not explicitly written become - # `NULL`. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Array] rows One or more hash objects with the hash keys - # matching the table's columns, and the hash values matching the - # table's values. - # - # Ruby types are mapped to Spanner types as follows: - # - # | Spanner | Ruby | Notes | - # |-------------|----------------|---| - # | `BOOL` | `true`/`false` | | - # | `INT64` | `Integer` | | - # | `FLOAT64` | `Float` | | - # | `NUMERIC` | `BigDecimal` | | - # | `STRING` | `String` | | - # | `DATE` | `Date` | | - # | `TIMESTAMP` | `Time`, `DateTime` | | - # | `BYTES` | `File`, `IO`, `StringIO`, or similar | | - # | `ARRAY` | `Array` | Nested arrays are not supported. | - # - # See [Data - # types](https://cloud.google.com/spanner/docs/data-definition-language#data_types). - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.replace "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }] - # end - # - def replace table, *rows - ensure_session! - @commit.replace table, rows - end - - ## - # Deletes rows from a table. Succeeds whether or not the specified rows - # were present. - # - # All changes are accumulated in memory until the block passed to - # {Client#transaction} completes. - # - # @param [String] table The name of the table in the database to be - # modified. - # @param [Object, Array] keys A single, or list of keys or key - # ranges to match returned data to. Values should have exactly as many - # elements as there are columns in the primary key. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction { |tx| tx.delete "users", [1, 2, 3] } - # - def delete table, keys = [] - ensure_session! - @commit.delete table, keys - end - - ## - # @private - # Returns the field names and types for a table. - # - # @param [String] table The name of the table in the database to - # retrieve types for - # - # @return [Hash, Array] The types of the returned data. The default is a - # Hash. Is a nested Array of Arrays when `pairs` is specified. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # users_types = tx.fields_for "users" - # tx.insert "users", [{ id: 1, name: "Charlie", active: false }, - # { id: 2, name: "Harvey", active: true }], - # types: users_types - # end - # - def fields_for table - execute_query("SELECT * FROM #{table} WHERE 1 = 0").fields - end - - ## - # Creates a configuration object ({Fields}) that may be provided to - # queries or used to create STRUCT objects. (The STRUCT will be - # represented by the {Data} class.) See {Client#execute} and/or - # {Fields#struct}. - # - # For more information, see [Data Types - Constructing a - # STRUCT](https://cloud.google.com/spanner/docs/data-types#constructing-a-struct). - # - # @param [Array, Hash] types Accepts an array or hash types. - # - # Arrays can contain just the type value, or a sub-array of the - # field's name and type value. Hash keys must contain the field name - # as a `Symbol` or `String`, or the field position as an `Integer`. - # Hash values must contain the type value. If a Hash is used the - # fields will be created using the same order as the Hash keys. - # - # Supported type values incude: - # - # * `:BOOL` - # * `:BYTES` - # * `:DATE` - # * `:FLOAT64` - # * `:NUMERIC` - # * `:INT64` - # * `:STRING` - # * `:TIMESTAMP` - # * `Array` - Lists are specified by providing the type code in an - # array. For example, an array of integers are specified as - # `[:INT64]`. - # * {Fields} - Nested Structs are specified by providing a Fields - # object. - # - # @return [Fields] The fields of the given types. - # - # @example Create a STRUCT value with named fields using Fields object: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # named_type = tx.fields( - # { id: :INT64, name: :STRING, active: :BOOL } - # ) - # named_data = named_type.struct( - # { id: 42, name: nil, active: false } - # ) - # end - # - # @example Create a STRUCT value with anonymous field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # anon_type = tx.fields [:INT64, :STRING, :BOOL] - # anon_data = anon_type.struct [42, nil, false] - # end - # - # @example Create a STRUCT value with duplicate field names: - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # dup_type = tx.fields [[:x, :INT64], [:x, :STRING], [:x, :BOOL]] - # dup_data = dup_type.struct [42, nil, false] - # end - # - def fields types - Fields.new types - end - - ## - # Creates a Cloud Spanner Range. This can be used in place of a Ruby - # Range when needing to exclude the beginning value. - # - # @param [Object] beginning The object that defines the beginning of the - # range. - # @param [Object] ending The object that defines the end of the range. - # @param [Boolean] exclude_begin Determines if the range excludes its - # beginning value. Default is `false`. - # @param [Boolean] exclude_end Determines if the range excludes its - # ending value. Default is `false`. - # - # @return [Google::Cloud::Spanner::Range] The new Range instance. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # key_range = tx.range 1, 100 - # results = tx.read "users", [:id, :name], keys: key_range - # - # results.rows.each do |row| - # puts "User #{row[:id]} is #{row[:name]}" - # end - # end - # - def range beginning, ending, exclude_begin: false, exclude_end: false - Range.new beginning, ending, - exclude_begin: exclude_begin, - exclude_end: exclude_end - end - - ## - # Creates a column value object representing setting a field's value to - # the timestamp of the commit. (See {Client#commit_timestamp}) - # - # This placeholder value can only be used for timestamp columns that - # have set the option "(allow_commit_timestamp=true)" in the schema. - # - # @return [ColumnValue] The commit timestamp column value object. - # - # @example - # require "google/cloud/spanner" - # - # spanner = Google::Cloud::Spanner.new - # - # db = spanner.client "my-instance", "my-database" - # - # db.transaction do |tx| - # tx.insert "users", [ - # { id: 5, name: "Murphy", updated_at: tx.commit_timestamp } - # ] - # end - # - def commit_timestamp - ColumnValue.commit_timestamp - end - - ## - # @private - # Keeps the transaction current by creating a new transaction. - def keepalive! - ensure_session! - @grpc = session.create_transaction.instance_variable_get :@grpc - end - - ## - # @private - # Permanently deletes the transaction and session. - def release! - ensure_session! - session.release! - end - - ## - # @private - # Determines if the transaction has been idle longer than the given - # duration. - def idle_since? duration - session.idle_since? duration - end - - ## - # @private - # All of the mutations created in the transaction block. - def mutations - @commit.mutations - end - - ## - # @private Creates a new Transaction instance from a - # `Google::Cloud::Spanner::V1::Transaction`. - def self.from_grpc grpc, session - new.tap do |s| - s.instance_variable_set :@grpc, grpc - s.instance_variable_set :@session, session - end - end - - protected - - # The TransactionSelector to be used for queries - def tx_selector - return nil if transaction_id.nil? - V1::TransactionSelector.new id: transaction_id - end - - ## - # @private Build request options. If transaction tag is set - # then add into request options. - def build_request_options options - options = Convert.to_request_options options, tag_type: :request_tag - - if transaction_tag - options ||= {} - options[:transaction_tag] = transaction_tag - end - - options - end - - ## - # @private Raise an error unless an active connection to the service is - # available. - def ensure_session! - raise "Must have active connection to service" unless session - end - - def service - session.service - end - end - end - end -end diff --git a/google-cloud-spanner/lib/google/cloud/spanner/version.rb b/google-cloud-spanner/lib/google/cloud/spanner/version.rb deleted file mode 100644 index 4fec55fd75d8..000000000000 --- a/google-cloud-spanner/lib/google/cloud/spanner/version.rb +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -module Google - module Cloud - module Spanner - VERSION = "2.16.0".freeze - end - end -end diff --git a/google-cloud-spanner/support/doctest_helper.rb b/google-cloud-spanner/support/doctest_helper.rb deleted file mode 100644 index 317c67843c25..000000000000 --- a/google-cloud-spanner/support/doctest_helper.rb +++ /dev/null @@ -1,1758 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "minitest/focus" - -require "google/cloud/spanner" -require "grpc" -require "grpc/errors" - -module Google - module Cloud - module Spanner - def self.stub_new - define_singleton_method :new do |*args| - yield *args - end - end - # Create default unmocked methods that will raise if ever called - def self.new *args - raise "This code example is not yet mocked" - end - class Credentials - # Override the default constructor - def self.new *args - OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new {})) - end - end - end - end -end - -def mock_spanner - Google::Cloud::Spanner.stub_new do |*args| - credentials = OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new {})) - spanner = Google::Cloud::Spanner::Project.new(Google::Cloud::Spanner::Service.new("my-project", credentials)) - - service = spanner.service - service.mocked_service = Minitest::Mock.new - service.mocked_instances = Minitest::Mock.new - service.mocked_databases = Minitest::Mock.new - if block_given? - yield service.mocked_service, service.mocked_instances, service.mocked_databases - end - spanner - end -end - -def verify_mock_params actual, expected - expected.all? do |name, value| - value === actual[name] || value == actual[value] - end -end - - -YARD::Doctest.configure do |doctest| - # Skip private classes and methods - doctest.skip "Google::Cloud::Spanner::Session" - doctest.skip "Google::Cloud::Spanner::Client#fields" - doctest.skip "Google::Cloud::Spanner::Client#fields_for" - doctest.skip "Google::Cloud::Spanner::Transaction#fields_for" - - # Skip all aliases, since tests would be exact duplicates - doctest.skip "Google::Cloud::Spanner::BatchSnapshot#query" - doctest.skip "Google::Cloud::Spanner::Client#query" - doctest.skip "Google::Cloud::Spanner::Client#save" - doctest.skip "Google::Cloud::Spanner::Commit#save" - doctest.skip "Google::Cloud::Spanner::Fields#new" - doctest.skip "Google::Cloud::Spanner::Project#project_id" - doctest.skip "Google::Cloud::Spanner::Snapshot#query" - doctest.skip "Google::Cloud::Spanner::Transaction#query" - doctest.skip "Google::Cloud::Spanner::Transaction#save" - doctest.skip "Google::Cloud::Spanner::Instance::Job#refresh!" - doctest.skip "Google::Cloud::Spanner::Database::Job#refresh!" - doctest.skip "Google::Cloud::Spanner::Backup::Job#refresh!" - doctest.skip "Google::Cloud::Spanner::Backup::Restore::Job#refresh!" - doctest.skip "Google::Cloud::Spanner::Instance#update" - - doctest.before "Google::Cloud#spanner" do - mock_spanner do |mock, mock_instances, mock_databases| - #mock.expect :annotate_text, text_resp, annotate_text_args - end - end - - doctest.before "Google::Cloud.spanner" do - mock_spanner do |mock, mock_instances, mock_databases| - end - end - - doctest.before "Google::Cloud::Spanner" do - mock_spanner do |mock, mock_instances, mock_databases| - end - end - - doctest.before "Google::Cloud::Spanner.new" do - mock_spanner do |mock, mock_instances, mock_databases| - end - end - - doctest.skip "Google::Cloud::Spanner::Credentials" # occasionally getting "This code example is not yet mocked" - - # Instance - - doctest.before "Google::Cloud::Spanner::Instance" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :create_instance, create_instance_resp(client: mock_client) do |req| - verify_mock_params(req, parent: "projects/my-project", instance_id: "my-new-instance", instance: Google::Cloud::Spanner::Admin::Instance::V1::Instance) - end - operation = job_grpc("google.spanner.admin.instance.v1.CreateInstanceMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-new-instance" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#save" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :get_instance, Google::Cloud::Spanner::Admin::Instance::V1::Instance.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :update_instance, update_instance_resp(client: mock_client) do |req| - verify_mock_params(req, instance: Google::Cloud::Spanner::Admin::Instance::V1::Instance, field_mask: Google::Protobuf::FieldMask) - end - operation = job_grpc("google.spanner.admin.instance.v1.UpdateInstanceMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#create_database" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - operation = job_grpc("google.spanner.admin.database.v1.CreateDatabaseMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_databases.expect :create_database, create_database_resp(client: mock_client), [{ - parent: "projects/my-project/instances/my-instance", - create_statement: "CREATE DATABASE `my-new-database`", extra_statements: [], - encryption_config: nil - }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#create_database@Create with encryption config" do - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - operation = job_grpc("google.spanner.admin.database.v1.CreateDatabaseMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_databases.expect :create_database, create_database_resp(client: mock_client), [{ - parent: "projects/my-project/instances/my-instance", - create_statement: "CREATE DATABASE `my-new-database`", extra_statements: [], - encryption_config: { kms_key_name: kms_key_name } - }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#database" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :get_database, database_resp, [{ name: "projects/my-project/instances/my-instance/databases/my-database" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#database@Will return `nil` if instance does not exist." do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :get_database, nil, [{ name: "projects/my-project/instances/my-instance/databases/my-database" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#databases" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :list_databases, databases_resp(token: "token"), [{ parent: "projects/my-project/instances/my-instance", page_size: nil, page_token: nil }, nil] - mock_databases.expect :list_databases, databases_resp, [{ parent: "projects/my-project/instances/my-instance", page_size: nil, page_token: "token" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#policy" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :get_iam_policy, policy_resp, [{ resource: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :set_iam_policy, policy_resp do |req| - verify_mock_params(req, resource: "projects/my-project/instances/my-instance", policy: Google::Iam::V1::Policy) - end - end - end - - doctest.before "Google::Cloud::Spanner::Instance#update_policy" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :get_iam_policy, policy_resp, [{ resource: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :set_iam_policy, policy_resp do |req| - verify_mock_params(req, resource: "projects/my-project/instances/my-instance", policy: Google::Iam::V1::Policy) - end - end - end - - doctest.before "Google::Cloud::Spanner::Instance#test_permissions" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :test_iam_permissions, test_permissions_res, [{ resource: "projects/my-project/instances/my-instance", permissions: ["spanner.instances.get", "spanner.instances.update"] }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#delete" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :delete_instance, nil, [{ name: "projects/my-project/instances/my-instance" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Instance#database_operations" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :instance_variable_get, mock_client, ["@operations_client"] - mock_databases.expect :list_database_operations, database_operations_resp do |req| - verify_mock_params(req, parent: "projects/my-project/instances/my-instance") - end - end - end - - doctest.before "Google::Cloud::Spanner::Instance#database_operations@Filter and list" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :instance_variable_get, mock_client, ["@operations_client"] - mock_databases.expect :list_database_operations, database_operations_resp do |req| - verify_mock_params(req, parent: "projects/my-project/instances/my-instance", filter: String) - end - end - end - - # Instance::Config - - doctest.before "Google::Cloud::Spanner::Instance::Config" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :list_instance_configs, instance_configs_resp do |req| - verify_mock_params(req, parent: "projects/my-project") - end - end - end - - # Instance::List - - doctest.before "Google::Cloud::Spanner::Instance::List" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :list_instances, instances_resp(token: "token") do |req| - verify_mock_params(req, parent: "projects/my-project") - end - mock_instances.expect :list_instances, instances_resp do |req| - verify_mock_params(req, parent: "projects/my-project", page_token: "token") - end - end - end - - # Instance::Config::List - - doctest.before "Google::Cloud::Spanner::Instance::Config::List" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :list_instance_configs, instance_configs_resp(token: "token") do |req| - verify_mock_params(req, parent: "projects/my-project", page_size: nil, page_token: nil) - end - mock_instances.expect :list_instance_configs, instance_configs_resp do |req| - verify_mock_params(req, parent: "projects/my-project", page_size: nil, page_token: "token") - end - end - end - - # BatchClient - - doctest.before "Google::Cloud::Spanner::BatchClient" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - # BatchSnapshot - - doctest.before "Google::Cloud::Spanner::BatchSnapshot" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - doctest.before "Google::Cloud::Spanner::BatchSnapshot#partition_query" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_query, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - doctest.before "Google::Cloud::Spanner::BatchSnapshot#execute" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String, transaction: Google::Cloud::Spanner::V1::TransactionSelector) - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::BatchSnapshot#execute_sql" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::BatchSnapshot#execute_partition" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - doctest.before "Google::Cloud::Spanner::BatchSnapshot#execute_sql_partition" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - # BatchUpdate - - doctest.before "Google::Cloud::Spanner::BatchUpdate" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil}, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_batch_dml, batch_response_grpc do |req| - verify_mock_params(req, session: "session-name", transaction: Google::Cloud::Spanner::V1::TransactionSelector, statements: Array, seqno: Integer) - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - # Partition - - doctest.before "Google::Cloud::Spanner::Partition" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ name: "session-name" }, Hash] - end - end - - # Policy - - doctest.before "Google::Cloud::Spanner::Policy" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :get_iam_policy, policy_resp, [{ resource: "projects/my-project/instances/my-instance" }, nil] - mock_instances.expect :set_iam_policy, policy_resp do |req| - verify_mock_params(req, resource: "projects/my-project/instances/my-instance", policy: Google::Iam::V1::Policy) - end - end - end - - # Project - - doctest.before "Google::Cloud::Spanner::Project" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :get_database, database_resp, [{ name: "projects/my-project/instances/my-instance/databases/my-database" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project@Obtaining a client for use with a database." do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{ database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil}, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: "SELECT * FROM users") - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::Project#batch_client" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :create_session, session_grpc, [{ database: "projects/my-project/instances/my-instance/databases/my-database", session: nil }, Hash] - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - mock.expect :partition_read, OpenStruct.new(partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")]) do |req| - verify_mock_params(req, session: "session-name", table: "users", key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :streaming_read, results_enum do |req| - verify_mock_params(req, session: "session-name", table: "users", columns: ["id", "name"], key_set: Google::Cloud::Spanner::V1::KeySet) - end - mock.expect :delete_session, session_grpc, [{ session: "session-name" }, Hash] - end - end - - doctest.before "Google::Cloud::Spanner::Project#client" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{ database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil}, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: "SELECT * FROM users") - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::Project#create_instance" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - mock_instances.expect :create_instance, create_instance_resp(client: mock_client) do |req| - verify_mock_params(req, parent: "projects/my-project", instance_id: "my-new-instance", instance: Google::Cloud::Spanner::Admin::Instance::V1::Instance) - end - operation = job_grpc("google.spanner.admin.instance.v1.CreateInstanceMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-new-instance" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instance" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instance@Will return `nil` if instance does not exist." do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/non-existing" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instances" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :list_instances, instances_resp(token: "token"), [{ parent: "projects/my-project", page_size: nil, page_token: nil }, nil] - mock_instances.expect :list_instances, instances_resp, [{ parent: "projects/my-project", page_size: nil, page_token: "token" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instance_config" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance_config, instance_config_resp, [{ name: "projects/my-project/instanceConfigs/regional-us-central1" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instance_config@Will return `nil` if instance config does not exist." do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance_config, instance_config_resp, [{ name: "projects/my-project/instanceConfigs/non-existing" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#instance_configs" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :list_instance_configs, instance_configs_resp(token: "token"), [{ parent: "projects/my-project", page_size: nil, page_token: nil }, nil] - mock_instances.expect :list_instance_configs, instance_configs_resp, [{ parent: "projects/my-project", page_size: nil, page_token: "token" }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#create_database" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - operation = job_grpc("google.spanner.admin.database.v1.CreateDatabaseMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_databases.expect :create_database, create_database_resp(client: mock_client), [{ - parent: "projects/my-project/instances/my-instance", - create_statement: "CREATE DATABASE `my-new-database`", - extra_statements: [], encryption_config: nil - }, nil] - end - end - - doctest.before "Google::Cloud::Spanner::Project#create_database@Create with encryption config" do - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - mock_spanner do |mock, mock_instances, mock_databases| - mock_client = Minitest::Mock.new - operation = job_grpc("google.spanner.admin.database.v1.CreateDatabaseMetadata", done: true) - mock_client.expect :get_operation, OpenStruct.new(grpc_op: operation), [{ name: "1234567890" }, Gapic::CallOptions] - mock_databases.expect :create_database, create_database_resp(client: mock_client), [{ - parent: "projects/my-project/instances/my-instance", - create_statement: "CREATE DATABASE `my-new-database`", - extra_statements: [], encryption_config: { kms_key_name: kms_key_name } - }, nil] - end - end - - - doctest.before "Google::Cloud::Spanner::Project#databases" do - mock_spanner do |mock, mock_instances, mock_databases| - mock_instances.expect :get_instance, OpenStruct.new(instance_hash), [{ name: "projects/my-project/instances/my-instance" }, nil] - mock_databases.expect :list_databases, databases_resp(token: "token"), [{ parent: "projects/my-project/instances/my-instance", page_size: nil, page_token: nil}, nil] - mock_databases.expect :list_databases, databases_resp, [{ parent: "projects/my-project/instances/my-instance", page_size: nil, page_token: "token"}, nil] - end - end - - # Client - - doctest.before "Google::Cloud::Spanner::Client" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: "SELECT * FROM users") - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#execute" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#execute_sql" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#execute_partition_update" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 6.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#execute_pdml" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: String) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#transaction" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: "SELECT * FROM users") - end - mock.expect :rollback, nil, [{ session: "session-name", transaction_id: "tx-001-02"}, Hash] - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#snapshot" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :execute_streaming_sql, results_enum do |req| - verify_mock_params(req, session: "session-name", sql: "SELECT * FROM users") - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - end - - doctest.before "Google::Cloud::Spanner::Client#fields" do - mock_spanner do |mock, mock_instances, mock_databases| - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: "projects/my-project/instances/my-instance/databases/my-database", session_count: 10, session_template: nil }, Hash] - 5.times do - mock.expect :begin_transaction, tx_resp do |req| - verify_mock_params(req, session: "session-name", options: Google::Cloud::Spanner::V1::TransactionOptions) - end - end - mock.expect :commit, commit_resp do |req| - verify_mock_params(req, session: "session-name", mutations: Array) - end - end - - # TODO: Failing 1) wrong num args in Fields#data 2) undefined method `empty?' for #(keyfile, scope: nil) { - _(keyfile).must_equal keyfile_path - _(scope).wont_be :nil? - :this_channel_is_insecure - } - end - let(:found_credentials) { "{}" } - - after do - Google::Cloud.configure.reset! - end - - it "can override config for itself and sub classes" do - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project_id = project_id - config.keyfile = keyfile_path - config.timeout = default_timeout - end - - # Override configuration - Google::Cloud::Spanner::Admin::Database.configure do |config| - config.timeout = 25 - end - - File.stub :file?, true, [keyfile_path] do - File.stub :read, found_credentials, [keyfile_path] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - client = Google::Cloud::Spanner::Admin::Database.database_admin - _(client.configure.timeout).must_equal 25 - end - end - end - end - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_config_test.rb b/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_config_test.rb deleted file mode 100644 index b2ef25523b68..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_config_test.rb +++ /dev/null @@ -1,60 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "google/cloud/spanner/admin/instance" - -describe Google::Cloud::Spanner::Admin::Instance do - let(:project_id) { "project-id" } - let(:default_timeout) { 15 } - let(:keyfile_path) { "path/to/keyfile.json" } - let(:default_credentials) do - ->(keyfile, scope: nil) { - _(keyfile).must_equal keyfile_path - _(scope).wont_be :nil? - :this_channel_is_insecure - } - end - let(:found_credentials) { "{}" } - - after do - Google::Cloud.configure.reset! - end - - it "can override config for itself and sub classes" do - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project_id = project_id - config.keyfile = keyfile_path - config.timeout = default_timeout - end - - # Override configuration - Google::Cloud::Spanner::Admin::Instance.configure do |config| - config.timeout = 25 - end - - File.stub :file?, true, [keyfile_path] do - File.stub :read, found_credentials, [keyfile_path] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - client = Google::Cloud::Spanner::Admin::Instance.instance_admin - _(client.configure.timeout).must_equal 25 - end - end - end - end - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_test.rb b/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_test.rb deleted file mode 100644 index 5e5cbccbc734..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/admin/instance/client_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "google/cloud/spanner/admin/instance" -require "google/cloud/spanner/admin/instance/v1/instance_admin" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::Spanner::AdminInstanceClientConstructionMinitest < Minitest::Test - def test_instance_admin - emulator_host = "localhost:4567" - channel_args = { "grpc.service_config_disable_resolution" => 1 } - channel_creds = :this_channel_is_insecure - channel = GRPC::Core::Channel.new emulator_host, channel_args, channel_creds - - emulator_check = ->(name) { (name == "SPANNER_EMULATOR_HOST") ? emulator_host : nil } - channel_check = ->(chan_host, chan_args, chan_creds) do - assert_equal emulator_host, chan_host - assert_equal channel_args, chan_args - assert_equal channel_creds, chan_creds - channel - end - - # Clear all environment variables, except SPANNER_EMULATOR_HOST - ENV.stub :[], emulator_check do - Gapic::ServiceStub.stub :new, :stub do - GRPC::Core::Channel.stub :new, channel_check do - client = Google::Cloud::Spanner::Admin::Instance.instance_admin project_id: "1234" - assert_kind_of Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client, client - assert_equal emulator_host, client.configure.endpoint - end - end - end - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/backup/delete_test.rb b/google-cloud-spanner/test/google/cloud/spanner/backup/delete_test.rb deleted file mode 100644 index 1320f294d473..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/backup/delete_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :delete, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:backup_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Backup.new( - backup_hash(instance_id: instance_id, database_id: database_id, backup_id: backup_id) - ) - } - let(:backup) { Google::Cloud::Spanner::Backup.from_grpc backup_grpc, spanner.service } - - it "can delete itself" do - mock = Minitest::Mock.new - mock.expect :delete_backup, nil, [{ name: backup_grpc.name }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - _(backup.delete).must_equal true - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/backup/expire_time_test.rb b/google-cloud-spanner/test/google/cloud/spanner/backup/expire_time_test.rb deleted file mode 100644 index 1a300c2fe497..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/backup/expire_time_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :expire_time=, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:backup_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Backup.new( - backup_hash(instance_id: instance_id, database_id: database_id, backup_id: backup_id) - ) - } - let(:backup) { Google::Cloud::Spanner::Backup.from_grpc backup_grpc, spanner.service } - - it "update backup expire time" do - mask = Google::Protobuf::FieldMask.new paths: ["expire_time"] - mock = Minitest::Mock.new - mock.expect :update_backup, backup_grpc, [{backup: backup_grpc, update_mask: mask}, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - expire_time = Time.now + 36000 - backup.expire_time = expire_time - _(backup.expire_time).must_equal expire_time - - mock.verify - end - - it "reset previous expire time on update error" do - stub = Object.new - - def stub.update_backup *args - raise Google::Cloud::InvalidArgumentError.new "invalid expire time" - end - backup.service.mocked_databases = stub - expire_time_was = backup.expire_time - - assert_raises Google::Cloud::Error do - backup.expire_time = (Time.now - 36000) - end - - _(backup.expire_time).must_equal expire_time_was - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/backup/referencing_databases_test.rb b/google-cloud-spanner/test/google/cloud/spanner/backup/referencing_databases_test.rb deleted file mode 100644 index a0b0ba39be05..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/backup/referencing_databases_test.rb +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :referencing_databases, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:referencing_database_id) { "referencing-db1" } - let(:backup_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Backup.new \ - backup_hash( - instance_id: instance_id, - database_id: database_id, - backup_id: backup_id, - referencing_databases: [referencing_database_id] - ) - } - let(:backup) { Google::Cloud::Spanner::Backup.from_grpc backup_grpc, spanner.service } - - it "get referencing databases" do - get_res = Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: referencing_database_id) - mock = Minitest::Mock.new - mock.expect :get_database, get_res, [{ name: database_path(instance_id, referencing_database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - referencing_databases = backup.referencing_databases - mock.verify - - _(referencing_databases).must_be_kind_of Array - _(referencing_databases.length).must_equal 1 - - referencing_database = referencing_databases[0] - _(referencing_database.instance_id).must_equal instance_id - _(referencing_database.database_id).must_equal referencing_database_id - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/backup/restore_test.rb b/google-cloud-spanner/test/google/cloud/spanner/backup/restore_test.rb deleted file mode 100644 index 9a8b50b81a53..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/backup/restore_test.rb +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :restore_database, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:backup_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Backup.new( - backup_hash(instance_id: instance_id, database_id: database_id, backup_id: backup_id) - ) - } - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.RestoreDatabaseRequest", - value: "" - } - ) - end - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.RestoreDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.database.v1.Database", - value: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata.new.to_proto - ) - ) - end - let(:backup) { Google::Cloud::Spanner::Backup.from_grpc backup_grpc, spanner.service } - let(:kms_key_name) { - "projects//locations//keyRings//cryptoKeys/" - } - - it "restore a database in the same instance as the backup instance" do - mock = Minitest::Mock.new - restore_res = Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata, - ) - operation_done = Gapic::Operation.new( - job_grpc_done, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata, - ) - - mock.expect :restore_database, restore_res, [{ - parent: instance_path(instance_id), - database_id: "restored-database", - backup: backup_path(instance_id, backup_id), - encryption_config: { kms_key_name: kms_key_name, encryption_type: :CUSTOMER_MANAGED_ENCRYPTION } - }, ::Gapic::CallOptions] - mock.expect :get_operation, operation_done, [{ name: "1234567890" }, Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = backup.restore "restored-database", encryption_config: { - kms_key_name: kms_key_name, encryption_type: :CUSTOMER_MANAGED_ENCRYPTION - } - - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Restore::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - - mock.verify - end - - it "restore a database in a different instance than the backup instance" do - mock = Minitest::Mock.new - restore_res = Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata, - ) - operation_done = Gapic::Operation.new( - job_grpc_done, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::RestoreDatabaseMetadata, - ) - mock.expect :restore_database, restore_res, [{ - parent: instance_path("other-instance"), - database_id: "restored-database", - backup: backup_path(instance_id, backup_id), - encryption_config: nil - }, ::Gapic::CallOptions] - mock.expect :get_operation, operation_done, [{ name: "1234567890" } , Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = backup.restore "restored-database", instance_id: "other-instance" - - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Restore::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - - mock.verify - end - - it "raise an error on restore database backup for kms key without customer managed encryption type" do - assert_raises Google::Cloud::InvalidArgumentError do - backup.restore "restored-database", encryption_config: { kms_key_name: kms_key_name } - end - end - - it "raise an error on create database backup with invalid encryption config" do - assert_raises Google::Cloud::InvalidArgumentError do - backup.restore "restored-database", encryption_config: { - kms_key_name: kms_key_name, encryption_type: :GOOGLE_DEFAULT_ENCRYPTION - } - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/backup_test.rb b/google-cloud-spanner/test/google/cloud/spanner/backup_test.rb deleted file mode 100644 index 870d4bb8a8e2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/backup_test.rb +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:backup_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Backup.new( - backup_hash( - instance_id: instance_id, - database_id: database_id, - backup_id: backup_id, - expire_time: Time.now + 36000, - version_time: Time.now - 7200, - create_time: Time.now, - size_bytes: 1024 - ) - ) - } - let(:backup) { Google::Cloud::Spanner::Backup.from_grpc backup_grpc, spanner.service } - - it "knows the identifiers" do - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - _(backup.project_id).must_equal project - _(backup.instance_id).must_equal instance_id - _(backup.database_id).must_equal database_id - _(backup.backup_id).must_equal backup_id - - _(backup.state).must_equal :READY - _(backup).must_be :ready? - _(backup).wont_be :creating? - - _(backup.expire_time).must_be_kind_of Time - _(backup.version_time).must_be_kind_of Time - _(backup.create_time).must_be_kind_of Time - _(backup.size_in_bytes).must_be :>, 0 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_client_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_client_test.rb deleted file mode 100644 index b93c8563612b..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_client_test.rb +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchClient, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:timestamp) { Google::Protobuf::Timestamp.new seconds: 1412262083, nanos: 45123456 } - let(:timestamp_time) { Google::Cloud::Spanner::Convert.timestamp_to_time timestamp } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id, read_timestamp: timestamp } - let(:batch_tx_hash) { { session: Base64.strict_encode64(session_grpc.to_proto), transaction: Base64.strict_encode64(transaction_grpc.to_proto) } } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new return_read_timestamp: true } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new read_only: snp_opts } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:batch_client) { spanner.batch_client instance_id, database_id } - - let(:labels) { { "env" => "production" } } - let(:batch_client_labels) { spanner.batch_client instance_id, database_id, labels: labels } - - it "knows its project_id" do - _(batch_client.project_id).must_equal project - end - - it "holds a reference to project" do - _(batch_client.project).must_equal spanner - end - - it "knows its instance_id" do - _(batch_client.instance_id).must_equal instance_id - end - - it "retrieves the instance" do - get_res = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) - mock = Minitest::Mock.new - mock.expect :get_instance, get_res, [{ name: instance_path(instance_id) }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instance = spanner.instance instance_id - - mock.verify - - _(instance.project_id).must_equal project - _(instance.instance_id).must_equal instance_id - _(instance.path).must_equal instance_path(instance_id) - end - - it "knows its database_id" do - _(batch_client.database_id).must_equal database_id - end - - it "retrieves the database" do - get_res = Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) - mock = Minitest::Mock.new - mock.expect :get_database, get_res, [{ name: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - database = batch_client.database - - mock.verify - - _(database.project_id).must_equal project - _(database.instance_id).must_equal instance_id - _(database.database_id).must_equal database_id - _(database.path).must_equal database_path(instance_id, database_id) - end - - it "creates a batch_snapshot" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates a batch_snapshot with session labels" do - mock = Minitest::Mock.new - session_labels_grpc = Google::Cloud::Spanner::V1::Session.new labels: labels - session_labels_resp_grpc = Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id), labels: labels - mock.expect :create_session, session_labels_resp_grpc, [{ database: database_path(instance_id, database_id), session: session_labels_grpc }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client_labels.batch_snapshot - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - describe :strong do - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new strong: true, return_read_timestamp: true } - - it "creates a batch_snapshot with strong timestamp bound" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot strong: true - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - end - - describe :timestamp do - let(:snapshot_time) { Time.now } - let(:snapshot_datetime) { snapshot_time.to_datetime } - let(:snapshot_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp snapshot_time } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new read_timestamp: snapshot_timestamp, return_read_timestamp: true } - - it "creates a batch_snapshot with timestamp option (Time)" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot timestamp: snapshot_time - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates a batch_snapshot with read_timestamp option (Time)" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot read_timestamp: snapshot_time - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates a batch_snapshot with timestamp option (DateTime)" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot timestamp: snapshot_datetime - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates a batch_snapshot with read_timestamp option (DateTime)" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot read_timestamp: snapshot_datetime - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - end - - describe :staleness do - let(:snapshot_staleness) { 60 } - let(:duration_staleness) { Google::Cloud::Spanner::Convert.number_to_duration snapshot_staleness } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new exact_staleness: duration_staleness, return_read_timestamp: true } - - it "creates a batch_snapshot with the staleness option" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot staleness: snapshot_staleness - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates a batch_snapshot with the exact_staleness option" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - batch_snapshot = batch_client.batch_snapshot exact_staleness: snapshot_staleness - - mock.verify - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - end - - it "loads a batch_snapshot (hash)" do - batch_snapshot = batch_client.load_batch_snapshot batch_tx_hash - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "loads a batch_snapshot (json)" do - batch_snapshot = batch_client.load_batch_snapshot batch_tx_hash - - _(batch_snapshot.transaction_id).must_equal transaction_id - _(batch_snapshot.timestamp).must_equal timestamp_time - _(batch_snapshot.session.path).must_equal session.path - end - - it "creates an inclusive range" do - range = batch_client.range 1, 100 - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates an exclusive range" do - range = batch_client.range 1, 100, exclude_begin: true, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).must_be :exclude_end? - end - - it "creates a range that excludes beginning" do - range = batch_client.range 1, 100, exclude_begin: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates a range that excludes ending" do - range = batch_client.range 1, 100, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).must_be :exclude_end? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_partition_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_partition_test.rb deleted file mode 100644 index 8bba592591b6..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_partition_test.rb +++ /dev/null @@ -1,471 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :execute_partition, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - let(:partition_token) { "my-partition" } - let(:table) { "my-table" } - let(:sql) { "SELECT * FROM users" } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a simple query" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, sql, transaction: tx_selector, param_types: {}, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: sql) - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE active = @active", params: { active: true } ) - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE age = @age", params: { age: 29 } ) - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE score = @score", params: { score: 0.9 } ) - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE updated_at = @updated_at", params: { updated_at: timestamp } ) - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE birthday = @birthday", params: { birthday: date } ) - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE name = @name", params: { name: "Charlie" } ) - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE avatar = @avatar", params: { avatar: file } ) - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE project_ids = @list", params: { list: [1,2,3] } ) - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE project_ids = @list", params: { list: [] }, param_types: { list: [:INT64] } ) - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: :production } } ) - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [ Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } ) - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } ) - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))).to_h }, partition_token: partition_token, options: default_options - - struct_fields = Google::Cloud::Spanner::Fields.new name: :STRING, email: :STRING - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } ) - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])).to_h }, partition_token: partition_token, options: default_options - - results = batch_snapshot.execute_partition partition(sql: "SELECT * FROM users WHERE settings = @dict", params: { dict: { } } ) - - mock.verify - - assert_results results - end - - it "can read all rows" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: "", limit: nil, resume_token: nil, partition_token: partition_token, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.execute_partition partition(table: "my-table", columns: columns) - - mock.verify - - assert_results results - end - - it "can read rows by id" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: tx_selector, index: "", limit: nil, resume_token: nil, partition_token: partition_token, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.execute_partition partition(table: "my-table", columns: columns, keys: [1, 2, 3]) - - mock.verify - - assert_results results - end - - it "can read rows with index" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: partition_token, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.execute_partition partition(table: "my-table", columns: columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey") - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: partition_token, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - lookup_range = Google::Cloud::Spanner::Range.new [1,1], [3,3] - results = batch_snapshot.execute_partition partition(table: "my-table", columns: columns, keys: lookup_range, index: "MyTableCompositeKey") - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options" do - expect_query_options = { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, sql, transaction: tx_selector, param_types: {}, partition_token: partition_token, options: default_options, query_options: expect_query_options - - results = batch_snapshot.execute_partition partition(sql: sql, query_options: expect_query_options) - - mock.verify - - assert_results results - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, sql, transaction: tx_selector, param_types: {}, partition_token: partition_token, options: expect_options - - results = batch_snapshot.execute_partition partition(sql: sql), call_options: call_options - - mock.verify - - assert_results results - end - - it "can read all rows with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: "", limit: nil, resume_token: nil, partition_token: partition_token, - request_options: nil - }, expect_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.execute_partition partition(table: "my-table", columns: columns), call_options: call_options - - mock.verify - - assert_results results - end - - def partition table: nil, keys: nil, columns: nil, index: nil, sql: nil, - params: nil, param_types: nil, query_options: nil - if table - columns = Array(columns).map(&:to_s) - keys = Google::Cloud::Spanner::Convert.to_key_set keys - - read_grpc = Google::Cloud::Spanner::V1::ReadRequest.new( - { - session: session.path, - table: table, - columns: columns, - key_set: keys, - index: index, - transaction: tx_selector, - partition_token: partition_token - }.delete_if { |_, v| v.nil? } - ) - - Google::Cloud::Spanner::Partition.from_read_grpc read_grpc - else #sql - params, param_types = Google::Cloud::Spanner::Convert.to_input_params_and_types params, param_types - - execute_sql_grpc = Google::Cloud::Spanner::V1::ExecuteSqlRequest.new( - { - session: session.path, - sql: sql, - params: params, - param_types: param_types, - transaction: tx_selector, - partition_token: partition_token, - query_options: query_options - }.delete_if { |_, v| v.nil? } - ) - - Google::Cloud::Spanner::Partition.from_execute_sql_grpc execute_sql_grpc - end - end - - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_query_test.rb deleted file mode 100644 index 59a12770f968..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/execute_query_test.rb +++ /dev/null @@ -1,354 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :execute_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a simple query" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query using execute alias" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = batch_snapshot.execute "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query using execute_sql alias" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = batch_snapshot.execute_sql "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query using query alias" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = batch_snapshot.query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE active = @active", params: { active: true } - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE age = @age", params: { age: 29 } - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE score = @score", params: { score: 0.9 } - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE updated_at = @updated_at", params: { updated_at: timestamp } - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE birthday = @birthday", params: { birthday: date } - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE name = @name", params: { name: "Charlie" } - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE avatar = @avatar", params: { avatar: file } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [1,2,3] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: :production } } - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [ Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - results = batch_snapshot.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - struct_fields = Google::Cloud::Spanner::Fields.new name: :STRING, email: :STRING - results = batch_snapshot.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, options: default_options - - results = batch_snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { } } - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options (query-level)" do - expect_query_options = { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options, query_options: expect_query_options - - results = batch_snapshot.execute_query "SELECT * FROM users", query_options: expect_query_options - - mock.verify - - assert_results results - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - batch_snapshot.session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: expect_options - - results = batch_snapshot.execute_query "SELECT * FROM users", call_options: call_options - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/metadata_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/metadata_test.rb deleted file mode 100644 index 5bd5ffd88631..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/metadata_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :metadata, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:time_obj) { Time.parse "2014-10-02T15:01:23.045123456Z" } - let(:timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp time_obj } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id, read_timestamp: timestamp } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - - it "knows it has a transaction_id" do - _(batch_snapshot).must_be_kind_of Google::Cloud::Spanner::BatchSnapshot - - _(batch_snapshot.transaction_id).must_equal transaction_id - end - - it "knows it has a timestamp" do - _(batch_snapshot).must_be_kind_of Google::Cloud::Spanner::BatchSnapshot - - _(batch_snapshot.timestamp).must_equal time_obj - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_query_test.rb deleted file mode 100644 index f6b96bf8c8d2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_query_test.rb +++ /dev/null @@ -1,462 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :partition_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:partitions_resp) { Google::Cloud::Spanner::V1::PartitionResponse.new partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")] } - - it "can execute a simple query" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users" - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: nil, param_types: nil, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE active = @active" - params = Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }) - param_types = { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { active: true } - - mock.verify - - assert_partitions partitions, sql, params: { active: true } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { active: true } - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE age = @age" - params = Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }) - param_types = { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { age: 29 } - - mock.verify - - assert_partitions partitions, sql, params: { age: 29 } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { age: 29 } - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE score = @score" - params = Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }) - param_types = { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { score: 0.9 } - - mock.verify - - assert_partitions partitions, sql, params: { score: 0.9 } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { score: 0.9 } - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE updated_at = @updated_at" - params = Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }) - param_types = { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { updated_at: timestamp } - - mock.verify - - assert_partitions partitions, sql, params: { updated_at: timestamp } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { updated_at: timestamp } - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE birthday = @birthday" - params = Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }) - param_types = { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { birthday: date } - - mock.verify - - assert_partitions partitions, sql, params: { birthday: date } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { birthday: date } - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE name = @name" - params = Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }) - param_types = { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { name: "Charlie" } - - mock.verify - - assert_partitions partitions, sql, params: { name: "Charlie" } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { name: "Charlie" } - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE avatar = @avatar" - params = Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }) - param_types = { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { avatar: file } - - mock.verify - - assert_partitions partitions, sql, params: { avatar: file } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { avatar: file } - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE project_ids = @list" - params = Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }) - param_types = { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { list: [1,2,3] } - - mock.verify - - assert_partitions partitions, sql, params: { list: [1,2,3] } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { list: [1,2,3] } - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE project_ids = @list" - params = Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }) - param_types = { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - assert_partitions partitions, sql, params: { list: [] }, types: { list: [:INT64] } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { list: [] }, types: { list: [:INT64] } - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE settings = @dict" - params = Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }) - param_types = { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { dict: { env: :production } } - - mock.verify - - assert_partitions partitions, sql, params: { dict: { env: :production } } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { dict: { env: :production } } - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE settings = @dict" - params = Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }) - param_types = { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - assert_partitions partitions, sql, params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)" - params = Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ) - param_types = { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - struct_fields = Google::Cloud::Spanner::Fields.new name: :STRING, email: :STRING - partitions = batch_snapshot.partition_query "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - mock.verify - - assert_partitions partitions, sql, params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)" - params = Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ) - param_types = { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - struct_fields = Google::Cloud::Spanner::Fields.new name: :STRING, email: :STRING - partitions = batch_snapshot.partition_query "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - mock.verify - - assert_partitions partitions, sql, params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - sql = "SELECT * FROM users WHERE settings = @dict" - params = Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }) - param_types = { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) } - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: params, param_types: param_types, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, params: { dict: { } } - - mock.verify - - assert_partitions partitions, sql, params: { dict: { } } - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, sql, params: { dict: { } } - end - - it "can execute a query with partition_size_bytes" do - partition_size_bytes = 65536 - partition_options = Google::Cloud::Spanner::V1::PartitionOptions.new partition_size_bytes: partition_size_bytes, max_partitions: 0 - mock = Minitest::Mock.new - sql = "SELECT * FROM users" - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: nil, param_types: nil, partition_options: partition_options }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, partition_size_bytes: partition_size_bytes - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can execute a query with max_partitions" do - max_partitions = 4 - partition_options = Google::Cloud::Spanner::V1::PartitionOptions.new partition_size_bytes: 0, max_partitions: max_partitions - mock = Minitest::Mock.new - sql = "SELECT * FROM users" - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: nil, param_types: nil, partition_options: partition_options }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, max_partitions: max_partitions - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can execute a simple query with query options (query-level)" do - expect_query_options = { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - sql = "SELECT * FROM users" - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: nil, param_types: nil, partition_options: nil }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, query_options: expect_query_options - - mock.verify - - partitions.each do |p| - _(p.execute.query_options.to_h).must_equal expect_query_options - end - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - sql = "SELECT * FROM users" - mock.expect :partition_query, partitions_resp, [{ session: session.path, sql: sql, transaction: tx_selector, params: nil, param_types: nil, partition_options: nil }, expect_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_query sql, call_options: call_options - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - def assert_partitions partitions, sql = "SELECT * FROM users", params: nil, types: nil - _(partitions).must_be_kind_of Array - _(partitions).wont_be :empty? - - params, types = Google::Cloud::Spanner::Convert.to_input_params_and_types params, types - - partitions.each do |partition| - _(partition).must_be :execute? - _(partition).must_be :execute_query? - - _(partition.execute.partition_token).must_equal "partition-token" - _(partition.execute.sql).must_equal sql - if params.nil? - _(partition.execute.params).must_be_nil - else - _(partition.execute.params).must_equal params - end - types_hash = Hash[Hash(types).map { |key, value| [key, value.to_h] }] - _(partition.execute.param_types.to_h).must_equal types_hash - - _(partition.read).must_be_nil - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_read_test.rb deleted file mode 100644 index 6e9994f744d8..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/partition_read_test.rb +++ /dev/null @@ -1,220 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :partition_read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:columns) { [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] } - let(:columns_arg) { ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"] } - let(:partitions_resp) { Google::Cloud::Spanner::V1::PartitionResponse.new partitions: [Google::Cloud::Spanner::V1::Partition.new(partition_token: "partition-token")] } - - it "can read all rows" do - - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(all: true) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: nil, columns: columns_arg, partition_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can read rows by id" do - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: nil, columns: columns_arg, partition_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns, keys: [1, 2, 3] - - mock.verify - - assert_partitions partitions, keys: [1, 2, 3] - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, keys: [1, 2, 3] - end - - it "can read rows with index" do - - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: "MyTableCompositeKey", columns: columns_arg, partition_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - mock.verify - - assert_partitions partitions, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - end - - it "can read rows with index and range" do - - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: "MyTableCompositeKey", columns: columns_arg, partition_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - lookup_range = Google::Cloud::Spanner::Range.new [1,1], [3,3] - partitions = batch_snapshot.partition_read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - mock.verify - - assert_partitions partitions, keys: lookup_range, index: "MyTableCompositeKey" - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions, keys: lookup_range, index: "MyTableCompositeKey" - end - - it "can read all rows with partition_size_bytes" do - partition_size_bytes = 65536 - partition_options = Google::Cloud::Spanner::V1::PartitionOptions.new partition_size_bytes: partition_size_bytes, max_partitions: 0 - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(all: true) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: nil, columns: columns_arg, partition_options: partition_options - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns, partition_size_bytes: partition_size_bytes - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can read all rows with max_partitions" do - max_partitions = 4 - partition_options = Google::Cloud::Spanner::V1::PartitionOptions.new partition_size_bytes: 0, max_partitions: max_partitions - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(all: true) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: nil, columns: columns_arg, partition_options: partition_options - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns, max_partitions: max_partitions - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - it "can read all rows with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - key_set = Google::Cloud::Spanner::V1::KeySet.new(all: true) - mock.expect :partition_read, partitions_resp, [{ - session: session.path, table: "my-table", key_set: key_set, - transaction: tx_selector, index: nil, columns: columns_arg, partition_options: nil - }, expect_options] - batch_snapshot.session.service.mocked_service = mock - - partitions = batch_snapshot.partition_read "my-table", columns, call_options: call_options - - mock.verify - - assert_partitions partitions - - serialized_partitions = partitions.map(&:dump) - deserialized_partitions = serialized_partitions.map do |sp| - Google::Cloud::Spanner::Partition.load sp - end - assert_partitions deserialized_partitions - end - - def assert_partitions partitions, keys: nil, index: nil - _(partitions).must_be_kind_of Array - _(partitions).wont_be :empty? - - partitions.each do |partition| - _(partition).must_be :read? - - _(partition.read.partition_token).must_equal "partition-token" - _(partition.read.table).must_equal "my-table" - _(partition.read.key_set).must_equal Google::Cloud::Spanner::Convert.to_key_set(keys) - _(partition.read.columns).must_equal columns.map(&:to_s) - _(partition.read.index).must_equal index.to_s - - _(partition.execute).must_be_nil - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/read_test.rb deleted file mode 100644 index d5d051dc13b0..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/batch_snapshot/read_test.rb +++ /dev/null @@ -1,259 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::BatchSnapshot, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:batch_snapshot) { Google::Cloud::Spanner::BatchSnapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - - it "can read all rows" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns - - mock.verify - - assert_results results - end - - it "can read rows by id" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns, keys: [1, 2, 3] - - mock.verify - - assert_results results - end - - it "can read rows with index" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - lookup_range = Google::Cloud::Spanner::Range.new [1,1], [3,3] - results = batch_snapshot.read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), transaction: tx_selector, index: nil, limit: 5, - resume_token: nil, partition_token: nil, request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns, limit: 5 - - mock.verify - - assert_results results - end - - it "can read just one row with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value]), - transaction: tx_selector, index: nil, limit: 1, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns, keys: 1, limit: 1 - - mock.verify - - assert_results results - end - - it "can read all rows" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, expect_options] - batch_snapshot.session.service.mocked_service = mock - - results = batch_snapshot.read "my-table", columns, call_options: call_options - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/admin_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/admin_test.rb deleted file mode 100644 index 4267436d4cb7..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/admin_test.rb +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :admin, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new "google-cloud-resource-prefix" => database_path(instance_id, database_id) } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - after do - shutdown_client! client - end - - it "knows its project_id" do - _(client.project_id).must_equal project - end - - it "holds a reference to project" do - _(client.project).must_equal spanner - end - - it "knows its instance_id" do - _(client.instance_id).must_equal instance_id - end - - it "retrieves the instance" do - get_res = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) - mock = Minitest::Mock.new - mock.expect :get_instance, get_res, [{ name: instance_path(instance_id) }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instance = spanner.instance instance_id - - mock.verify - - _(instance.project_id).must_equal project - _(instance.instance_id).must_equal instance_id - _(instance.path).must_equal instance_path(instance_id) - end - - it "knows its database_id" do - _(client.database_id).must_equal database_id - end - - it "retrieves the database" do - get_res = Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) - mock = Minitest::Mock.new - mock.expect :get_database, get_res, [{ name: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - database = client.database - - mock.verify - - _(database.project_id).must_equal project - _(database.instance_id).must_equal instance_id - _(database.database_id).must_equal database_id - _(database.path).must_equal database_path(instance_id, database_id) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/close_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/close_test.rb deleted file mode 100644 index 578b059433c7..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/close_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :close, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new "google-cloud-resource-prefix" => database_path(instance_id, database_id) } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:pool) { client.instance_variable_get :@pool } - let(:default_options) { - ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } - } - - before do - session.instance_variable_set :@last_updated_at, Time.now - p = client.instance_variable_get :@pool - p.all_sessions = [session] - p.session_queue = [session] - end - - it "deletes sessions when closed" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{name: session_grpc.name}, default_options] - session.service.mocked_service = mock - - client.close - - shutdown_pool! pool - - mock.verify - end - - it "cannot be used after being closed" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{name: session_grpc.name}, default_options] - session.service.mocked_service = mock - - client.close - - assert_raises Google::Cloud::Spanner::ClientClosedError do - client.execute_query "SELECT 1" - end - - shutdown_pool! pool - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/commit_field_values_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/commit_field_values_test.rb deleted file mode 100644 index 97d1ee571474..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/commit_field_values_test.rb +++ /dev/null @@ -1,205 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:commit_time) { Time.now } - let(:commit_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp commit_time } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: commit_timestamp } - let(:commit_stats_grpc) { - Google::Cloud::Spanner::V1::CommitResponse::CommitStats.new( - mutation_count: 5 - ) - } - let(:commit_stats_resp_grpc) { - Google::Cloud::Spanner::V1::CommitResponse.new( - commit_timestamp: commit_timestamp, commit_stats: commit_stats_grpc - ) - } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new( - read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) - } - let(:default_options) { - ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } - } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - describe "commit_timestamp" do - it "commits using a block" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", "spanner.commit_timestamp()"]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", "spanner.commit_timestamp()"]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", "spanner.commit_timestamp()"]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.commit do |c| - c.update "users", [{ id: 1, name: "Charlie", updated_at: client.commit_timestamp }] - c.insert "users", [{ id: 2, name: "Harvey", updated_at: client.commit_timestamp }] - c.upsert "users", [{ id: 3, name: "Marley", updated_at: client.commit_timestamp }] - c.replace "users", [{ id: 4, name: "Henry", updated_at: client.commit_timestamp }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "updates directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.update "users", [{ id: 1, name: "Charlie", updated_at: client.commit_timestamp }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "inserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.insert "users", [{ id: 2, name: "Harvey", updated_at: client.commit_timestamp }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.upsert "users", [{ id: 3, name: "Marley", updated_at: client.commit_timestamp }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts using save alias" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.save "users", [{ id: 3, name: "Marley", updated_at: client.commit_timestamp }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "replaces directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.replace "users", [{ id: 4, name: "Henry", updated_at: client.commit_timestamp }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/commit_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/commit_test.rb deleted file mode 100644 index 77fd042b2886..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/commit_test.rb +++ /dev/null @@ -1,677 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:commit_time) { Time.now } - let(:commit_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp commit_time } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: commit_timestamp } - let(:commit_stats_grpc) { - Google::Cloud::Spanner::V1::CommitResponse::CommitStats.new( - mutation_count: 5 - ) - } - let(:commit_stats_resp_grpc) { - Google::Cloud::Spanner::V1::CommitResponse.new( - commit_timestamp: commit_timestamp, commit_stats: commit_stats_grpc - ) - } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:mutations) { - [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - } - - it "commits using a block" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.commit do |c| - c.update "users", [{ id: 1, name: "Charlie", active: false }] - c.insert "users", [{ id: 2, name: "Harvey", active: true }] - c.upsert "users", [{ id: 3, name: "Marley", active: false }] - c.replace "users", [{ id: 4, name: "Henry", active: true }] - c.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "updates directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.update "users", [{ id: 1, name: "Charlie", active: false }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "inserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.insert "users", [{ id: 2, name: "Harvey", active: true }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.upsert "users", [{ id: 3, name: "Marley", active: false }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts using save alias" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.save "users", [{ id: 3, name: "Marley", active: false }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "replaces directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.replace "users", [{ id: 4, name: "Henry", active: true }] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes multiple rows of keys directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", [1, 2, 3, 4, 5] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes multiple rows of keys (timestamp keys) directly" do - time1 = Time.now - 5*60*60 - time2 = Time.now - 5*60*60 - time3 = Time.now - 5*60*60 - time4 = Time.now - 5*60*60 - - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [time1, time2, time3, time4].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", [time1, time2, time3, time4] - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes multiple rows of key rangess directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - ranges: [Google::Cloud::Spanner::Convert.to_key_range(1..100)] - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", 1..100 - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes a single rows directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", 5 - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes a single rows (timestamp key) directly" do - time5 = Time.now - 5*60*60 - - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [time5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", time5 - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes all rows directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users" - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes all rows directly with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, expect_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", call_options: call_options - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "commits using a block with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, expect_options] - spanner.service.mocked_service = mock - - timestamp = client.commit call_options: call_options do |c| - c.update "users", [{ id: 1, name: "Charlie", active: false }] - c.insert "users", [{ id: 2, name: "Harvey", active: true }] - c.upsert "users", [{ id: 3, name: "Marley", active: false }] - c.replace "users", [{ id: 4, name: "Henry", active: true }] - c.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - describe "commit options" do - let(:commit_options) { { return_commit_stats: true } } - - it "commit using block and return commits stats" do - mutations = [Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - )] - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.commit commit_options: commit_options do |c| - c.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - - it "insert rows and return commits stats" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ) - ] - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.insert "users", [{ id: 2, name: "Harvey", active: true }], commit_options: commit_options - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - - it "updates rows and return commits stats" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.update "users", [{ id: 1, name: "Charlie", active: false }], commit_options: commit_options - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - - it "upsert rows and return commits stats" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.save "users", [{ id: 3, name: "Marley", active: false }], commit_options: commit_options - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - - it "delete rows and return commits stats" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.delete "users", [1, 2, 3, 4, 5], commit_options: commit_options - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - - it "replace values and return commits stats" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name updated_at), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", "spanner.commit_timestamp()"]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :commit, commit_stats_resp_grpc, [{ session: session_grpc.name, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, return_commit_stats: true, request_options: nil }, default_options] - spanner.service.mocked_service = mock - - commit_resp = client.replace "users", [{ id: 4, name: "Henry", updated_at: client.commit_timestamp }], commit_options: commit_options - assert_commit_response commit_resp, commit_stats_resp_grpc - - shutdown_client! client - mock.verify - end - end - - describe "priority request options" do - let(:write_mutation){ - Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Harvey", true]).list_value] - ) - } - let(:request_options){ - { priority: :PRIORITY_MEDIUM } - } - - it 'inserts records' do - mock_commit_request [Google::Cloud::Spanner::V1::Mutation.new(insert: write_mutation )], - request_options: request_options do - timestamp = client.insert "users", [{ id: 1, name: "Harvey", active: true }], - request_options: request_options - _(timestamp).must_equal commit_time - end - end - - it 'upserts records' do - mock_commit_request [Google::Cloud::Spanner::V1::Mutation.new(insert_or_update: write_mutation )], - request_options: request_options do - timestamp = client.upsert "users", [{ id: 1, name: "Harvey", active: true }], - request_options: request_options - _(timestamp).must_equal commit_time - end - end - - it 'updates records' do - mock_commit_request [Google::Cloud::Spanner::V1::Mutation.new(update: write_mutation )], - request_options: request_options do - timestamp = client.update "users", [{ id: 1, name: "Harvey", active: true }], - request_options: request_options - _(timestamp).must_equal commit_time - end - end - - it 'replaces records' do - mock_commit_request [Google::Cloud::Spanner::V1::Mutation.new(replace: write_mutation )], - request_options: request_options do - timestamp = client.replace "users", [{ id: 1, name: "Harvey", active: true }], - request_options: request_options - _(timestamp).must_equal commit_time - end - end - - it 'deletes records' do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock_commit_request mutations, request_options: request_options do - timestamp = client.delete "users", [1, 2, 3, 4, 5], request_options: request_options - _(timestamp).must_equal commit_time - end - end - - it "commits using a block" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ - database: database_path(instance_id, database_id), session: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: request_options - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.commit request_options: request_options do |c| - c.update "users", [{ id: 1, name: "Charlie", active: false }] - c.insert "users", [{ id: 2, name: "Harvey", active: true }] - c.upsert "users", [{ id: 3, name: "Marley", active: false }] - c.replace "users", [{ id: 4, name: "Henry", active: true }] - c.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - end - - def mock_commit_request mutations, request_options: nil - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ - database: database_path(instance_id, database_id), session: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, - request_options: request_options - }, default_options] - spanner.service.mocked_service = mock - - yield - - mock.verify - shutdown_client! client - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/commit_timestamp_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/commit_timestamp_test.rb deleted file mode 100644 index fbcd1d69ad79..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/commit_timestamp_test.rb +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :commit_timestamp, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: Google::Protobuf::Timestamp.new() } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - after do - shutdown_client! client - end - - it "creates a commit_timestamp column value" do - column_value = client.commit_timestamp - - _(column_value).must_be_kind_of Google::Cloud::Spanner::ColumnValue - _(column_value.type).must_equal :commit_timestamp - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/commit_transaction_tag_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/commit_transaction_tag_test.rb deleted file mode 100644 index 953694864b02..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/commit_transaction_tag_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:commit_time) { Time.now } - let(:commit_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp commit_time } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: commit_timestamp } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - it "commits using a block" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: { transaction_tag: "Tag-1"} - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.commit request_options: { tag: "Tag-1"} do |c| - c.insert "users", [{ id: 1, name: "Charlie", active: false }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "updates" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: { transaction_tag: "Tag-2" } - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.update "users", [{ id: 1, name: "Charlie", active: false }], - request_options: { tag: "Tag-2" } - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "inserts" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: { transaction_tag: "Tag-3" } - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.insert "users", [{ id: 2, name: "Harvey", active: true }], - request_options: { tag: "Tag-3" } - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: { transaction_tag: "Tag-4" } - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.upsert "users", [{ id: 3, name: "Marley", active: false }], - request_options: { tag: "Tag-4" } - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{database: database_path(instance_id, database_id), session: nil}, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: nil, - single_use_transaction: tx_opts, request_options: { transaction_tag: "Tag-5" } - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.delete "users", [1, 2], request_options: { tag: "Tag-5" } - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/execute_partition_update_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/execute_partition_update_test.rb deleted file mode 100644 index 0ae53fc91807..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/execute_partition_update_test.rb +++ /dev/null @@ -1,358 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :execute_partition_update, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:pdml_tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(partitioned_dml: Google::Cloud::Spanner::V1::TransactionOptions::PartitionedDml.new) } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:results_grpc) { - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_lower_bound: 1 - ) - ) - } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a PDML statement" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET active = true" - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with bool param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET active = @active", params: { active: true } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with int param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET age = @age", params: { age: 29 } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with float param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET score = @score", params: { score: 0.9 } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET updated_at = @updated_at", params: { updated_at: timestamp } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET birthday = @birthday", params: { birthday: date } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with String param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET name = @name", params: { name: "Charlie" } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET avatar = @avatar", params: { avatar: file } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with an Array param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET project_ids = @list", params: { list: [1,2,3] } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with an empty Array param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with a simple Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET settings = @dict", params: { dict: { env: :production } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with a complex Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with an empty Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, options: default_options - - row_count = client.execute_partition_update "UPDATE users SET settings = @dict", params: { dict: { } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "raises InvalidArgumentError if the response does not contain stats" do - no_stats_results_grpc = results_grpc.dup - no_stats_results_grpc.stats = nil - no_stats_results_enum = Array(no_stats_results_grpc).to_enum - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql no_stats_results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: default_options - - err = expect do - client.execute_partition_update "UPDATE users SET active = true" - end.must_raise Google::Cloud::InvalidArgumentError - - mock.verify - end - - it "can execute a PDML statement with query options" do - expect_query_options = { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: default_options, query_options: expect_query_options - - row_count = client.execute_partition_update "UPDATE users SET active = true", query_options: expect_query_options - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with query options (environment variable or client-level)" do - expect_query_options = { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - new_client = spanner.client instance_id, database_id, pool: { min: 0 }, query_options: expect_query_options - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: default_options, query_options: expect_query_options - - row_count = new_client.execute_partition_update "UPDATE users SET active = true" - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with query options that query-level configs merge over environment variable or client-level configs" do - expect_query_options = { optimizer_version: "2", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - new_client = spanner.client instance_id, database_id, pool: { min: 0 }, query_options: { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: default_options, query_options: expect_query_options - - row_count = new_client.execute_partition_update "UPDATE users SET active = true", query_options: { optimizer_version: "2" } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a PDML statement with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, options: expect_options - - row_count = client.execute_partition_update "UPDATE users SET active = true", call_options: call_options - - mock.verify - - _(row_count).must_equal 1 - end - - describe "priority request options" do - it "execute a PDML statement" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, - "UPDATE users SET active = true", - transaction: tx_selector, - request_options: { priority: :PRIORITY_MEDIUM }, - options: default_options - - row_count = client.execute_partition_update "UPDATE users SET active = true", - request_options: { priority: :PRIORITY_MEDIUM } - - mock.verify - - _(row_count).must_equal 1 - end - end - - it "can execute a PDML statement with request tag" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{session: session_grpc.name, options: pdml_tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", - transaction: tx_selector, request_options: { request_tag: "Tag-2" }, - options: default_options - - row_count = client.execute_partition_update "UPDATE users SET active = true", request_options: { tag: "Tag-2" } - - mock.verify - - _(row_count).must_equal 1 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_resume_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_resume_test.rb deleted file mode 100644 index f9692bfc6cdc..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_resume_test.rb +++ /dev/null @@ -1,271 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :execute_query, :resume, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :metadata_result do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :partial_row_1 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" } - ], - resume_token: "xyz890" - } - end - let :partial_row_2 do - { - values: [ - { bool_value: true}, - { string_value: "29" } - ] - } - end - let :partial_row_3 do - { - values: [ - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" } - ], - resume_token: "abc123" - } - end - let :partial_row_4 do - { - values: [ - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - ] - } - end - let :partial_row_5 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let :full_row do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ], - } - end - - let(:service_mock) { Minitest::Mock.new } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - before do - spanner.service.mocked_service = service_mock - end - - after do - shutdown_client! client - end - - describe "when a resume token is available" do - it "resumes broken response streams" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_1), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_2), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_3), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_4), - GRPC::Unavailable, - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_5) - ].to_enum - resulting_stream_2 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_4), - Google::Cloud::Spanner::V1::PartialResultSet.new(partial_row_5) - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_2), session_grpc.name, "SELECT * FROM users", resume_token: "abc123", options: default_options - - results = client.execute_query "SELECT * FROM users" - - assert_results results - service_mock.verify - end - end - - describe "when a resume token is NOT available" do - it "restarts the request when a unavailable error is returned" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - GRPC::Unavailable, - ].to_enum - resulting_stream_2 = [ - Google::Cloud::UnavailableError, - ].to_enum - resulting_stream_3 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(full_row) - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_2), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_3), session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute_query "SELECT * FROM users" - - assert_results results - service_mock.verify - end - - it "restarts the request when a EOS internal error is returned" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - GRPC::Internal.new("INTERNAL: Received unexpected EOS on DATA frame from server"), - ].to_enum - resulting_stream_2 = [ - Google::Cloud::InternalError.new("INTERNAL: Received unexpected EOS on DATA frame from server"), - ].to_enum - resulting_stream_3 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(full_row) - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_2), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_3), session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute_query "SELECT * FROM users" - - assert_results results - service_mock.verify - end - - it "restarts the request when a RST_STREAM internal error is returned" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - GRPC::Internal.new("INTERNAL: Received RST_STREAM with code 2 (Internal server error)"), - ].to_enum - resulting_stream_2 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - GRPC::Internal.new("INTERNAL: Received RST_STREAM with code 2 (Internal server error)"), - ].to_enum - resulting_stream_3 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(full_row) - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_2), session_grpc.name, "SELECT * FROM users", options: default_options - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_3), session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute_query "SELECT * FROM users" - - assert_results results - service_mock.verify - end - - it "bubbles up the error when a generic GRPC internal error is returned" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - GRPC::Internal.new("INTERNAL: Generic (Internal server error)"), - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - - assert_raises Google::Cloud::Error do - results = client.execute_query "SELECT * FROM users" - results.rows.to_a # gets results from the enumerator - end - end - - it "bubbles up the error when a generic Google Cloud internal error is returned" do - resulting_stream_1 = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(metadata_result), - Google::Cloud::InternalError.new("INTERNAL: Generic (Internal server error)"), - ].to_enum - service_mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - expect_execute_streaming_sql RaiseableEnumerator.new(resulting_stream_1), session_grpc.name, "SELECT * FROM users", options: default_options - - assert_raises Google::Cloud::Error do - results = client.execute_query "SELECT * FROM users" - results.rows.to_a # gets results from the enumerator - end - end - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_single_use_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_single_use_test.rb deleted file mode 100644 index 2a0b7f211c08..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_single_use_test.rb +++ /dev/null @@ -1,302 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :execute_query, :single_use, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:time_obj) { Time.parse "2014-10-02T15:01:23.045123456Z" } - let(:timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp time_obj } - let(:duration) { Google::Cloud::Spanner::Convert.number_to_duration 120 } - - it "execute_querys with strong" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - strong: true, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { strong: true } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with read_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { read_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - exact_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with exact_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - exact_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { exact_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with bounded_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - min_read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { bounded_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with min_read_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - min_read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { min_read_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with bounded_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - max_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { bounded_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "execute_querys with max_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - max_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: transaction, options: default_options - - results = client.execute_query "SELECT * FROM users", single_use: { max_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_test.rb deleted file mode 100644 index 9bbfbf8a6aa9..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/execute_query_test.rb +++ /dev/null @@ -1,459 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :execute_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - it "can execute a simple query" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute_query "SELECT * FROM users" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query using execute alias" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute "SELECT * FROM users" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query using execute_sql alias" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.execute_sql "SELECT * FROM users" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query using query alias" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options - - results = client.query "SELECT * FROM users" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE active = @active", params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE active = @active", params: { active: true } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE age = @age", params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE age = @age", params: { age: 29 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE score = @score", params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE score = @score", params: { score: 0.9 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE updated_at = @updated_at", params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE updated_at = @updated_at", params: { updated_at: timestamp } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE birthday = @birthday", params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE birthday = @birthday", params: { birthday: date } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE name = @name", params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE name = @name", params: { name: "Charlie" } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE avatar = @avatar", params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE avatar = @avatar", params: { avatar: file } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE project_ids = @list", params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [1,2,3] } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE project_ids = @list", params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: :production } } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - results = client.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - struct_fields = client.fields name: :STRING, email: :STRING - results = client.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, options: default_options - - results = client.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { } } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options, query_options: expect_query_options - - results = client.execute_query "SELECT * FROM users", query_options: expect_query_options - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options (client-level)" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - new_client = spanner.client instance_id, database_id, pool: { min: 0 }, query_options: expect_query_options - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: default_options, query_options: expect_query_options - - results = new_client.execute_query "SELECT * FROM users" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", options: expect_options - - results = client.execute_query "SELECT * FROM users", call_options: call_options - - shutdown_client! client - - mock.verify - - assert_results results - end - - describe "priority request options" do - it "can execute a query" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", - request_options: { priority: :PRIORITY_MEDIUM }, - options: default_options - - results = client.execute_query "SELECT * FROM users", - request_options: { priority: :PRIORITY_MEDIUM} - - shutdown_client! client - - mock.verify - - assert_results results - end - end - - it "can execute a query with request tag" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", - request_options: { request_tag: "Tag-1" }, options: default_options - - results = client.execute_query "SELECT * FROM users", request_options: { tag: "Tag-1" } - - shutdown_client! client - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/fields_for_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/fields_for_test.rb deleted file mode 100644 index fd1b3937316c..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/fields_for_test.rb +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :fields_for, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - it "can get a table's fields" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE 1 = 0", options: default_options - - fields = client.fields_for "users" - - shutdown_client! client - - mock.verify - - assert_fields fields - end - - def assert_fields fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.keys.count).must_equal 9 - _(fields[:id]).must_equal :INT64 - _(fields[:name]).must_equal :STRING - _(fields[:active]).must_equal :BOOL - _(fields[:age]).must_equal :INT64 - _(fields[:score]).must_equal :FLOAT64 - _(fields[:updated_at]).must_equal :TIMESTAMP - _(fields[:birthday]).must_equal :DATE - _(fields[:avatar]).must_equal :BYTES - _(fields[:project_ids]).must_equal [:INT64] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/range_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/range_test.rb deleted file mode 100644 index 16884eb7da76..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/range_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :range, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - after do - shutdown_client! client - end - - it "creates an inclusive range" do - range = client.range 1, 100 - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates an exclusive range" do - range = client.range 1, 100, exclude_begin: true, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).must_be :exclude_end? - end - - it "creates a range that excludes beginning" do - range = client.range 1, 100, exclude_begin: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates a range that excludes ending" do - range = client.range 1, 100, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).must_be :exclude_end? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/read_error_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/read_error_test.rb deleted file mode 100644 index d806aef74aa2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/read_error_test.rb +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :error, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" } - ], - resume_token: Base64.strict_encode64("xyz890") - } - end - let :results_hash3 do - { - values: [ - { bool_value: true}, - { string_value: "29" } - ] - } - end - let :results_hash4 do - { - values: [ - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" } - ], - resume_token: Base64.strict_encode64("abc123") - } - end - let :results_hash5 do - { - values: [ - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - ] - } - end - let :results_hash6 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum1) do - [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - GRPC::InvalidArgument, - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash6) - ].to_enum - end - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - it "raises unhandled errors" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, RaiseableEnumerator.new(results_enum1), [{ - session: session_grpc.name, - table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - assert_raises Google::Cloud::InvalidArgumentError do - client.read("my-table", columns).rows.to_a - end - - shutdown_client! client - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_buffer_bound_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_buffer_bound_test.rb deleted file mode 100644 index 0decc561e642..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_buffer_bound_test.rb +++ /dev/null @@ -1,254 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :resume, :buffer_bound, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_header do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash1 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" } - ] - } - end - let :results_hash2 do - { - values: [ - { bool_value: true}, - { string_value: "29" } - ] - } - end - let :results_hash3 do - { - values: [ - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" } - ] - } - end - let :results_hash4 do - { - values: [ - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - ] - } - end - let :results_hash5 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:columns) { [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] } - - it "returns all rows even when there is no resume_token" do - no_tokens_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_header), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5) - ].to_enum - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, no_tokens_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns - - assert_results results - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 3 - rows.each { |row| assert_row row } - - shutdown_client! client - - mock.verify - end - - it "returns all rows even when all requests have resume_token" do - all_tokens_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_header), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1.merge(resume_token: Base64.strict_encode64("xyz123"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2.merge(resume_token: Base64.strict_encode64("xyz124"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3.merge(resume_token: Base64.strict_encode64("xyz125"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4.merge(resume_token: Base64.strict_encode64("xyz126"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5.merge(resume_token: Base64.strict_encode64("xyz127"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1.merge(resume_token: Base64.strict_encode64("xyz128"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2.merge(resume_token: Base64.strict_encode64("xyz129"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3.merge(resume_token: Base64.strict_encode64("xyz130"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4.merge(resume_token: Base64.strict_encode64("xyz131"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5.merge(resume_token: Base64.strict_encode64("xyz132"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1.merge(resume_token: Base64.strict_encode64("xyz133"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2.merge(resume_token: Base64.strict_encode64("xyz134"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3.merge(resume_token: Base64.strict_encode64("xyz135"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4.merge(resume_token: Base64.strict_encode64("xyz137"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5.merge(resume_token: Base64.strict_encode64("xyz128"))) - ].to_enum - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, all_tokens_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns - - assert_results results - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 3 - rows.each { |row| assert_row row } - - shutdown_client! client - - mock.verify - end - - it "returns buffered responses once it hits the buffer bounds, but will re-raise if there is no resume_token" do - bounds_with_abort_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_header), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1.merge(resume_token: Base64.strict_encode64("xyz123"))), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - GRPC::Aborted, - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5) - ].to_enum - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, RaiseableEnumerator.new(bounds_with_abort_enum), [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns - - assert_results results - row_enum = results.rows - # gets the first row - assert_row row_enum.next - # gets the second row - assert_row row_enum.next - # raises error getting third row, since the buffer bound has been reached - assert_raises Google::Cloud::AbortedError do - results.rows.next - end - - shutdown_client! client - - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - end - - def assert_row row - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_test.rb deleted file mode 100644 index 1778085b56ec..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/read_resume_test.rb +++ /dev/null @@ -1,168 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :resume, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" } - ], - resume_token: Base64.strict_encode64("xyz890") - } - end - let :results_hash3 do - { - values: [ - { bool_value: true}, - { string_value: "29" } - ] - } - end - let :results_hash4 do - { - values: [ - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" } - ], - resume_token: "abc123" - } - end - let :results_hash5 do - { - values: [ - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - ] - } - end - let :results_hash6 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum1) do - [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - GRPC::Unavailable, - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash6) - ].to_enum - end - let(:results_enum2) do - [ - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash6) - ].to_enum - end - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - it "resumes broken response streams" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, RaiseableEnumerator.new(results_enum1), [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - mock.expect :streaming_read, RaiseableEnumerator.new(results_enum2), [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: "abc123", partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns - - assert_results results - - shutdown_client! client - - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/read_single_use_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/read_single_use_test.rb deleted file mode 100644 index 2df93d7b65a1..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/read_single_use_test.rb +++ /dev/null @@ -1,358 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :single_use, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash)].to_enum - end - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:columns) { [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] } - let(:time_obj) { Time.parse "2014-10-02T15:01:23.045123456Z" } - let(:timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp time_obj } - let(:duration) { Google::Cloud::Spanner::Convert.number_to_duration 120 } - - it "reads with strong" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - strong: true, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { strong: true } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with read_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { read_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - exact_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with exact_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - exact_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { exact_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with bounded_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - min_read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { bounded_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with min_read_timestamp" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - min_read_timestamp: timestamp, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { min_read_timestamp: time_obj } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with bounded_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - max_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { bounded_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "reads with max_staleness" do - transaction = Google::Cloud::Spanner::V1::TransactionSelector.new( - single_use: Google::Cloud::Spanner::V1::TransactionOptions.new( - read_only: Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new( - max_staleness: duration, return_read_timestamp: true - ) - ) - ) - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: transaction, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, single_use: { max_staleness: 120 } - - shutdown_client! client - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/read_test.rb deleted file mode 100644 index c41aa3c78052..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/read_test.rb +++ /dev/null @@ -1,378 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - - let(:labels) { { "env" => "production" } } - let(:client_labels) { spanner.client instance_id, database_id, pool: { min: 0 }, labels: labels } - - it "can read all rows" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] -# puts Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2).inspect -# puts Google::Cloud::Spanner::V1::PartialResultSet.new(Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2)).inspect - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read rows by id" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, keys: [1, 2, 3] - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read rows by id (timestamp keys)" do - time1 = Time.now - 1*60*60 - time2 = Time.now - 2*60*60 - time3 = Time.now - 3*60*60 - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([time1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([time2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([time3]).list_value]), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, keys: [time1, time2, time3] - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read rows with index" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: nil, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: nil, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - lookup_range = client.range [1,1], [3,3] - results = client.read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read rows with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: 5, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, limit: 5 - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read just one row with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value]), - transaction: nil, index: nil, limit: 1, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, keys: 1, limit: 1 - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can read all rows with session labels" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - session_labels_grpc = Google::Cloud::Spanner::V1::Session.new labels: labels - session_labels_resp_grpc = Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id), labels: labels - mock.expect :create_session, session_labels_resp_grpc, [{ database: database_path(instance_id, database_id), session: session_labels_grpc }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - results = client_labels.read "my-table", columns - - shutdown_client! client_labels - - mock.verify - - assert_results results - end - - it "can read all rows with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, expect_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, call_options: call_options - - shutdown_client! client - - mock.verify - - assert_results results - end - - describe "priority request options" do - it "read rows" do - columns = [:id, :name] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: { priority: :PRIORITY_MEDIUM } - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", columns, request_options: { priority: :PRIORITY_MEDIUM } - - shutdown_client! client - - mock.verify - - assert_results results - end - end - - it "can read with request tag" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: { request_tag: "Tag-1"} - }, default_options] - spanner.service.mocked_service = mock - - results = client.read "my-table", [:id], request_options: { tag: "Tag-1" } - - shutdown_client! client - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/reset_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/reset_test.rb deleted file mode 100644 index e947b34d016f..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/reset_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :close, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { - Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) - } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { - ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } - } - let(:batch_create_sessions_grpc) { - Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new session: [session_grpc] - } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } } - ] - } - }, - values: [ - { string_value: "1" } - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "reset client sessions and able to query database" do - mock = Minitest::Mock.new - mock.expect :batch_create_sessions, batch_create_sessions_grpc, [ - { database: database_path(instance_id, database_id), session_count: 1, session_template: nil }, - default_options - ] - mock.expect :delete_session, nil, [{ name: session_grpc.name }, default_options] - mock.expect :batch_create_sessions, batch_create_sessions_grpc, [ - { database: database_path(instance_id, database_id), session_count: 1, session_template: nil }, - default_options - ] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT 1", options: default_options - - client = spanner.client instance_id, database_id, pool: { min: 1, max: 1 } - _(client.reset).must_equal true - _(client.execute_query("SELECT 1").rows.first.values).must_equal [1] - - pool = client.instance_variable_get :@pool - shutdown_pool! pool - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/snapshot_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/snapshot_test.rb deleted file mode 100644 index 13e020f11211..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/snapshot_test.rb +++ /dev/null @@ -1,325 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :snapshot, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:snapshot) { Google::Cloud::Spanner::Snapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new return_read_timestamp: true } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new read_only: snp_opts } - - def mock_builder - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, default_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, options: default_options - mock - end - - it "can execute a simple query without any options" do - mock = mock_builder() - - results = nil - client.snapshot do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "does not allow multiple options to be given" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - - assert_raises ArgumentError do - client.snapshot strong: true, timestamp: Time.now do |snp| - snp.execute_query "SELECT * FROM users" - end - end - - shutdown_client! client - - mock.verify - end - - describe :strong do - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new strong: true, return_read_timestamp: true } - - it "can execute a simple query with the strong option" do - mock = mock_builder() - - results = nil - client.snapshot strong: true do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - end - - describe :timestamp do - let(:snapshot_time) { Time.now } - let(:snapshot_datetime) { snapshot_time.to_datetime } - let(:snapshot_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp snapshot_time } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new read_timestamp: snapshot_timestamp, return_read_timestamp: true } - - it "can execute a simple query with the timestamp option (Time)" do - mock = mock_builder() - - results = nil - client.snapshot timestamp: snapshot_time do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with the read_timestamp option (Time)" do - mock = mock_builder() - - results = nil - client.snapshot read_timestamp: snapshot_time do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with the timestamp option (DateTime)" do - mock = mock_builder() - - results = nil - client.snapshot timestamp: snapshot_datetime do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with the read_timestamp option (DateTime)" do - mock = mock_builder() - - results = nil - client.snapshot read_timestamp: snapshot_datetime do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - end - - describe :staleness do - let(:snapshot_staleness) { 60 } - let(:duration_staleness) { Google::Cloud::Spanner::Convert.number_to_duration snapshot_staleness } - let(:snp_opts) { Google::Cloud::Spanner::V1::TransactionOptions::ReadOnly.new exact_staleness: duration_staleness, return_read_timestamp: true } - - it "can execute a simple query with the staleness option" do - mock = mock_builder() - - results = nil - client.snapshot staleness: snapshot_staleness do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "can execute a simple query with the exact_staleness option" do - mock = mock_builder() - - results = nil - client.snapshot exact_staleness: snapshot_staleness do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - end - - it "does not allow nested snapshots" do - mock = mock_builder() - - results = nil - results2 = nil - - nested_error = assert_raises RuntimeError do - client.snapshot do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - - client.snapshot do |snp2| - _(snp2).must_be_kind_of Google::Cloud::Spanner::Snapshot - results2 = snp2.execute_query "SELECT * FROM other_users" - end - end - end - _(nested_error.message).must_equal "Nested snapshots are not allowed" - - shutdown_client! client - - mock.verify - - assert_results results - assert_nil results2 - end - - it "can create a snapshot with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ session: session_grpc.name, options: tx_opts }, expect_options] - spanner.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = nil - client.snapshot call_options: call_options do |snp| - _(snp).must_be_kind_of Google::Cloud::Spanner::Snapshot - results = snp.execute_query "SELECT * FROM users" - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/threads_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/threads_test.rb deleted file mode 100644 index 4caeedcac77a..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/threads_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :threads, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - - it "creates a thread pool with the number of threads specified" do - mock = Minitest::Mock.new - # mock.expect :delete_session, nil, [session_grpc.name, options: default_options] - session.service.mocked_service = mock - - client = spanner.client instance_id, database_id, pool: { min: 0, max: 4, threads: 13 } - pool = client.instance_variable_get :@pool - threads = pool.instance_variable_get :@threads - thread_pool = pool.instance_variable_get :@thread_pool - - _(threads).must_equal 13 - _(thread_pool.max_length).must_equal 13 - - client.close - - shutdown_client! client - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_retry_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/transaction_retry_test.rb deleted file mode 100644 index ffa5daaf1354..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_retry_test.rb +++ /dev/null @@ -1,430 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "google/rpc/error_details_pb" -require "helper" - -describe Google::Cloud::Spanner::Client, :transaction, :retry, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - - it "retries aborted transactions without retry metadata" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - def mock.commit *args - # first time called this will raise - if @called == nil - @called = true - gax_error = Google::Cloud::AbortedError.new "aborted" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(10, "aborted") - raise gax_error - end - # second call will return correct response - Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: Google::Protobuf::Timestamp.new() - end - mock.expect :sleep, nil, [1.3] - - client.define_singleton_method :sleep do |count| - # call the mock to satisfy the expectation - mock.sleep count - end - - results = nil - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - assert_results results - - shutdown_client! client - - mock.verify - end - - it "retries aborted transactions with retry metadata seconds" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - def mock.commit *args - # first time called this will raise - if @called == nil - @called = true - raise GRPC::Aborted.new "aborted", create_retry_info_metadata(60, 0) - end - # second call will return correct response - Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: Google::Protobuf::Timestamp.new() - end - mock.expect :sleep, nil, [60] - - client.define_singleton_method :sleep do |count| - # call the mock to satisfy the expectation - mock.sleep count - end - - results = nil - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - assert_results results - - shutdown_client! client - - mock.verify - end - - it "retries aborted transactions with retry metadata seconds and nanos" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - def mock.commit *args - # first time called this will raise - if @called == nil - @called = true - raise GRPC::Aborted.new "aborted", create_retry_info_metadata(123, 456000000) - end - # second call will return correct response - Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: Google::Protobuf::Timestamp.new() - end - mock.expect :sleep, nil, [123.456] - - client.define_singleton_method :sleep do |count| - # call the mock to satisfy the expectation - mock.sleep count - end - - results = nil - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - assert_results results - - shutdown_client! client - - mock.verify - end - - it "retries multiple aborted transactions" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - def mock.commit *args - # first time called this will raise - if @called == nil - @called = false - raise GRPC::Aborted.new "aborted" - end - if @called == false - @called = true - raise GRPC::Aborted.new "aborted", create_retry_info_metadata(30, 0) - end - # third call will return correct response - Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: Google::Protobuf::Timestamp.new() - end - mock.expect :sleep, nil, [1.3] - mock.expect :sleep, nil, [30] - - client.define_singleton_method :sleep do |count| - # call the mock to satisfy the expectation - mock.sleep count - end - - results = nil - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - assert_results results - - shutdown_client! client - - mock.verify - end - - it "retries with incremental backoff until deadline has passed" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - def mock.commit *args - raise GRPC::Aborted.new "aborted" - end - mock.expect :sleep, nil, [1.3] - mock.expect :sleep, nil, [1.6900000000000002] - mock.expect :sleep, nil, [2.1970000000000005] - mock.expect :sleep, nil, [2.856100000000001] - - mock.expect :current_time, Time.now, [] - mock.expect :current_time, Time.now, [] - mock.expect :current_time, Time.now + 30, [] - mock.expect :current_time, Time.now + 60, [] - mock.expect :current_time, Time.now + 90, [] - mock.expect :current_time, Time.now + 125, [] - - client.define_singleton_method :sleep do |count| - # call the mock to satisfy the expectation - mock.sleep count - end - client.define_singleton_method :current_time do - # call the mock to satisfy the expectation - mock.current_time - end - - assert_raises Google::Cloud::AbortedError do - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - end - - shutdown_client! client - - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end - -def create_retry_info_metadata seconds, nanos - metadata = {} - retry_info = Google::Rpc::RetryInfo.new(retry_delay: Google::Protobuf::Duration.new(seconds: seconds, nanos: nanos)) - metadata["google.rpc.retryinfo-bin"] = Google::Rpc::RetryInfo.encode(retry_info) - metadata -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_rollback_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/transaction_rollback_test.rb deleted file mode 100644 index c8bf48c7e226..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_rollback_test.rb +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :transaction, :rollback, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - - it "will rollback and not pass on the error when using Rollback" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - mock.expect :rollback, nil, [{ session: session_grpc.name, transaction_id: transaction_id }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - results = nil - timestamp = client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - # This mutation will never be committed, so no mocks for it. - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # Cause an error - raise Google::Cloud::Spanner::Rollback - end - _(timestamp).must_be :nil? - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "will rollback and pass on the error" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - mock.expect :rollback, nil, [{ session: session_grpc.name, transaction_id: transaction_id }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - results = nil - assert_raises ZeroDivisionError do - client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - # This mutation will never be committed, so no mocks for it. - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - # Cause an error - 1/0 - end - end - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "does not allow nested transactions" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :rollback, nil, [{ session: session_grpc.name, transaction_id: transaction_id }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - nested_error = assert_raises RuntimeError do - client.transaction do |tx| - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - tx.upsert "users", [{ id: 3, name: "Marley", active: false }] - tx.replace "users", [{ id: 4, name: "Henry", active: true }] - tx.delete "users", [1, 2, 3, 4, 5] - - # A nested transaction is not allowed - client.transaction do |tx2| - tx2.insert "users", [{ id: 6, name: "Barney", active: true }] - end - end - end - _(nested_error.message).must_equal "Nested transactions are not allowed" - - shutdown_client! client - - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_test.rb b/google-cloud-spanner/test/google/cloud/spanner/client/transaction_test.rb deleted file mode 100644 index 509c75fd724c..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/client/transaction_test.rb +++ /dev/null @@ -1,733 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Client, :transaction, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - let(:update_results_grpc) { - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_exact: 1 - ) - ) - } - let(:update_results_enum) { Array(update_results_grpc).to_enum } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:commit_time) { Time.now } - let(:commit_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp commit_time } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: commit_timestamp } - let(:commit_stats_grpc) { - Google::Cloud::Spanner::V1::CommitResponse::CommitStats.new( - mutation_count: 5 - ) - } - let(:commit_stats_resp_grpc) { - Google::Cloud::Spanner::V1::CommitResponse.new( - commit_timestamp: commit_timestamp, commit_stats: commit_stats_grpc - ) - } - let(:mutations) { - [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - } - - it "can execute a simple query" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: [], transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - results = nil - timestamp = client.transaction do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - - assert_results results - end - - it "updates" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "inserts" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.upsert "users", [{ id: 3, name: "Marley", active: false }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "upserts using save alias" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.save "users", [{ id: 3, name: "Marley", active: false }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "replaces" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.replace "users", [{ id: 4, name: "Henry", active: true }] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes multiple rows of keys" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes multiple rows of key ranges" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - ranges: [Google::Cloud::Spanner::Convert.to_key_range(1..100)] - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil, - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.delete "users", 1..100 - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes a single rows" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.delete "users", 5 - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "deletes all rows" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.delete "users" - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "commits multiple mutations" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active address), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false, { postcode: 1234 }]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction do |tx| - tx.update "users", [{ id: 1, name: "Charlie", active: false, address: { "postcode" => 1234 } }] - tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - tx.upsert "users", [{ id: 3, name: "Marley", active: false }] - tx.replace "users", [{ id: 4, name: "Henry", active: true }] - tx.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: [], transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, expect_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - results = nil - timestamp = client.transaction call_options: call_options do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - results = tx.execute_query "SELECT * FROM users" - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - - assert_results results - end - - describe "priority request options" do - let(:request_options){ - { priority: :PRIORITY_MEDIUM } - } - - it "commits multiple mutations" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: request_options - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - timestamp = client.transaction request_options: request_options do |tx| - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - tx.insert "users", [{ id: 2, name: "Harvey", active: true }] - tx.upsert "users", [{ id: 3, name: "Marley", active: false }] - tx.replace "users", [{ id: 4, name: "Henry", active: true }] - tx.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - - it "execute query" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, request_options: request_options, options: default_options - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: [], transaction_id: transaction_id, - single_use_transaction: nil, request_options: nil - }, default_options] - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - timestamp = client.transaction do |tx| - tx.execute_query "SELECT * FROM users", request_options: request_options - end - _(timestamp).must_equal commit_time - - shutdown_client! client - - mock.verify - end - end - - it "can execute a trasaction with transaction and request tag" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", - transaction: tx_selector, seqno: 1, - request_options: { transaction_tag: "Tag-1", request_tag: "Tag-1-1" }, - options: default_options - expect_execute_streaming_sql update_results_enum, session_grpc.name, - "UPDATE users SET active = true", transaction: tx_selector, - seqno: 2, request_options: { transaction_tag: "Tag-1", request_tag: "Tag-1-2" }, - options: default_options - - mock.expect :commit, commit_resp, [{ - session: session_grpc.name, mutations: mutations, transaction_id: transaction_id, - single_use_transaction: nil, request_options: { transaction_tag: "Tag-1" } - }, default_options] - - # transaction checkin - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - - client.transaction request_options: { tag: "Tag-1" } do |tx| - _(tx).must_be_kind_of Google::Cloud::Spanner::Transaction - - tx.execute_query "SELECT * FROM users", request_options: { tag: "Tag-1-1" } - tx.execute_update "UPDATE users SET active = true", request_options: { tag: "Tag-1-2" } - tx.update "users", [{ id: 1, name: "Charlie", active: false }] - end - - shutdown_client! client - - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/column_value_test.rb b/google-cloud-spanner/test/google/cloud/spanner/column_value_test.rb deleted file mode 100644 index 19d1a5c61608..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/column_value_test.rb +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::ColumnValue do - it "creates an commit_timestamp" do - column_value = Google::Cloud::Spanner::ColumnValue.commit_timestamp - - _(column_value).must_be_kind_of Google::Cloud::Spanner::ColumnValue - _(column_value.type).must_equal :commit_timestamp - _(column_value.to_column_value).must_equal "spanner.commit_timestamp()" - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/commit_response_test.rb b/google-cloud-spanner/test/google/cloud/spanner/commit_response_test.rb deleted file mode 100644 index d5ca306fee56..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/commit_response_test.rb +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::CommitResponse, :mock_spanner do - let(:commit_stats_grpc) { - Google::Cloud::Spanner::V1::CommitResponse::CommitStats.new( - mutation_count: 5 - ) - } - let(:commit_response_grpc) { - Google::Cloud::Spanner::V1::CommitResponse.new( - commit_timestamp: Time.now, - commit_stats: commit_stats_grpc - ) - } - let(:commit_response) { - Google::Cloud::Spanner::CommitResponse.from_grpc commit_response_grpc - } - - it "knows the identifiers" do - _(commit_response).must_be_kind_of Google::Cloud::Spanner::CommitResponse - _(commit_response.timestamp).must_be_kind_of Time - - _(commit_response.stats).must_be_kind_of Google::Cloud::Spanner::CommitResponse::CommitStats - _(commit_response.stats.mutation_count).must_equal 5 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/duration_to_number_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/duration_to_number_test.rb deleted file mode 100644 index f05fea536c9f..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/duration_to_number_test.rb +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Convert, :duration_to_number, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "converts an integer" do - duration = Google::Protobuf::Duration.new seconds: 42, nanos: 0 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal 42 - end - - it "converts a negative integer" do - duration = Google::Protobuf::Duration.new seconds: -42, nanos: 0 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal -42 - end - - it "converts a small number" do - duration = Google::Protobuf::Duration.new seconds: 1, nanos: 500000000 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal 1.5 - end - - it "converts a negative small number" do - duration = Google::Protobuf::Duration.new seconds: -1, nanos: -500000000 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal -1.5 - end - - it "converts a big number" do - duration = Google::Protobuf::Duration.new seconds: 643383279502884, nanos: 197169399 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal 643383279502884.197169399 - end - - it "converts a negative big number" do - duration = Google::Protobuf::Duration.new seconds: -643383279502884, nanos: -197169399 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal -643383279502884.197169399 - end - - it "converts pi" do - duration = Google::Protobuf::Duration.new seconds: 3, nanos: 141592654 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal 3.141592654 - end - - it "converts a negative pi" do - duration = Google::Protobuf::Duration.new seconds: -3, nanos: -141592654 - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_equal -3.141592654 - end - - it "returns nil when given nil" do - duration = nil - number = Google::Cloud::Spanner::Convert.duration_to_number duration - _(number).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_type_for_field_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_type_for_field_test.rb deleted file mode 100644 index 3971970c2777..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_type_for_field_test.rb +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "bigdecimal" - -describe Google::Cloud::Spanner::Convert, :grpc_type_for_field, :mock_spanner do - - it "converts a BOOL value" do - field = :BOOL - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :BOOL - end - - it "converts a INT64 value" do - field = :INT64 - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :INT64 - end - - it "converts a FLOAT64 value" do - field = :FLOAT64 - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :FLOAT64 - end - - it "converts a TIMESTAMP value" do - field = :TIMESTAMP - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :TIMESTAMP - end - - it "converts a DATE value" do - field = :DATE - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :DATE - end - - it "converts a STRING value" do - field = :STRING - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :STRING - end - - it "converts a BYTES value" do - field = :BYTES - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :BYTES - end - - it "converts an ARRAY of INT64 values" do - field = [:INT64] - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :ARRAY - assert_equal type.array_element_type.code, :INT64 - end - - it "converts a STRUCT value" do - field = :STRUCT - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :STRUCT - end - - it "converts a NUMERIC value" do - field = :NUMERIC - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :NUMERIC - end - - it "converts a JSON value" do - field = :JSON - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :JSON - end - - it "converts a PG_JSONB value" do - field = :PG_JSONB - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :JSON - assert_equal type.type_annotation, :PG_JSONB - end - - it "converts a PG_NUMERIC value" do - field = :PG_NUMERIC - type = Google::Cloud::Spanner::Convert.grpc_type_for_field field - assert_equal type.code, :NUMERIC - assert_equal type.type_annotation, :PG_NUMERIC - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_value_to_object_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_value_to_object_test.rb deleted file mode 100644 index a6268d4b980d..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/grpc_value_to_object_test.rb +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "bigdecimal" - -describe Google::Cloud::Spanner::Convert, :grpc_value_to_object, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "converts a BOOL value" do - value = Google::Protobuf::Value.new(bool_value: true) - type = Google::Cloud::Spanner::V1::Type.new(code: :BOOL) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal true - end - - it "converts a INT64 value" do - value = Google::Protobuf::Value.new(string_value: "29") - type = Google::Cloud::Spanner::V1::Type.new(code: :INT64) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal 29 - end - - it "converts a FLOAT64 value" do - value = Google::Protobuf::Value.new(number_value: 0.9) - type = Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal 0.9 - end - - it "converts a FLOAT64 value (Infinity)" do - value = Google::Protobuf::Value.new(string_value: "Infinity") - type = Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal Float::INFINITY - end - - it "converts a FLOAT64 value (-Infinity)" do - value = Google::Protobuf::Value.new(string_value: "-Infinity") - type = Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal -Float::INFINITY - end - - it "converts a FLOAT64 value (NaN)" do - value = Google::Protobuf::Value.new(string_value: "NaN") - type = Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_be :nan? # equality checks on Float::NAN fails - end - - it "converts a TIMESTAMP value" do - value = Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") - type = Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal Time.parse("2017-01-02 03:04:05.06 UTC") - end - - it "converts a DATE value" do - value = Google::Protobuf::Value.new(string_value: "2017-01-02") - type = Google::Cloud::Spanner::V1::Type.new(code: :DATE) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal Date.parse("2017-01-02") - end - - it "converts a STRING value" do - value = Google::Protobuf::Value.new(string_value: "Charlie") - type = Google::Cloud::Spanner::V1::Type.new(code: :STRING) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal "Charlie" - end - - it "converts a BYTES value" do - value = Google::Protobuf::Value.new(string_value: Base64.encode64("contents")) - type = Google::Cloud::Spanner::V1::Type.new(code: :BYTES) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_be_kind_of StringIO - _(raw.read).must_equal "contents" - end - - it "converts an ARRAY of INT64 values" do - value = Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) - type = Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal [1, 2, 3] - end - - it "converts an ARRAY of STRING values" do - value = Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "foo"), Google::Protobuf::Value.new(string_value: "bar"), Google::Protobuf::Value.new(string_value: "baz")])) - type = Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal %w(foo bar baz) - end - - it "converts a simple STRUCT value" do - value = Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "bar")])) - type = Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "foo", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal Google::Cloud::Spanner::Fields.new(foo: :STRING).struct(foo: "bar") - end - - it "converts a complex STRUCT value" do - value = Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [ Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) - type = Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64))) ] )) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal Google::Cloud::Spanner::Fields.new(env: :STRING, score: :FLOAT64, project_ids: [:INT64]).struct({env: "production", score: 0.9, project_ids: [1,2,3]}) - end - - it "converts an emtpy STRUCT value" do - value = Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) - type = Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal(Google::Cloud::Spanner::Fields.new([]).struct([])) - end - - it "converts a NUMERIC value" do - number = "99999999999999999999999999999.999999999" - value = Google::Protobuf::Value.new(string_value: number) - type = Google::Spanner::V1::Type.new(code: :NUMERIC) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal BigDecimal(number) - end - - it "converts a JSON value" do - venue_detail = { "name" => "ABC", "open" => true, "rating" => 10 } - - value = Google::Protobuf::Value.new(string_value: venue_detail.to_json) - type = Google::Spanner::V1::Type.new(code: :JSON) - raw = Google::Cloud::Spanner::Convert.grpc_value_to_object value, type - _(raw).must_equal venue_detail - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/number_to_duration_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/number_to_duration_test.rb deleted file mode 100644 index f990d460ef13..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/number_to_duration_test.rb +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "bigdecimal" - -describe Google::Cloud::Spanner::Convert, :number_to_duration, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "converts an Integer" do - number = 42 - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal 42 - _(duration.nanos).must_equal 0 - end - - it "converts a negative Integer" do - number = -42 - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal -42 - _(duration.nanos).must_equal 0 - end - - it "converts a Float" do - number = 1.5 - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal 1 - _(duration.nanos).must_equal 500000000 - end - - it "converts a negative Float" do - number = -1.5 - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal -1 - _(duration.nanos).must_equal -500000000 - end - - it "converts a BigDecimal" do - number = BigDecimal "643383279502884.1971693993751058209749445923078164062" - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal 643383279502884 - _(duration.nanos).must_equal 197169399 - end - - it "converts a negative BigDecimal" do - number = BigDecimal "-643383279502884.1971693993751058209749445923078164062" - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - # This should really be -643383279502884, but BigDecimal is doing something here... - _(duration.seconds).must_equal -643383279502885 - _(duration.nanos).must_equal -197169399 - end - - it "converts a Rational" do - number = Rational "3.14159265358979323846264338327950288419716939937510582097" - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal 3 - _(duration.nanos).must_equal 141592654 - end - - it "converts a negative Rational" do - number = Rational "-3.14159265358979323846264338327950288419716939937510582097" - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be_kind_of Google::Protobuf::Duration - _(duration.seconds).must_equal -3 - _(duration.nanos).must_equal -141592654 - end - - it "returns nil when given nil" do - number = nil - duration = Google::Cloud::Spanner::Convert.number_to_duration number - _(duration).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/timestamp_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/timestamp_test.rb deleted file mode 100644 index dbb02c661e29..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/timestamp_test.rb +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -# require "datetime" - -describe Google::Cloud::Spanner::Convert, :timestamp, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "converts a Time to a Timestamp" do - time = Time.parse "2014-10-02T15:01:23.045123456Z" - timestamp = Google::Cloud::Spanner::Convert.time_to_timestamp time - _(timestamp).must_be_kind_of Google::Protobuf::Timestamp - _(timestamp.seconds).must_equal 1412262083 - _(timestamp.nanos).must_equal 45123456 - end - - it "converts a DateTime to a Timestamp" do - datetime = DateTime.parse "2014-10-02T15:01:23.045123456Z" - timestamp = Google::Cloud::Spanner::Convert.time_to_timestamp datetime - _(timestamp).must_be_kind_of Google::Protobuf::Timestamp - _(timestamp.seconds).must_equal 1412262083 - _(timestamp.nanos).must_equal 45123456 - end - - it "converts an empty Time to an empty Timestamp" do - time = nil - timestamp = Google::Cloud::Spanner::Convert.time_to_timestamp time - _(timestamp).must_be :nil? - end - - it "converts a Timestamp to a Time" do - timestamp = Google::Protobuf::Timestamp.new seconds: 1412262083, nanos: 45123456 - time = Google::Cloud::Spanner::Convert.timestamp_to_time timestamp - _(time).must_be_kind_of Time - _(time).must_equal Time.parse("2014-10-02T15:01:23.045123456Z") - end - - it "converts an empty Timestamp to an empty Time" do - timestamp = nil - time = Google::Cloud::Spanner::Convert.timestamp_to_time timestamp - _(time).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/to_key_range_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/to_key_range_test.rb deleted file mode 100644 index d9fdc90b44b9..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/to_key_range_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Convert, :to_key_range, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "creates an inclusive Spanner::Range" do - range = Google::Cloud::Spanner::Range.new 1, 100 - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.start_open).must_be :nil? - _(key_range.end_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - _(key_range.end_open).must_be :nil? - end - - it "creates an exclusive Spanner::Range" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_begin: true, exclude_end: true - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_be :nil? - _(key_range.start_open).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.end_closed).must_be :nil? - _(key_range.end_open).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - end - - it "creates a Spanner::Range that excludes beginning" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_begin: true - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_be :nil? - _(key_range.start_open).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.end_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - _(key_range.end_open).must_be :nil? - end - - it "creates a Spanner::Range that excludes ending" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_end: true - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.start_open).must_be :nil? - _(key_range.end_closed).must_be :nil? - _(key_range.end_open).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - end - - it "creates an inclusive Range" do - range = 1..100 - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.start_open).must_be :nil? - _(key_range.end_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - _(key_range.end_open).must_be :nil? - end - - it "creates a Range that excludes ending" do - range = 1...100 - key_range = Google::Cloud::Spanner::Convert.to_key_range range - - _(key_range).must_be_kind_of Google::Cloud::Spanner::V1::KeyRange - _(key_range.start_closed).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value - _(key_range.start_open).must_be :nil? - _(key_range.end_closed).must_be :nil? - _(key_range.end_open).must_equal Google::Cloud::Spanner::Convert.object_to_grpc_value([100]).list_value - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/to_query_params_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/to_query_params_test.rb deleted file mode 100644 index f4d82f4ccbfd..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/to_query_params_test.rb +++ /dev/null @@ -1,1133 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "bigdecimal" - -describe Google::Cloud::Spanner::Convert, :to_query_params, :mock_spanner do - # This tests is a sanity check on the implementation of the conversion method. - # We are testing the private method. This functionality is also covered elsewhere, - # but it was thought that since this conversion is so important we might as well - # also test it apart from the other tests. - - it "converts a bool value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params active: true - _(combined_params).must_equal({ "active" => [Google::Protobuf::Value.new(bool_value: true), - Google::Cloud::Spanner::V1::Type.new(code: :BOOL)] }) - end - - it "converts a nil bool value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({active: nil}, {active: :BOOL}) - _(combined_params).must_equal({ "active" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :BOOL)] }) - end - - it "converts a int value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params age: 29 - _(combined_params).must_equal({ "age" => [Google::Protobuf::Value.new(string_value: "29"), - Google::Cloud::Spanner::V1::Type.new(code: :INT64)] }) - end - - it "converts a nil int value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({age: nil}, {age: :INT64}) - _(combined_params).must_equal({ "age" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :INT64)] }) - end - - it "converts a float value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params score: 0.9 - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(number_value: 0.9), - Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)] }) - end - - it "converts a float value (Infinity)" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params score: Float::INFINITY - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(string_value: "Infinity"), - Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)] }) - end - - it "converts a float value (-Infinity)" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params score: -Float::INFINITY - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(string_value: "-Infinity"), - Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)] }) - end - - it "converts a float value (NaN)" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params score: Float::NAN - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(string_value: "NaN"), - Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)] }) - end - - it "converts a nil float value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({score: nil}, {score: :FLOAT64}) - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)] }) - end - - it "converts a Time value" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - combined_params = Google::Cloud::Spanner::Convert.to_query_params updated_at: timestamp - _(combined_params).must_equal({ "updated_at" => [Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z"), - Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP)] }) - end - - it "converts a DateTime value" do - timestamp = DateTime.parse "2017-01-01 20:04:05.06 -0700" - - combined_params = Google::Cloud::Spanner::Convert.to_query_params updated_at: timestamp - _(combined_params).must_equal({ "updated_at" => [Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z"), - Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP)] }) - end - - it "converts a nil value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({updated_at: nil}, {updated_at: :TIMESTAMP}) - _(combined_params).must_equal({ "updated_at" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP)] }) - end - - it "converts a Date value" do - date = Date.parse "2017-01-02" - - combined_params = Google::Cloud::Spanner::Convert.to_query_params birthday: date - _(combined_params).must_equal({ "birthday" => [Google::Protobuf::Value.new(string_value: "2017-01-02"), - Google::Cloud::Spanner::V1::Type.new(code: :DATE)] }) - end - - it "converts a nil Date value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({birthday: nil}, {birthday: :DATE}) - _(combined_params).must_equal({ "birthday" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :DATE)] }) - end - - it "converts a String value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params name: "Charlie" - _(combined_params).must_equal({ "name" => [Google::Protobuf::Value.new(string_value: "Charlie"), - Google::Cloud::Spanner::V1::Type.new(code: :STRING)] }) - end - - it "converts a Symbol value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params name: :foo - _(combined_params).must_equal({ "name" => [Google::Protobuf::Value.new(string_value: "foo"), - Google::Cloud::Spanner::V1::Type.new(code: :STRING)] }) - end - - it "converts a nil String value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({name: nil}, {name: :STRING}) - _(combined_params).must_equal({ "name" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :STRING)] }) - end - - it "converts a IO-ish value" do - file = StringIO.new "contents" - - combined_params = Google::Cloud::Spanner::Convert.to_query_params avatar: file - _(combined_params).must_equal({ "avatar" => [Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")), - Google::Cloud::Spanner::V1::Type.new(code: :BYTES)] }) - end - - it "converts a nil IO-ish value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({avatar: nil}, {avatar: :BYTES}) - _(combined_params).must_equal({ "avatar" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :BYTES)] }) - end - - it "converts an Array of Integer values" do - array = [1, 2, 3] - - combined_params = Google::Cloud::Spanner::Convert.to_query_params list: array - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64))] }) - end - - it "converts an empty Array of Integer values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: []}, {list: [:INT64]}) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64))] }) - end - - it "converts a nil Array of Integer values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: nil}, {list: [:INT64]}) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64))] }) - end - - it "converts an Array of String values" do - array = %w(foo bar baz) - - combined_params = Google::Cloud::Spanner::Convert.to_query_params list: array - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "foo"), Google::Protobuf::Value.new(string_value: "bar"), Google::Protobuf::Value.new(string_value: "baz")])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] }) - end - - it "converts an empty Array of String values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: []}, list: [:STRING]) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] }) - end - - it "converts a nil Array of String values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: nil}, {list: [:STRING]}) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] }) - end - - it "converts an Array of IO-ish values" do - array = [StringIO.new("foo"), StringIO.new("bar"), StringIO.new("baz")] - - foo, bar, baz = %w[ foo bar baz ].map {|raw| Base64.strict_encode64(raw) } - - combined_params = Google::Cloud::Spanner::Convert.to_query_params list: array - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: foo), Google::Protobuf::Value.new(string_value: bar), Google::Protobuf::Value.new(string_value: baz)])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :BYTES))] }) - end - - it "converts an empty Array of IO-ish values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: []}, list: [:BYTES]) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :BYTES))] }) - end - - it "converts a nil Array of IO-ish values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: nil}, {list: [:BYTES]}) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :BYTES))] }) - end - - it "converts a simple Hash value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params settings: { foo: :bar } - _(combined_params).must_equal({ "settings" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "bar")])), - Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "foo", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))]))] }) - end - - it "converts a complex Hash value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params settings: { env: "production", score: 0.9, project_ids: [1,2,3] } - _(combined_params).must_equal({ "settings" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [ Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])), - Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64))) ] ))] }) - end - - it "converts an emtpy Hash value" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params settings: {} - _(combined_params).must_equal({ "settings" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])), - Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: []))] }) - end - - it "converts an empty Array of Data values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: []}, list: [fields(foo: :STRING)]) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "foo", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])))] }) - end - - it "converts a nil Array of Data values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params({list: nil}, list: [fields(foo: :STRING)]) - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "foo", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])))] }) - end - - it "converts an Array of simple Data values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params list: [{ foo: :bar }] - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "bar")]))])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT,struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "foo", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))]))) ]}) - end - - it "converts an Array complex Data values" do - combined_params = Google::Cloud::Spanner::Convert.to_query_params list: [{ env: "production", score: 0.9, project_ids: [1,2,3] }] - _(combined_params).must_equal({ "list" => [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")]))]))])), - Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))]))) ]}) - end - - it "converts a numeric (BigDecimal) value" do - number = "99999999999999999999999999999.999999999" - combined_params = Google::Cloud::Spanner::Convert.to_query_params score: BigDecimal(number) - _(combined_params).must_equal({ "score" => [Google::Protobuf::Value.new(string_value: number), - Google::Spanner::V1::Type.new(code: :NUMERIC)] }) - end - - it "converts a Hash to json value " do - value = { name: "ABC", open: true, rating: 10 } - combined_params = Google::Cloud::Spanner::Convert.to_query_params( - { venue_detail: value }, { venue_detail: :JSON } - ) - _(combined_params).must_equal({ - "venue_detail" => [ Google::Protobuf::Value.new(string_value: value.to_json), - Google::Spanner::V1::Type.new(code: :JSON)] - }) - end - - describe "Struct Parameters Query Examples" do - # Simple field access. - # [parameters=STRUCT(1,"bob") AS struct_param, 10 as p4] - # SELECT @struct_param.userf, @p4; - describe "Simple field access" do - it "with Hash" do - params = { struct_param: { threadf: 1, userf: "bob" }, p4: 10 } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ], - "p4" => [ - Google::Protobuf::Value.new(string_value: "10"), - Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ] - }) - end - - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - params = { struct_param: { threadf: 1, userf: "bob" }, p4: 10 } - types = { struct_param: fields, p4: :INT64 } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ], - "p4" => [ - Google::Protobuf::Value.new(string_value: "10"), - Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - data = fields.struct threadf: 1, userf: "bob" - params = { struct_param: data, p4: 10 } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ], - "p4" => [ - Google::Protobuf::Value.new(string_value: "10"), - Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ] - }) - end - end - - # # Simple field access on NULL struct value. - # [parameters=CAST(NULL AS STRUCT) AS struct_param] - # SELECT @struct_param.userf; - describe "Simple field access on NULL struct value" do - it "with nil and type" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - params = { struct_param: nil } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ] - }) - end - end - - # # Nested struct field access. - # [parameters=STRUCT> (STRUCT("bob")) AS struct_param] - # SELECT @struct_param.structf.nestedf; - describe "Nested struct field access" do - it "with Hash" do - params = { struct_param: { structf: { nestedf: "bob" } } } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "structf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "nestedf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - ) - ) - ] - }) - end - - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new structf: Google::Cloud::Spanner::Fields.new(nestedf: :STRING) - params = { struct_param: { structf: { nestedf: "bob" } } } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "structf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "nestedf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - ) - ) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new structf: Google::Cloud::Spanner::Fields.new(nestedf: :STRING) - data = fields.struct structf: { nestedf: "bob" } - params = { struct_param: data } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "structf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "nestedf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - ) - ) - ] - }) - end - end - - # # Nested struct field access on NULL struct value. - # [parameters=CAST(STRUCT(null) AS STRUCT>) AS struct_param] - # SELECT @struct_param.structf.nestedf; - describe "Nested struct field access on NULL struct value" do - it "with nil and type" do - fields = Google::Cloud::Spanner::Fields.new structf: Google::Cloud::Spanner::Fields.new(nestedf: :STRING) - params = { struct_param: nil } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "structf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "nestedf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - ) - ) - ] - }) - end - end - - # # Non-NULL struct with no fields (empty struct). - # [parameters=CAST(STRUCT() AS STRUCT<>) AS struct_param] - # SELECT @struct_param IS NULL; - describe "Non-NULL struct with no fields (empty struct)" do - it "with Hash" do - params = { struct_param: {} } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ) - ] - }) - end - - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new({}) - params = { struct_param: {} } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new({}) - data = fields.struct({}) - params = { struct_param: data } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ) - ] - }) - end - end - - # # NULL struct with no fields. - # [parameters=CAST(NULL AS STRUCT<>) AS struct_param] - # SELECT @struct_param IS NULL - describe "NULL struct with no fields" do - it "with nil and type" do - fields = Google::Cloud::Spanner::Fields.new({}) - params = { struct_param: nil } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ) - ] - }) - end - end - - # # Struct with single NULL field. - # [parameters=STRUCT(NULL) AS struct_param] - # SELECT @struct_param.f1; - describe "Struct with single NULL field" do - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new f1: :INT64 - params = { struct_param: { f1: nil } } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "f1", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ) - ] - ) - ) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new f1: :INT64 - data = fields.struct f1: nil - params = { struct_param: data } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "f1", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ) - ] - ) - ) - ] - }) - end - end - - # # Equality check. - # [parameters=STRUCT(1,"bob") AS struct_param] - # SELECT @struct_param=STRUCT(1,"bob"); - describe "Equality check" do - it "with Hash" do - params = { struct_param: { threadf: 1, userf: "bob" } } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ] - }) - end - - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - params = { struct_param: { threadf: 1, userf: "bob" } } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - data = fields.struct threadf: 1, userf: "bob" - params = { struct_param: data } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ] - }) - end - end - - # # Nullness check. - # [parameters=ARRAY> [(1,"bob")] AS struct_arr_param] - # SELECT @struct_arr_param IS NULL; - describe "Nullness check" do - it "with Array of Hash" do - params = { struct_arr_param: [{ threadf: 1, userf: "bob" }] } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_arr_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - }) - end - - it "with Array of Hash and type" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - params = { struct_arr_param: [{ threadf: 1, userf: "bob" }] } - types = { struct_arr_param: [fields] } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_arr_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - }) - end - - it "with Array of Data" do - fields = Google::Cloud::Spanner::Fields.new threadf: :INT64, userf: :STRING - data = fields.struct threadf: 1, userf: "bob" - params = { struct_arr_param: [data] } - types = nil - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_arr_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "1"), - Google::Protobuf::Value.new(string_value: "bob") - ] - ) - ) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "userf", - type: Google::Cloud::Spanner::V1::Type.new(code: :STRING) - ) - ] - ) - ) - ) - ] - }) - end - end - - # # Null array of struct field. - # [parameters=STRUCT>> (10,CAST(NULL AS ARRAY>)) AS struct_param] - # SELECT a.threadid FROM UNNEST(@struct_param.arraysf) a; - describe "Null array of struct field" do - it "with Hash and type" do - fields = Google::Cloud::Spanner::Fields.new intf: :INT64, arraysf: [Google::Cloud::Spanner::Fields.new(threadid: :INT64)] - data = fields.struct intf: 10, arraysf: nil - params = { struct_param: { intf: 10, arraysf: nil } } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "10"), - Google::Protobuf::Value.new(null_value: :NULL_VALUE) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "intf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "arraysf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadid", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ) - ] - ) - ) - ) - ) - ] - ) - ) - ] - }) - end - - it "with Data" do - fields = Google::Cloud::Spanner::Fields.new intf: :INT64, arraysf: [Google::Cloud::Spanner::Fields.new(threadid: :INT64)] - data = fields.struct intf: 10, arraysf: nil - params = { struct_param: data } - types = { struct_param: fields } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_param" => [ - Google::Protobuf::Value.new( - list_value: Google::Protobuf::ListValue.new( - values: [ - Google::Protobuf::Value.new(string_value: "10"), - Google::Protobuf::Value.new(null_value: :NULL_VALUE) - ] - ) - ), - Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "intf", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ), - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "arraysf", - type: Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadid", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ) - ] - ) - ) - ) - ) - ] - ) - ) - ] - }) - end - end - - # # Null array of struct. - # [parameters=CAST(NULL AS ARRAY>) as struct_arr_param] - # SELECT a.threadid FROM UNNEST(@struct_arr_param) a; - describe "Null array of struct" do - it "with nil and type" do - fields = Google::Cloud::Spanner::Fields.new threadid: :INT64 - params = { struct_arr_param: nil } - types = { struct_arr_param: [fields] } - combined_params = Google::Cloud::Spanner::Convert.to_query_params params, types - _(combined_params).must_equal({ - "struct_arr_param" => [ - Google::Protobuf::Value.new(null_value: :NULL_VALUE), - Google::Cloud::Spanner::V1::Type.new( - code: :ARRAY, - array_element_type: Google::Cloud::Spanner::V1::Type.new( - code: :STRUCT, - struct_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [ - Google::Cloud::Spanner::V1::StructType::Field.new( - name: "threadid", - type: Google::Cloud::Spanner::V1::Type.new(code: :INT64) - ) - ] - ) - ) - ) - ] - }) - end - end - end - - def fields *args - Google::Cloud::Spanner::Fields.new *args - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/convert/to_request_options_test.rb b/google-cloud-spanner/test/google/cloud/spanner/convert/to_request_options_test.rb deleted file mode 100644 index c894ae21dbc1..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/convert/to_request_options_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "bigdecimal" - -describe Google::Cloud::Spanner::Convert, :to_request_options, :mock_spanner do - it "returns nil for nil options value" do - options = Google::Cloud::Spanner::Convert.to_request_options nil - _(options).must_be_nil - end - - it "returns same options if tag field not present" do - options = Google::Cloud::Spanner::Convert.to_request_options({extra: "123"}) - _(options).must_equal({ extra: "123" }) - end - - it "transform tag key to provided tag type" do - options = Google::Cloud::Spanner::Convert.to_request_options( - { tag: "Tag-1" }, tag_type: :request_tag - ) - _(options).must_equal({ request_tag: "Tag-1"}) - - options = Google::Cloud::Spanner::Convert.to_request_options( - { tag: "Tag-2" }, tag_type: :transaction_tag - ) - _(options).must_equal({ transaction_tag: "Tag-2"}) - end - - it "transform tag key to provided tag type and merge with options" do - options = Google::Cloud::Spanner::Convert.to_request_options( - { extra: "123", transaction_tag: "Tag-1", tag: "Tag-1-1" }, tag_type: :request_tag - ) - _(options).must_equal({ extra: "123", transaction_tag: "Tag-1", request_tag: "Tag-1-1"}) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/backup_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/backup_test.rb deleted file mode 100644 index fd862808261f..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/backup_test.rb +++ /dev/null @@ -1,136 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Database, :backups, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:databases_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash } - let(:database) { Google::Cloud::Spanner::Database.from_grpc databases_grpc, spanner.service } - let(:first_page) do - h = backups_hash instance_id: instance_id - h[:next_page_token] = "next_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:second_page) do - h = backups_hash instance_id: instance_id - h[:next_page_token] = "second_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:last_page) do - h = backups_hash instance_id: instance_id - h[:backups].pop - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:next_page_options) { "next_page_token" } - let(:backup_filter) { "database:#{database.database_id}" } - - it "lists backups" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - backups = database.backups - - mock.verify - - _(backups.size).must_equal 3 - end - - it "paginates backups with page size" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - backups = database.backups page_size: 3 - - mock.verify - - _(backups.size).must_equal 3 - end - - it "paginates backups with next? and next" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - list = database.backups - - mock.verify - - _(list.size).must_equal 3 - _(list.next?).must_equal true - _(list.next.size).must_equal 2 - _(list.next?).must_equal false - end - - it "paginates backups with next? and next and page size" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - list = database.backups page_size: 3 - - mock.verify - - _(list.size).must_equal 3 - _(list.next?).must_equal true - _(list.next.size).must_equal 2 - _(list.next?).must_equal false - end - - it "paginates backups with all" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - backups = database.backups.all.to_a - - mock.verify - - _(backups.size).must_equal 5 - end - - it "paginates backups with all and page size" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - backups = database.backups(page_size: 3).all.to_a - - mock.verify - - _(backups.size).must_equal 5 - end - - it "iterates backups with all using Enumerator" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: backup_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - backups = database.backups.all.take(5) - - mock.verify - - _(backups.size).must_equal 5 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/client_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/client_test.rb deleted file mode 100644 index ae8ac24c983b..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/client_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2021 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" -require "google/cloud/spanner/admin/database" -require "google/cloud/spanner/admin/database/v1/database_admin" -require "gapic/common" -require "gapic/grpc" - -class Google::Cloud::Spanner::ClientConstructionMinitest < Minitest::Test - def test_database_admin - emulator_host = "localhost:4567" - channel_args = { "grpc.service_config_disable_resolution" => 1 } - channel_creds = :this_channel_is_insecure - channel = GRPC::Core::Channel.new emulator_host, channel_args, channel_creds - - emulator_check = ->(name) { (name == "SPANNER_EMULATOR_HOST") ? emulator_host : nil } - channel_check = ->(chan_host, chan_args, chan_creds) do - assert_equal emulator_host, chan_host - assert_equal channel_args, chan_args - assert_equal channel_creds, chan_creds - channel - end - - # Clear all environment variables, except SPANNER_EMULATOR_HOST - ENV.stub :[], emulator_check do - Gapic::ServiceStub.stub :new, :stub do - GRPC::Core::Channel.stub :new, channel_check do - client = Google::Cloud::Spanner::Admin::Database.database_admin project_id: "1234" - assert_kind_of Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Client, client - assert_equal emulator_host, client.configure.endpoint - end - end - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/create_backup_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/create_backup_test.rb deleted file mode 100644 index 28520da416fd..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/create_backup_test.rb +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Backup, :create_backup, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new \ - database_hash(instance_id: instance_id, database_id: database_id) - } - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata.new( - progress: { start_time: Time.now } - ).to_proto - } - ) - end - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateBackupMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata.new( - progress: { - start_time: Time.now, - end_time: Time.now + 100, - progress_percent: 100 - } - ).to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.Backup", - value: Google::Cloud::Spanner::Admin::Database::V1::Backup.new.to_proto - ) - ) - end - let(:job_grpc_cancel) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateBackupMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata.new( - progress: { - start_time: Time.now, - end_time: Time.now + 100, - progress_percent: 100 - }, - cancel_time: Time.now + 100 - ).to_proto - ), - done: true, - error: { code: 1, message: 'Backup creation cancelled by the user' } - ) - end - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - let(:expire_time) { Time.now + 36000 } - let(:version_time) { Time.now } - let(:kms_key_name){ "projects//locations//keyRings//cryptoKeys/"} - - it "create a database backup" do - mock = Minitest::Mock.new - create_req = { - database: database_path(instance_id, database_id), - expire_time: expire_time, - version_time: version_time - } - create_res = Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Backup, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata - ) - operation_done = Gapic::Operation.new( - job_grpc_done, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Backup, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata - ) - - mock.expect :create_backup, create_res, [{ - parent: instance_path(instance_id), - backup_id: backup_id, - backup: create_req, - encryption_config: { kms_key_name: kms_key_name, encryption_type: :CUSTOMER_MANAGED_ENCRYPTION } - }, ::Gapic::CallOptions] - mock.expect :get_operation, operation_done, [{ name: "1234567890" }, Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = database.create_backup backup_id, expire_time, - version_time: version_time, - encryption_config: { kms_key_name: kms_key_name, encryption_type: :CUSTOMER_MANAGED_ENCRYPTION } - - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.backup).must_be :nil? - _(job.start_time).must_be_kind_of Time - _(job.end_time).must_be :nil? - _(job.progress_percent).must_equal 0 - - job.reload! - backup = job.backup - _(backup).wont_be :nil? - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - _(job.start_time).must_be_kind_of Time - _(job.end_time).must_be_kind_of Time - _(job.cancel_time).must_be :nil? - _(job.progress_percent).must_equal 100 - - mock.verify - end - - it "cancel create database backup job" do - mock = Minitest::Mock.new - create_req = { - database: database_path(instance_id, database_id), - expire_time: expire_time, - version_time: nil - } - create_res = Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Backup, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata - ) - operation_cancel = Gapic::Operation.new( - job_grpc_cancel, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Backup, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata - ) - mock.expect :create_backup, create_res, [{ - parent: instance_path(instance_id), - backup_id: backup_id, - backup: create_req, - encryption_config: nil - }, ::Gapic::CallOptions] - mock.expect :cancel_operation, nil , [{ name: "1234567890" }, Gapic::CallOptions] - mock.expect :get_operation, operation_cancel, [{ name: "1234567890" }, Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = database.create_backup backup_id, expire_time - - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - _(job).wont_be :done? - _(job.cancel).must_be_nil - - job.reload! - _(job).must_be :done? - _(job.start_time).must_be_kind_of Time - _(job.end_time).must_be_kind_of Time - _(job.cancel_time).must_be_kind_of Time - _(job.progress_percent).must_equal 100 - - mock.verify - end - - it "raise an error on create database backup for invalid expire time" do - stub = Object.new - - def stub.create_backup *args - raise Google::Cloud::InvalidArgumentError.new "invalid expire time" - end - - spanner.service.mocked_databases = stub - - assert_raises Google::Cloud::Error do - database.create_backup backup_id, Time.now - 36000 - end - end - - it "raise an error on create database backup for kms key without customer managed encryption type" do - assert_raises Google::Cloud::InvalidArgumentError do - database.create_backup backup_id, Time.now - 36000, encryption_config: { kms_key_name: kms_key_name } - end - end - - it "raise an error on create database backup with invalid encryption config" do - assert_raises Google::Cloud::InvalidArgumentError do - database.create_backup backup_id, Time.now - 36000, encryption_config: { - kms_key_name: kms_key_name, encryption_type: :GOOGLE_DEFAULT_ENCRYPTION - } - end - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/database_operations_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/database_operations_test.rb deleted file mode 100644 index 8d44d900bd99..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/database_operations_test.rb +++ /dev/null @@ -1,242 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Database, :database_operations, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:databases_grpc) { - Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash( - instance_id: instance_id, database_id: database_id) - } - let(:database) { Google::Cloud::Spanner::Database.from_grpc databases_grpc, spanner.service } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash } - let(:database_metadata_filter) { - format( - Google::Cloud::Spanner::Database::DATBASE_OPERATION_METADAT_FILTER_TEMPLATE, - database_id: database_id - ) - } - let(:job_name) { "1234567890" } - let(:job_hash) do - { - name: job_name, - metadata: { - type_url: "type.googleapis.com/google.spanner.admin.database.v1.CreateDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata.new.to_proto - } - } - end - let(:job_grpc) { Google::Longrunning::Operation.new job_hash } - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.database.v1.Database", - value: database_grpc.to_proto - ) - ) - end - let(:jobs_hash) do - 3.times.map { job_hash } - end - let(:first_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "next_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - let(:second_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "second_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - let(:last_page) do - h = { operations: jobs_hash } - h[:operations].pop - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - - it "list database operations" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - database.service.mocked_databases = mock - - jobs = database.database_operations - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - end - - mock.verify - end - - it "paginates database operations with page size" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - database.service.mocked_databases = mock - - jobs = database.database_operations page_size: 3 - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - end - - mock.verify - end - - it "paginates database operations with next? and next" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: nil, page_token: nil}, ::Gapic::CallOptions] - - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - database.service.mocked_databases = mock - - jobs = database.database_operations - - _(jobs.size).must_equal 3 - _(jobs.next?).must_equal true - _(jobs.next.size).must_equal 2 - _(jobs.next?).must_equal false - - mock.verify - end - - it "paginates database operations with all" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - database.service.mocked_databases = mock - - jobs = database.database_operations.all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates database operations with all and page size" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - database.service.mocked_databases = mock - - jobs = database.database_operations(page_size: 3).all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "iterates database operations with all using Enumerator" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: database_metadata_filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - database.service.mocked_databases = mock - - jobs = database.database_operations.all.take(5) - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates database operations with filter" do - filter = format( - "(%s) AND (%s)", - filter: "done:true", database_filter: database_metadata_filter - ) - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - database.service.mocked_databases = mock - - jobs = database.database_operations filter: "done:true" - - mock.verify - - _(jobs.size).must_equal 3 - end - - it "paginates database operations with filter and page size" do - filter = format( - "(%s) AND (%s)", - filter: "done:true", database_filter: database_metadata_filter - ) - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - database.service.mocked_databases = mock - - jobs = database.database_operations filter: "done:true", page_size: 3 - - mock.verify - - _(jobs.size).must_equal 3 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/ddl_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/ddl_test.rb deleted file mode 100644 index 94e1ed25c51f..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/ddl_test.rb +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Database, :ddl, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) } - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - let(:statements) { ["CREATE TABLE table1", "CREATE TABLE table2", "CREATE TABLE table3"] } - - it "gets the DDL statements" do - update_res = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new( - statements: statements - ) - mock = Minitest::Mock.new - mock.expect :get_database_ddl, update_res, [{ database: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - ddl = database.ddl - - mock.verify - - _(ddl).must_equal statements - - # The results are cached, second call does not raise - ddl2 = database.ddl - _(ddl2).must_equal ddl - end - - it "forces an API request" do - database.instance_variable_set :@ddl, statements - - # The results are cached, this does not make an API request - cached_ddl = database.ddl - _(cached_ddl).must_equal statements - - update_res = Google::Cloud::Spanner::Admin::Database::V1::GetDatabaseDdlResponse.new( - statements: statements.reverse - ) - mock = Minitest::Mock.new - mock.expect :get_database_ddl, update_res, [{ database: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - ddl = database.ddl force: true - - mock.verify - - _(ddl).must_equal statements.reverse - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/drop_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/drop_test.rb deleted file mode 100644 index 680e5648b971..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/drop_test.rb +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Database, :drop, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) } - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - - it "can delete itself" do - mock = Minitest::Mock.new - mock.expect :drop_database, nil, [{ database: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - database.drop - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/iam_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/iam_test.rb deleted file mode 100644 index dcad1aa27250..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/iam_test.rb +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Database, :iam, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) } - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - let(:viewer_policy_hash) do - { - etag: "\b\x01", - bindings: [{ - role: "roles/viewer", - members: [ - "user:viewer@example.com", - "serviceAccount:1234567890@developer.gserviceaccount.com" - ] - }] - } - end - let(:owner_policy_hash) do - { - etag: "\b\x01", - bindings: [{ - role: "roles/owner", - members: [ - "user:owner@example.com", - "serviceAccount:0987654321@developer.gserviceaccount.com" - ] - }] - } - end - - it "gets the IAM Policy" do - get_res = Google::Iam::V1::Policy.new viewer_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: database.path }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - policy = database.policy - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x01" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be_kind_of Array - _(policy.roles["roles/viewer"].count).must_equal 2 - _(policy.roles["roles/viewer"].first).must_equal "user:viewer@example.com" - _(policy.roles["roles/viewer"].last).must_equal "serviceAccount:1234567890@developer.gserviceaccount.com" - end - - it "sets the IAM Policy" do - get_res = Google::Iam::V1::Policy.new owner_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: database.path }, ::Gapic::CallOptions] - - updated_policy_hash = owner_policy_hash.dup - updated_policy_hash[:bindings].first[:members].shift - updated_policy_hash[:bindings].first[:members] << "user:newowner@example.com" - - set_req = Google::Iam::V1::Policy.new updated_policy_hash - set_res = Google::Iam::V1::Policy.new updated_policy_hash.merge(etag: "\b\x10") - mock.expect :set_iam_policy, set_res, [{ resource: database.path, policy: set_req }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - policy = database.policy - - policy.add "roles/owner", "user:newowner@example.com" - policy.remove "roles/owner", "user:owner@example.com" - - policy = database.update_policy policy - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x10" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be :nil? - _(policy.roles["roles/owner"]).must_be_kind_of Array - _(policy.roles["roles/owner"].count).must_equal 2 - _(policy.roles["roles/owner"].first).must_equal "serviceAccount:0987654321@developer.gserviceaccount.com" - _(policy.roles["roles/owner"].last).must_equal "user:newowner@example.com" - end - - it "sets the IAM Policy in a block" do - get_res = Google::Iam::V1::Policy.new owner_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: database.path }, ::Gapic::CallOptions] - - updated_policy_hash = owner_policy_hash.dup - updated_policy_hash[:bindings].first[:members].shift - updated_policy_hash[:bindings].first[:members] << "user:newowner@example.com" - - set_req = Google::Iam::V1::Policy.new updated_policy_hash - set_res = Google::Iam::V1::Policy.new updated_policy_hash.merge(etag: "\b\x10") - mock.expect :set_iam_policy, set_res, [{ resource: database.path, policy: set_req }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - policy = database.policy do |p| - p.add "roles/owner", "user:newowner@example.com" - p.remove "roles/owner", "user:owner@example.com" - end - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x10" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be :nil? - _(policy.roles["roles/owner"]).must_be_kind_of Array - _(policy.roles["roles/owner"].count).must_equal 2 - _(policy.roles["roles/owner"].first).must_equal "serviceAccount:0987654321@developer.gserviceaccount.com" - _(policy.roles["roles/owner"].last).must_equal "user:newowner@example.com" - end - - it "tests the available permissions" do - permissions = ["spanner.databases.get", "spanner.databases.publish"] - test_res = Google::Iam::V1::TestIamPermissionsResponse.new( - permissions: ["spanner.databases.get"] - ) - mock = Minitest::Mock.new - mock.expect :test_iam_permissions, test_res, [{ resource: database.path, permissions: permissions }, ::Gapic::CallOptions] - database.service.mocked_databases = mock - - permissions = database.test_permissions "spanner.databases.get", - "spanner.databases.publish" - - mock.verify - - _(permissions).must_equal ["spanner.databases.get"] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database/update_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database/update_test.rb deleted file mode 100644 index 9983aa6526ec..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database/update_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Database, :update, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id) } - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest", - value: "" - } - ) - end - - it "updates with single statement" do - update_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest - ) - mock = Minitest::Mock.new - mock.expect :update_database_ddl, update_res, [{ database: database_path(instance_id, database_id), statements: ["CREATE TABLE table4"], operation_id: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = database.update statements: "CREATE TABLE table4" - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end - - it "updates with multiple statements" do - update_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest - ) - mock = Minitest::Mock.new - mock.expect :update_database_ddl, update_res, [{ database: database_path(instance_id, database_id), statements: ["CREATE TABLE table4", "CREATE TABLE table5"], operation_id: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = database.update statements: ["CREATE TABLE table4", "CREATE TABLE table5"] - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end - - it "updates with operation_id" do - update_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::UpdateDatabaseDdlRequest - ) - mock = Minitest::Mock.new - mock.expect :update_database_ddl, update_res, [{ database: database_path(instance_id, database_id), statements: ["CREATE TABLE table4", "CREATE TABLE table5"], operation_id: "update123" }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = database.update statements: ["CREATE TABLE table4", "CREATE TABLE table5"], operation_id: "update123" - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/database_test.rb b/google-cloud-spanner/test/google/cloud/spanner/database_test.rb deleted file mode 100644 index 81f8d78cebb4..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/database_test.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:backup_id) { "my-backup-id" } - let(:source_database_id) { "my-backup-source-database-id" } - let(:restore_info) do - restore_info_hash source_type: 'BACKUP', backup_info: backup_info_hash( - instance_id: instance_id, - backup_id: backup_id, - create_time: Time.now, - source_database_id: source_database_id - ) - end - let(:version_retention_period) { "1d" } - let(:earliest_version_time) { Time.now } - let(:encryption_info){ - Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo.new(encryption_type: :GOOGLE_DEFAULT_ENCRYPTION) - } - let(:database_grpc) do - Google::Cloud::Spanner::Admin::Database::V1::Database.new \ - database_hash( - instance_id: instance_id, database_id: database_id, create_time: Time.now, - restore_info: restore_info, version_retention_period: version_retention_period, - earliest_version_time: earliest_version_time, encryption_info: [encryption_info] - ) - end - let(:database) { Google::Cloud::Spanner::Database.from_grpc database_grpc, spanner.service } - - it "knows the identifiers" do - _(database).must_be_kind_of Google::Cloud::Spanner::Database - _(database.project_id).must_equal project - _(database.instance_id).must_equal instance_id - _(database.database_id).must_equal database_id - - _(database.state).must_equal :READY - _(database).must_be :ready? - _(database).wont_be :creating? - - _(database.create_time).must_be_kind_of Time - - _(database.version_retention_period).must_equal version_retention_period - _(database.earliest_version_time).must_equal earliest_version_time - - restore_info = database.restore_info - _(restore_info).must_be_kind_of Google::Cloud::Spanner::Database::RestoreInfo - _(restore_info.source_type).must_equal :BACKUP - _(restore_info).must_be :source_backup? - - backup_info = restore_info.backup_info - _(backup_info).must_be_kind_of Google::Cloud::Spanner::Database::BackupInfo - _(backup_info.project_id).must_equal project - _(backup_info.instance_id).must_equal instance_id - _(backup_info.backup_id).must_equal backup_id - _(backup_info.source_database_project_id).must_equal project - _(backup_info.source_database_instance_id).must_equal instance_id - _(backup_info.source_database_id).must_equal source_database_id - _(backup_info.create_time).must_be_kind_of Time - - _(database.encryption_config).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig - - _(database.encryption_info).wont_be :empty? - _(database.encryption_info).must_be_kind_of Array - _(database.encryption_info.first).must_be_kind_of Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/fields/deeply_nested_struct_test.rb b/google-cloud-spanner/test/google/cloud/spanner/fields/deeply_nested_struct_test.rb deleted file mode 100644 index 7f71f0095ab2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/fields/deeply_nested_struct_test.rb +++ /dev/null @@ -1,101 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Fields, :deeply_nested_struct do - let(:fields_hash) { { id: :INT64, name: :STRING, active: :BOOL, age: :INT64, score: :FLOAT64, updated_at: :TIMESTAMP, birthday: :DATE, avatar: :BYTES, project_ids: [:INT64] } } - let(:fields) { Google::Cloud::Spanner::Fields.new fields_hash } - - it "creates with an array of fields" do - data = fields.struct id: 1, name: "Charlie", active: true, age: 29, score: 0.9, - updated_at: Time.parse("2017-01-02T03:04:05.060000000Z"), - birthday: Date.parse("1950-01-01"), avatar: StringIO.new("image"), - project_ids: [1, 2, 3] - - _(data).must_be_kind_of Google::Cloud::Spanner::Data - - _(data.fields).wont_be :nil? - _(data.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(data.fields.keys.count).must_equal 9 - _(data.fields.to_h).must_equal({ id: :INT64, name: :STRING, active: :BOOL, age: :INT64, - score: :FLOAT64, updated_at: :TIMESTAMP, birthday: :DATE, - avatar: :BYTES, project_ids: [:INT64] }) - - _(data.fields.to_s).wont_be :empty? - _(data.fields.inspect).must_match /Google::Cloud::Spanner::Fields/ - - _(data.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - data_values = data.values - _(data_values[0]).must_equal 1 - _(data_values[1]).must_equal "Charlie" - _(data_values[2]).must_equal true - _(data_values[3]).must_equal 29 - _(data_values[4]).must_equal 0.9 - _(data_values[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_values[6]).must_equal Date.parse("1950-01-01") - _(data_values[7]).must_be_kind_of StringIO - _(data_values[7].read).must_equal "image" - _(data_values[8]).must_equal [1, 2, 3] - - _(data[:id]).must_equal 1 - _(data[:name]).must_equal "Charlie" - _(data[:active]).must_equal true - _(data[:age]).must_equal 29 - _(data[:score]).must_equal 0.9 - _(data[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data[:birthday]).must_equal Date.parse("1950-01-01") - _(data[:avatar]).must_be_kind_of StringIO - _(data[:avatar].read).must_equal "image" - _(data[:project_ids]).must_equal [1, 2, 3] - - _(data[0]).must_equal 1 - _(data[1]).must_equal "Charlie" - _(data[2]).must_equal true - _(data[3]).must_equal 29 - _(data[4]).must_equal 0.9 - _(data[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data[6]).must_equal Date.parse("1950-01-01") - _(data[7]).must_be_kind_of StringIO - _(data[7].read).must_equal "image" - _(data[8]).must_equal [1, 2, 3] - - data_hash = data.to_h - _(data_hash[:id]).must_equal 1 - _(data_hash[:name]).must_equal "Charlie" - _(data_hash[:active]).must_equal true - _(data_hash[:age]).must_equal 29 - _(data_hash[:score]).must_equal 0.9 - _(data_hash[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_hash[:birthday]).must_equal Date.parse("1950-01-01") - _(data_hash[:avatar]).must_be_kind_of StringIO - _(data_hash[:avatar].read).must_equal "image" - _(data_hash[:project_ids]).must_equal [1, 2, 3] - - data_array = data.to_a - _(data_array[0]).must_equal 1 - _(data_array[1]).must_equal "Charlie" - _(data_array[2]).must_equal true - _(data_array[3]).must_equal 29 - _(data_array[4]).must_equal 0.9 - _(data_array[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_array[6]).must_equal Date.parse("1950-01-01") - _(data_array[7]).must_be_kind_of StringIO - _(data_array[7].read).must_equal "image" - _(data_array[8]).must_equal [1, 2, 3] - - _(data.to_s).wont_be :empty? - _(data.inspect).must_match /Google::Cloud::Spanner::Data/ - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/fields/initializer_test.rb b/google-cloud-spanner/test/google/cloud/spanner/fields/initializer_test.rb deleted file mode 100644 index 8a83911b1893..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/fields/initializer_test.rb +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Fields, :initializer do - it "creates with an array of fields" do - fields = Google::Cloud::Spanner::Fields.new [:INT64, :STRING, :BOOL, :JSON] - - _(fields.types).must_equal [:INT64, :STRING, :BOOL, :JSON] - _(fields.keys).must_equal [0, 1, 2, 3] - _(fields.pairs).must_equal [[0, :INT64], [1, :STRING], [2, :BOOL], [3, :JSON]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL, :JSON] - _(fields.to_h).must_equal({ 0 => :INT64, 1 => :STRING, 2 => :BOOL, 3 => :JSON }) - end - - it "creates with an array of type pairs" do - fields = Google::Cloud::Spanner::Fields.new [[:id, :INT64], [:name, :STRING], [:active, :BOOL]] - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [:id, :name, :active] - _(fields.pairs).must_equal [[:id, :INT64], [:name, :STRING], [:active, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ id: :INT64, name: :STRING, active: :BOOL }) - end - - it "creates with a mixed array of fields" do - fields = Google::Cloud::Spanner::Fields.new [:INT64, [:name, :STRING], :BOOL] - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [0, :name, 2] - _(fields.pairs).must_equal [[0, :INT64], [:name, :STRING], [2, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ 0=>:INT64, name: :STRING, 2=>:BOOL }) - end - - it "creates with an unsorted mixed array of fields" do - fields = Google::Cloud::Spanner::Fields.new [[:name, :STRING], :BOOL, [0, :INT64]] - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [0, :name, 2] - _(fields.pairs).must_equal [[0, :INT64], [:name, :STRING], [2, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ 0=>:INT64, name: :STRING, 2=>:BOOL }) - end - - it "creates with a positional hash of fields" do - fields = Google::Cloud::Spanner::Fields.new 0=>:INT64, 1=>:STRING, 2=>:BOOL - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [0, 1, 2] - _(fields.pairs).must_equal [[0, :INT64], [1, :STRING], [2, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ 0=>:INT64, 1=>:STRING, 2=>:BOOL }) - end - - it "creates with named hash of fields" do - fields = Google::Cloud::Spanner::Fields.new id: :INT64, name: :STRING, active: :BOOL - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [:id, :name, :active] - _(fields.pairs).must_equal [[:id, :INT64], [:name, :STRING], [:active, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ id: :INT64, name: :STRING, active: :BOOL }) - end - - it "creates with mixed hash of fields" do - fields = Google::Cloud::Spanner::Fields.new 0=>:INT64, name: :STRING, 2=>:BOOL - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [0, :name, 2] - _(fields.pairs).must_equal [[0, :INT64], [:name, :STRING], [2, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ 0=>:INT64, name: :STRING, 2=>:BOOL }) - end - - it "creates with an unsorted mixed hash of fields" do - fields = Google::Cloud::Spanner::Fields.new name: :STRING, 2=>:BOOL, 0=>:INT64 - - _(fields.types).must_equal [:INT64, :STRING, :BOOL] - _(fields.keys).must_equal [0, :name, 2] - _(fields.pairs).must_equal [[0, :INT64], [:name, :STRING], [2, :BOOL]] - _(fields.to_a).must_equal [:INT64, :STRING, :BOOL] - _(fields.to_h).must_equal({ 0=>:INT64, name: :STRING, 2=>:BOOL }) - end - - it "raises when creating duplicate positions" do - err = expect do - fields = Google::Cloud::Spanner::Fields.new [[-1, :INT64], [:name, :STRING], [2, :BOOL]] - end.must_raise ArgumentError - _(err.message).must_equal "cannot specify position less than 0" - end - - it "raises when creating duplicate positions" do - err = expect do - fields = Google::Cloud::Spanner::Fields.new [[0, :INT64], [:name, :STRING], [3, :BOOL]] - end.must_raise ArgumentError - _(err.message).must_equal "cannot specify position more than field count" - end - - it "raises when creating duplicate positions" do - err = expect do - fields = Google::Cloud::Spanner::Fields.new [[0, :INT64], [:name, :STRING], [0, :BOOL]] - end.must_raise ArgumentError - _(err.message).must_equal "cannot specify position more than once" - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/fields/struct_test.rb b/google-cloud-spanner/test/google/cloud/spanner/fields/struct_test.rb deleted file mode 100644 index dc4bf9dc5858..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/fields/struct_test.rb +++ /dev/null @@ -1,264 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Fields, :struct do - let(:fields_unnamed_array) { [:INT64, :STRING, :BOOL, :INT64, :FLOAT64, :TIMESTAMP, :DATE, :BYTES, [:INT64]] } - let(:fields_named_array) { [[:id, :INT64], [:name, :STRING], [:active, :BOOL], [:age, :INT64], [:score, :FLOAT64], [:updated_at, :TIMESTAMP], [:birthday, :DATE], [:avatar, :BYTES], [:project_ids, [:INT64]]] } - let(:fields_named_hash) { { id: :INT64, name: :STRING, active: :BOOL, age: :INT64, score: :FLOAT64, updated_at: :TIMESTAMP, birthday: :DATE, avatar: :BYTES, project_ids: [:INT64] } } - let(:fields_unnamed_hash) { { 0 => :INT64, 1 => :STRING, 2 => :BOOL, 3 => :INT64, 4 => :FLOAT64, 5 => :TIMESTAMP, 6 => :DATE, 7 => :BYTES, 8 => [:INT64] } } - let(:data_array) { [1, "Charlie", true, 29, 0.9, Time.parse("2017-01-02T03:04:05.060000000Z"), Date.parse("1950-01-01"), StringIO.new("image"), [1, 2, 3]] } - let(:data_named_hash) { { id: 1, name: "Charlie", active: true, age: 29, score: 0.9, updated_at: Time.parse("2017-01-02T03:04:05.060000000Z"), birthday: Date.parse("1950-01-01"), avatar: StringIO.new("image"), project_ids: [1, 2, 3] } } - let(:data_unnamed_hash) { { 0 => 1, 1 => "Charlie", 2 => true, 3 => 29, 4 => 0.9, 5 => Time.parse("2017-01-02T03:04:05.060000000Z"), 6 => Date.parse("1950-01-01"), 7 => StringIO.new("image"), 8 => [1, 2, 3] } } - - it "creates with an unnamed array of fields and an array of values" do - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_array - - data = fields.struct data_array - - assert_unnamed_struct data - end - - it "creates with an named array of fields and an array of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_array - - data = fields.struct data_array - - assert_named_struct data - end - - it "creates with an unnamed array of fields and a named hash of values" do - skip "Cannot create with an unnamed array of fields and a named hash of values, " \ - "because the value hash keys have names and don't match the fields." - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_array - - data = fields.struct data_named_hash - - assert_unnamed_struct data - end - - it "creates with an unnamed array of fields and an unnamed hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_array - - data = fields.struct data_unnamed_hash - - assert_unnamed_struct data - end - - it "creates with a named array of fields and a named hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_array - - data = fields.struct data_named_hash - - assert_named_struct data - end - - it "creates with a named array of fields and an unnamed hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_array - - data = fields.struct data_unnamed_hash - - assert_named_struct data - end - - it "creates with a named hash of fields and an array of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_hash - - data = fields.struct data_array - - assert_named_struct data - end - - it "creates with an unnamed hash of fields and an array of values" do - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_hash - - data = fields.struct data_array - - assert_unnamed_struct data - end - - it "creates with a named hash of fields and a named hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_hash - - data = fields.struct data_named_hash - - assert_named_struct data - end - - it "creates with a named hash of fields and an unnamed hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_named_hash - - data = fields.struct data_unnamed_hash - - assert_named_struct data - end - - it "creates with an unnamed hash of fields and a named hash of values" do - skip "Cannot create with an unnamed hash of fields and a named hash of values, " \ - "because the value hash keys have names and don't match the fields hash keys." - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_hash - - data = fields.struct data_named_hash - - assert_unnamed_struct data - end - - it "creates with an unnamed hash of fields and an unnamed hash of values" do - fields = Google::Cloud::Spanner::Fields.new fields_unnamed_hash - - data = fields.struct data_unnamed_hash - - assert_unnamed_struct data - end - - def assert_unnamed_struct data - _(data).must_be_kind_of Google::Cloud::Spanner::Data - - _(data.fields).wont_be :nil? - _(data.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(data.fields.keys.count).must_equal 9 - _(data.fields.to_a).must_equal fields_unnamed_array - _(data.fields.to_h).must_equal fields_unnamed_hash - - _(data.fields.to_s).wont_be :empty? - _(data.fields.inspect).must_match /Google::Cloud::Spanner::Fields/ - - _(data.keys).must_equal [0, 1, 2, 3, 4, 5, 6, 7, 8] - data_values = data.values - _(data_values[0]).must_equal 1 - _(data_values[1]).must_equal "Charlie" - _(data_values[2]).must_equal true - _(data_values[3]).must_equal 29 - _(data_values[4]).must_equal 0.9 - _(data_values[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_values[6]).must_equal Date.parse("1950-01-01") - _(data_values[7]).must_be_kind_of StringIO - _(data_values[7].read).must_equal "image" - _(data_values[8]).must_equal [1, 2, 3] - - _(data[0]).must_equal 1 - _(data[1]).must_equal "Charlie" - _(data[2]).must_equal true - _(data[3]).must_equal 29 - _(data[4]).must_equal 0.9 - _(data[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data[6]).must_equal Date.parse("1950-01-01") - _(data[7]).must_be_kind_of StringIO - _(data[7].read).must_equal "image" - _(data[8]).must_equal [1, 2, 3] - - data_hash = data.to_h - _(data_hash[0]).must_equal 1 - _(data_hash[1]).must_equal "Charlie" - _(data_hash[2]).must_equal true - _(data_hash[3]).must_equal 29 - _(data_hash[4]).must_equal 0.9 - _(data_hash[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_hash[6]).must_equal Date.parse("1950-01-01") - _(data_hash[7]).must_be_kind_of StringIO - _(data_hash[7].read).must_equal "image" - _(data_hash[8]).must_equal [1, 2, 3] - - data_array = data.to_a - _(data_array[0]).must_equal 1 - _(data_array[1]).must_equal "Charlie" - _(data_array[2]).must_equal true - _(data_array[3]).must_equal 29 - _(data_array[4]).must_equal 0.9 - _(data_array[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_array[6]).must_equal Date.parse("1950-01-01") - _(data_array[7]).must_be_kind_of StringIO - _(data_array[7].read).must_equal "image" - _(data_array[8]).must_equal [1, 2, 3] - - _(data.to_s).wont_be :empty? - _(data.inspect).must_match /Google::Cloud::Spanner::Data/ - end - - def assert_named_struct data - _(data).must_be_kind_of Google::Cloud::Spanner::Data - - _(data.fields).wont_be :nil? - _(data.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(data.fields.keys.count).must_equal 9 - _(data.fields.to_a).must_equal fields_unnamed_array - _(data.fields.to_h).must_equal fields_named_hash - - _(data.fields.to_s).wont_be :empty? - _(data.fields.inspect).must_match /Google::Cloud::Spanner::Fields/ - - _(data.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - data_values = data.values - _(data_values[0]).must_equal 1 - _(data_values[1]).must_equal "Charlie" - _(data_values[2]).must_equal true - _(data_values[3]).must_equal 29 - _(data_values[4]).must_equal 0.9 - _(data_values[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_values[6]).must_equal Date.parse("1950-01-01") - _(data_values[7]).must_be_kind_of StringIO - _(data_values[7].read).must_equal "image" - _(data_values[8]).must_equal [1, 2, 3] - - _(data[:id]).must_equal 1 - _(data[:name]).must_equal "Charlie" - _(data[:active]).must_equal true - _(data[:age]).must_equal 29 - _(data[:score]).must_equal 0.9 - _(data[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data[:birthday]).must_equal Date.parse("1950-01-01") - _(data[:avatar]).must_be_kind_of StringIO - _(data[:avatar].read).must_equal "image" - _(data[:project_ids]).must_equal [1, 2, 3] - - _(data[0]).must_equal 1 - _(data[1]).must_equal "Charlie" - _(data[2]).must_equal true - _(data[3]).must_equal 29 - _(data[4]).must_equal 0.9 - _(data[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data[6]).must_equal Date.parse("1950-01-01") - _(data[7]).must_be_kind_of StringIO - _(data[7].read).must_equal "image" - _(data[8]).must_equal [1, 2, 3] - - data_hash = data.to_h - _(data_hash[:id]).must_equal 1 - _(data_hash[:name]).must_equal "Charlie" - _(data_hash[:active]).must_equal true - _(data_hash[:age]).must_equal 29 - _(data_hash[:score]).must_equal 0.9 - _(data_hash[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_hash[:birthday]).must_equal Date.parse("1950-01-01") - _(data_hash[:avatar]).must_be_kind_of StringIO - _(data_hash[:avatar].read).must_equal "image" - _(data_hash[:project_ids]).must_equal [1, 2, 3] - - data_array = data.to_a - _(data_array[0]).must_equal 1 - _(data_array[1]).must_equal "Charlie" - _(data_array[2]).must_equal true - _(data_array[3]).must_equal 29 - _(data_array[4]).must_equal 0.9 - _(data_array[5]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(data_array[6]).must_equal Date.parse("1950-01-01") - _(data_array[7]).must_be_kind_of StringIO - _(data_array[7].read).must_equal "image" - _(data_array[8]).must_equal [1, 2, 3] - - _(data.to_s).wont_be :empty? - _(data.inspect).must_match /Google::Cloud::Spanner::Data/ - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/backup_operations_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/backup_operations_test.rb deleted file mode 100644 index 51a0d9999baa..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/backup_operations_test.rb +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Instance, :backup_operations, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:backup_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Backup.new backup_hash } - let(:job_name) { "1234567890" } - let(:job_hash) do - { - name: job_name, - metadata: { - type_url: "type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata", - value: "" - } - } - end - let(:job_grpc) { Google::Longrunning::Operation.new job_hash } - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateBackupMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateBackupMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.database.v1.backup", - value: backup_grpc.to_proto - ) - ) - end - let(:jobs_hash) do - 3.times.map { job_hash } - end - let(:first_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "next_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new h - end - let(:second_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "second_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new h - end - let(:last_page) do - h = { operations: jobs_hash } - h[:operations].pop - Google::Cloud::Spanner::Admin::Database::V1::ListBackupOperationsResponse.new h - end - - it "list backup operations" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.backup_operations - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.backup).must_be :nil? - job.reload! - - backup = job.backup - _(backup).wont_be :nil? - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - end - - mock.verify - end - - it "paginates backup operations with page size" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.backup_operations page_size: 3 - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Backup::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.backup).must_be :nil? - job.reload! - - backup = job.backup - _(backup).wont_be :nil? - _(backup).must_be_kind_of Google::Cloud::Spanner::Backup - end - - mock.verify - end - - it "paginates backup operations with next? and next" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.backup_operations - - _(jobs.size).must_equal 3 - _(jobs.next?).must_equal true - _(jobs.next.size).must_equal 2 - _(jobs.next?).must_equal false - - mock.verify - end - - it "paginates backup operations with all" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.backup_operations.all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates backup operations with all and page size" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.backup_operations(page_size: 3).all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "iterates backup operations with all using Enumerator" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.backup_operations.all.take(5) - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates backup operations with filter" do - filter = 'metadata.@type:CreateBackupMetadata' - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.backup_operations filter: filter - - mock.verify - - _(jobs.size).must_equal 3 - end - - it "paginates backup operations with filter and page size" do - filter = 'metadata.@type:CreateBackupMetadata' - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backup_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.backup_operations filter: filter, page_size: 3 - - mock.verify - - _(jobs.size).must_equal 3 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/backup_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/backup_test.rb deleted file mode 100644 index 8df4b16f6211..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/backup_test.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Instance, :backup, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - - it "gets a database backup" do - backup_id = "found-backup" - - encryption_info = Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo.new \ - encryption_type: Google::Cloud::Spanner::Admin::Database::V1::EncryptionInfo::Type::CUSTOMER_MANAGED_ENCRYPTION, - encryption_status: Google::Rpc::Status.new(code: 0), - kms_key_version: "kms_key_version" - - get_res = Google::Cloud::Spanner::Admin::Database::V1::Backup.new \ - backup_hash(instance_id: instance_id, database_id: database_id, backup_id: backup_id, encryption_info: encryption_info) - mock = Minitest::Mock.new - mock.expect :get_backup, get_res, [{ name: backup_path(instance_id, backup_id) }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backup = instance.backup backup_id - - mock.verify - - _(backup.project_id).must_equal project - _(backup.instance_id).must_equal instance_id - _(backup.database_id).must_equal database_id - _(backup.backup_id).must_equal backup_id - _(backup.encryption_info).must_equal encryption_info - _(backup.encryption_info.kms_key_version).must_equal "kms_key_version" - - _(backup.path).must_equal backup_path(instance_id, backup_id) - - _(backup.state).must_equal :READY - _(backup).must_be :ready? - _(backup).wont_be :creating? - end - - it "returns nil when getting a non-existent backup" do - not_found_backup_id = "not-found-backup" - - stub = Object.new - def stub.get_backup *args - gax_error = Google::Cloud::NotFoundError.new "not found" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(5, "not found") - raise gax_error - end - instance.service.mocked_databases = stub - - backup = instance.backup not_found_backup_id - _(backup).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/backups_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/backups_test.rb deleted file mode 100644 index 4a0dc0dc907d..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/backups_test.rb +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Instance, :backups, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:first_page) do - h = backups_hash instance_id: instance_id - h[:next_page_token] = "next_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:second_page) do - h = backups_hash instance_id: instance_id - h[:next_page_token] = "second_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:last_page) do - h = backups_hash instance_id: instance_id - h[:backups].pop - Google::Cloud::Spanner::Admin::Database::V1::ListBackupsResponse.new h - end - let(:next_page_options) { "next_page_token" } - - it "lists backups" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups - - mock.verify - - _(backups.size).must_equal 3 - end - - it "paginates backups with page size" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups page_size: 3 - - mock.verify - - _(backups.size).must_equal 3 - end - - it "paginates backups with next? and next" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - - instance.service.mocked_databases = mock - - list = instance.backups - - mock.verify - - _(list.size).must_equal 3 - _(list.next?).must_equal true - _(list.next.size).must_equal 2 - _(list.next?).must_equal false - end - - it "paginates backups with next? and next and page size" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - list = instance.backups page_size: 3 - - mock.verify - - _(list.size).must_equal 3 - _(list.next?).must_equal true - _(list.next.size).must_equal 2 - _(list.next?).must_equal false - end - - it "paginates backups with all" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups.all.to_a - - mock.verify - - _(backups.size).must_equal 5 - end - - it "paginates backups with all and page size" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups(page_size: 3).all.to_a - - mock.verify - - _(backups.size).must_equal 5 - end - - it "iterates backups with all using Enumerator" do - get_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups.all.take(5) - - mock.verify - - _(backups.size).must_equal 5 - end - - it "paginates backups with filter" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: "name:db1", page_size: nil, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups filter: "name:db1" - - mock.verify - - _(backups.size).must_equal 3 - end - - it "paginates backups with filter and page size" do - get_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_backups, get_res, [{ parent: instance_path(instance_id), filter: "name:db1", page_size: 3, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - backups = instance.backups filter: "name:db1", page_size: 3 - - mock.verify - - _(backups.size).must_equal 3 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/config_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/config_test.rb deleted file mode 100644 index b7584473fdea..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/config_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :config, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - - it "gets an instance config object" do - get_res = Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new instance_config_hash - mock = Minitest::Mock.new - mock.expect :get_instance_config, get_res, [{ name: instance_grpc.config }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - config = instance.config - - mock.verify - - _(config).must_be_kind_of Google::Cloud::Spanner::Instance::Config - _(config.project_id).must_equal project - _(config.instance_config_id).must_equal instance_config_hash[:name].split("/").last - _(config.path).must_equal instance_config_hash[:name] - _(config.name).must_equal instance_config_hash[:display_name] - _(config.display_name).must_equal instance_config_hash[:display_name] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/create_database_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/create_database_test.rb deleted file mode 100644 index a2ab24140d2a..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/create_database_test.rb +++ /dev/null @@ -1,138 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :create_database, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest", - value: "" - } - ) - end - let(:database_grpc) do - Google::Cloud::Spanner::Admin::Database::V1::Database.new( - name: "projects/bustling-kayak-91516/instances/my-new-instance", - state: :READY, - create_time: Time.now - ) - end - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.database.v1.Database", - value: database_grpc.to_proto - ) - ) - end - - it "creates an empty database" do - instance_id = "my-instance-id" - database_id = "new-database" - - mock = Minitest::Mock.new - create_res = \ - Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - operation_done = \ - Gapic::Operation.new( - job_grpc_done, mock, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: [], encryption_config: nil }, ::Gapic::CallOptions] - mock.expect :get_operation, operation_done, [{ name: "1234567890" }, Gapic::CallOptions] - instance.service.mocked_databases = mock - - job = instance.create_database database_id - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - - job.reload! - database = job.database - - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - - mock.verify - end - - it "creates a database with additional statements" do - instance_id = "my-instance-id" - database_id = "new-database" - - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: ["CREATE TABLE table1;", "CREATE TABLE table2;"], encryption_config: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - job = instance.create_database database_id, statements: [ - "CREATE TABLE table1;", - "CREATE TABLE table2;" - ] - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end - - it "creates a database with cmek config" do - instance_id = "my-instance-id" - database_id = "new-database" - - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: [], encryption_config: { kms_key_name: kms_key_name } }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - job = instance.create_database database_id, encryption_config: { kms_key_name: kms_key_name } - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/database_operations_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/database_operations_test.rb deleted file mode 100644 index 10a55d9c2858..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/database_operations_test.rb +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -require "helper" - -describe Google::Cloud::Spanner::Instance, :database_operations, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:database_grpc) { Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash } - let(:job_name) { "1234567890" } - let(:job_hash) do - { - name: job_name, - metadata: { - type_url: "type.googleapis.com/google.spanner.admin.database.v1.CreateDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata.new.to_proto - } - } - end - let(:job_grpc) { Google::Longrunning::Operation.new job_hash } - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.database.v1.CreateDatabaseMetadata", - value: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.database.v1.Database", - value: database_grpc.to_proto - ) - ) - end - let(:jobs_hash) do - 3.times.map { job_hash } - end - let(:first_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "next_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - let(:second_page) do - h = { operations: jobs_hash } - h[:next_page_token] = "second_page_token" - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - let(:last_page) do - h = { operations: jobs_hash } - h[:operations].pop - Google::Cloud::Spanner::Admin::Database::V1::ListDatabaseOperationsResponse.new h - end - - it "list database operations" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.database_operations - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - end - - mock.verify - end - - it "paginates database operations with page size" do - list_res = MockPagedEnumerable.new([first_page]) - - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 3.times do - gapic_operation = Gapic::Operation.new job_grpc_done, mock - mock.expect :get_operation, gapic_operation, [{ name: job_name }, Gapic::CallOptions] - end - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.database_operations page_size: 3 - _(jobs.size).must_equal 3 - - jobs.each do |job| - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.database).must_be :nil? - job.reload! - - database = job.database - _(database).wont_be :nil? - _(database).must_be_kind_of Google::Cloud::Spanner::Database - end - - mock.verify - end - - it "paginates database operations with next? and next" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.database_operations - - _(jobs.size).must_equal 3 - _(jobs.next?).must_equal true - _(jobs.next.size).must_equal 2 - _(jobs.next?).must_equal false - - mock.verify - end - - it "paginates database operations with all" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.database_operations.all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates database operations with all and page size" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.database_operations(page_size: 3).all.to_a - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "iterates database operations with all using Enumerator" do - list_res = MockPagedEnumerable.new([first_page, last_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: nil, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - 2.times do - mock.expect :instance_variable_get, mock, ["@operations_client"] - end - instance.service.mocked_databases = mock - - jobs = instance.database_operations.all.take(5) - - mock.verify - - _(jobs.size).must_equal 5 - end - - it "paginates database operations with filter" do - filter = 'metadata.@type:CreateDatabaseMetadata' - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.database_operations filter: filter - - mock.verify - - _(jobs.size).must_equal 3 - end - - it "paginates database operations with filter and page size" do - filter = 'metadata.@type:CreateDatabaseMetadata' - list_res = MockPagedEnumerable.new([first_page]) - mock = Minitest::Mock.new - mock.expect :list_database_operations, list_res, [{ parent: instance_path(instance_id), filter: filter, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :instance_variable_get, mock, ["@operations_client"] - instance.service.mocked_databases = mock - - jobs = instance.database_operations filter: filter, page_size: 3 - - mock.verify - - _(jobs.size).must_equal 3 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/database_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/database_test.rb deleted file mode 100644 index f885fe823ab4..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/database_test.rb +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :database, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - - it "gets an database" do - database_id = "found-database" - - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - encryption_config = Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig.new kms_key_name: kms_key_name - - get_res = Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id, encryption_config: encryption_config) - mock = Minitest::Mock.new - mock.expect :get_database, get_res, [{ name: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - database = instance.database database_id - - mock.verify - - _(database.project_id).must_equal project - _(database.instance_id).must_equal instance_id - _(database.database_id).must_equal database_id - _(database.encryption_config).must_equal encryption_config - - _(database.path).must_equal database_path(instance_id, database_id) - - _(database.state).must_equal :READY - _(database).must_be :ready? - _(database).wont_be :creating? - end - - it "returns nil when getting an non-existent database" do - not_found_database_id = "not-found-database" - - stub = Object.new - def stub.get_database *args - gax_error = Google::Cloud::NotFoundError.new "not found" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(5, "not found") - raise gax_error - end - instance.service.mocked_databases = stub - - database = instance.database not_found_database_id - _(database).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/databases_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/databases_test.rb deleted file mode 100644 index c9289e4d0467..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/databases_test.rb +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :databases, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:first_page) do - h = databases_hash instance_id: instance_id - h[:next_page_token] = "next_page_token" - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:second_page) do - h = databases_hash instance_id: instance_id - h[:next_page_token] = "second_page_token" - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:last_page) do - h = databases_hash instance_id: instance_id - h[:databases].pop - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:next_page_options) { "next_page_token" } - - it "lists databases" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases - - mock.verify - - _(databases.size).must_equal 3 - end - - it "paginates databases" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - first_databases = instance.databases - second_databases = instance.databases token: first_databases.token - - mock.verify - - _(first_databases.size).must_equal 3 - token = first_databases.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - - _(second_databases.size).must_equal 2 - _(second_databases.token).must_be :nil? - end - - it "paginates databases with max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases max: 3 - - mock.verify - - _(databases.size).must_equal 3 - token = databases.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - end - - it "paginates databases with next? and next" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - first_databases = instance.databases - second_databases = first_databases.next - - mock.verify - - _(first_databases.size).must_equal 3 - _(first_databases.next?).must_equal true - - _(second_databases.size).must_equal 2 - _(second_databases.next?).must_equal false - end - - it "paginates databases with next? and next and max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - first_databases = instance.databases max: 3 - second_databases = first_databases.next - - mock.verify - - _(first_databases.size).must_equal 3 - _(first_databases.next?).must_equal true - - _(second_databases.size).must_equal 2 - _(second_databases.next?).must_equal false - end - - it "paginates databases with all" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases.all.to_a - - mock.verify - - _(databases.size).must_equal 5 - end - - it "paginates databases with all and max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases(max: 3).all.to_a - - mock.verify - - _(databases.size).must_equal 5 - end - - it "iterates databases with all using Enumerator" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, second_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases.all.take(5) - - mock.verify - - _(databases.size).must_equal 5 - end - - it "iterates databases with all and request_limit set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, second_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - instance.service.mocked_databases = mock - - databases = instance.databases.all(request_limit: 1).to_a - - mock.verify - - _(databases.size).must_equal 6 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/delete_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/delete_test.rb deleted file mode 100644 index 76b062b311f6..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/delete_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :delete, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - - it "can delete itself" do - mock = Minitest::Mock.new - mock.expect :delete_instance, nil, [{ name: instance_grpc.name }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instance.delete - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/iam_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/iam_test.rb deleted file mode 100644 index a20491b37b0d..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/iam_test.rb +++ /dev/null @@ -1,149 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :iam, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:viewer_policy_hash) do - { - etag: "\b\x01", - bindings: [{ - role: "roles/viewer", - members: [ - "user:viewer@example.com", - "serviceAccount:1234567890@developer.gserviceaccount.com" - ] - }] - } - end - let(:owner_policy_hash) do - { - etag: "\b\x01", - bindings: [{ - role: "roles/owner", - members: [ - "user:owner@example.com", - "serviceAccount:0987654321@developer.gserviceaccount.com" - ] - }] - } - end - - it "gets the IAM Policy" do - get_res = Google::Iam::V1::Policy.new viewer_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: instance.path }, ::Gapic::CallOptions] - instance.service.mocked_instances = mock - - policy = instance.policy - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x01" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be_kind_of Array - _(policy.roles["roles/viewer"].count).must_equal 2 - _(policy.roles["roles/viewer"].first).must_equal "user:viewer@example.com" - _(policy.roles["roles/viewer"].last).must_equal "serviceAccount:1234567890@developer.gserviceaccount.com" - end - - it "sets the IAM Policy" do - get_res = Google::Iam::V1::Policy.new owner_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: instance.path }, ::Gapic::CallOptions] - - updated_policy_hash = owner_policy_hash.dup - updated_policy_hash[:bindings].first[:members].shift - updated_policy_hash[:bindings].first[:members] << "user:newowner@example.com" - - set_req = Google::Iam::V1::Policy.new updated_policy_hash - set_res = Google::Iam::V1::Policy.new updated_policy_hash.merge(etag: "\b\x10") - mock.expect :set_iam_policy, set_res, [{ resource: instance.path, policy: set_req }, ::Gapic::CallOptions] - instance.service.mocked_instances = mock - - policy = instance.policy - - policy.add "roles/owner", "user:newowner@example.com" - policy.remove "roles/owner", "user:owner@example.com" - - policy = instance.update_policy policy - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x10" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be :nil? - _(policy.roles["roles/owner"]).must_be_kind_of Array - _(policy.roles["roles/owner"].count).must_equal 2 - _(policy.roles["roles/owner"].first).must_equal "serviceAccount:0987654321@developer.gserviceaccount.com" - _(policy.roles["roles/owner"].last).must_equal "user:newowner@example.com" - end - - it "sets the IAM Policy in a block" do - - get_res = Google::Iam::V1::Policy.new owner_policy_hash - mock = Minitest::Mock.new - mock.expect :get_iam_policy, get_res, [{ resource: instance.path }, ::Gapic::CallOptions] - - updated_policy_hash = owner_policy_hash.dup - updated_policy_hash[:bindings].first[:members].shift - updated_policy_hash[:bindings].first[:members] << "user:newowner@example.com" - - set_req = Google::Iam::V1::Policy.new updated_policy_hash - set_res = Google::Iam::V1::Policy.new updated_policy_hash.merge(etag: "\b\x10") - mock.expect :set_iam_policy, set_res, [{ resource: instance.path, policy: set_req }, ::Gapic::CallOptions] - instance.service.mocked_instances = mock - - policy = instance.policy do |p| - p.add "roles/owner", "user:newowner@example.com" - p.remove "roles/owner", "user:owner@example.com" - end - - mock.verify - - _(policy).must_be_kind_of Google::Cloud::Spanner::Policy - _(policy.etag).must_equal "\b\x10" - _(policy.roles).must_be_kind_of Hash - _(policy.roles.size).must_equal 1 - _(policy.roles["roles/viewer"]).must_be :nil? - _(policy.roles["roles/owner"]).must_be_kind_of Array - _(policy.roles["roles/owner"].count).must_equal 2 - _(policy.roles["roles/owner"].first).must_equal "serviceAccount:0987654321@developer.gserviceaccount.com" - _(policy.roles["roles/owner"].last).must_equal "user:newowner@example.com" - end - - it "tests the available permissions" do - permissions = ["spanner.instances.get", "spanner.instances.publish"] - test_res = Google::Iam::V1::TestIamPermissionsResponse.new( - permissions: ["spanner.instances.get"] - ) - mock = Minitest::Mock.new - mock.expect :test_iam_permissions, test_res, [{ resource: instance.path, permissions: permissions }, ::Gapic::CallOptions] - instance.service.mocked_instances = mock - - permissions = instance.test_permissions "spanner.instances.get", - "spanner.instances.publish" - - mock.verify - - _(permissions).must_equal ["spanner.instances.get"] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance/save_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance/save_test.rb deleted file mode 100644 index 84fd26aebec2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance/save_test.rb +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :save, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest", - value: "" - } - ) - end - let(:update_res) do - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Instance::V1::Instance, - metadata_type: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata - ) - end - - it "updates and saves itself" do - instance.display_name = "Updated display name" - instance.nodes = 99 - instance.labels = { "env" => "production" } - - mask = Google::Protobuf::FieldMask.new paths: ["display_name", "node_count", "labels"] - mock = Minitest::Mock.new - mock.expect :update_instance, update_res, [{ instance: instance_grpc, field_mask: mask }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = instance.save - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - end - - it "updates and saves when changing the labels directly" do - instance.display_name = "Updated display name" - instance.nodes = 99 - instance.labels["env"] = "production" - - mask = Google::Protobuf::FieldMask.new paths: ["display_name", "node_count", "labels"] - mock = Minitest::Mock.new - mock.expect :update_instance, update_res, [{ instance: instance_grpc, field_mask: mask }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = instance.save - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - end - - it "updates processing units" do - instance.processing_units = 1000 - - mask = Google::Protobuf::FieldMask.new paths: ["processing_units"] - mock = Minitest::Mock.new - mock.expect :update_instance, update_res, [{ instance: instance_grpc, field_mask: mask }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = instance.save - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - end - - it "update orignal value after instance update request" do - _(instance.processing_units).must_equal 0 - - instance.processing_units = 1000 - - mask = Google::Protobuf::FieldMask.new paths: ["processing_units"] - mock = Minitest::Mock.new - mock.expect :update_instance, update_res, [{ instance: instance_grpc, field_mask: mask }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = instance.save - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - - _(instance.instance_variable_get("@current_values")[:processing_units]).must_equal 1000 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/instance_test.rb b/google-cloud-spanner/test/google/cloud/spanner/instance_test.rb deleted file mode 100644 index a54338e181ab..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/instance_test.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Instance, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:instance_grpc) { - Google::Cloud::Spanner::Admin::Instance::V1::Instance.new( - instance_hash(name: instance_id, processing_units: 1000) - ) - } - let(:instance) { Google::Cloud::Spanner::Instance.from_grpc instance_grpc, spanner.service } - - it "knows the identifiers" do - _(instance).must_be_kind_of Google::Cloud::Spanner::Instance - _(instance.project_id).must_equal project - _(instance.instance_id).must_equal instance_id - - _(instance.state).must_equal :READY - _(instance).must_be :ready? - _(instance).wont_be :creating? - - _(instance.nodes).must_equal 1 - _(instance.processing_units).must_equal 1000 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/pool/close_test.rb b/google-cloud-spanner/test/google/cloud/spanner/pool/close_test.rb deleted file mode 100644 index e019b0154fab..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/pool/close_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Pool, :close, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:pool) do - session.instance_variable_set :@last_updated_at, Time.now - p = client.instance_variable_get :@pool - p.all_sessions = [session] - p.session_queue = [session] - p - end - - after do - shutdown_client! client - end - - it "deletes sessions when closed" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{ name: session_grpc.name }, default_options] - session.service.mocked_service = mock - - pool.close - - shutdown_pool! pool - - mock.verify - end - - it "cannot be used after being closed" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{ name: session_grpc.name }, default_options] - session.service.mocked_service = mock - - pool.close - - shutdown_pool! pool - - assert_raises Google::Cloud::Spanner::ClientClosedError do - pool.checkout_session - end - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/pool/keepalive_or_release_test.rb b/google-cloud-spanner/test/google/cloud/spanner/pool/keepalive_or_release_test.rb deleted file mode 100644 index b10bb2755009..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/pool/keepalive_or_release_test.rb +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Pool, :keepalive_or_release, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:pool) { client.instance_variable_get :@pool } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } } - ] - } - }, - values: [ { string_value: "1" }] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - before do - # kill the background thread before starting the tests - pool.instance_variable_get(:@keepalive_task).shutdown - end - - after do - shutdown_client! client - end - - it "calls keepalive on the sessions that need it" do - # update the session so it was last updated an hour ago - session.instance_variable_set :@last_updated_at, Time.now - 60*60 - # set the session in the pool - pool.all_sessions = [session] - pool.session_queue = [session] - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT 1", options: default_options - - pool.keepalive_or_release! - - shutdown_pool! pool - - mock.verify - end - - it "calls keepalive on the transactions that need it" do - # update the session so it was last updated an hour ago - session.instance_variable_set :@last_updated_at, Time.now - 60*60 - # set the session in the pool - pool.all_sessions = [session] - pool.transaction_queue = [transaction] - - mock = Minitest::Mock.new - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - session.service.mocked_service = mock - - pool.keepalive_or_release! - - shutdown_pool! pool - - mock.verify - end - - it "doesn't call keepalive on sessions that don't need it" do - # update the session so it was last updated now - session.instance_variable_set :@last_updated_at, Time.now - # set the session in the pool - pool.all_sessions = [session] - pool.session_queue = [session] - - mock = Minitest::Mock.new - session.service.mocked_service = mock - - pool.keepalive_or_release! - - shutdown_pool! pool - - mock.verify - end - - it "doesn't call keepalive on transactions that don't need it" do - # update the session so it was last updated now - session.instance_variable_set :@last_updated_at, Time.now - # set the session in the pool - pool.all_sessions = [session] - pool.transaction_queue = [transaction] - - mock = Minitest::Mock.new - session.service.mocked_service = mock - - pool.keepalive_or_release! - - shutdown_pool! pool - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/pool/new_sessions_in_process_test.rb b/google-cloud-spanner/test/google/cloud/spanner/pool/new_sessions_in_process_test.rb deleted file mode 100644 index d810053ef53a..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/pool/new_sessions_in_process_test.rb +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Pool, :new_sessions_in_process, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:pool) do - session.instance_variable_set :@last_updated_at, Time.now - p = client.instance_variable_get :@pool - p.all_sessions = [session] - p.session_queue = [session] - p.transaction_queue = [] - p - end - - after do - shutdown_client! client - end - - it "does not increment new_sessions_in_process when create_session raises an error" do - stub = Object.new - def stub.create_session *args - raise Google::Cloud::Error.from_error GRPC::BadStatus.new(11, "sumthin happen") - end - spanner.service.mocked_service = stub - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.instance_variable_get(:@new_sessions_in_process)).must_equal 0 - - s1 = pool.checkout_session # gets the one session from the queue - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.instance_variable_get(:@new_sessions_in_process)).must_equal 0 - - raised_error = assert_raises Google::Cloud::Error do - pool.checkout_session - end - _(raised_error.message).must_equal "11:sumthin happen" - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.instance_variable_get(:@new_sessions_in_process)).must_equal 0 - - 10.times do - raised_error = assert_raises Google::Cloud::Error do - pool.checkout_session - end - _(raised_error.message).must_equal "11:sumthin happen" - end - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.instance_variable_get(:@new_sessions_in_process)).must_equal 0 - - pool.checkin_session s1 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.instance_variable_get(:@new_sessions_in_process)).must_equal 0 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/pool/write_ratio_test.rb b/google-cloud-spanner/test/google/cloud/spanner/pool/write_ratio_test.rb deleted file mode 100644 index 28b48d9d5158..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/pool/write_ratio_test.rb +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Pool, :write_ratio, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client_pool) do - session.instance_variable_set :@last_updated_at, Time.now - p = client.instance_variable_get :@pool - p.all_sessions = [session] - p.session_queue = [session] - p - end - - after do - shutdown_client! client - end - - it "creates two sessions and one transaction" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - sessions = Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new( - session: [ - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-001")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-002")) - ] - ) - mock.expect :batch_create_sessions, sessions, [{ database: database_path(instance_id, database_id), session_count: 2, session_template: nil }, default_options] - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-01"), tx_opts, default_options - - pool = Google::Cloud::Spanner::Pool.new client, min: 2, write_ratio: 0.5 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 1 - - mock.verify - end - - it "calls batch_create_sessions until min number of sessions are returned" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - sessions = Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new( - session: [ - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-001")), - ] - ) - sessions_2 = Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new( - session: [ - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-002")), - ] - ) - mock.expect :batch_create_sessions, sessions, [{ database: database_path(instance_id, database_id), session_count: 2, session_template: nil }, default_options] - mock.expect :batch_create_sessions, sessions_2, [{ database: database_path(instance_id, database_id), session_count: 1, session_template: nil }, default_options] - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-01"), tx_opts, default_options - - pool = Google::Cloud::Spanner::Pool.new client, min: 2, write_ratio: 0.5 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 1 - - mock.verify - end - - it "creates five sessions and three transactions" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - sessions = Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new( - session: [ - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-001")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-002")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-003")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-004")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-005")) - ] - ) - mock.expect :batch_create_sessions, sessions, [{ database: database_path(instance_id, database_id), session_count: 5, session_template: nil }, default_options] - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-003-01"), tx_opts, default_options - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-004-01"), tx_opts, default_options - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-005-01"), tx_opts, default_options - - pool = Google::Cloud::Spanner::Pool.new client, min: 5, write_ratio: 0.5 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 5 - _(pool.session_queue.size).must_equal 2 - _(pool.transaction_queue.size).must_equal 3 - - mock.verify - end - - it "creates eight sessions and three transactions" do - mock = Minitest::Mock.new - spanner.service.mocked_service = mock - sessions = Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new( - session: [ - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-001")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-002")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-003")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-004")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-005")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-006")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-007")), - Google::Cloud::Spanner::V1::Session.new(name: session_path(instance_id, database_id, "session-008")) - ] - ) - mock.expect :batch_create_sessions, sessions, [{ database: database_path(instance_id, database_id), session_count: 8, session_template: nil }, default_options] - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-007-01"), tx_opts, default_options - expect_begin_transaction Google::Cloud::Spanner::V1::Transaction.new(id: "tx-008-01"), tx_opts, default_options - - pool = Google::Cloud::Spanner::Pool.new client, min: 8, write_ratio: 0.3 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 8 - _(pool.session_queue.size).must_equal 6 - _(pool.transaction_queue.size).must_equal 2 - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/pool_test.rb b/google-cloud-spanner/test/google/cloud/spanner/pool_test.rb deleted file mode 100644 index 68577c4be8b9..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/pool_test.rb +++ /dev/null @@ -1,350 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Pool, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:client) { spanner.client instance_id, database_id, pool: { min: 0, max: 4 } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:pool) do - session.instance_variable_set :@last_updated_at, Time.now - p = client.instance_variable_get :@pool - p.all_sessions = [session] - p.session_queue = [session] - p.transaction_queue = [] - p - end - - after do - shutdown_client! client - end - - it "can checkout and checkin a session" do - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - - s = pool.checkout_session - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - - pool.checkin_session s - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - end - - it "creates new sessions when needed" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - - s1 = pool.checkout_session - s2 = pool.checkout_session - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 0 - - pool.checkin_session s1 - pool.checkin_session s2 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 2 - - mock.verify - end - - it "raises when checking out more than MAX sessions" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - - s1 = pool.checkout_session - s2 = pool.checkout_session - s3 = pool.checkout_session - s4 = pool.checkout_session - - assert_raises Google::Cloud::Spanner::SessionLimitError do - pool.checkout_session - end - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 0 - - pool.checkin_session s1 - pool.checkin_session s2 - pool.checkin_session s3 - pool.checkin_session s4 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 4 - - mock.verify - end - - it "raises when checking in a session that does not belong" do - outside_session = Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service - - checkin_error = assert_raises ArgumentError do - pool.checkin_session outside_session - end - _(checkin_error.message).must_equal "Cannot checkin session" - end - - it "uses existing transaction when checking out and checking in a transaction" do - init_tx = Google::Cloud::Spanner::Transaction.from_grpc Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-01"), pool.session_queue.shift - pool.transaction_queue << init_tx - - mock = Minitest::Mock.new - # created when checking in - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-02"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - # reload on session pool checkin - mock.expect :get_session, session_grpc, [{ name: session_grpc.name }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-02"), [{session: session_path(instance_id, database_id, session_id), options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 1 - _(pool.transaction_queue.first).must_equal init_tx - - tx = pool.checkout_transaction - _(tx).must_equal init_tx - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 0 - - pool.checkin_transaction tx - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 1 - end - - it "can create a transaction when checking out and checking in a transaction" do - mock = Minitest::Mock.new - # created when checking out - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - # created when checking in - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-02"), [{ session: session_path(instance_id, database_id, session_id), options: tx_opts }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 0 - - tx = pool.checkout_transaction - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 0 - - pool.checkin_transaction tx - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 1 - end - - it "creates new transaction when needed" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - # created when checking out - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 0 - - tx1 = pool.checkout_transaction - tx2 = pool.checkout_transaction - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 0 - - pool.checkin_transaction tx1 - pool.checkin_transaction tx2 - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 2 - - mock.verify - end - - it "creates new transaction when needed using with_transaction" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - # created when checking out - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - # created when checking in - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-02"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-02"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 0 - - pool.with_transaction do |tx1| - pool.with_transaction do |tx1| - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 0 - end - end - - shutdown_pool! pool - - _(pool.all_sessions.size).must_equal 2 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 2 - - mock.verify - end - - it "raises when checking out more than MAX transaction" do - mock = Minitest::Mock.new - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - # created when checking out - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-001-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-002-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-003-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - mock.expect :begin_transaction, Google::Cloud::Spanner::V1::Transaction.new(id: "tx-004-01"), [{ - session: session_path(instance_id, database_id, session_id), options: tx_opts, - request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - _(pool.all_sessions.size).must_equal 1 - _(pool.session_queue.size).must_equal 1 - _(pool.transaction_queue.size).must_equal 0 - - tx1 = pool.checkout_transaction - tx2 = pool.checkout_transaction - tx3 = pool.checkout_transaction - tx4 = pool.checkout_transaction - - assert_raises Google::Cloud::Spanner::SessionLimitError do - pool.checkout_transaction - end - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 0 - - pool.checkin_transaction tx1 - pool.checkin_transaction tx2 - pool.checkin_transaction tx3 - pool.checkin_transaction tx4 - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 4 - - s1 = pool.checkout_session - s2 = pool.checkout_session - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 0 - _(pool.transaction_queue.size).must_equal 2 - - pool.checkin_session s1 - pool.checkin_session s2 - - _(pool.all_sessions.size).must_equal 4 - _(pool.session_queue.size).must_equal 2 - _(pool.transaction_queue.size).must_equal 2 - - shutdown_pool! pool - - mock.verify - end - - it "raises when checking in a transaction that does not belong" do - outside_session = Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service - outside_tx = Google::Cloud::Spanner::Transaction.from_grpc Google::Cloud::Spanner::V1::Transaction.new(id: "outside-tx-001"), outside_session - - checkin_error = assert_raises ArgumentError do - pool.checkin_transaction outside_tx - end - _(checkin_error.message).must_equal "Cannot checkin session" - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/create_database_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/create_database_test.rb deleted file mode 100644 index 84afb44a856e..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/create_database_test.rb +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :create_database, :mock_spanner do - let(:instance_id) { "my-instance-id" } - - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest", - value: "" - } - ) - end - - it "creates an empty database" do - instance_id = "my-instance-id" - database_id = "new-database" - - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: [], encryption_config: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = spanner.create_database instance_id, database_id - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end - - it "creates a database with additional statements" do - instance_id = "my-instance-id" - database_id = "new-database" - - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: ["CREATE TABLE table1;", "CREATE TABLE table2;"], encryption_config: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = spanner.create_database instance_id, database_id, statements: [ - "CREATE TABLE table1;", - "CREATE TABLE table2;" - ] - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end - - it "creates a database with cmek config" do - instance_id = "my-instance-id" - database_id = "new-database" - - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Database::V1::Database, - metadata_type: Google::Cloud::Spanner::Admin::Database::V1::CreateDatabaseMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_database, create_res, [{ parent: instance_path(instance_id), create_statement: "CREATE DATABASE `#{database_id}`", extra_statements: [], encryption_config: { kms_key_name: kms_key_name } }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - job = spanner.create_database instance_id, database_id, encryption_config: { kms_key_name: kms_key_name } - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Database::Job - _(job).wont_be :done? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/create_instance_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/create_instance_test.rb deleted file mode 100644 index 6350cd7c403c..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/create_instance_test.rb +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :create_instance, :mock_spanner do - let(:job_grpc) do - Google::Longrunning::Operation.new( - name: "1234567890", - metadata: { - type_url: "google.spanner.admin.database.v1.CreateInstanceMetadata", - value: "" - } - ) - end - let(:config) { "regional-us-central1" } - let(:instance_grpc) do - Google::Cloud::Spanner::Admin::Instance::V1::Instance.new \ - name: "projects/bustling-kayak-91516/instances/my-new-instance", - config: "projects/my-project/instanceConfigs/regional-us-central1", - display_name: "My New Instance", - node_count: 1, - state: :READY, - labels: {} - end - let(:job_grpc_done) do - Google::Longrunning::Operation.new( - name:"1234567890", - metadata: Google::Protobuf::Any.new( - type_url: "google.spanner.admin.instance.v1.CreateInstanceMetadata", - value: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata.new.to_proto - ), - done: true, - response: Google::Protobuf::Any.new( - type_url: "type.googleapis.com/google.spanner.admin.instance.v1.Instance", - value: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata.new.to_proto - ) - ) - end - let(:instance_id) { "new-instance" } - - it "creates an empty instance" do - mock = Minitest::Mock.new - create_req = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new config: instance_config_path(config) - create_res = \ - Gapic::Operation.new( - job_grpc, mock, - result_type: Google::Cloud::Spanner::Admin::Instance::V1::Instance, - metadata_type: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata - ) - operation_done = \ - Gapic::Operation.new( - job_grpc_done, mock, - result_type: Google::Cloud::Spanner::Admin::Instance::V1::Instance, - metadata_type: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata - ) - mock.expect :create_instance, create_res, [{ parent: project_path, instance_id: instance_id, instance: create_req }, ::Gapic::CallOptions] - mock.expect :get_operation, operation_done, [{name: "1234567890"}, Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = spanner.create_instance instance_id, config: config - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - _(job).wont_be :error? - _(job.error).must_be :nil? - _(job.instance).must_be :nil? - - job.reload! - instance = job.instance - - _(instance).wont_be :nil? - _(instance).must_be_kind_of Google::Cloud::Spanner::Instance - - mock.verify - end - - it "creates a full instance and labels with symbols" do - create_req = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new( - config: instance_config_path(config), display_name: "My New Instance", - node_count: 99, labels: { "env" => "production" } - ) - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Instance::V1::Instance, - metadata_type: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata - ) - mock = Minitest::Mock.new - mock.expect :create_instance, create_res, [{ parent: project_path, instance_id: instance_id, instance: create_req }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = spanner.create_instance instance_id, config: config, name: "My New Instance", nodes: 99, labels: { env: :production } - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - end - - it "creates a instance with processing units" do - create_req = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new( - config: instance_config_path(config), display_name: "My New Instance", - processing_units: 1000, labels: { "env" => "production" } - ) - create_res = \ - Gapic::Operation.new( - job_grpc, Object.new, - result_type: Google::Cloud::Spanner::Admin::Instance::V1::Instance, - metadata_type: Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceMetadata - ) - mock = Minitest::Mock.new - - mock.expect :create_instance, create_res, [{ parent: project_path, instance_id: instance_id, instance: create_req }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - job = spanner.create_instance instance_id, config: config, name: "My New Instance", processing_units: 1000, labels: { env: :production } - - mock.verify - - _(job).must_be_kind_of Google::Cloud::Spanner::Instance::Job - _(job).wont_be :done? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/database_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/database_test.rb deleted file mode 100644 index efa53e89d999..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/database_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :database, :mock_spanner do - let(:instance_id) { "my-instance-id" } - - it "gets an database" do - database_id = "found-database" - - kms_key_name = "projects//locations//keyRings//cryptoKeys/" - encryption_config = Google::Cloud::Spanner::Admin::Database::V1::EncryptionConfig.new kms_key_name: kms_key_name - - get_res = Google::Cloud::Spanner::Admin::Database::V1::Database.new database_hash(instance_id: instance_id, database_id: database_id, encryption_config: encryption_config) - mock = Minitest::Mock.new - mock.expect :get_database, get_res, [{ name: database_path(instance_id, database_id) }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - database = spanner.database instance_id, database_id - - mock.verify - - _(database.project_id).must_equal project - _(database.instance_id).must_equal instance_id - _(database.database_id).must_equal database_id - _(database.encryption_config).must_equal encryption_config - - _(database.path).must_equal database_path(instance_id, database_id) - - _(database.state).must_equal :READY - _(database).must_be :ready? - _(database).wont_be :creating? - end - - it "returns nil when getting an non-existent database" do - not_found_database_id = "not-found-database" - - stub = Object.new - def stub.get_database *args - gax_error = Google::Cloud::NotFoundError.new "not found" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(5, "not found") - raise gax_error - end - spanner.service.mocked_databases = stub - - database = spanner.database instance_id, not_found_database_id - _(database).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/databases_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/databases_test.rb deleted file mode 100644 index b14301968324..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/databases_test.rb +++ /dev/null @@ -1,173 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :databases, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:first_page) do - h = databases_hash instance_id: instance_id - h[:next_page_token] = "next_page_token" - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:second_page) do - h = databases_hash instance_id: instance_id - h[:next_page_token] = "second_page_token" - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:last_page) do - h = databases_hash instance_id: instance_id - h[:databases].pop - response = Google::Cloud::Spanner::Admin::Database::V1::ListDatabasesResponse.new h - paged_enum_struct response - end - let(:next_page_options) { "next_page_token" } - - it "lists databases" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases instance_id - - mock.verify - - _(databases.size).must_equal 3 - end - - it "paginates databases" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - first_databases = spanner.databases instance_id - second_databases = spanner.databases instance_id, token: first_databases.token - - mock.verify - - _(first_databases.size).must_equal 3 - token = first_databases.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - - _(second_databases.size).must_equal 2 - _(second_databases.token).must_be :nil? - end - - it "paginates databases with max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases instance_id, max: 3 - - mock.verify - - _(databases.size).must_equal 3 - token = databases.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - end - - it "paginates databases with next? and next" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - first_databases = spanner.databases instance_id - second_databases = first_databases.next - - mock.verify - - _(first_databases.size).must_equal 3 - _(first_databases.next?).must_equal true - - _(second_databases.size).must_equal 2 - _(second_databases.next?).must_equal false - end - - it "paginates databases with next? and next and max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - first_databases = spanner.databases instance_id, max: 3 - second_databases = first_databases.next - - mock.verify - - _(first_databases.size).must_equal 3 - _(first_databases.next?).must_equal true - - _(second_databases.size).must_equal 2 - _(second_databases.next?).must_equal false - end - - it "paginates databases with all" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases(instance_id).all.to_a - - mock.verify - - _(databases.size).must_equal 5 - end - - it "paginates databases with all and max set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, last_page, [{ parent: instance_path(instance_id), page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases(instance_id, max: 3).all.to_a - - mock.verify - - _(databases.size).must_equal 5 - end - - it "iterates databases with all using Enumerator" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, second_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases(instance_id).all.take(5) - - mock.verify - - _(databases.size).must_equal 5 - end - - it "iterates databases with all and request_limit set" do - mock = Minitest::Mock.new - mock.expect :list_databases, first_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_databases, second_page, [{ parent: instance_path(instance_id), page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_databases = mock - - databases = spanner.databases(instance_id).all(request_limit: 1).to_a - - mock.verify - - _(databases.size).must_equal 6 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/instance_config_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/instance_config_test.rb deleted file mode 100644 index 7264273e57f5..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/instance_config_test.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :instance_config, :mock_spanner do - it "gets an instance config" do - config_name = "found-config" - - get_res = Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig.new instance_config_hash - mock = Minitest::Mock.new - mock.expect :get_instance_config, get_res, [{ name: instance_config_path(config_name) }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - config = spanner.instance_config config_name - - mock.verify - - _(config.project_id).must_equal project - _(config.instance_config_id).must_equal instance_config_hash[:name].split("/").last - _(config.path).must_equal instance_config_hash[:name] - _(config.name).must_equal instance_config_hash[:display_name] - _(config.display_name).must_equal instance_config_hash[:display_name] - end - - it "returns nil when getting an non-existent instance config" do - not_found_config_name = "not-found-config" - - stub = Object.new - def stub.get_instance_config *args - gax_error = Google::Cloud::NotFoundError.new "not found" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(5, "not found") - raise gax_error - end - spanner.service.mocked_instances = stub - - config = spanner.instance_config not_found_config_name - _(config).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/instance_configs_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/instance_configs_test.rb deleted file mode 100644 index 1c8a614e75e1..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/instance_configs_test.rb +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :instance_configs, :mock_spanner do - let(:first_page) do - h = instance_configs_hash - h[:next_page_token] = "next_page_token" - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new h - paged_enum_struct response - end - let(:second_page) do - h = instance_configs_hash - h[:next_page_token] = "second_page_token" - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new h - paged_enum_struct response - end - let(:last_page) do - h = instance_configs_hash - h[:instance_configs].pop - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse.new h - paged_enum_struct response - end - let(:next_page_options) { "next_page_token" } - - it "lists configs" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs - - mock.verify - - _(configs.size).must_equal 3 - end - - it "paginates configs" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_configs = spanner.instance_configs - second_configs = spanner.instance_configs token: first_configs.token - - mock.verify - - _(first_configs.size).must_equal 3 - token = first_configs.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - - _(second_configs.size).must_equal 2 - _(second_configs.token).must_be :nil? - end - - it "paginates configs with max set" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs max: 3 - - mock.verify - - _(configs.size).must_equal 3 - token = configs.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - end - - it "paginates configs with next? and next" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_configs = spanner.instance_configs - second_configs = first_configs.next - - mock.verify - - _(first_configs.size).must_equal 3 - _(first_configs.next?).must_equal true - - _(second_configs.size).must_equal 2 - _(second_configs.next?).must_equal false - end - - it "paginates configs with next? and next and max set" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, last_page, [{ parent: project_path, page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_configs = spanner.instance_configs max: 3 - second_configs = first_configs.next - - mock.verify - - _(first_configs.size).must_equal 3 - _(first_configs.next?).must_equal true - - _(second_configs.size).must_equal 2 - _(second_configs.next?).must_equal false - end - - it "paginates configs with all" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs.all.to_a - - mock.verify - - _(configs.size).must_equal 5 - end - - it "paginates configs with all and max set" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, last_page, [{ parent: project_path, page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs(max: 3).all.to_a - - mock.verify - - _(configs.size).must_equal 5 - end - - it "iterates configs with all using Enumerator" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, second_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs.all.take(5) - - mock.verify - - _(configs.size).must_equal 5 - end - - it "iterates configs with all and request_limit set" do - mock = Minitest::Mock.new - mock.expect :list_instance_configs, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instance_configs, second_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - configs = spanner.instance_configs.all(request_limit: 1).to_a - - mock.verify - - _(configs.size).must_equal 6 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/instance_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/instance_test.rb deleted file mode 100644 index 3be42ee4b571..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/instance_test.rb +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :instance, :mock_spanner do - it "gets an instance" do - instance_id = "found-instance" - - get_res = Google::Cloud::Spanner::Admin::Instance::V1::Instance.new instance_hash(name: instance_id) - mock = Minitest::Mock.new - mock.expect :get_instance, get_res, [{ name: instance_path(instance_id) }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instance = spanner.instance instance_id - - mock.verify - - _(instance.project_id).must_equal project - _(instance.instance_id).must_equal instance_id - _(instance.path).must_equal instance_path(instance_id) - _(instance.name).must_equal instance_id.split("-").map(&:capitalize).join(" ") - _(instance.display_name).must_equal instance_id.split("-").map(&:capitalize).join(" ") - end - - it "returns nil when getting an non-existent instance" do - not_found_instance_id = "not-found-instance" - - stub = Object.new - def stub.get_instance *args - gax_error = Google::Cloud::NotFoundError.new "not found" - gax_error.instance_variable_set :@cause, GRPC::BadStatus.new(5, "not found") - raise gax_error - end - spanner.service.mocked_instances = stub - - instance = spanner.instance not_found_instance_id - _(instance).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project/instances_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project/instances_test.rb deleted file mode 100644 index 840842b4b69e..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project/instances_test.rb +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :instances, :mock_spanner do - let(:first_page) do - h = instances_hash - h[:next_page_token] = "next_page_token" - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new h - paged_enum_struct response - end - let(:second_page) do - h = instances_hash - h[:next_page_token] = "second_page_token" - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new h - paged_enum_struct response - end - let(:last_page) do - h = instances_hash - h[:instances].pop - response = Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse.new h - paged_enum_struct response - end - let(:next_page_options) { "next_page_token" } - - it "lists instances" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances - - mock.verify - - _(instances.size).must_equal 3 - end - - it "paginates instances" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_instances = spanner.instances - second_instances = spanner.instances token: first_instances.token - - mock.verify - - _(first_instances.size).must_equal 3 - token = first_instances.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - - _(second_instances.size).must_equal 2 - _(second_instances.token).must_be :nil? - end - - it "paginates instances with max set" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances max: 3 - - mock.verify - - _(instances.size).must_equal 3 - token = instances.token - _(token).wont_be :nil? - _(token).must_equal "next_page_token" - end - - it "paginates instances with next? and next" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_instances = spanner.instances - second_instances = first_instances.next - - mock.verify - - _(first_instances.size).must_equal 3 - _(first_instances.next?).must_equal true - - _(second_instances.size).must_equal 2 - _(second_instances.next?).must_equal false - end - - it "paginates instances with next? and next and max set" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, last_page, [{ parent: project_path, page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - first_instances = spanner.instances max: 3 - second_instances = first_instances.next - - mock.verify - - _(first_instances.size).must_equal 3 - _(first_instances.next?).must_equal true - - _(second_instances.size).must_equal 2 - _(second_instances.next?).must_equal false - end - - it "paginates instances with all" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, last_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances.all.to_a - - mock.verify - - _(instances.size).must_equal 5 - end - - it "paginates instances with all and max set" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: 3, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, last_page, [{ parent: project_path, page_size: 3, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances(max: 3).all.to_a - - mock.verify - - _(instances.size).must_equal 5 - end - - it "iterates instances with all using Enumerator" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, second_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances.all.take(5) - - mock.verify - - _(instances.size).must_equal 5 - end - - it "iterates instances with all and request_limit set" do - mock = Minitest::Mock.new - mock.expect :list_instances, first_page, [{ parent: project_path, page_size: nil, page_token: nil }, ::Gapic::CallOptions] - mock.expect :list_instances, second_page, [{ parent: project_path, page_size: nil, page_token: next_page_options }, ::Gapic::CallOptions] - spanner.service.mocked_instances = mock - - instances = spanner.instances.all(request_limit: 1).to_a - - mock.verify - - _(instances.size).must_equal 6 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/project_test.rb b/google-cloud-spanner/test/google/cloud/spanner/project_test.rb deleted file mode 100644 index 4ebdb67fbdc2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/project_test.rb +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Project, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { - Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) - } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:batch_create_sessions_grpc) { - Google::Cloud::Spanner::V1::BatchCreateSessionsResponse.new session: [session_grpc] - } - - it "knows the project identifier" do - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project_id).must_equal project - end - - it "creates client with database role" do - mock = Minitest::Mock.new - request_session = Google::Cloud::Spanner::V1::Session.new labels: nil, creator_role: "test_role" - mock.expect :batch_create_sessions, batch_create_sessions_grpc, [Hash,::Gapic::CallOptions] - spanner.service.mocked_service = mock - - client = spanner.client instance_id, database_id, pool: { min: 1, max: 1 }, database_role: "test-role" - _(client.database_role).must_equal "test-role" - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/range_test.rb b/google-cloud-spanner/test/google/cloud/spanner/range_test.rb deleted file mode 100644 index 784f207d6fa2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/range_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Range do - it "creates an inclusive range" do - range = Google::Cloud::Spanner::Range.new 1, 100 - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates an exclusive range" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_begin: true, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).must_be :exclude_end? - end - - it "creates a range that excludes beginning" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_begin: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates a range that excludes ending" do - range = Google::Cloud::Spanner::Range.new 1, 100, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).must_be :exclude_end? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/anonymous_struct_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/anonymous_struct_test.rb deleted file mode 100644 index 20f4b3e92dcc..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/anonymous_struct_test.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :anonymous_struct, :mock_spanner do - let :results_hash do - {metadata: - {row_type: - {fields: - [{type: - {code: :ARRAY, - array_element_type: - {code: :STRUCT, - struct_type: - {fields: - [{type:{code: :INT64}}, - {type:{code: :INT64}}]}}}}]}}, - values: - [{list_value: - {values: - [{list_value: - {values:[{string_value: "1"}, {string_value: "2"}]}}]}}]} - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles anonymous structs" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys).must_equal [0] - _(results.fields.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new([:INT64, :INT64])]]] - _(results.fields.to_a).must_equal [[Google::Cloud::Spanner::Fields.new([:INT64, :INT64])]] - _(results.fields.to_h).must_equal({ 0 => [Google::Cloud::Spanner::Fields.new([:INT64, :INT64])] }) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [0] - _(row.values).must_equal [[Google::Cloud::Spanner::Fields.new([:INT64, :INT64]).new([1, 2])]] - _(row.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new([:INT64, :INT64]).new([1, 2])]]] - _(row.to_a).must_equal [[{ 0 => 1, 1 => 2 }]] - _(row.to_h).must_equal({ 0 => [{ 0 => 1, 1 => 2 }] }) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/deeply_nested_list_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/deeply_nested_list_test.rb deleted file mode 100644 index 0ea37d041779..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/deeply_nested_list_test.rb +++ /dev/null @@ -1,201 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :deeply_nested_list, :mock_spanner do - let :results_metadata do - { metadata: - { row_type: - { fields: - [{ type: - { code: :ARRAY, - array_element_type: - { code: :STRUCT, - struct_type: - { fields: - [{ name: "name", type: { code: :STRING}}, - { name: "numbers", type: { code: :ARRAY, array_element_type: { code: :INT64 }}}, - { name: "strings", type: { code: :ARRAY, array_element_type: { code: :STRING }}}] }}}}] }}, - } - end - let :results_values1 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "foo"}, - { list_value: - { values: - [{ string_value: "111"}, - { string_value: "222"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values2 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "333"}] }}, - { list_value: - { values: - [{ string_value: "foo"}, - { string_value: "bar"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values3 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "baz"}] }}] }}, - { list_value: - { values: - [{ string_value: "bar"}, - { list_value: - { values: - [{ string_value: "444"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values4 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "555"}, - { string_value: "666"}] }}, - { list_value: - { values: - [{ string_value: "foo"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values5 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "bar"}, - { string_value: "baz"}] }}] }}, - { list_value: - { values: - [{ string_value: "baz"}, - { list_value: - { values: - [{ string_value: "777"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values6 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "888"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values7 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "999"}] }}, - { list_value: - { values: - [{ string_value: "foo"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values8 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "bar"}] }}] }} - ] }}], - chunked_value: true } - end - let :results_values9 do - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ list_value: - { values: - [{ string_value: "baz"}] }}] }} - ] }}] } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_metadata), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values3), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values4), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values5), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values6), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values7), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values8), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values9)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles nested structs" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys).must_equal [0] - _(results.fields.to_a).must_equal [[Google::Cloud::Spanner::Fields.new({ name: :STRING, numbers: [:INT64], strings: [:STRING] })]] - _(results.fields.to_h).must_equal({ 0 => [Google::Cloud::Spanner::Fields.new({ name: :STRING, numbers: [:INT64], strings: [:STRING] })] }) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [0] - _(row.to_a).must_equal [[{ name: "foo", numbers: [111, 222333], strings: ["foo", "barbaz"] }, - { name: "bar", numbers: [444555, 666], strings: ["foobar", "baz"] }, - { name: "baz", numbers: [777888999], strings: ["foobarbaz"] }]] - _(row.to_h).must_equal({ 0 => [{ name: "foo", numbers: [111, 222333], strings: ["foo", "barbaz"] }, - { name: "bar", numbers: [444555, 666], strings: ["foobar", "baz"] }, - { name: "baz", numbers: [777888999], strings: ["foobarbaz"] }] }) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_struct_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_struct_test.rb deleted file mode 100644 index 6bb9d232dbbe..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_struct_test.rb +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :duplicate_struct, :mock_spanner do - let :results_hash do - {metadata: - {row_type: - {fields: - [{type: - {code: :ARRAY, - array_element_type: - {code: :STRUCT, - struct_type: - {fields: - [{name: "num", type:{code: :INT64}}, - {name: "num", type:{code: :INT64}}]}}}}]}}, - values: - [{list_value: - {values: - [{list_value: - {values:[{string_value: "1"}, {string_value: "2"}]}}]}}]} - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles duplicate structs" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys).must_equal [0] - _(results.fields.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new([[:num, :INT64], [:num, :INT64]])]]] - _(results.fields.to_a).must_equal [[Google::Cloud::Spanner::Fields.new([[:num, :INT64], [:num, :INT64]])]] - results.fields.to_h - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [0] - _(row.values).must_equal [[Google::Cloud::Spanner::Fields.new([[:num, :INT64], [:num, :INT64]]).new([1, 2])]] - _(row.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new([[:num, :INT64], [:num, :INT64]]).new([1, 2])]]] - assert_raises Google::Cloud::Spanner::DuplicateNameError do - row.to_a - end - row.to_a skip_dup_check: true # does not raise - assert_raises Google::Cloud::Spanner::DuplicateNameError do - row.to_h - end - row.to_h skip_dup_check: true # does not raise - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_test.rb deleted file mode 100644 index 5d3f292973e2..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/duplicate_test.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :duplicate, :mock_spanner do - let :results_types do - { - metadata: { - row_type: { - fields: [ - { name: "num", type: { code: :INT64 } }, - { name: "str", type: { code: :INT64 } }, - { name: "num", type: { code: :STRING } }, - { name: "str", type: { code: :STRING } } - ] - } - } - } - end - let :results_values do - { - values: [ - { string_value: "1" }, - { string_value: "2" }, - { string_value: "hello" }, - { string_value: "world" }, - { string_value: "3" }, - { string_value: "4" }, - { string_value: "hola" }, - { string_value: "mundo" } - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_types), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles duplicate names" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - fields = results.fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.types).must_equal [:INT64, :INT64, :STRING, :STRING] - _(fields.keys).must_equal [:num, :str, :num, :str] - _(fields.pairs).must_equal [[:num, :INT64], [:str, :INT64], [:num, :STRING], [:str, :STRING]] - _(fields.to_a).must_equal [:INT64, :INT64, :STRING, :STRING] - assert_raises Google::Cloud::Spanner::DuplicateNameError do - fields.to_h - end - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 2 - _(rows.first.to_a).must_equal [1, 2, "hello", "world"] - _(rows.last.to_a).must_equal [3, 4, "hola", "mundo"] - assert_raises Google::Cloud::Spanner::DuplicateNameError do - rows.first.to_h - end - rows.first.to_h skip_dup_check: true # does not raise - assert_raises Google::Cloud::Spanner::DuplicateNameError do - rows.last.to_h - end - rows.last.to_h skip_dup_check: true # does not raise - _(rows.first.pairs).must_equal [[:num, 1], [:str, 2], [:num, "hello"], [:str, "world"]] - _(rows.last.pairs).must_equal [[:num, 3], [:str, 4], [:num, "hola"], [:str, "mundo"]] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/empty_field_names_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/empty_field_names_test.rb deleted file mode 100644 index 4ab8b8d6fb78..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/empty_field_names_test.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :empty_field_names, :mock_spanner do - let :results_types do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } } - ] - } - } - } - end - let :results_values do - { - values: [ - { string_value: "1" }, - { string_value: "2" }, - { string_value: "3" }, - { string_value: "4" }, - { string_value: "5" }, - { string_value: "6" }, - { string_value: "7" }, - { string_value: "8" } - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_types), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_values)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles empty field names" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - fields = results.fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.types).must_equal [:INT64, :INT64, :INT64, :INT64] - _(fields.keys).must_equal [0, 1, 2, 3] - _(fields.pairs).must_equal [[0, :INT64], [1, :INT64], [2, :INT64], [3, :INT64]] - _(fields.to_a).must_equal [:INT64, :INT64, :INT64, :INT64] - _(fields.to_h).must_equal({ 0=>:INT64, 1=>:INT64, 2=>:INT64, 3=>:INT64 }) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 2 - _(rows.first.to_a).must_equal [1, 2, 3, 4] - _(rows.last.to_a).must_equal [5, 6, 7, 8] - _(rows.first.to_h).must_equal({ 0=>1, 1=>2, 2=>3, 3=>4 }) - _(rows.last.to_h).must_equal({ 0=>5, 1=>6, 2=>7, 3=>8 }) - _(rows.first.pairs).must_equal [[0, 1], [1, 2], [2, 3], [3, 4]] - _(rows.last.pairs).must_equal [[0, 5], [1, 6], [2, 7], [3, 8]] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/empty_fields_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/empty_fields_test.rb deleted file mode 100644 index 9e7701d33061..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/empty_fields_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :empty_fields, :mock_spanner do - let :results_types do - { - metadata: { - row_type: { - fields: [] - } - } - } - end - let :results_values do - { - values: [] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_types)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles empty field names" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - fields = results.fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.types).must_equal [] - _(fields.keys).must_equal [] - _(fields.pairs).must_equal [] - _(fields.to_a).must_equal [] - _(fields.to_h).must_equal({}) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 0 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/empty_rows_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/empty_rows_test.rb deleted file mode 100644 index 54d7b2948fb6..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/empty_rows_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :empty_rows, :mock_spanner do - let :results_types do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } } - ] - } - } - } - end - let :results_values do - { - values: [] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_types)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles empty field names" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - fields = results.fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.types).must_equal [:INT64, :INT64, :INT64, :INT64] - _(fields.keys).must_equal [0, 1, 2, 3] - _(fields.pairs).must_equal [[0, :INT64], [1, :INT64], [2, :INT64], [3, :INT64]] - _(fields.to_a).must_equal [:INT64, :INT64, :INT64, :INT64] - _(fields.to_h).must_equal({ 0=>:INT64, 1=>:INT64, 2=>:INT64, 3=>:INT64 }) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 0 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_single_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_single_test.rb deleted file mode 100644 index 0cc8de9fd43b..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_single_test.rb +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :from_enum, :single_response, :mock_spanner do - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "exists" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_test.rb deleted file mode 100644 index b801e4481854..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/from_enum_test.rb +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :from_enum, :mock_spanner do - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "exists" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/merge_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/merge_test.rb deleted file mode 100644 index ebe548079102..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/merge_test.rb +++ /dev/null @@ -1,224 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :merge, :mock_spanner do - it "merges Strings" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :STRING } }] } }, - values: [{ string_value: "abc" }], - chunked_value: true }, - { values: [{ string_value: "def" }], - chunked_value: true }, - { values: [{ string_value: "ghi" }] } - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal :STRING - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal "abcdefghi" - end - - it "merges String Arrays" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :STRING }}}] }}, - values: [{ list_value: { values: [{ string_value: "abc" }, { string_value: "d" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "ef" }, { string_value: "gh" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "i" }, { string_value: "jkl" }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:STRING] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal ["abc", "def", "ghi", "jkl"] - end - - it "merges String Arrays With Nulls" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :STRING }}}] }}, - values: [{ list_value: { values: [{ string_value: "abc" }, { string_value: "def" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ null_value: "NULL_VALUE" }, { string_value: "ghi" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ null_value: "NULL_VALUE" }, { string_value: "jkl" }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:STRING] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal ["abc", "def", nil, "ghi", nil, "jkl"] - end - - it "merges String Arrays With Empty Strings" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :STRING }}}] }}, - values: [{ list_value: { values: [{ string_value: "abc" }, { string_value: "def" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "" }, { string_value: "ghi" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "" }, { string_value: "jkl" }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:STRING] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal ["abc", "def", "ghi", "jkl"] - end - - it "merges String Arrays With One Large String" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :STRING }}}] }}, - values: [{ list_value: { values: [{ string_value: "abc" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "def" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "ghi" }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:STRING] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal ["abcdefghi"] - end - - it "merges INT64 Arrays" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :INT64 }}}] }}, - values: [{ list_value: { values: [{ string_value: "1" }, { string_value: "2" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "3" }, { string_value: "4" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ null_value: "NULL_VALUE" }, { string_value: "5" }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal [1, 23, 4, nil, 5] - end - - it "merges FLOAT64 Arrays" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :ARRAY, array_element_type: { code: :FLOAT64 }}}] }}, - values: [{ list_value: { values: [{ number_value: 1.0 }, { number_value: 2.0 }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ string_value: "Infinity" }, { string_value: "-Infinity" }, { string_value: "NaN" }] }}], - chunked_value: true }, - { values: [{ list_value: { values: [{ null_value: "NULL_VALUE" }, { number_value: 3.0 }] }}]} - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal [:FLOAT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row[:f1]).must_equal [1.0, 2.0, Float::INFINITY, -Float::INFINITY, Float::NAN, nil, 3.0] - end - - it "merges Multiple Row Chunks/Non Chunks Interleaved" do - results_hashes = [ - { metadata: { row_type: { fields: [{ name: "f1", type: { code: :STRING } }] } }, - values: [{ string_value: "a" }], - chunked_value: true }, - { values: [{ string_value: "b" }, { string_value: "c" }] }, - { values: [{ string_value: "d" }, { string_value: "e" }], - chunked_value: true }, - { values: [{ string_value: "f" }] } - ] - results_enum = results_hashes.map { |hash| Google::Cloud::Spanner::V1::PartialResultSet.new hash }.to_enum - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 1 - _(results.fields[:f1]).must_equal :STRING - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 4 - _(rows.map(&:to_h)).must_equal [{ f1: "ab" }, { f1: "c" }, { f1: "d" }, { f1: "ef" }] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/nested_struct_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/nested_struct_test.rb deleted file mode 100644 index dfe324a4e061..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/nested_struct_test.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :nested_struct, :mock_spanner do - let :results_hash do - {metadata: - {row_type: - {fields: - [{type: - {code: :ARRAY, - array_element_type: - {code: :STRUCT, - struct_type: - {fields: - [{name: "C1", type:{code: :STRING}}, - {name: "C2", type:{code: :INT64}}]}}}}]}}, - values: - [{list_value: - {values: - [{list_value: - {values:[{string_value: "a"}, {string_value: "1"}]}}, - {list_value: - {values:[{string_value: "b"}, {string_value: "2"}]}}]}}]} - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "handles nested structs" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys).must_equal [0] - _(results.fields.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 })]]] - _(results.fields.to_a).must_equal [[Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 })]] - _(results.fields.to_h).must_equal({ 0 => [Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 })] }) - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [0] - _(row.values).must_equal [[Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 }).new(["a", 1]), - Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 }).new(["b", 2])]] - _(row.pairs).must_equal [[0, [Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 }).new(["a", 1]), - Google::Cloud::Spanner::Fields.new({ C1: :STRING, C2: :INT64 }).new(["b", 2])]]] - _(row.to_a).must_equal [[{ C1: "a", C2: 1 }, { C1: "b", C2: 2 }]] - _(row.to_h).must_equal({ 0 => [{ C1: "a", C2: 1 }, { C1: "b", C2: 2 }] }) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/row_count_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/row_count_test.rb deleted file mode 100644 index 0b2b179f1311..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/row_count_test.rb +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :row_count, :mock_spanner do - it "knows exact row count" do - results_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_exact: 1 - ) - ) - ].to_enum - - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - results.rows.to_a # force all results to be processed - - _(results).must_be :row_count_exact? - _(results).wont_be :row_count_lower_bound? - _(results.row_count).must_equal 1 - end - - it "knows lower bound row count" do - results_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_lower_bound: 42 - ) - ) - ].to_enum - - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - results.rows.to_a # force all results to be processed - - _(results).must_be :row_count_lower_bound? - _(results).wont_be :row_count_exact? - _(results.row_count).must_equal 42 - end - - it "does not present row_count if none is provided" do - results_enum = [ - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [] - ) - ].to_enum - - results = Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service - results.rows.to_a # force all results to be processed - - _(results).wont_be :row_count_exact? - _(results).wont_be :row_count_lower_bound? - _(results.row_count).must_be :nil? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/results/timestamp_test.rb b/google-cloud-spanner/test/google/cloud/spanner/results/timestamp_test.rb deleted file mode 100644 index ea33f8ece36b..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/results/timestamp_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Results, :timestamp, :mock_spanner do - let(:time_obj) { Time.parse "2014-10-02T15:01:23.045123456Z" } - let(:timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp time_obj } - let :results_types do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } }, - { type: { code: :INT64 } } - ] - }, - transaction: { - read_timestamp: timestamp - } - } - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_types)].to_enum - end - let(:results) { Google::Cloud::Spanner::Results.from_enum results_enum, spanner.service } - - it "knows it has a timestamp" do - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.timestamp).must_equal time_obj - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/service_test.rb b/google-cloud-spanner/test/google/cloud/spanner/service_test.rb deleted file mode 100644 index d0d373b717c7..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/service_test.rb +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2022 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Service, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - - describe ".new" do - it "sets quota_project with given value" do - expected_quota_project = "test_quota_project" - service = Google::Cloud::Spanner::Service.new( - "test_project", nil, quota_project: expected_quota_project - ) - assert_equal expected_quota_project, service.quota_project - end - - it "sets quota_project from credentials if not given from config" do - expected_quota_project = "test_quota_project" - service = Google::Cloud::Spanner::Service.new( - "test_project", OpenStruct.new(quota_project_id: expected_quota_project) - ) - assert_equal expected_quota_project, service.quota_project - end - - end - - describe ".create_session" do - it "creates session with given database role" do - mock = Minitest::Mock.new - session = Google::Cloud::Spanner::V1::Session.new labels: nil, creator_role: "test_role" - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: session }, default_options] - service = Google::Cloud::Spanner::Service.new( - "test_project", OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new{""})) - ) - service.mocked_service = mock - service.create_session database_path(instance_id, database_id), database_role: "test_role" - mock.verify - end - end - - describe ".batch_create_sessions" do - it "batch creates session with given database role" do - mock = Minitest::Mock.new - session = Google::Cloud::Spanner::V1::Session.new labels: nil, creator_role: "test_role" - mock.expect :batch_create_sessions, OpenStruct.new(session: Array.new(10) { session_grpc }), [{database: database_path(instance_id, database_id), session_count: 10, session_template: session }, default_options] - service = Google::Cloud::Spanner::Service.new( - "test_project", OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new{""})) - ) - service.mocked_service = mock - service.batch_create_sessions database_path(instance_id, database_id), 10, database_role: "test_role" - mock.verify - end - end -end \ No newline at end of file diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/commit_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/commit_test.rb deleted file mode 100644 index 928fb26a4f88..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/commit_test.rb +++ /dev/null @@ -1,268 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:commit_time) { Time.now } - let(:commit_timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp commit_time } - let(:commit_resp) { Google::Cloud::Spanner::V1::CommitResponse.new commit_timestamp: commit_timestamp } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - - it "commits using a block" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ), - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - - session.service.mocked_service = mock - - timestamp = session.commit do |c| - c.update "users", [{ id: 1, name: "Charlie", active: false }] - c.insert "users", [{ id: 2, name: "Harvey", active: true }] - c.upsert "users", [{ id: 3, name: "Marley", active: false }] - c.replace "users", [{ id: 4, name: "Henry", active: true }] - c.delete "users", [1, 2, 3, 4, 5] - end - _(timestamp).must_equal commit_time - - mock.verify - end - - it "updates directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1, "Charlie", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.update "users", [{ id: 1, name: "Charlie", active: false }] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "inserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([2, "Harvey", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.insert "users", [{ id: 2, name: "Harvey", active: true }] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "upserts directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.upsert "users", [{ id: 3, name: "Marley", active: false }] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "upserts using save alias" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - insert_or_update: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([3, "Marley", false]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.save "users", [{ id: 3, name: "Marley", active: false }] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "replaces directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - replace: Google::Cloud::Spanner::V1::Mutation::Write.new( - table: "users", columns: %w(id name active), - values: [Google::Cloud::Spanner::Convert.object_to_grpc_value([4, "Henry", true]).list_value] - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.replace "users", [{ id: 4, name: "Henry", active: true }] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "deletes multiple rows of keys directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [1, 2, 3, 4, 5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.delete "users", [1, 2, 3, 4, 5] - _(timestamp).must_equal commit_time - - mock.verify - end - - it "deletes multiple rows of key ranges directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - ranges: [Google::Cloud::Spanner::Convert.to_key_range(1..100)] - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.delete "users", 1..100 - _(timestamp).must_equal commit_time - - mock.verify - end - - it "deletes a single rows directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new( - keys: [5].map do |i| - Google::Cloud::Spanner::Convert.object_to_grpc_value([i]).list_value - end - ) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.delete "users", 5 - _(timestamp).must_equal commit_time - - mock.verify - end - - it "deletes all rows directly" do - mutations = [ - Google::Cloud::Spanner::V1::Mutation.new( - delete: Google::Cloud::Spanner::V1::Mutation::Delete.new( - table: "users", key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true) - ) - ) - ] - - mock = Minitest::Mock.new - mock.expect :commit, commit_resp, [{ session: session.path, mutations: mutations, transaction_id: nil, single_use_transaction: tx_opts, request_options: nil }, default_options] - session.service.mocked_service = mock - - timestamp = session.delete "users" - _(timestamp).must_equal commit_time - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/execute_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/execute_query_test.rb deleted file mode 100644 index ac3f2d95b738..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/execute_query_test.rb +++ /dev/null @@ -1,311 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :execute_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a simple query" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", options: default_options - - results = session.execute_query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE active = @active", params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, options: default_options - - params, types = params_types({ active: true }) - results = session.execute_query "SELECT * FROM users WHERE active = @active", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE age = @age", params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, options: default_options - - params, types = params_types({ age: 29 }) - results = session.execute_query "SELECT * FROM users WHERE age = @age", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE score = @score", params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, options: default_options - - params, types = params_types({ score: 0.9 }) - results = session.execute_query "SELECT * FROM users WHERE score = @score", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE updated_at = @updated_at", params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, options: default_options - - params, types = params_types({ updated_at: timestamp }) - results = session.execute_query "SELECT * FROM users WHERE updated_at = @updated_at", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE birthday = @birthday", params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, options: default_options - - params, types = params_types({ birthday: date }) - results = session.execute_query "SELECT * FROM users WHERE birthday = @birthday", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE name = @name", params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, options: default_options - - params, types = params_types({ name: "Charlie" }) - results = session.execute_query "SELECT * FROM users WHERE name = @name", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE avatar = @avatar", params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, options: default_options - - params, types = params_types({ avatar: file }) - results = session.execute_query "SELECT * FROM users WHERE avatar = @avatar", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - params, types = params_types({ list: [1,2,3] }) - results = session.execute_query "SELECT * FROM users WHERE project_ids = @list", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - params, types = params_types({ list: [] }, { list: [:INT64] }) - results = session.execute_query "SELECT * FROM users WHERE project_ids = @list", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, options: default_options - - params, types = params_types({ dict: { env: :production } }) - results = session.execute_query "SELECT * FROM users WHERE settings = @dict", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, options: default_options - - params, types = params_types({ dict: { env: "production", score: 0.9, project_ids: [1,2,3] } }) - results = session.execute_query "SELECT * FROM users WHERE settings = @dict", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, options: default_options - - params, types = params_types({ dict: { } }) - results = session.execute_query "SELECT * FROM users WHERE settings = @dict", params: params, types: types - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", options: default_options, query_options: expect_query_options - - results = session.execute_query "SELECT * FROM users", query_options: expect_query_options - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options (session-level)" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - session = Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service, query_options: expect_query_options - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", options: default_options, query_options: expect_query_options - - results = session.execute_query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options that query-level configs merge over session-level configs" do - expect_query_options = { optimizer_version: "2", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - session = Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service, query_options: { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", options: default_options, query_options: expect_query_options - - results = session.execute_query "SELECT * FROM users", query_options: { optimizer_version: "2" } - - mock.verify - - assert_results results - end - - def params_types params, types = nil - Google::Cloud::Spanner::Convert.to_input_params_and_types params, types - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - # results.fields[:project_ids].must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - # row[:project_ids].must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/keepalive_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/keepalive_test.rb deleted file mode 100644 index 4081a5743934..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/keepalive_test.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :keepalive, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { type: { code: :INT64 } } - ] - } - }, - values: [ - { string_value: "1" } - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - let(:labels) { { "env" => "production" } } - let(:session_grpc_labels) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id), labels: labels } - let(:session_labels) { Google::Cloud::Spanner::Session.from_grpc session_grpc_labels, spanner.service } - - it "can call keepalive" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT 1", options: default_options - - session.keepalive! - - mock.verify - end - - it "can recreate itself if error is raised on keepalive" do - mock = Minitest::Mock.new - def results_enum.peek - raise GRPC::NotFound.new 5, "not found" - end - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT 1", options: default_options - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - - result = session.keepalive! - _(result).must_equal false - mock.verify - end - - it "can recreate itself with labels if error is raised on keepalive" do - mock = Minitest::Mock.new - def results_enum.peek - raise GRPC::NotFound.new 5, "not found" - end - session_labels.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_labels.path, "SELECT 1", options: default_options - mock.expect :create_session, session_grpc_labels, [{ database: database_path(instance_id, database_id), session: Google::Cloud::Spanner::V1::Session.new(labels: labels) }, default_options] - - result = session_labels.keepalive! - _(result).must_equal false - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/read_test.rb deleted file mode 100644 index 16e1edd276ad..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/read_test.rb +++ /dev/null @@ -1,214 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:columns) { ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"] } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - - it "can read all rows" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = session.read "my-table", columns, keys: key_set(nil) - - mock.verify - - assert_results results - end - - it "can read rows by id" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: nil, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = session.read "my-table", columns, keys: key_set([1, 2, 3]) - - mock.verify - - assert_results results - end - - it "can read rows with index" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: nil, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = session.read "my-table", columns, keys: key_set([[1,1], [2,2], [3,3]]), index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: nil, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - - session.service.mocked_service = mock - - lookup_range = key_set [1,1]..[3,3] - results = session.read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with limit" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: nil, index: nil, limit: 5, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = session.read "my-table", columns, keys: key_set(nil), limit: 5 - - mock.verify - - assert_results results - end - - it "can read just one row with limit" do - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session.path, table: "my-table", columns: columns, - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value]), - transaction: nil, index: nil, limit: 1, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = session.read "my-table", columns, keys: key_set(1), limit: 1 - - mock.verify - - assert_results results - end - - def key_set keys - Google::Cloud::Spanner::Convert.to_key_set keys - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/release_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/release_test.rb deleted file mode 100644 index c2329bde3d41..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/release_test.rb +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :release, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - - it "can release itself" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{ name: session_grpc.name }, default_options] - session.service.mocked_service = mock - - session.release! - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/session/reload_test.rb b/google-cloud-spanner/test/google/cloud/spanner/session/reload_test.rb deleted file mode 100644 index 51f3c3488534..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/session/reload_test.rb +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :reload, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - - let(:labels) { { "env" => "production" } } - let(:session_grpc_labels) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id), labels: labels } - let(:session_labels) { Google::Cloud::Spanner::Session.from_grpc session_grpc_labels, spanner.service } - - it "can reload itself" do - mock = Minitest::Mock.new - mock.expect :get_session, session_grpc, [{ name: session_grpc.name }, default_options] - session.service.mocked_service = mock - - _(session).must_be_kind_of Google::Cloud::Spanner::Session - - session.reload! - - mock.verify - - _(session).must_be_kind_of Google::Cloud::Spanner::Session - - _(session.project_id).must_equal "test" - _(session.instance_id).must_equal "my-instance-id" - _(session.database_id).must_equal "my-database-id" - _(session.session_id).must_equal "session123" - end - - it "can recreate itself if error is raised on reload" do - mock = Minitest::Mock.new - def mock.get_session *args - grpc_error = GRPC::NotFound.new 5, "not found" - raise Google::Cloud::Error.from_error grpc_error - end - mock.expect :create_session, session_grpc, [{ database: database_path(instance_id, database_id), session: nil }, default_options] - session.service.mocked_service = mock - - _(session).must_be_kind_of Google::Cloud::Spanner::Session - - session.reload! - - mock.verify - - _(session).must_be_kind_of Google::Cloud::Spanner::Session - - _(session.project_id).must_equal "test" - _(session.instance_id).must_equal "my-instance-id" - _(session.database_id).must_equal "my-database-id" - _(session.session_id).must_equal "session123" - end - - it "can recreate itself with labels if error on reload" do - mock = Minitest::Mock.new - def mock.get_session *args - grpc_error = GRPC::NotFound.new 5, "not found" - raise Google::Cloud::Error.from_error grpc_error - end - mock.expect :create_session, session_grpc_labels, [{ database: database_path(instance_id, database_id), session: Google::Cloud::Spanner::V1::Session.new(labels: labels) }, default_options] - session_labels.service.mocked_service = mock - - _(session_labels).must_be_kind_of Google::Cloud::Spanner::Session - - session_labels.reload! - - mock.verify - - _(session_labels).must_be_kind_of Google::Cloud::Spanner::Session - - _(session_labels.project_id).must_equal "test" - _(session_labels.instance_id).must_equal "my-instance-id" - _(session_labels.database_id).must_equal "my-database-id" - _(session_labels.session_id).must_equal "session123" - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/snapshot/execute_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/snapshot/execute_query_test.rb deleted file mode 100644 index 886878ce8ec9..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/snapshot/execute_query_test.rb +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Snapshot, :execute_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:snapshot) { Google::Cloud::Spanner::Snapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a simple query" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options - - results = snapshot.execute_query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE active = @active", params: { active: true } - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE age = @age", params: { age: 29 } - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE score = @score", params: { score: 0.9 } - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE updated_at = @updated_at", params: { updated_at: timestamp } - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE birthday = @birthday", params: { birthday: date } - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE name = @name", params: { name: "Charlie" } - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE avatar = @avatar", params: { avatar: file } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [1,2,3] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: :production } } - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - results = snapshot.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, options: default_options - - struct_fields = snapshot.fields name: :STRING, email: :STRING - results = snapshot.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, options: default_options - - results = snapshot.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { } } - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: default_options, query_options: expect_query_options - - results = snapshot.execute_query "SELECT * FROM users", query_options: expect_query_options - - mock.verify - - assert_results results - end - - it "can execute a query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "SELECT * FROM users", transaction: tx_selector, options: expect_options - - results = snapshot.execute_query "SELECT * FROM users", call_options: call_options - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/snapshot/metadata_test.rb b/google-cloud-spanner/test/google/cloud/spanner/snapshot/metadata_test.rb deleted file mode 100644 index 16b521bccb0c..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/snapshot/metadata_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Snapshot, :metadata, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:time_obj) { Time.parse "2014-10-02T15:01:23.045123456Z" } - let(:timestamp) { Google::Cloud::Spanner::Convert.time_to_timestamp time_obj } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id, read_timestamp: timestamp } - let(:snapshot) { Google::Cloud::Spanner::Snapshot.from_grpc transaction_grpc, session } - - it "knows it has a transaction_id" do - _(snapshot).must_be_kind_of Google::Cloud::Spanner::Snapshot - - _(snapshot.transaction_id).must_equal transaction_id - end - - it "knows it has a timestamp" do - _(snapshot).must_be_kind_of Google::Cloud::Spanner::Snapshot - - _(snapshot.timestamp).must_equal time_obj - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/snapshot/range_test.rb b/google-cloud-spanner/test/google/cloud/spanner/snapshot/range_test.rb deleted file mode 100644 index 4d465e271d06..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/snapshot/range_test.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Snapshot, :range, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:snapshot) { Google::Cloud::Spanner::Snapshot.from_grpc transaction_grpc, session } - - it "creates an inclusive range" do - range = snapshot.range 1, 100 - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates an exclusive range" do - range = snapshot.range 1, 100, exclude_begin: true, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).must_be :exclude_end? - end - - it "creates a range that excludes beginning" do - range = snapshot.range 1, 100, exclude_begin: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates a range that excludes ending" do - range = snapshot.range 1, 100, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).must_be :exclude_end? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/snapshot/read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/snapshot/read_test.rb deleted file mode 100644 index 0a5325b91821..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/snapshot/read_test.rb +++ /dev/null @@ -1,260 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Snapshot, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:snapshot) { Google::Cloud::Spanner::Snapshot.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - - it "can read all rows" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns - - mock.verify - - assert_results results - end - - it "can read rows by id" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns, keys: [1, 2, 3] - - mock.verify - - assert_results results - end - - it "can read rows with index" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - lookup_range = snapshot.range [1,1], [3,3] - results = snapshot.read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: 5, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns, limit: 5 - - mock.verify - - assert_results results - end - - it "can read just one row with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value]), - transaction: tx_selector, index: nil, limit: 1, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns, keys: 1, limit: 1 - - mock.verify - - assert_results results - end - - it "can read all rows with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, expect_options] - session.service.mocked_service = mock - - results = snapshot.read "my-table", columns, call_options: call_options - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/status_test.rb b/google-cloud-spanner/test/google/cloud/spanner/status_test.rb deleted file mode 100644 index ca3129a3ef8c..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/status_test.rb +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Status do - let(:msg) { "The status message." } - - it "supports code 0" do - status = from_grpc 0 - _(status.code).must_equal 0 - _(status.description).must_equal "OK" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 1" do - status = from_grpc 1 - _(status.code).must_equal 1 - _(status.description).must_equal "CANCELLED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 2" do - status = from_grpc 2 - _(status.code).must_equal 2 - _(status.description).must_equal "UNKNOWN" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 3" do - status = from_grpc 3 - _(status.code).must_equal 3 - _(status.description).must_equal "INVALID_ARGUMENT" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 4" do - status = from_grpc 4 - _(status.code).must_equal 4 - _(status.description).must_equal "DEADLINE_EXCEEDED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 5" do - status = from_grpc 5 - _(status.code).must_equal 5 - _(status.description).must_equal "NOT_FOUND" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 6" do - status = from_grpc 6 - _(status.code).must_equal 6 - _(status.description).must_equal "ALREADY_EXISTS" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 7" do - status = from_grpc 7 - _(status.code).must_equal 7 - _(status.description).must_equal "PERMISSION_DENIED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 8" do - status = from_grpc 8 - _(status.code).must_equal 8 - _(status.description).must_equal "RESOURCE_EXHAUSTED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 9" do - status = from_grpc 9 - _(status.code).must_equal 9 - _(status.description).must_equal "FAILED_PRECONDITION" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 10" do - status = from_grpc 10 - _(status.code).must_equal 10 - _(status.description).must_equal "ABORTED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 11" do - status = from_grpc 11 - _(status.code).must_equal 11 - _(status.description).must_equal "OUT_OF_RANGE" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 12" do - status = from_grpc 12 - _(status.code).must_equal 12 - _(status.description).must_equal "UNIMPLEMENTED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 13" do - status = from_grpc 13 - _(status.code).must_equal 13 - _(status.description).must_equal "INTERNAL" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 14" do - status = from_grpc 14 - _(status.code).must_equal 14 - _(status.description).must_equal "UNAVAILABLE" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 15" do - status = from_grpc 15 - _(status.code).must_equal 15 - _(status.description).must_equal "DATA_LOSS" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - it "supports code 16" do - status = from_grpc 16 - _(status.code).must_equal 16 - _(status.description).must_equal "UNAUTHENTICATED" - _(status.message).must_equal msg - _(status.details).must_equal [] - end - - def from_grpc code - Google::Cloud::Spanner::Status.from_grpc grpc_status(code) - end - - def grpc_status code - Google::Rpc::Status.new( - code: code, - message: msg - ) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/batch_update_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/batch_update_test.rb deleted file mode 100644 index 64758341d1c7..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/batch_update_test.rb +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 2019 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :batch_update, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:timestamp) { Time.parse "2017-01-01 20:04:05.06 -0700" } - let(:date) { Date.parse "2017-01-02" } - let(:file) { StringIO.new "contents" } - - it "can execute a single DML query" do - mock = Minitest::Mock.new - mock.expect :execute_batch_dml, batch_response_grpc, [{ - session: session_grpc.name, transaction: tx_selector, - statements: [statement_grpc("UPDATE users SET active = true")], - seqno: 1, request_options: nil - }, default_options] - session.service.mocked_service = mock - - row_counts = transaction.batch_update do |b| - b.batch_update "UPDATE users SET active = true" - end - - mock.verify - - _(row_counts.count).must_equal 1 - _(row_counts.first).must_equal 1 - end - - it "can execute a DML query with multiple statements and param types" do - mock = Minitest::Mock.new - statements = [] - statements << statement_grpc("UPDATE users SET active = @active", params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }) - statements << statement_grpc("UPDATE users SET age = @age", params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }) - statements << statement_grpc("UPDATE users SET score = @score", params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }) - statements << statement_grpc("UPDATE users SET updated_at = @updated_at", params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }) - statements << statement_grpc("UPDATE users SET birthday = @birthday", params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }) - statements << statement_grpc("UPDATE users SET name = @name", params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }) - statements << statement_grpc("UPDATE users SET avatar = @avatar", params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }) - statements << statement_grpc("UPDATE users SET project_ids = @list", params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }) - statements << statement_grpc("UPDATE users SET settings = @dict", params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }) - mock.expect :execute_batch_dml, batch_response_grpc(9), [{ - session: session_grpc.name, transaction: tx_selector, statements: statements, - seqno: 1, request_options: nil - }, default_options] - session.service.mocked_service = mock - - row_counts = transaction.batch_update do |b| - b.batch_update "UPDATE users SET active = @active", params: { active: true } - b.batch_update "UPDATE users SET age = @age", params: { age: 29 } - b.batch_update "UPDATE users SET score = @score", params: { score: 0.9 } - b.batch_update "UPDATE users SET updated_at = @updated_at", params: { updated_at: timestamp } - b.batch_update "UPDATE users SET birthday = @birthday", params: { birthday: date } - b.batch_update "UPDATE users SET name = @name", params: { name: "Charlie" } - b.batch_update "UPDATE users SET avatar = @avatar", params: { avatar: file } - b.batch_update "UPDATE users SET project_ids = @list", params: { list: [1,2,3] } - b.batch_update "UPDATE users SET settings = @dict", params: { dict: { env: :production } } - end - - mock.verify - - _(row_counts.count).must_equal 9 - _(row_counts.first).must_equal 1 - _(row_counts.last).must_equal 1 - end - - it "raises ArgumentError if no block is provided" do - err = expect do - transaction.batch_update - end.must_raise ArgumentError - _(err.message).must_equal "block is required" - end - - describe "when used with execute_update" do - def results_grpc - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_exact: 1 - ) - ) - end - - def results_enum - Array(results_grpc).to_enum - end - - it "increases seqno for each request" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, seqno: 1, options: default_options - statement = statement_grpc("UPDATE users SET age = @age", params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }) - mock.expect :execute_batch_dml, batch_response_grpc, [{ session: session_grpc.name, transaction: tx_selector, statements: [statement], seqno: 2, request_options: nil }, default_options] - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = false", transaction: tx_selector, seqno: 3, options: default_options - - transaction.execute_update "UPDATE users SET active = true" - transaction.batch_update do |b| - b.batch_update "UPDATE users SET age = @age", params: { age: 29 } - end - transaction.execute_update "UPDATE users SET active = false" - - mock.verify - end - end - - it "can execute a single DML query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - mock.expect :execute_batch_dml, batch_response_grpc, [{ session: session_grpc.name, transaction: tx_selector, statements: [statement_grpc("UPDATE users SET active = true")], seqno: 1, request_options: nil }, expect_options] - session.service.mocked_service = mock - - row_counts = transaction.batch_update call_options: call_options do |b| - b.batch_update "UPDATE users SET active = true" - end - - mock.verify - - _(row_counts.count).must_equal 1 - _(row_counts.first).must_equal 1 - end - - describe "priority request options" do - it "can execute a DML query" do - mock = Minitest::Mock.new - statements = [ - statement_grpc( - "UPDATE users SET active = @active", - params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), - param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) } - ) - ] - mock.expect :execute_batch_dml, batch_response_grpc(1), [{ - session: session_grpc.name, transaction: tx_selector, statements: statements, - seqno: 1, request_options: { priority: :PRIORITY_MEDIUM} - }, default_options] - session.service.mocked_service = mock - - row_counts = transaction.batch_update request_options: { priority: :PRIORITY_MEDIUM} do |b| - b.batch_update "UPDATE users SET active = @active", params: { active: true } - end - - mock.verify - - _(row_counts.count).must_equal 1 - end - end - - it "can execute a barch DML with transaction and request tag" do - transaction = Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session - transaction.transaction_tag = "Tag-1" - - mock = Minitest::Mock.new - mock.expect :execute_batch_dml, batch_response_grpc, [{ - session: session_grpc.name, transaction: tx_selector, - statements: [statement_grpc("UPDATE users SET active = true")], seqno: 1, - request_options: { transaction_tag: "Tag-1", request_tag: "Tag-1-1" } - }, default_options] - session.service.mocked_service = mock - - request_options = { tag: "Tag-1-1" } - row_counts = transaction.batch_update request_options: request_options do |b| - b.batch_update "UPDATE users SET active = true" - end - - mock.verify - - _(row_counts.count).must_equal 1 - _(row_counts.first).must_equal 1 - end - - def statement_grpc sql, params: nil, param_types: {} - Google::Cloud::Spanner::V1::ExecuteBatchDmlRequest::Statement.new \ - sql: sql, params: params, param_types: param_types - end - - def batch_result_sets_grpc count, row_count_exact: 1 - count.times.map do - Google::Cloud::Spanner::V1::ResultSet.new( - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_exact: row_count_exact - ) - ) - end - end - - def batch_response_grpc count = 1 - Google::Cloud::Spanner::V1::ExecuteBatchDmlResponse.new( - result_sets: batch_result_sets_grpc(count), - status: Google::Rpc::Status.new(code: 0) - ) - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/commit_timestamp_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/commit_timestamp_test.rb deleted file mode 100644 index 2a69b747c80f..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/commit_timestamp_test.rb +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :commit_timestamp, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - - it "creates a commit_timestamp column value" do - column_value = transaction.commit_timestamp - - _(column_value).must_be_kind_of Google::Cloud::Spanner::ColumnValue - _(column_value.type).must_equal :commit_timestamp - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_query_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_query_test.rb deleted file mode 100644 index b558d2e10d33..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_query_test.rb +++ /dev/null @@ -1,336 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :execute_query, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - }, - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" }, - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a simple query" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users" - - mock.verify - - assert_results results - end - - it "can execute a query with bool param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE active = @active", params: { active: true } - - mock.verify - - assert_results results - end - - it "can execute a query with int param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE age = @age", params: { age: 29 } - - mock.verify - - assert_results results - end - - it "can execute a query with float param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE score = @score", params: { score: 0.9 } - - mock.verify - - assert_results results - end - - it "can execute a query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE updated_at = @updated_at", params: { updated_at: timestamp } - - mock.verify - - assert_results results - end - - it "can execute a query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE birthday = @birthday", params: { birthday: date } - - mock.verify - - assert_results results - end - - it "can execute a query with String param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE name = @name", params: { name: "Charlie" } - - mock.verify - - assert_results results - end - - it "can execute a query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE avatar = @avatar", params: { avatar: file } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [1,2,3] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - assert_results results - end - - it "can execute a query with a simple Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: :production } } - - mock.verify - - assert_results results - end - - it "can execute a query with a complex Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of Hashes" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, seqno: 1, options: default_options - - results = transaction.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [{ name: "mike", email: "mike@example.net" }, { name: "chris", email: "chris@example.net" }] } - - mock.verify - - assert_results results - end - - it "can execute a query with an Array of STRUCTs" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "data" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "mike"), Google::Protobuf::Value.new(string_value: "mike@example.net")] )), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "chris"), Google::Protobuf::Value.new(string_value: "chris@example.net")] ))] )) } ), param_types: { "data" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [ Google::Cloud::Spanner::V1::StructType::Field.new(name: "name", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "email", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))] ))) }, seqno: 1, options: default_options - - struct_fields = transaction.fields name: :STRING, email: :STRING - results = transaction.execute "SELECT * FROM users WHERE STRUCT(name, email) IN UNNEST(@data)", params: { data: [struct_fields.data(["mike", "mike@example.net"]), struct_fields.data(["chris","chris@example.net"])] } - - mock.verify - - assert_results results - end - - it "can execute a query with an empty Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, seqno: 1, options: default_options - - results = transaction.execute_query "SELECT * FROM users WHERE settings = @dict", params: { dict: { } } - - mock.verify - - assert_results results - end - - it "can execute a simple query with query options" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: default_options, query_options: expect_query_options - - results = transaction.execute_query "SELECT * FROM users", query_options: expect_query_options - - mock.verify - - assert_results results - end - - it "can execute a simple query with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", transaction: tx_selector, seqno: 1, options: expect_options - - results = transaction.execute_query "SELECT * FROM users", call_options: call_options - - mock.verify - - assert_results results - end - - it "execute query with transaction and request tag" do - transaction = Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session - transaction.transaction_tag = "Tag-1" - mock = Minitest::Mock.new - session.service.mocked_service = mock - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users", - transaction: tx_selector, seqno: 1, - request_options: { transaction_tag: "Tag-1", request_tag: "Tag-1-1"}, - options: default_options - - transaction.execute_query "SELECT * FROM users", - request_options: { tag: "Tag-1-1"} - mock.verify - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_update_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_update_test.rb deleted file mode 100644 index 5e1a882942f4..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/execute_update_test.rb +++ /dev/null @@ -1,293 +0,0 @@ -# Copyright 2018 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :execute_update, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:results_grpc) { - Google::Cloud::Spanner::V1::PartialResultSet.new( - metadata: Google::Cloud::Spanner::V1::ResultSetMetadata.new( - row_type: Google::Cloud::Spanner::V1::StructType.new( - fields: [] - ) - ), - values: [], - stats: Google::Cloud::Spanner::V1::ResultSetStats.new( - row_count_exact: 1 - ) - ) - } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can execute a DML query" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET active = true" - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with bool param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = @active", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "active" => Google::Protobuf::Value.new(bool_value: true) }), param_types: { "active" => Google::Cloud::Spanner::V1::Type.new(code: :BOOL) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET active = @active", params: { active: true } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with int param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET age = @age", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "age" => Google::Protobuf::Value.new(string_value: "29") }), param_types: { "age" => Google::Cloud::Spanner::V1::Type.new(code: :INT64) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET age = @age", params: { age: 29 } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with float param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET score = @score", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "score" => Google::Protobuf::Value.new(number_value: 0.9) }), param_types: { "score" => Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET score = @score", params: { score: 0.9 } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with Time param" do - timestamp = Time.parse "2017-01-01 20:04:05.06 -0700" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET updated_at = @updated_at", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "updated_at" => Google::Protobuf::Value.new(string_value: "2017-01-02T03:04:05.060000000Z") }), param_types: { "updated_at" => Google::Cloud::Spanner::V1::Type.new(code: :TIMESTAMP) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET updated_at = @updated_at", params: { updated_at: timestamp } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with Date param" do - date = Date.parse "2017-01-02" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET birthday = @birthday", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "birthday" => Google::Protobuf::Value.new(string_value: "2017-01-02") }), param_types: { "birthday" => Google::Cloud::Spanner::V1::Type.new(code: :DATE) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET birthday = @birthday", params: { birthday: date } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with String param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET name = @name", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "name" => Google::Protobuf::Value.new(string_value: "Charlie") }), param_types: { "name" => Google::Cloud::Spanner::V1::Type.new(code: :STRING) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET name = @name", params: { name: "Charlie" } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with IO-ish param" do - file = StringIO.new "contents" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET avatar = @avatar", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "avatar" => Google::Protobuf::Value.new(string_value: Base64.strict_encode64("contents")) }), param_types: { "avatar" => Google::Cloud::Spanner::V1::Type.new(code: :BYTES) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET avatar = @avatar", params: { avatar: file } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with an Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET project_ids = @list", params: { list: [1,2,3] } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with an empty Array param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET project_ids = @list", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "list" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "list" => Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET project_ids = @list", params: { list: [] }, types: { list: [:INT64] } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with a simple Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production")])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING))])) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET settings = @dict", params: { dict: { env: :production } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with a complex Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session.path, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "production"), Google::Protobuf::Value.new(number_value: 0.9), Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [Google::Protobuf::Value.new(string_value: "1"), Google::Protobuf::Value.new(string_value: "2"), Google::Protobuf::Value.new(string_value: "3")] )) ])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [Google::Cloud::Spanner::V1::StructType::Field.new(name: "env", type: Google::Cloud::Spanner::V1::Type.new(code: :STRING)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "score", type: Google::Cloud::Spanner::V1::Type.new(code: :FLOAT64)), Google::Cloud::Spanner::V1::StructType::Field.new(name: "project_ids", type: Google::Cloud::Spanner::V1::Type.new(code: :ARRAY, array_element_type: Google::Cloud::Spanner::V1::Type.new(code: :INT64)))] )) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET settings = @dict", params: { dict: { env: "production", score: 0.9, project_ids: [1,2,3] } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query with an empty Hash param" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET settings = @dict", transaction: tx_selector, params: Google::Protobuf::Struct.new(fields: { "dict" => Google::Protobuf::Value.new(list_value: Google::Protobuf::ListValue.new(values: [])) }), param_types: { "dict" => Google::Cloud::Spanner::V1::Type.new(code: :STRUCT, struct_type: Google::Cloud::Spanner::V1::StructType.new(fields: [])) }, seqno: 1, options: default_options - - row_count = transaction.execute_update "UPDATE users SET settings = @dict", params: { dict: { } } - - mock.verify - - _(row_count).must_equal 1 - end - - it "raises InvalidArgumentError if the response does not contain stats" do - no_stats_results_grpc = results_grpc.dup - no_stats_results_grpc.stats = nil - no_stats_results_enum = Array(no_stats_results_grpc).to_enum - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql no_stats_results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, seqno: 1, options: default_options - - err = expect do - transaction.execute_update "UPDATE users SET active = true" - end.must_raise Google::Cloud::InvalidArgumentError - - mock.verify - end - - it "can execute a DML query with query options" do - expect_query_options = { optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, seqno: 1, options: default_options, query_options: expect_query_options - - row_count = transaction.execute_update "UPDATE users SET active = true", query_options: expect_query_options - - mock.verify - - _(row_count).must_equal 1 - end - - it "can execute a DML query" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", transaction: tx_selector, seqno: 1, options: expect_options - - row_count = transaction.execute_update "UPDATE users SET active = true", call_options: call_options - - mock.verify - - _(row_count).must_equal 1 - end - - describe "priority request options" do - it "can execute a DML query" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, - "UPDATE users SET active = true", - transaction: tx_selector, seqno: 1, - request_options: { priority: :PRIORITY_MEDIUM }, - options: default_options - - row_count = transaction.execute_update "UPDATE users SET active = true", - request_options: { priority: :PRIORITY_MEDIUM } - - mock.verify - - _(row_count).must_equal 1 - end - end - - it "execute a DML query with transaction and request tag" do - transaction = Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session - transaction.transaction_tag = "Tag-2" - - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "UPDATE users SET active = true", - transaction: tx_selector, seqno: 1, - request_options: { transaction_tag: "Tag-2", request_tag: "Tag-2-1" }, - options: default_options - - row_count = transaction.execute_update "UPDATE users SET active = true", - request_options: { tag: "Tag-2-1" } - - mock.verify - - _(row_count).must_equal 1 - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/fields_for_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/fields_for_test.rb deleted file mode 100644 index 0480e1b21fad..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/fields_for_test.rb +++ /dev/null @@ -1,77 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :fields_for, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let(:results_grpc) { Google::Cloud::Spanner::V1::PartialResultSet.new results_hash } - let(:results_enum) { Array(results_grpc).to_enum } - - it "can get a table's fields" do - mock = Minitest::Mock.new - session.service.mocked_service = mock - expect_execute_streaming_sql results_enum, session_grpc.name, "SELECT * FROM users WHERE 1 = 0", transaction: tx_selector, seqno: 1, options: default_options - - fields = transaction.fields_for "users" - - mock.verify - - assert_fields fields - end - - def assert_fields fields - _(fields).wont_be :nil? - _(fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(fields.keys.count).must_equal 9 - _(fields[:id]).must_equal :INT64 - _(fields[:name]).must_equal :STRING - _(fields[:active]).must_equal :BOOL - _(fields[:age]).must_equal :INT64 - _(fields[:score]).must_equal :FLOAT64 - _(fields[:updated_at]).must_equal :TIMESTAMP - _(fields[:birthday]).must_equal :DATE - _(fields[:avatar]).must_equal :BYTES - _(fields[:project_ids]).must_equal [:INT64] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/keepalive_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/keepalive_test.rb deleted file mode 100644 index e186cf032360..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/keepalive_test.rb +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :keepalive, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let(:tx_opts) { Google::Cloud::Spanner::V1::TransactionOptions.new(read_write: Google::Cloud::Spanner::V1::TransactionOptions::ReadWrite.new) } - - it "creates new transaction when calling keepalive" do - mock = Minitest::Mock.new - mock.expect :begin_transaction, transaction_grpc, [{ - session: session_grpc.name, options: tx_opts, request_options: nil - }, default_options] - spanner.service.mocked_service = mock - - transaction.keepalive! - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/range_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/range_test.rb deleted file mode 100644 index 028bdd2ae530..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/range_test.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :range, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - - it "creates an inclusive range" do - range = transaction.range 1, 100 - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates an exclusive range" do - range = transaction.range 1, 100, exclude_begin: true, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).must_be :exclude_end? - end - - it "creates a range that excludes beginning" do - range = transaction.range 1, 100, exclude_begin: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).must_be :exclude_begin? - _(range).wont_be :exclude_end? - end - - it "creates a range that excludes ending" do - range = transaction.range 1, 100, exclude_end: true - - _(range.begin).must_equal 1 - _(range.end).must_equal 100 - - _(range).wont_be :exclude_begin? - _(range).must_be :exclude_end? - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/read_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/read_test.rb deleted file mode 100644 index 302751a141f1..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/read_test.rb +++ /dev/null @@ -1,283 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :read, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:tx_selector) { Google::Cloud::Spanner::V1::TransactionSelector.new id: transaction_id } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - let :results_hash1 do - { - metadata: { - row_type: { - fields: [ - { name: "id", type: { code: :INT64 } }, - { name: "name", type: { code: :STRING } }, - { name: "active", type: { code: :BOOL } }, - { name: "age", type: { code: :INT64 } }, - { name: "score", type: { code: :FLOAT64 } }, - { name: "updated_at", type: { code: :TIMESTAMP } }, - { name: "birthday", type: { code: :DATE} }, - { name: "avatar", type: { code: :BYTES } }, - { name: "project_ids", type: { code: :ARRAY, - array_element_type: { code: :INT64 } } } - ] - } - } - } - end - let :results_hash2 do - { - values: [ - { string_value: "1" }, - { string_value: "Charlie" }, - { bool_value: true}, - { string_value: "29" }, - { number_value: 0.9 }, - { string_value: "2017-01-02T03:04:05.060000000Z" }, - { string_value: "1950-01-01" }, - { string_value: "aW1hZ2U=" } - ] - } - end - let :results_hash3 do - { - values: [ - { list_value: { values: [ { string_value: "1"}, - { string_value: "2"}, - { string_value: "3"} ]}} - ] - } - end - let(:results_enum) do - [Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash1), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash2), - Google::Cloud::Spanner::V1::PartialResultSet.new(results_hash3)].to_enum - end - - it "can read all rows" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns - - mock.verify - - assert_results results - end - - it "can read rows by id" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3]).list_value]), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, keys: [1, 2, 3] - - mock.verify - - assert_results results - end - - it "can read rows with index" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1,1]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([2,2]).list_value, Google::Cloud::Spanner::Convert.object_to_grpc_value([3,3]).list_value]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, keys: [[1,1], [2,2], [3,3]], index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with index and range" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(ranges: [Google::Cloud::Spanner::Convert.to_key_range([1,1]..[3,3])]), - transaction: tx_selector, index: "MyTableCompositeKey", limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - lookup_range = transaction.range [1,1], [3,3] - results = transaction.read "my-table", columns, keys: lookup_range, index: "MyTableCompositeKey" - - mock.verify - - assert_results results - end - - it "can read rows with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: 5, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, limit: 5 - - mock.verify - - assert_results results - end - - it "can read just one row with limit" do - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(keys: [Google::Cloud::Spanner::Convert.object_to_grpc_value([1]).list_value]), - transaction: tx_selector, index: nil, limit: 1, resume_token: nil, partition_token: nil, - request_options: nil - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, keys: 1, limit: 1 - - mock.verify - - assert_results results - end - - it "can read all rows with custom timeout and retry policy" do - timeout = 30 - retry_policy = { - initial_delay: 0.25, - max_delay: 32.0, - multiplier: 1.3, - retry_codes: ["UNAVAILABLE"] - } - expect_options = default_options.merge timeout: timeout, retry_policy: retry_policy - call_options = { timeout: timeout, retry_policy: retry_policy } - - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: nil - }, expect_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, call_options: call_options - - mock.verify - - assert_results results - end - - it "execute read with transaction and request tag" do - transaction = Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session - transaction.transaction_tag = "Tag-1" - columns = [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - - mock = Minitest::Mock.new - mock.expect :streaming_read, results_enum, [{ - session: session_grpc.name, table: "my-table", - columns: ["id", "name", "active", "age", "score", "updated_at", "birthday", "avatar", "project_ids"], - key_set: Google::Cloud::Spanner::V1::KeySet.new(all: true), - transaction: tx_selector, index: nil, limit: nil, resume_token: nil, partition_token: nil, - request_options: { transaction_tag: "Tag-1", request_tag: "Tag-1-1" } - }, default_options] - session.service.mocked_service = mock - - results = transaction.read "my-table", columns, - request_options: { tag: "Tag-1-1" } - - mock.verify - - assert_results results - end - - def assert_results results - _(results).must_be_kind_of Google::Cloud::Spanner::Results - - _(results.fields).wont_be :nil? - _(results.fields).must_be_kind_of Google::Cloud::Spanner::Fields - _(results.fields.keys.count).must_equal 9 - _(results.fields[:id]).must_equal :INT64 - _(results.fields[:name]).must_equal :STRING - _(results.fields[:active]).must_equal :BOOL - _(results.fields[:age]).must_equal :INT64 - _(results.fields[:score]).must_equal :FLOAT64 - _(results.fields[:updated_at]).must_equal :TIMESTAMP - _(results.fields[:birthday]).must_equal :DATE - _(results.fields[:avatar]).must_equal :BYTES - _(results.fields[:project_ids]).must_equal [:INT64] - - rows = results.rows.to_a # grab them all from the enumerator - _(rows.count).must_equal 1 - row = rows.first - _(row).must_be_kind_of Google::Cloud::Spanner::Data - _(row.keys).must_equal [:id, :name, :active, :age, :score, :updated_at, :birthday, :avatar, :project_ids] - _(row[:id]).must_equal 1 - _(row[:name]).must_equal "Charlie" - _(row[:active]).must_equal true - _(row[:age]).must_equal 29 - _(row[:score]).must_equal 0.9 - _(row[:updated_at]).must_equal Time.parse("2017-01-02T03:04:05.060000000Z") - _(row[:birthday]).must_equal Date.parse("1950-01-01") - _(row[:avatar]).must_be_kind_of StringIO - _(row[:avatar].read).must_equal "image" - _(row[:project_ids]).must_equal [1, 2, 3] - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/release_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/release_test.rb deleted file mode 100644 index aece23a22e11..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/release_test.rb +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Session, :release, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - let(:default_options) { ::Gapic::CallOptions.new metadata: { "google-cloud-resource-prefix" => database_path(instance_id, database_id) } } - - it "can release itself" do - mock = Minitest::Mock.new - mock.expect :delete_session, nil, [{ name: session_grpc.name}, default_options] - spanner.service.mocked_service = mock - - transaction.release! - - mock.verify - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner/transaction/transaction_id_test.rb b/google-cloud-spanner/test/google/cloud/spanner/transaction/transaction_id_test.rb deleted file mode 100644 index f6f7e0c71a16..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner/transaction/transaction_id_test.rb +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud::Spanner::Transaction, :transaction_id, :mock_spanner do - let(:instance_id) { "my-instance-id" } - let(:database_id) { "my-database-id" } - let(:session_id) { "session123" } - let(:session_grpc) { Google::Cloud::Spanner::V1::Session.new name: session_path(instance_id, database_id, session_id) } - let(:session) { Google::Cloud::Spanner::Session.from_grpc session_grpc, spanner.service } - let(:transaction_id) { "tx789" } - let(:transaction_grpc) { Google::Cloud::Spanner::V1::Transaction.new id: transaction_id } - let(:transaction) { Google::Cloud::Spanner::Transaction.from_grpc transaction_grpc, session } - - it "knows it has a timestamp" do - _(transaction).must_be_kind_of Google::Cloud::Spanner::Transaction - - _(transaction.transaction_id).must_equal transaction_id - end -end diff --git a/google-cloud-spanner/test/google/cloud/spanner_test.rb b/google-cloud-spanner/test/google/cloud/spanner_test.rb deleted file mode 100644 index 522a0fbfdc69..000000000000 --- a/google-cloud-spanner/test/google/cloud/spanner_test.rb +++ /dev/null @@ -1,805 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "helper" - -describe Google::Cloud do - describe "#spanner" do - it "calls out to Google::Cloud.spanner" do - gcloud = Google::Cloud.new - stubbed_spanner = ->(project, keyfile, scope: nil, timeout: nil, host: nil, lib_name: nil, lib_version: nil) { - _(project).must_be :nil? - _(keyfile).must_be :nil? - _(scope).must_be :nil? - _(timeout).must_be :nil? - _(host).must_be :nil? - _(lib_name).must_be :nil? - _(lib_version).must_be :nil? - "spanner-project-object-empty" - } - Google::Cloud.stub :spanner, stubbed_spanner do - project = gcloud.spanner - _(project).must_equal "spanner-project-object-empty" - end - end - - it "passes project and keyfile to Google::Cloud.spanner" do - gcloud = Google::Cloud.new "project-id", "keyfile-path" - stubbed_spanner = ->(project, keyfile, scope: nil, timeout: nil, host: nil, lib_name: nil, lib_version: nil) { - _(project).must_equal "project-id" - _(keyfile).must_equal "keyfile-path" - _(scope).must_be :nil? - _(timeout).must_be :nil? - _(host).must_be :nil? - _(lib_name).must_be :nil? - _(lib_version).must_be :nil? - "spanner-project-object" - } - Google::Cloud.stub :spanner, stubbed_spanner do - project = gcloud.spanner - _(project).must_equal "spanner-project-object" - end - end - - it "passes project and keyfile and options to Google::Cloud.spanner" do - gcloud = Google::Cloud.new "project-id", "keyfile-path" - stubbed_spanner = ->(project, keyfile, scope: nil, timeout: nil, host: nil, lib_name: nil, lib_version: nil) { - _(project).must_equal "project-id" - _(keyfile).must_equal "keyfile-path" - _(scope).must_equal "http://example.com/scope" - _(timeout).must_equal 60 - _(host).must_be :nil? - _(lib_name).must_be :nil? - _(lib_version).must_be :nil? - "spanner-project-object-scoped" - } - Google::Cloud.stub :spanner, stubbed_spanner do - project = gcloud.spanner scope: "http://example.com/scope", timeout: 60 - _(project).must_equal "spanner-project-object-scoped" - end - end - - it "passes lib name and version to Google::Cloud.spanner" do - gcloud = Google::Cloud.new - stubbed_spanner = ->(project, keyfile, scope: nil, timeout: nil, host: nil, lib_name: nil, lib_version: nil) { - _(project).must_be :nil? - _(keyfile).must_be :nil? - _(scope).must_be :nil? - _(timeout).must_be :nil? - _(host).must_be :nil? - _(lib_name).must_equal "spanner-ruby" - _(lib_version).must_equal "1.0.0" - "spanner-project-object-with-lib-version-name" - } - Google::Cloud.stub :spanner, stubbed_spanner do - project = gcloud.spanner lib_name: "spanner-ruby", lib_version: "1.0.0" - _(project).must_equal "spanner-project-object-with-lib-version-name" - end - end - end - - describe ".spanner" do - let(:default_credentials) do - creds = OpenStruct.new empty: true - def creds.is_a? target - target == Google::Auth::Credentials - end - creds - end - let(:found_credentials) { "{}" } - - it "gets defaults for project_id and keyfile" do - # Clear all environment variables - ENV.stub :[], nil do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud.spanner - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.credentials).must_equal default_credentials - end - end - end - end - - it "uses provided project_id and keyfile" do - default_scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/spanner.admin", - "https://www.googleapis.com/auth/spanner.data" - ] - stubbed_credentials = ->(keyfile, scope: nil) { - _(keyfile).must_equal "path/to/keyfile.json" - _(scope).must_equal default_scope - "spanner-credentials" - } - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).must_equal "spanner.googleapis.com" - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, stubbed_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud.spanner "project-id", "path/to/keyfile.json" - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - end - - describe "Spanner.new" do - let(:default_credentials) do - creds = OpenStruct.new empty: true - def creds.is_a? target - target == Google::Auth::Credentials - end - creds - end - let(:found_credentials) { "{}" } - - it "gets defaults for project_id, keyfile, lib_name and lib_version" do - # Clear all environment variables - ENV.stub :[], nil do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.credentials).must_equal default_credentials - _(spanner.service.lib_name).must_be :nil? - _(spanner.service.lib_version).must_be :nil? - _(spanner.service.send(:lib_name_with_prefix)).must_equal "gccl" - end - end - end - end - - it "uses provided project_id and credentials" do - stubbed_credentials = ->(keyfile, scope: nil) { - _(keyfile).must_equal "path/to/keyfile.json" - _(scope).wont_be :nil? - "spanner-credentials" - } - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, stubbed_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new project_id: "project-id", credentials: "path/to/keyfile.json" - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses provided endpoint" do - endpoint = "spanner-endpoint2.example.com" - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal default_credentials - _(timeout).must_be :nil? - _(host).must_equal endpoint - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new project: "project-id", credentials: default_credentials, endpoint: endpoint - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - - it "uses quota_project from config" do - stubbed_service = ->(project, credentials, quota_project: nil, timeout: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal default_credentials - _(timeout).must_be :nil? - _(quota_project).must_equal "quota_project" - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - Google::Cloud::Spanner.configure do |config| - config.quota_project = "quota_project" - end - spanner = Google::Cloud::Spanner.new project: "project-id", credentials: default_credentials - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - - it "uses quota_project from credentials" do - stubbed_service = ->(project, credentials, quota_project: nil, timeout: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_be_kind_of OpenStruct - _(timeout).must_be :nil? - _(credentials.quota_project_id).must_equal "quota_project_id" - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - quota_project_credentials = OpenStruct.new(quota_project_id: "quota_project_id") - def quota_project_credentials.is_a? target - target == Google::Auth::Credentials - end - spanner = Google::Cloud::Spanner.new project: "project-id", credentials: quota_project_credentials - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - - it "uses provided project and keyfile aliases" do - stubbed_credentials = ->(keyfile, scope: nil) { - _(keyfile).must_equal "path/to/keyfile.json" - _(scope).wont_be :nil? - "spanner-credentials" - } - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, stubbed_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new project: "project-id", keyfile: "path/to/keyfile.json" - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "gets project_id from credentials" do - stubbed_credentials = ->(keyfile, scope: nil) { - _(keyfile).must_equal "path/to/keyfile.json" - _(scope).wont_be :nil? - OpenStruct.new project_id: "project-id" - } - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_be_kind_of OpenStruct - _(credentials.project_id).must_equal "project-id" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - empty_env = OpenStruct.new - - # Clear all environment variables - ENV.stub :[], nil do - Google::Cloud.stub :env, empty_env do - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, stubbed_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new credentials: "path/to/keyfile.json" - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - end - - it "uses SPANNER_EMULATOR_HOST environment variable" do - emulator_host = "localhost:4567" - emulator_check = ->(name) { (name == "SPANNER_EMULATOR_HOST") ? emulator_host : nil } - # Clear all environment variables, except SPANNER_EMULATOR_HOST - ENV.stub :[], emulator_check do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.credentials).must_equal :this_channel_is_insecure - _(spanner.service.host).must_equal emulator_host - end - end - end - end - - it "can create a new client with query options (client-level)" do - expect_query_options = { optimizer_version: "2", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - credentials = OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new {})) - new_spanner = Google::Cloud::Spanner.new - new_client = new_spanner.client "instance-id", "database-id", pool: { min: 0 }, query_options: expect_query_options - _(new_client.query_options).must_equal expect_query_options - end - end - end - - it "can create a new client with query options that environment variables should merge over client-level configs" do - expect_query_options = { optimizer_version: "2", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - optimizer_version_check = ->(name) { (name == "SPANNER_OPTIMIZER_VERSION") ? "2" : nil } - # Clear all environment variables, except SPANNER_OPTIMIZER_VERSION - ENV.stub :[], optimizer_version_check do - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - credentials = OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new {})) - new_spanner = Google::Cloud::Spanner.new - new_client = new_spanner.client "instance-id", "database-id", pool: { min: 0 }, query_options: { optimizer_version: "1", optimizer_statistics_package: "auto_20191128_14_47_22UTC" } - _(new_client.query_options).must_equal expect_query_options - end - end - end - end - - it "allows emulator_host to be set with emulator_host and implicit default_project_id" do - emulator_host = "localhost:4567" - # Clear all environment variables - ENV.stub :[], nil do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - spanner = Google::Cloud::Spanner.new emulator_host: emulator_host - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.credentials).must_equal :this_channel_is_insecure - _(spanner.service.host).must_equal emulator_host - end - end - end - - it 'allows emulator_host to be set with emulator_host and project_id' do - emulator_host = "localhost:4567" - project_id = "arbitrary-string" - ENV.stub :[], nil do - spanner = Google::Cloud::Spanner.new project_id: project_id, emulator_host: emulator_host - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal project_id - _(spanner.service.credentials).must_equal :this_channel_is_insecure - _(spanner.service.host).must_equal emulator_host - end - end - - it "uses provided lib name and lib version" do - lib_name = "spanner-ruby" - lib_version = "1.0.0" - - # Clear all environment variables - ENV.stub :[], nil do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new lib_name: lib_name, lib_version: lib_version - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.lib_name).must_equal lib_name - _(spanner.service.lib_version).must_equal lib_version - _(spanner.service.send(:lib_name_with_prefix)).must_equal "#{lib_name}/#{lib_version} gccl" - end - end - end - end - - it "uses SPANNER_OPTIMIZER_VERSION environment variable" do - optimizer_version = "4" - optimizer_version_check = ->(name) { (name == "SPANNER_OPTIMIZER_VERSION") ? optimizer_version : nil } - # Clear all environment variables, except SPANNER_OPTIMIZER_VERSION - ENV.stub :[], optimizer_version_check do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new - query_options = {optimizer_version: optimizer_version} - _(spanner.query_options).must_equal query_options - end - end - end - end - - it "uses SPANNER_OPTIMIZER_STATISTICS_PACKAGE environment variable" do - optimizer_statistics_package = "auto_20191128_14_47_22UTC" - check = ->(name) { (name == "SPANNER_OPTIMIZER_STATISTICS_PACKAGE") ? optimizer_statistics_package : nil } - # Clear all environment variables, except SPANNER_OPTIMIZER_STATISTICS_PACKAGE - ENV.stub :[], check do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new - query_options = {optimizer_statistics_package: optimizer_statistics_package} - _(spanner.query_options).must_equal query_options - end - end - end - end - - it "uses provided lib name only" do - lib_name = "spanner-ruby" - - # Clear all environment variables - ENV.stub :[], nil do - # Get project_id from Google Compute Engine - Google::Cloud.stub :env, OpenStruct.new(project_id: "project-id") do - Google::Cloud::Spanner::Credentials.stub :default, default_credentials do - spanner = Google::Cloud::Spanner.new lib_name: lib_name - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.lib_name).must_equal lib_name - _(spanner.service.lib_version).must_be :nil? - _(spanner.service.send(:lib_name_with_prefix)).must_equal "#{lib_name} gccl" - end - end - end - end - end - - describe "Spanner.configure" do - let(:default_credentials) do - ->(keyfile, scope: nil) { - _(keyfile).must_equal "path/to/keyfile.json" - _(scope).wont_be :nil? - "spanner-credentials" - } - end - let(:found_credentials) { "{}" } - - after do - Google::Cloud.configure.reset! - end - - it "uses shared config for project and keyfile" do - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud.configure do |config| - config.project = "project-id" - config.keyfile = "path/to/keyfile.json" - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses shared config for project_id and credentials" do - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud.configure do |config| - config.project_id = "project-id" - config.credentials = "path/to/keyfile.json" - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses spanner config for project and keyfile" do - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_equal 42 - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project = "project-id" - config.keyfile = "path/to/keyfile.json" - config.timeout = 42 - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses spanner config for project_id and credentials" do - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_equal 42 - _(host).wont_be :nil? - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project_id = "project-id" - config.credentials = "path/to/keyfile.json" - config.timeout = 42 - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses spanner config for endpoint" do - endpoint = "spanner-endpoint2.example.com" - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).must_equal endpoint - _(keyword_args.key?(:lib_name)).must_equal true - _(keyword_args.key?(:lib_version)).must_equal true - _(keyword_args[:lib_name]).must_be :nil? - _(keyword_args[:lib_version]).must_be :nil? - OpenStruct.new project: project - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project = "project-id" - config.keyfile = "path/to/keyfile.json" - config.endpoint = endpoint - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - end - end - end - end - end - end - - it "uses spanner config for emulator_host" do - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project_id = "project-id" - config.keyfile = "path/to/keyfile.json" - config.emulator_host = "localhost:4567" - end - - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service.credentials).must_equal :this_channel_is_insecure - _(spanner.service.host).must_equal "localhost:4567" - end - end - - it "uses spanner config for custom lib name and version" do - custom_lib_name = "spanner-ruby" - custom_lib_version = "1.0.0" - - stubbed_credentials = ->(keyfile, scope: nil) { - _(scope).wont_be :nil? - "spanner-credentials" - } - stubbed_service = ->(project, credentials, timeout: nil, host: nil, **keyword_args) { - _(project).must_equal "project-id" - _(credentials).must_equal "spanner-credentials" - _(timeout).must_be :nil? - _(host).wont_be :nil? - _(keyword_args[:lib_name]).must_equal custom_lib_name - _(keyword_args[:lib_version]).must_equal custom_lib_version - OpenStruct.new project: project, lib_name: keyword_args[:lib_name], lib_version: keyword_args[:lib_version] - } - - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project = "project-id" - config.keyfile = "path/to/keyfile.json" - config.lib_name = custom_lib_name - config.lib_version = custom_lib_version - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, stubbed_credentials do - Google::Cloud::Spanner::Service.stub :new, stubbed_service do - spanner = Google::Cloud::Spanner.new - _(spanner).must_be_kind_of Google::Cloud::Spanner::Project - _(spanner.project).must_equal "project-id" - _(spanner.service).must_be_kind_of OpenStruct - _(spanner.service.lib_name).must_equal custom_lib_name - _(spanner.service.lib_version).must_equal custom_lib_version - end - end - end - end - end - end - - it "uses spanner config for query_options" do - query_options = {optimizer_version: "4", optimizer_statistics_package: "auto_20191128_14_47_22UTC"} - # Clear all environment variables - ENV.stub :[], nil do - # Set new configuration - Google::Cloud::Spanner.configure do |config| - config.project_id = "project-id" - config.keyfile = "path/to/keyfile.json" - config.query_options = query_options - end - - File.stub :file?, true, ["path/to/keyfile.json"] do - File.stub :read, found_credentials, ["path/to/keyfile.json"] do - Google::Cloud::Spanner::Credentials.stub :new, default_credentials do - spanner = Google::Cloud::Spanner.new - _(spanner.project).must_equal "project-id" - _(spanner.query_options).must_equal query_options - end - end - end - end - end - end -end diff --git a/google-cloud-spanner/test/helper.rb b/google-cloud-spanner/test/helper.rb deleted file mode 100644 index 788903ea9a58..000000000000 --- a/google-cloud-spanner/test/helper.rb +++ /dev/null @@ -1,262 +0,0 @@ -# Copyright 2016 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -require "simplecov" - -gem "minitest" -require "minitest/autorun" -require "minitest/focus" -require "minitest/rg" -require "ostruct" -require "json" -require "base64" -require "google/cloud/spanner" -require "grpc" - -class MockSpanner < Minitest::Spec - let(:project) { "test" } - let(:credentials) { OpenStruct.new(client: OpenStruct.new(updater_proc: Proc.new {})) } - let(:spanner) { Google::Cloud::Spanner::Project.new(Google::Cloud::Spanner::Service.new(project, credentials)) } - - # Register this spec type for when :spanner is used. - register_spec_type(self) do |desc, *addl| - addl.include? :mock_spanner - end - - def shutdown_client! client - # extract the pool - pool = client.instance_variable_get :@pool - # remove all sessions so we don't have to handle the calls to session_delete - pool.all_sessions = [] - - # close the client - client.close - - # close the client - shutdown_pool! pool - end - - def shutdown_pool! pool - # ensure the pool's thread pool is also shut down - thread_pool = pool.instance_variable_get :@thread_pool - thread_pool.shutdown - thread_pool.wait_for_termination 60 - end - - def instance_configs_hash - { - instance_configs: [ - { name: "projects/#{project}/instanceConfigs/regional-europe-west1", - display_name: "EU West 1"}, - { name: "projects/#{project}/instanceConfigs/regional-us-west1", - display_name: "US West 1"}, - { name: "projects/#{project}/instanceConfigs/regional-us-central1", - display_name: "US Central 1"} - ] - } - end - - def instance_config_hash - instance_configs_hash[:instance_configs].last - end - - def instances_hash - { instances: 3.times.map { instance_hash } } - end - - def instance_hash name: "instance-#{rand(9999)}", nodes: 1, processing_units: nil, - state: "READY", labels: {} - { - name: "projects/#{project}/instances/#{name}", - config: "projects/#{project}/instanceConfigs/regional-us-central1", - display_name: name.split("-").map(&:capitalize).join(" "), - node_count: nodes, - processing_units: processing_units, - state: state, - labels: labels - } - end - - def databases_hash instance_id: "my-instance-id" - { databases: 3.times.map { database_hash(instance_id: instance_id) } } - end - - def database_hash instance_id: "my-instance-id", database_id: "database-#{rand(9999)}", - state: "READY", create_time: nil, restore_info: {}, - version_retention_period: "", earliest_version_time: nil, - encryption_config: {}, encryption_info: [] - { - name: "projects/#{project}/instances/#{instance_id}/databases/#{database_id}", - state: state, - create_time: create_time, - restore_info: restore_info, - version_retention_period: version_retention_period, - earliest_version_time: earliest_version_time, - encryption_config: encryption_config, - encryption_info: encryption_info - } - end - - def restore_info_hash source_type: "BACKUP", backup_info: {} - { - source_type: source_type, - backup_info: backup_info - } - end - - def backup_info_hash instance_id: "my-instance-id", backup_id: "my-backup-id", - create_time: Time.now, source_database_id: "my-backup-source-database-id" - { - backup: "projects/#{project}/instances/#{instance_id}/backups/#{backup_id}", - create_time: create_time, - source_database: "projects/#{project}/instances/#{instance_id}/databases/#{source_database_id}" - } - end - - def backup_hash instance_id: "my-instance-id", database_id: "database-#{rand(9999)}", - backup_id: "backup-#{rand(9999)}", state: "READY", expire_time: Time.now + 36000, - version_time: Time.now - 3600, create_time: Time.now, size_bytes: 1024, - referencing_databases: ["db1"], encryption_info: nil - { - name: "projects/#{project}/instances/#{instance_id}/backups/#{backup_id}", - database: "projects/#{project}/instances/#{instance_id}/databases/#{database_id}", - state: state, - expire_time: expire_time, - version_time: version_time, - create_time: create_time, - size_bytes: size_bytes, - referencing_databases: referencing_databases.map do |database| - "projects/#{project}/instances/#{instance_id}/databases/#{database}" - end, - encryption_info: encryption_info - } - end - - def backups_hash instance_id: "my-instance-id" - { backups: 3.times.map { backup_hash instance_id: instance_id } } - end - - def project_path - Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Paths.project_path \ - project: project - end - - def instance_path name - Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Paths.instance_path \ - project: project, instance: name - end - - def database_path instance, name - Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Paths.database_path \ - project: project, instance: instance, database: name - end - - def instance_config_path name - Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Paths.instance_config_path \ - project: project, instance_config: name - end - - def session_path instance_id, database_id, session_id - Google::Cloud::Spanner::V1::Spanner::Paths.session_path \ - project: project, instance: instance_id, database: database_id, session: session_id - end - - def backup_path instance, backup - Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Paths.backup_path \ - project: project, instance: instance, backup: backup - end - - def paged_enum_struct response - OpenStruct.new(response: response) - end - - def expect_execute_streaming_sql results_enum, session_name, sql, - transaction: nil, params: nil, param_types: nil, - resume_token: nil, partition_token: nil, seqno: nil, - query_options: nil, request_options: nil, options: nil - spanner.service.mocked_service.expect :execute_streaming_sql, results_enum do |request, gapic_options| - request[:session] == session_name && - request[:sql] == sql && - request[:transaction] == transaction && - request[:params] == params && - request[:param_types] == param_types && - request[:resume_token] == resume_token && - request[:partition_token] == partition_token && - request[:seqno] == seqno && - request[:query_options] == query_options && - request[:request_options] == request_options && - gapic_options == options - end - end - - def expect_begin_transaction transaction, tx_opts, options - spanner.service.mocked_service.expect :begin_transaction, transaction do |request, gapic_options| - request[:session].instance_of?(String) && request[:options] == tx_opts && gapic_options == options - end - end - - def assert_commit_response expected, actual - timestamp = Google::Cloud::Spanner::Convert.timestamp_to_time actual.commit_timestamp - _(expected.timestamp).must_equal timestamp - - unless actual.commit_stats - _(expected.stats).must_be :nil? - return - end - - _(expected.stats.mutation_count).must_equal actual.commit_stats.mutation_count - end -end - -# This is used to raise errors in an enumerator -class RaiseableEnumerator - def initialize enum - @enum = enum - end - - def next - v = @enum.next - raise v if v.is_a? Class - raise v if v.is_a? StandardError - v - end - - def method_missing method, *args - @enum.send method, *args - end - - def inspect - "<#{self.class}>" - end -end - -class MockPagedEnumerable - def initialize responses = [] - @responses = responses - @current_index = 0 - end - - def response - @responses[@current_index] - end - - def next_page? - response.next_page_token != "" - end - - def next_page - @current_index += 1 - response - end -end diff --git a/release-please-config.json b/release-please-config.json index f708ca386ca5..4e9258928823 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -1055,10 +1055,6 @@ "component": "google-cloud-shell-v1", "version_file": "lib/google/cloud/shell/v1/version.rb" }, - "google-cloud-spanner": { - "component": "google-cloud-spanner", - "version_file": "lib/google/cloud/spanner/version.rb" - }, "google-cloud-spanner-admin-database-v1": { "component": "google-cloud-spanner-admin-database-v1", "version_file": "lib/google/cloud/spanner/admin/database/v1/version.rb" From fccd64fe47f88674140d43fc924564862331c8f6 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 2 Nov 2022 22:27:10 -0700 Subject: [PATCH 016/112] chore(main): release google-cloud-storage 1.44.0 (#19327) --- .release-please-manifest.json | 2 +- google-cloud-storage/CHANGELOG.md | 6 ++++++ google-cloud-storage/lib/google/cloud/storage/version.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a5504635a619..26cc12746a68 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -535,7 +535,7 @@ "google-cloud-speech-v1p1beta1+FILLER": "0.0.0", "google-cloud-speech-v2": "0.1.0", "google-cloud-speech-v2+FILLER": "0.0.0", - "google-cloud-storage": "1.43.0", + "google-cloud-storage": "1.44.0", "google-cloud-storage+FILLER": "0.0.0", "google-cloud-storage_transfer": "1.1.0", "google-cloud-storage_transfer+FILLER": "0.0.0", diff --git a/google-cloud-storage/CHANGELOG.md b/google-cloud-storage/CHANGELOG.md index eff04e3d1b43..cb082dfd819e 100644 --- a/google-cloud-storage/CHANGELOG.md +++ b/google-cloud-storage/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 1.44.0 (2022-11-02) + +#### Features + +* support autoclass + ### 1.43.0 (2022-09-30) #### Features diff --git a/google-cloud-storage/lib/google/cloud/storage/version.rb b/google-cloud-storage/lib/google/cloud/storage/version.rb index 23a9fd4496c3..1bdeaf4a6f6b 100644 --- a/google-cloud-storage/lib/google/cloud/storage/version.rb +++ b/google-cloud-storage/lib/google/cloud/storage/version.rb @@ -16,7 +16,7 @@ module Google module Cloud module Storage - VERSION = "1.43.0".freeze + VERSION = "1.44.0".freeze end end end From 95c7bc520260a9426d499a581613afd3a713bb69 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 11:42:55 -0700 Subject: [PATCH 017/112] feat(network_connectivity-v1): Added support for policy-based routing (#19362) --- .../.owlbot-manifest.json | 15 + .../gapic_metadata.json | 29 + .../google/cloud/network_connectivity/v1.rb | 1 + .../v1/hub_service/client.rb | 96 +-- .../v1/policy_based_routing_service.rb | 51 ++ .../v1/policy_based_routing_service/client.rb | 749 +++++++++++++++++ .../credentials.rb | 51 ++ .../operations.rb | 770 ++++++++++++++++++ .../v1/policy_based_routing_service/paths.rb | 86 ++ .../cloud/networkconnectivity/v1/common_pb.rb | 1 + .../cloud/networkconnectivity/v1/hub_pb.rb | 16 +- .../networkconnectivity/v1/hub_services_pb.rb | 22 +- .../v1/policy_based_routing_pb.rb | 108 +++ .../v1/policy_based_routing_services_pb.rb | 52 ++ .../cloud/networkconnectivity/v1/hub.rb | 185 +++-- .../v1/policy_based_routing.rb | 295 +++++++ .../create_policy_based_route.rb | 46 ++ .../delete_policy_based_route.rb | 46 ++ .../get_policy_based_route.rb | 39 + .../list_policy_based_routes.rb | 45 + ...a_google.cloud.networkconnectivity.v1.json | 160 ++++ ...y_based_routing_service_operations_test.rb | 380 +++++++++ ...policy_based_routing_service_paths_test.rb | 61 ++ .../v1/policy_based_routing_service_test.rb | 343 ++++++++ 24 files changed, 3507 insertions(+), 140 deletions(-) create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb create mode 100644 google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb create mode 100644 google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb create mode 100644 google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/create_policy_based_route.rb create mode 100644 google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/delete_policy_based_route.rb create mode 100644 google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/get_policy_based_route.rb create mode 100644 google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/list_policy_based_routes.rb create mode 100644 google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb create mode 100644 google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb create mode 100644 google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb diff --git a/google-cloud-network_connectivity-v1/.owlbot-manifest.json b/google-cloud-network_connectivity-v1/.owlbot-manifest.json index bde1ab754e0d..ccc085f71eee 100644 --- a/google-cloud-network_connectivity-v1/.owlbot-manifest.json +++ b/google-cloud-network_connectivity-v1/.owlbot-manifest.json @@ -19,15 +19,23 @@ "lib/google/cloud/network_connectivity/v1/hub_service/credentials.rb", "lib/google/cloud/network_connectivity/v1/hub_service/operations.rb", "lib/google/cloud/network_connectivity/v1/hub_service/paths.rb", + "lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb", + "lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb", + "lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb", + "lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb", + "lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb", "lib/google/cloud/network_connectivity/v1/version.rb", "lib/google/cloud/networkconnectivity/v1/common_pb.rb", "lib/google/cloud/networkconnectivity/v1/hub_pb.rb", "lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb", + "lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb", + "lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb", "proto_docs/README.md", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/networkconnectivity/v1/common.rb", "proto_docs/google/cloud/networkconnectivity/v1/hub.rb", + "proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/protobuf/any.rb", "proto_docs/google/protobuf/duration.rb", @@ -46,10 +54,17 @@ "snippets/hub_service/list_spokes.rb", "snippets/hub_service/update_hub.rb", "snippets/hub_service/update_spoke.rb", + "snippets/policy_based_routing_service/create_policy_based_route.rb", + "snippets/policy_based_routing_service/delete_policy_based_route.rb", + "snippets/policy_based_routing_service/get_policy_based_route.rb", + "snippets/policy_based_routing_service/list_policy_based_routes.rb", "snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json", "test/google/cloud/network_connectivity/v1/hub_service_operations_test.rb", "test/google/cloud/network_connectivity/v1/hub_service_paths_test.rb", "test/google/cloud/network_connectivity/v1/hub_service_test.rb", + "test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb", + "test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb", + "test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb", "test/helper.rb" ], "static": [ diff --git a/google-cloud-network_connectivity-v1/gapic_metadata.json b/google-cloud-network_connectivity-v1/gapic_metadata.json index bbd80451a96a..036eb672e0b1 100644 --- a/google-cloud-network_connectivity-v1/gapic_metadata.json +++ b/google-cloud-network_connectivity-v1/gapic_metadata.json @@ -63,6 +63,35 @@ } } } + }, + "PolicyBasedRoutingService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client", + "rpcs": { + "ListPolicyBasedRoutes": { + "methods": [ + "list_policy_based_routes" + ] + }, + "GetPolicyBasedRoute": { + "methods": [ + "get_policy_based_route" + ] + }, + "CreatePolicyBasedRoute": { + "methods": [ + "create_policy_based_route" + ] + }, + "DeletePolicyBasedRoute": { + "methods": [ + "delete_policy_based_route" + ] + } + } + } + } } } } diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1.rb index 976d369001ef..02cba718aa93 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1.rb @@ -17,6 +17,7 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! require "google/cloud/network_connectivity/v1/hub_service" +require "google/cloud/network_connectivity/v1/policy_based_routing_service" require "google/cloud/network_connectivity/v1/version" module Google diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb index e137014336eb..1c68f0211bc8 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/hub_service/client.rb @@ -177,7 +177,7 @@ def initialize # Service calls ## - # Lists hubs in a given project. + # Lists the Network Connectivity Center hubs associated with a given project. # # @overload list_hubs(request, options = nil) # Pass arguments to `list_hubs` via a request object, either of type @@ -277,7 +277,7 @@ def list_hubs request, options = nil end ## - # Gets details about the specified hub. + # Gets details about a Network Connectivity Center hub. # # @overload get_hub(request, options = nil) # Pass arguments to `get_hub` via a request object, either of type @@ -362,7 +362,7 @@ def get_hub request, options = nil end ## - # Creates a new hub in the specified project. + # Creates a new Network Connectivity Center hub in the specified project. # # @overload create_hub(request, options = nil) # Pass arguments to `create_hub` via a request object, either of type @@ -386,11 +386,11 @@ def get_hub request, options = nil # @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash] # Required. The initial values for a new hub. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -474,7 +474,8 @@ def create_hub request, options = nil end ## - # Updates the description and/or labels of the specified hub. + # Updates the description and/or labels of a Network Connectivity Center + # hub. # # @overload update_hub(request, options = nil) # Pass arguments to `update_hub` via a request object, either of type @@ -492,19 +493,19 @@ def create_hub request, options = nil # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. In the case of an update to an existing hub, field mask is used to specify - # the fields to be overwritten. The fields specified in the update_mask are - # relative to the resource, not the full request. A field is overwritten if - # it is in the mask. If the user does not provide a mask, then all fields are - # overwritten. + # Optional. In the case of an update to an existing hub, field mask is used + # to specify the fields to be overwritten. The fields specified in the + # update_mask are relative to the resource, not the full request. A field is + # overwritten if it is in the mask. If the user does not provide a mask, then + # all fields are overwritten. # @param hub [::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash] # Required. The state that the hub should be in after the update. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -588,7 +589,7 @@ def update_hub request, options = nil end ## - # Deletes the specified hub. + # Deletes a Network Connectivity Center hub. # # @overload delete_hub(request, options = nil) # Pass arguments to `delete_hub` via a request object, either of type @@ -608,11 +609,11 @@ def update_hub request, options = nil # @param name [::String] # Required. The name of the hub to delete. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -696,7 +697,8 @@ def delete_hub request, options = nil end ## - # Lists the spokes in the specified project and location. + # Lists the Network Connectivity Center spokes in a specified project and + # location. # # @overload list_spokes(request, options = nil) # Pass arguments to `list_spokes` via a request object, either of type @@ -796,7 +798,7 @@ def list_spokes request, options = nil end ## - # Gets details about the specified spoke. + # Gets details about a Network Connectivity Center spoke. # # @overload get_spoke(request, options = nil) # Pass arguments to `get_spoke` via a request object, either of type @@ -881,7 +883,7 @@ def get_spoke request, options = nil end ## - # Creates a spoke in the specified project and location. + # Creates a Network Connectivity Center spoke. # # @overload create_spoke(request, options = nil) # Pass arguments to `create_spoke` via a request object, either of type @@ -905,11 +907,11 @@ def get_spoke request, options = nil # @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash] # Required. The initial values for a new spoke. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -993,7 +995,7 @@ def create_spoke request, options = nil end ## - # Updates the parameters of the specified spoke. + # Updates the parameters of a Network Connectivity Center spoke. # # @overload update_spoke(request, options = nil) # Pass arguments to `update_spoke` via a request object, either of type @@ -1011,19 +1013,19 @@ def create_spoke request, options = nil # the default parameter values, pass an empty Hash as a request object (see above). # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. In the case of an update to an existing spoke, field mask is used to - # specify the fields to be overwritten. The fields specified in the + # Optional. In the case of an update to an existing spoke, field mask is used + # to specify the fields to be overwritten. The fields specified in the # update_mask are relative to the resource, not the full request. A field is # overwritten if it is in the mask. If the user does not provide a mask, then # all fields are overwritten. # @param spoke [::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash] # Required. The state that the spoke should be in after the update. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -1107,7 +1109,7 @@ def update_spoke request, options = nil end ## - # Deletes the specified spoke. + # Deletes a Network Connectivity Center spoke. # # @overload delete_spoke(request, options = nil) # Pass arguments to `delete_spoke` via a request object, either of type @@ -1127,11 +1129,11 @@ def update_spoke request, options = nil # @param name [::String] # Required. The name of the spoke to delete. # @param request_id [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb new file mode 100644 index 000000000000..1f1ad329eecd --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/network_connectivity/v1/version" + +require "google/cloud/network_connectivity/v1/policy_based_routing_service/credentials" +require "google/cloud/network_connectivity/v1/policy_based_routing_service/paths" +require "google/cloud/network_connectivity/v1/policy_based_routing_service/operations" +require "google/cloud/network_connectivity/v1/policy_based_routing_service/client" + +module Google + module Cloud + module NetworkConnectivity + module V1 + ## + # Policy-Based Routing allows GCP customers to specify flexibile routing + # policies for Layer 4 traffic traversing through the connected service. + # + # To load this service and instantiate a client: + # + # require "google/cloud/network_connectivity/v1/policy_based_routing_service" + # client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + module PolicyBasedRoutingService + end + end + end + end +end + +helper_path = ::File.join __dir__, "policy_based_routing_service", "helpers.rb" +require "google/cloud/network_connectivity/v1/policy_based_routing_service/helpers" if ::File.file? helper_path diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb new file mode 100644 index 000000000000..bc544a92959b --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/client.rb @@ -0,0 +1,749 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/networkconnectivity/v1/policy_based_routing_pb" + +module Google + module Cloud + module NetworkConnectivity + module V1 + module PolicyBasedRoutingService + ## + # Client for the PolicyBasedRoutingService service. + # + # Policy-Based Routing allows GCP customers to specify flexibile routing + # policies for Layer 4 traffic traversing through the connected service. + # + class Client + include Paths + + # @private + attr_reader :policy_based_routing_service_stub + + ## + # Configure the PolicyBasedRoutingService Client class. + # + # See {::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all PolicyBasedRoutingService clients + # ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "NetworkConnectivity", "V1"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_policy_based_route.timeout = 60.0 + + default_config.rpcs.delete_policy_based_route.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBasedRoutingService Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new PolicyBasedRoutingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the PolicyBasedRoutingService client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/networkconnectivity/v1/policy_based_routing_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @policy_based_routing_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations] + # + attr_reader :operations_client + + # Service calls + + ## + # Lists PolicyBasedRoutes in a given project and location. + # + # @overload list_policy_based_routes(request, options = nil) + # Pass arguments to `list_policy_based_routes` via a request object, either of type + # {::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_policy_based_routes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_policy_based_routes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource's name. + # @param page_size [::Integer] + # The maximum number of results per page that should be returned. + # @param page_token [::String] + # The page token. + # @param filter [::String] + # A filter expression that filters the results listed in the response. + # @param order_by [::String] + # Sort the results by a certain order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/network_connectivity/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest.new + # + # # Call the list_policy_based_routes method. + # result = client.list_policy_based_routes request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute. + # p response + # end + # + def list_policy_based_routes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_policy_based_routes.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_policy_based_routes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_policy_based_routes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_based_routing_service_stub.call_rpc :list_policy_based_routes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policy_based_routing_service_stub, :list_policy_based_routes, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets details of a single PolicyBasedRoute. + # + # @overload get_policy_based_route(request, options = nil) + # Pass arguments to `get_policy_based_route` via a request object, either of type + # {::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_policy_based_route(name: nil) + # Pass arguments to `get_policy_based_route` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the PolicyBasedRoute resource to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/network_connectivity/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest.new + # + # # Call the get_policy_based_route method. + # result = client.get_policy_based_route request + # + # # The returned object is of type Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute. + # p result + # + def get_policy_based_route request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_policy_based_route.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_policy_based_route.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_policy_based_route.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_based_routing_service_stub.call_rpc :get_policy_based_route, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Creates a new PolicyBasedRoute in a given project and location. + # + # @overload create_policy_based_route(request, options = nil) + # Pass arguments to `create_policy_based_route` via a request object, either of type + # {::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_policy_based_route(parent: nil, policy_based_route_id: nil, policy_based_route: nil, request_id: nil) + # Pass arguments to `create_policy_based_route` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent resource's name of the PolicyBasedRoute. + # @param policy_based_route_id [::String] + # Optional. Unique id for the Policy Based Route to create. + # @param policy_based_route [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute, ::Hash] + # Required. Initial values for a new Policy Based Route. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/network_connectivity/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest.new + # + # # Call the create_policy_based_route method. + # result = client.create_policy_based_route request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def create_policy_based_route request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_policy_based_route.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_policy_based_route.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_policy_based_route.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_based_routing_service_stub.call_rpc :create_policy_based_route, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a single PolicyBasedRoute. + # + # @overload delete_policy_based_route(request, options = nil) + # Pass arguments to `delete_policy_based_route` via a request object, either of type + # {::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_policy_based_route(name: nil, request_id: nil) + # Pass arguments to `delete_policy_based_route` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Name of the PolicyBasedRoute resource to delete. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/network_connectivity/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest.new + # + # # Call the delete_policy_based_route method. + # result = client.delete_policy_based_route request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def delete_policy_based_route request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_policy_based_route.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_policy_based_route.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_policy_based_route.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policy_based_routing_service_stub.call_rpc :delete_policy_based_route, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the PolicyBasedRoutingService API. + # + # This class represents the configuration for PolicyBasedRoutingService, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_policy_based_routes to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_policy_based_routes.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_policy_based_routes.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"networkconnectivity.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "networkconnectivity.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the PolicyBasedRoutingService API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_policy_based_routes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policy_based_routes + ## + # RPC-specific configuration for `get_policy_based_route` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy_based_route + ## + # RPC-specific configuration for `create_policy_based_route` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy_based_route + ## + # RPC-specific configuration for `delete_policy_based_route` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy_based_route + + # @private + def initialize parent_rpcs = nil + list_policy_based_routes_config = parent_rpcs.list_policy_based_routes if parent_rpcs.respond_to? :list_policy_based_routes + @list_policy_based_routes = ::Gapic::Config::Method.new list_policy_based_routes_config + get_policy_based_route_config = parent_rpcs.get_policy_based_route if parent_rpcs.respond_to? :get_policy_based_route + @get_policy_based_route = ::Gapic::Config::Method.new get_policy_based_route_config + create_policy_based_route_config = parent_rpcs.create_policy_based_route if parent_rpcs.respond_to? :create_policy_based_route + @create_policy_based_route = ::Gapic::Config::Method.new create_policy_based_route_config + delete_policy_based_route_config = parent_rpcs.delete_policy_based_route if parent_rpcs.respond_to? :delete_policy_based_route + @delete_policy_based_route = ::Gapic::Config::Method.new delete_policy_based_route_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb new file mode 100644 index 000000000000..f964d70bd9de --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/credentials.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module NetworkConnectivity + module V1 + module PolicyBasedRoutingService + # Credentials for the PolicyBasedRoutingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "NETWORK_CONNECTIVITY_CREDENTIALS", + "NETWORK_CONNECTIVITY_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "NETWORK_CONNECTIVITY_CREDENTIALS_JSON", + "NETWORK_CONNECTIVITY_KEYFILE_JSON", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb new file mode 100644 index 000000000000..d372bdf5ec94 --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/operations.rb @@ -0,0 +1,770 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module NetworkConnectivity + module V1 + module PolicyBasedRoutingService + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the PolicyBasedRoutingService Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the PolicyBasedRoutingService Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Longrunning::Operation. + # p response + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::NetworkConnectivity::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"networkconnectivity.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "networkconnectivity.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb new file mode 100644 index 000000000000..55eb43e1f48e --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb @@ -0,0 +1,86 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module NetworkConnectivity + module V1 + module PolicyBasedRoutingService + # Path helper methods for the PolicyBasedRoutingService API. + module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{resource_id}` + # + # @param project [String] + # @param resource_id [String] + # + # @return [::String] + def network_path project:, resource_id: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{resource_id}" + end + + ## + # Create a fully-qualified PolicyBasedRoute resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/{location}/global/PolicyBasedRoutes/{policy_based_route}` + # + # @param project [String] + # @param location [String] + # @param policy_based_route [String] + # + # @return [::String] + def policy_based_route_path project:, location:, policy_based_route: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/#{location}/global/PolicyBasedRoutes/#{policy_based_route}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/common_pb.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/common_pb.rb index 9dd3e4ba4c50..6bd72b6b5e4f 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/common_pb.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/common_pb.rb @@ -4,6 +4,7 @@ require 'google/protobuf' require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_pb.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_pb.rb index 86612fb4d063..b64fd84c398b 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_pb.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_pb.rb @@ -103,14 +103,17 @@ add_message "google.cloud.networkconnectivity.v1.LinkedVpnTunnels" do repeated :uris, :string, 1 optional :site_to_site_data_transfer, :bool, 2 + optional :vpc_network, :string, 3 end add_message "google.cloud.networkconnectivity.v1.LinkedInterconnectAttachments" do repeated :uris, :string, 1 optional :site_to_site_data_transfer, :bool, 2 + optional :vpc_network, :string, 3 end add_message "google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances" do repeated :instances, :message, 1, "google.cloud.networkconnectivity.v1.RouterApplianceInstance" optional :site_to_site_data_transfer, :bool, 2 + optional :vpc_network, :string, 3 end add_message "google.cloud.networkconnectivity.v1.RouterApplianceInstance" do optional :virtual_machine, :string, 1 @@ -119,16 +122,17 @@ add_message "google.cloud.networkconnectivity.v1.LocationMetadata" do repeated :location_features, :enum, 1, "google.cloud.networkconnectivity.v1.LocationFeature" end + add_enum "google.cloud.networkconnectivity.v1.LocationFeature" do + value :LOCATION_FEATURE_UNSPECIFIED, 0 + value :SITE_TO_CLOUD_SPOKES, 1 + value :SITE_TO_SITE_SPOKES, 2 + end add_enum "google.cloud.networkconnectivity.v1.State" do value :STATE_UNSPECIFIED, 0 value :CREATING, 1 value :ACTIVE, 2 value :DELETING, 3 - end - add_enum "google.cloud.networkconnectivity.v1.LocationFeature" do - value :LOCATION_FEATURE_UNSPECIFIED, 0 - value :SITE_TO_CLOUD_SPOKES, 1 - value :SITE_TO_SITE_SPOKES, 2 + value :UPDATING, 6 end end end @@ -157,8 +161,8 @@ module V1 LinkedRouterApplianceInstances = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.LinkedRouterApplianceInstances").msgclass RouterApplianceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.RouterApplianceInstance").msgclass LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.LocationMetadata").msgclass - State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.State").enummodule LocationFeature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.LocationFeature").enummodule + State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.State").enummodule end end end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb index db132984da39..84de2ec59a6f 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/hub_services_pb.rb @@ -35,25 +35,27 @@ class Service self.unmarshal_class_method = :decode self.service_name = 'google.cloud.networkconnectivity.v1.HubService' - # Lists hubs in a given project. + # Lists the Network Connectivity Center hubs associated with a given project. rpc :ListHubs, ::Google::Cloud::NetworkConnectivity::V1::ListHubsRequest, ::Google::Cloud::NetworkConnectivity::V1::ListHubsResponse - # Gets details about the specified hub. + # Gets details about a Network Connectivity Center hub. rpc :GetHub, ::Google::Cloud::NetworkConnectivity::V1::GetHubRequest, ::Google::Cloud::NetworkConnectivity::V1::Hub - # Creates a new hub in the specified project. + # Creates a new Network Connectivity Center hub in the specified project. rpc :CreateHub, ::Google::Cloud::NetworkConnectivity::V1::CreateHubRequest, ::Google::Longrunning::Operation - # Updates the description and/or labels of the specified hub. + # Updates the description and/or labels of a Network Connectivity Center + # hub. rpc :UpdateHub, ::Google::Cloud::NetworkConnectivity::V1::UpdateHubRequest, ::Google::Longrunning::Operation - # Deletes the specified hub. + # Deletes a Network Connectivity Center hub. rpc :DeleteHub, ::Google::Cloud::NetworkConnectivity::V1::DeleteHubRequest, ::Google::Longrunning::Operation - # Lists the spokes in the specified project and location. + # Lists the Network Connectivity Center spokes in a specified project and + # location. rpc :ListSpokes, ::Google::Cloud::NetworkConnectivity::V1::ListSpokesRequest, ::Google::Cloud::NetworkConnectivity::V1::ListSpokesResponse - # Gets details about the specified spoke. + # Gets details about a Network Connectivity Center spoke. rpc :GetSpoke, ::Google::Cloud::NetworkConnectivity::V1::GetSpokeRequest, ::Google::Cloud::NetworkConnectivity::V1::Spoke - # Creates a spoke in the specified project and location. + # Creates a Network Connectivity Center spoke. rpc :CreateSpoke, ::Google::Cloud::NetworkConnectivity::V1::CreateSpokeRequest, ::Google::Longrunning::Operation - # Updates the parameters of the specified spoke. + # Updates the parameters of a Network Connectivity Center spoke. rpc :UpdateSpoke, ::Google::Cloud::NetworkConnectivity::V1::UpdateSpokeRequest, ::Google::Longrunning::Operation - # Deletes the specified spoke. + # Deletes a Network Connectivity Center spoke. rpc :DeleteSpoke, ::Google::Cloud::NetworkConnectivity::V1::DeleteSpokeRequest, ::Google::Longrunning::Operation end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb new file mode 100644 index 000000000000..7d8cf2e9ad16 --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb @@ -0,0 +1,108 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/networkconnectivity/v1/policy_based_routing.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/networkconnectivity/v1/policy_based_routing.proto", :syntax => :proto3) do + add_message "google.cloud.networkconnectivity.v1.PolicyBasedRoute" do + optional :name, :string, 1 + optional :create_time, :message, 2, "google.protobuf.Timestamp" + optional :update_time, :message, 3, "google.protobuf.Timestamp" + map :labels, :string, :string, 4 + optional :description, :string, 5 + optional :network, :string, 6 + optional :filter, :message, 10, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter" + optional :priority, :int32, 11 + repeated :warnings, :message, 14, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings" + optional :self_link, :string, 15 + optional :kind, :string, 16 + oneof :target do + optional :virtual_machine, :message, 18, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine" + optional :interconnect_attachment, :message, 9, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment" + end + oneof :next_hop do + optional :next_hop_ilb_ip, :string, 12 + end + end + add_message "google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine" do + repeated :tags, :string, 1 + end + add_message "google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment" do + optional :region, :string, 1 + end + add_message "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter" do + optional :ip_protocol, :string, 1 + optional :src_range, :string, 2 + optional :dest_range, :string, 3 + optional :protocol_version, :enum, 6, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion" + end + add_enum "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion" do + value :PROTOCOL_VERSION_UNSPECIFIED, 0 + value :IPV4, 1 + end + add_message "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings" do + optional :code, :enum, 1, "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code" + map :data, :string, :string, 2 + optional :warning_message, :string, 3 + end + add_enum "google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code" do + value :WARNING_UNSPECIFIED, 0 + value :RESOURCE_NOT_ACTIVE, 1 + value :RESOURCE_BEING_MODIFIED, 2 + end + add_message "google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + optional :filter, :string, 4 + optional :order_by, :string, 5 + end + add_message "google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse" do + repeated :policy_based_routes, :message, 1, "google.cloud.networkconnectivity.v1.PolicyBasedRoute" + optional :next_page_token, :string, 2 + repeated :unreachable, :string, 3 + end + add_message "google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest" do + optional :parent, :string, 1 + optional :policy_based_route_id, :string, 2 + optional :policy_based_route, :message, 3, "google.cloud.networkconnectivity.v1.PolicyBasedRoute" + optional :request_id, :string, 4 + end + add_message "google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest" do + optional :name, :string, 1 + optional :request_id, :string, 2 + end + end +end + +module Google + module Cloud + module NetworkConnectivity + module V1 + PolicyBasedRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute").msgclass + PolicyBasedRoute::VirtualMachine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.VirtualMachine").msgclass + PolicyBasedRoute::InterconnectAttachment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.InterconnectAttachment").msgclass + PolicyBasedRoute::Filter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter").msgclass + PolicyBasedRoute::Filter::ProtocolVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion").enummodule + PolicyBasedRoute::Warnings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings").msgclass + PolicyBasedRoute::Warnings::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.PolicyBasedRoute.Warnings.Code").enummodule + ListPolicyBasedRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesRequest").msgclass + ListPolicyBasedRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.ListPolicyBasedRoutesResponse").msgclass + GetPolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.GetPolicyBasedRouteRequest").msgclass + CreatePolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.CreatePolicyBasedRouteRequest").msgclass + DeletePolicyBasedRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.networkconnectivity.v1.DeletePolicyBasedRouteRequest").msgclass + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb new file mode 100644 index 000000000000..ceb061c6f4ff --- /dev/null +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb @@ -0,0 +1,52 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/networkconnectivity/v1/policy_based_routing.proto for package 'Google.Cloud.NetworkConnectivity.V1' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/networkconnectivity/v1/policy_based_routing_pb' + +module Google + module Cloud + module NetworkConnectivity + module V1 + module PolicyBasedRoutingService + # Policy-Based Routing allows GCP customers to specify flexibile routing + # policies for Layer 4 traffic traversing through the connected service. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.networkconnectivity.v1.PolicyBasedRoutingService' + + # Lists PolicyBasedRoutes in a given project and location. + rpc :ListPolicyBasedRoutes, ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest, ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesResponse + # Gets details of a single PolicyBasedRoute. + rpc :GetPolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest, ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute + # Creates a new PolicyBasedRoute in a given project and location. + rpc :CreatePolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest, ::Google::Longrunning::Operation + # Deletes a single PolicyBasedRoute. + rpc :DeletePolicyBasedRoute, ::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/hub.rb b/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/hub.rb index 77a863f86f3b..4f051a7910fd 100644 --- a/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/hub.rb +++ b/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/hub.rb @@ -21,11 +21,11 @@ module Google module Cloud module NetworkConnectivity module V1 - # A hub is a collection of spokes. A single hub can contain spokes from - # multiple regions. However, if any of a hub's spokes use the data transfer - # feature, the resources associated with those spokes must all reside in the - # same VPC network. Spokes that do not use data transfer can be associated - # with any VPC network in your project. + # A Network Connectivity Center hub is a collection of spokes. A single hub + # can contain spokes from multiple regions. However, if any of a hub's spokes + # use the data transfer feature, the resources associated with those spokes + # must all reside in the same VPC network. Spokes that do not use data + # transfer can be associated with any VPC network in your project. # @!attribute [rw] name # @return [::String] # Immutable. The name of the hub. Hub names must be unique. They use the @@ -47,9 +47,9 @@ module V1 # An optional description of the hub. # @!attribute [r] unique_id # @return [::String] - # Output only. The Google-generated UUID for the hub. This value is unique across all hub - # resources. If a hub is deleted and another with the same name is created, - # the new hub is assigned a different unique_id. + # Output only. The Google-generated UUID for the hub. This value is unique + # across all hub resources. If a hub is deleted and another with the same + # name is created, the new hub is assigned a different unique_id. # @!attribute [r] state # @return [::Google::Cloud::NetworkConnectivity::V1::State] # Output only. The current lifecycle state of this hub. @@ -73,15 +73,15 @@ class LabelsEntry end end - # RoutingVPC contains information about the VPC networks that are associated - # with a hub's spokes. + # RoutingVPC contains information about the VPC networks associated + # with the spokes of a Network Connectivity Center hub. # @!attribute [rw] uri # @return [::String] # The URI of the VPC network. # @!attribute [r] required_for_new_site_to_site_data_transfer_spokes # @return [::Boolean] - # Output only. If true, indicates that this VPC network is currently associated with - # spokes that use the data transfer feature (spokes where the + # Output only. If true, indicates that this VPC network is currently + # associated with spokes that use the data transfer feature (spokes where the # site_to_site_data_transfer field is set to true). If you create new spokes # that use data transfer, they must be associated with this VPC network. At # most, one VPC network will have this field set to true. @@ -90,8 +90,8 @@ class RoutingVPC extend ::Google::Protobuf::MessageExts::ClassMethods end - # A spoke represents a connection between your Google Cloud network resources - # and a non-Google-Cloud network. + # A Network Connectivity Center spoke represents a connection between your + # Google Cloud network resources and a non-Google-Cloud network. # # When you create a spoke, you associate it with a hub. You must also identify # a value for exactly one of the following fields: @@ -132,9 +132,9 @@ class RoutingVPC # Router appliance instances that are associated with the spoke. # @!attribute [r] unique_id # @return [::String] - # Output only. The Google-generated UUID for the spoke. This value is unique across all - # spoke resources. If a spoke is deleted and another with the same name is - # created, the new spoke is assigned a different unique_id. + # Output only. The Google-generated UUID for the spoke. This value is unique + # across all spoke resources. If a spoke is deleted and another with the same + # name is created, the new spoke is assigned a different unique_id. # @!attribute [r] state # @return [::Google::Cloud::NetworkConnectivity::V1::State] # Output only. The current lifecycle state of this spoke. @@ -152,7 +152,9 @@ class LabelsEntry end end - # Request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_hubs HubService.ListHubs} method. + # Request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_hubs HubService.ListHubs} + # method. # @!attribute [rw] parent # @return [::String] # Required. The parent resource's name. @@ -173,7 +175,9 @@ class ListHubsRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Response for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_hubs HubService.ListHubs} method. + # Response for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_hubs HubService.ListHubs} + # method. # @!attribute [rw] hubs # @return [::Array<::Google::Cloud::NetworkConnectivity::V1::Hub>] # The requested hubs. @@ -189,7 +193,9 @@ class ListHubsResponse extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_hub HubService.GetHub} method. + # Request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_hub HubService.GetHub} + # method. # @!attribute [rw] name # @return [::String] # Required. The name of the hub resource to get. @@ -198,7 +204,9 @@ class GetHubRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_hub HubService.CreateHub} method. + # Request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_hub HubService.CreateHub} + # method. # @!attribute [rw] parent # @return [::String] # Required. The parent resource. @@ -210,11 +218,11 @@ class GetHubRequest # Required. The initial values for a new hub. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -229,24 +237,26 @@ class CreateHubRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_hub HubService.UpdateHub} method. + # Request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_hub HubService.UpdateHub} + # method. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] - # Optional. In the case of an update to an existing hub, field mask is used to specify - # the fields to be overwritten. The fields specified in the update_mask are - # relative to the resource, not the full request. A field is overwritten if - # it is in the mask. If the user does not provide a mask, then all fields are - # overwritten. + # Optional. In the case of an update to an existing hub, field mask is used + # to specify the fields to be overwritten. The fields specified in the + # update_mask are relative to the resource, not the full request. A field is + # overwritten if it is in the mask. If the user does not provide a mask, then + # all fields are overwritten. # @!attribute [rw] hub # @return [::Google::Cloud::NetworkConnectivity::V1::Hub] # Required. The state that the hub should be in after the update. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -261,17 +271,18 @@ class UpdateHubRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_hub HubService.DeleteHub}. + # The request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_hub HubService.DeleteHub}. # @!attribute [rw] name # @return [::String] # Required. The name of the hub to delete. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -286,7 +297,8 @@ class DeleteHubRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_spokes HubService.ListSpokes}. + # The request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_spokes HubService.ListSpokes}. # @!attribute [rw] parent # @return [::String] # Required. The parent resource. @@ -307,7 +319,8 @@ class ListSpokesRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The response for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_spokes HubService.ListSpokes}. + # The response for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#list_spokes HubService.ListSpokes}. # @!attribute [rw] spokes # @return [::Array<::Google::Cloud::NetworkConnectivity::V1::Spoke>] # The requested spokes. @@ -323,7 +336,8 @@ class ListSpokesResponse extend ::Google::Protobuf::MessageExts::ClassMethods end - # The request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_spoke HubService.GetSpoke}. + # The request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#get_spoke HubService.GetSpoke}. # @!attribute [rw] name # @return [::String] # Required. The name of the spoke resource. @@ -332,7 +346,8 @@ class GetSpokeRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_spoke HubService.CreateSpoke}. + # The request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#create_spoke HubService.CreateSpoke}. # @!attribute [rw] parent # @return [::String] # Required. The parent resource. @@ -344,11 +359,11 @@ class GetSpokeRequest # Required. The initial values for a new spoke. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -363,11 +378,13 @@ class CreateSpokeRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_spoke HubService.UpdateSpoke} method. + # Request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#update_spoke HubService.UpdateSpoke} + # method. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] - # Optional. In the case of an update to an existing spoke, field mask is used to - # specify the fields to be overwritten. The fields specified in the + # Optional. In the case of an update to an existing spoke, field mask is used + # to specify the fields to be overwritten. The fields specified in the # update_mask are relative to the resource, not the full request. A field is # overwritten if it is in the mask. If the user does not provide a mask, then # all fields are overwritten. @@ -376,11 +393,11 @@ class CreateSpokeRequest # Required. The state that the spoke should be in after the update. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -395,17 +412,18 @@ class UpdateSpokeRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The request for {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_spoke HubService.DeleteSpoke}. + # The request for + # {::Google::Cloud::NetworkConnectivity::V1::HubService::Client#delete_spoke HubService.DeleteSpoke}. # @!attribute [rw] name # @return [::String] # Required. The name of the spoke to delete. # @!attribute [rw] request_id # @return [::String] - # Optional. A unique request ID (optional). If you specify this ID, you can use it - # in cases when you need to retry your request. When you need to retry, this - # ID lets the server know that it can ignore the request if it has already - # been completed. The server guarantees that for at least 60 minutes after - # the first request. + # Optional. A unique request ID (optional). If you specify this ID, you can + # use it in cases when you need to retry your request. When you need to + # retry, this ID lets the server know that it can ignore the request if it + # has already been completed. The server guarantees that for at least 60 + # minutes after the first request. # # For example, consider a situation where you make an initial request and # the request times out. If you make the request again with the same request @@ -432,6 +450,9 @@ class DeleteSpokeRequest # A value that controls whether site-to-site data transfer is enabled for # these resources. Data transfer is available only in [supported # locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + # @!attribute [r] vpc_network + # @return [::String] + # Output only. The VPC network where these VPN tunnels are located. class LinkedVpnTunnels include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -449,6 +470,9 @@ class LinkedVpnTunnels # A value that controls whether site-to-site data transfer is enabled for # these resources. Data transfer is available only in [supported # locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + # @!attribute [r] vpc_network + # @return [::String] + # Output only. The VPC network where these VLAN attachments are located. class LinkedInterconnectAttachments include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -466,6 +490,10 @@ class LinkedInterconnectAttachments # A value that controls whether site-to-site data transfer is enabled for # these resources. Data transfer is available only in [supported # locations](https://cloud.google.com/network-connectivity/docs/network-connectivity-center/concepts/locations). + # @!attribute [r] vpc_network + # @return [::String] + # Output only. The VPC network where these router appliance instances are + # located. class LinkedRouterApplianceInstances include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -495,6 +523,18 @@ class LocationMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end + # Supported features for a location + module LocationFeature + # No publicly supported feature in this location + LOCATION_FEATURE_UNSPECIFIED = 0 + + # Site-to-cloud spokes are supported in this location + SITE_TO_CLOUD_SPOKES = 1 + + # Site-to-site spokes are supported in this location + SITE_TO_SITE_SPOKES = 2 + end + # The State enum represents the lifecycle stage of a Network Connectivity # Center resource. module State @@ -509,18 +549,9 @@ module State # The resource's Delete operation is in progress DELETING = 3 - end - - # Supported features for a location - module LocationFeature - # No publicly supported feature in this location - LOCATION_FEATURE_UNSPECIFIED = 0 - # Site-to-cloud spokes are supported in this location - SITE_TO_CLOUD_SPOKES = 1 - - # Site-to-site spokes are supported in this location - SITE_TO_SITE_SPOKES = 2 + # The resource's Update operation is in progress + UPDATING = 6 end end end diff --git a/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb b/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb new file mode 100644 index 000000000000..cd51d16055b6 --- /dev/null +++ b/google-cloud-network_connectivity-v1/proto_docs/google/cloud/networkconnectivity/v1/policy_based_routing.rb @@ -0,0 +1,295 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module NetworkConnectivity + module V1 + # Policy Based Routes (PBR) are more powerful routes that allows GCP customers + # to route their L4 network traffic based on not just destination IP, but also + # source IP, protocol and more. A PBR always take precedence when it conflicts + # with other types of routes. + # Next id: 19 + # @!attribute [rw] virtual_machine + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::VirtualMachine] + # Optional. VM instances to which this policy based route applies to. + # @!attribute [rw] interconnect_attachment + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::InterconnectAttachment] + # Optional. The interconnect attachments to which this route applies to. + # @!attribute [rw] next_hop_ilb_ip + # @return [::String] + # Optional. The IP of a global access enabled L4 ILB that should be the next hop to + # handle matching packets. For this version, only next_hop_ilb_ip is + # supported. + # @!attribute [rw] name + # @return [::String] + # Immutable. A unique name of the resource in the form of + # `projects/{project_number}/locations/global/PolicyBasedRoutes/{policy_based_route_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the PolicyBasedRoute was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the PolicyBasedRoute was updated. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # User-defined labels. + # @!attribute [rw] description + # @return [::String] + # Optional. An optional description of this resource. Provide this field when you + # create the resource. + # @!attribute [rw] network + # @return [::String] + # Required. Fully-qualified URL of the network that this route applies to. e.g. + # projects/my-project/global/networks/my-network. + # @!attribute [rw] filter + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter] + # Required. The filter to match L4 traffic. + # @!attribute [rw] priority + # @return [::Integer] + # Optional. The priority of this policy based route. Priority is used to break ties in + # cases where there are more than one matching policy based routes found. In + # cases where multiple policy based routes are matched, the one with the + # lowest-numbered priority value wins. The default value is 1000. The + # priority value must be from 1 to 65535, inclusive. + # @!attribute [r] warnings + # @return [::Array<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings>] + # Output only. If potential misconfigurations are detected for this route, + # this field will be populated with warning messages. + # @!attribute [r] self_link + # @return [::String] + # Output only. Server-defined fully-qualified URL for this resource. + # @!attribute [r] kind + # @return [::String] + # Output only. Type of this resource. Always networkconnectivity#policyBasedRoute for + # Policy Based Route resources. + class PolicyBasedRoute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # VM instances to which this policy based route applies to. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. A list of VM instance tags to which this policy based route applies to. + # VM instances that have ANY of tags specified here will install this + # PBR. + class VirtualMachine + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InterconnectAttachment to which this route applies to. + # @!attribute [rw] region + # @return [::String] + # Optional. Cloud region to install this policy based route on interconnect + # attachment. Use `all` to install it on all interconnect attachments. + class InterconnectAttachment + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Filter matches L4 traffic. + # @!attribute [rw] ip_protocol + # @return [::String] + # Optional. The IP protocol that this policy based route applies to. Valid values are + # 'TCP', 'UDP', and 'ALL'. Default is 'ALL'. + # @!attribute [rw] src_range + # @return [::String] + # Optional. The source IP range of outgoing packets that this policy based route + # applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + # @!attribute [rw] dest_range + # @return [::String] + # Optional. The destination IP range of outgoing packets that this policy based route + # applies to. Default is "0.0.0.0/0" if protocol version is IPv4. + # @!attribute [rw] protocol_version + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Filter::ProtocolVersion] + # Required. Internet protocol versions this policy based route applies to. For this + # version, only IPV4 is supported. + class Filter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The internet protocol version. + module ProtocolVersion + # Default value. + PROTOCOL_VERSION_UNSPECIFIED = 0 + + # The PBR is for IPv4 internet protocol traffic. + IPV4 = 1 + end + end + + # Informational warning message. + # @!attribute [r] code + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute::Warnings::Code] + # Output only. A warning code, if applicable. + # @!attribute [r] data + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Metadata about this warning in key: value format. The key should provides + # more detail on the warning being returned. For example, for warnings + # where there are no results in a list request for a particular zone, this + # key might be scope and the key value might be the zone name. Other + # examples might be a key indicating a deprecated resource and a suggested + # replacement. + # @!attribute [r] warning_message + # @return [::String] + # Output only. A human-readable description of the warning code. + class Warnings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class DataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Warning code for Policy Based Routing. Expect to add values in the + # future. + module Code + # Default value. + WARNING_UNSPECIFIED = 0 + + # The policy based route is not active and functioning. Common causes are + # the dependent network was deleted or the resource project was turned + # off. + RESOURCE_NOT_ACTIVE = 1 + + # The policy based route is being modified (e.g. created/deleted) at this + # time. + RESOURCE_BEING_MODIFIED = 2 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request for [PolicyBasedRouting.ListPolicyBasedRoutes][] method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource's name. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results per page that should be returned. + # @!attribute [rw] page_token + # @return [::String] + # The page token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that filters the results listed in the response. + # @!attribute [rw] order_by + # @return [::String] + # Sort the results by a certain order. + class ListPolicyBasedRoutesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for [PolicyBasedRouting.ListPolicyBasedRoutes][] method. + # @!attribute [rw] policy_based_routes + # @return [::Array<::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute>] + # Policy based routes to be returned. + # @!attribute [rw] next_page_token + # @return [::String] + # The next pagination token in the List response. It should be used as + # page_token for the following request. An empty value means no more result. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListPolicyBasedRoutesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [PolicyBasedRouting.GetPolicyBasedRoute][] method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the PolicyBasedRoute resource to get. + class GetPolicyBasedRouteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [PolicyBasedRouting.CreatePolicyBasedRoute][] method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource's name of the PolicyBasedRoute. + # @!attribute [rw] policy_based_route_id + # @return [::String] + # Optional. Unique id for the Policy Based Route to create. + # @!attribute [rw] policy_based_route + # @return [::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute] + # Required. Initial values for a new Policy Based Route. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreatePolicyBasedRouteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for [PolicyBasedRouting.DeletePolicyBasedRoute][] method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the PolicyBasedRoute resource to delete. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeletePolicyBasedRouteRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/create_policy_based_route.rb b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/create_policy_based_route.rb new file mode 100644 index 000000000000..3b5dadec629b --- /dev/null +++ b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/create_policy_based_route.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync] +require "google/cloud/network_connectivity/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#create_policy_based_route +# +def create_policy_based_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest.new + + # Call the create_policy_based_route method. + result = client.create_policy_based_route request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/delete_policy_based_route.rb b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/delete_policy_based_route.rb new file mode 100644 index 000000000000..13264cfe520c --- /dev/null +++ b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/delete_policy_based_route.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_sync] +require "google/cloud/network_connectivity/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#delete_policy_based_route +# +def delete_policy_based_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest.new + + # Call the delete_policy_based_route method. + result = client.delete_policy_based_route request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/get_policy_based_route.rb b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/get_policy_based_route.rb new file mode 100644 index 000000000000..a4733cca91d3 --- /dev/null +++ b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/get_policy_based_route.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_sync] +require "google/cloud/network_connectivity/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#get_policy_based_route +# +def get_policy_based_route + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest.new + + # Call the get_policy_based_route method. + result = client.get_policy_based_route request + + # The returned object is of type Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute. + p result +end +# [END networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/list_policy_based_routes.rb b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/list_policy_based_routes.rb new file mode 100644 index 000000000000..b0c894cfa1e9 --- /dev/null +++ b/google-cloud-network_connectivity-v1/snippets/policy_based_routing_service/list_policy_based_routes.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_sync] +require "google/cloud/network_connectivity/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#list_policy_based_routes +# +def list_policy_based_routes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest.new + + # Call the list_policy_based_routes method. + result = client.list_policy_based_routes request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute. + p response + end +end +# [END networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_sync] diff --git a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json index 354098850a28..9eccf0581284 100644 --- a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -410,6 +410,166 @@ "type": "FULL" } ] + }, + { + "region_tag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_ListPolicyBasedRoutes_sync", + "title": "Snippet for list_policy_based_routes in PolicyBasedRoutingService", + "description": "Basic snippet for list_policy_based_routes in PolicyBasedRoutingService", + "file": "policy_based_routing_service/list_policy_based_routes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_policy_based_routes", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#list_policy_based_routes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesResponse", + "client": { + "short_name": "PolicyBasedRoutingService::Client", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client" + }, + "method": { + "short_name": "ListPolicyBasedRoutes", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.ListPolicyBasedRoutes", + "service": { + "short_name": "PolicyBasedRoutingService", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_GetPolicyBasedRoute_sync", + "title": "Snippet for get_policy_based_route in PolicyBasedRoutingService", + "description": "Basic snippet for get_policy_based_route in PolicyBasedRoutingService", + "file": "policy_based_routing_service/get_policy_based_route.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_policy_based_route", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#get_policy_based_route", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute", + "client": { + "short_name": "PolicyBasedRoutingService::Client", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client" + }, + "method": { + "short_name": "GetPolicyBasedRoute", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.GetPolicyBasedRoute", + "service": { + "short_name": "PolicyBasedRoutingService", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_CreatePolicyBasedRoute_sync", + "title": "Snippet for create_policy_based_route in PolicyBasedRoutingService", + "description": "Basic snippet for create_policy_based_route in PolicyBasedRoutingService", + "file": "policy_based_routing_service/create_policy_based_route.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_policy_based_route", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#create_policy_based_route", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PolicyBasedRoutingService::Client", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client" + }, + "method": { + "short_name": "CreatePolicyBasedRoute", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.CreatePolicyBasedRoute", + "service": { + "short_name": "PolicyBasedRoutingService", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "networkconnectivity_v1_generated_PolicyBasedRoutingService_DeletePolicyBasedRoute_sync", + "title": "Snippet for delete_policy_based_route in PolicyBasedRoutingService", + "description": "Basic snippet for delete_policy_based_route in PolicyBasedRoutingService", + "file": "policy_based_routing_service/delete_policy_based_route.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_policy_based_route", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client#delete_policy_based_route", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "PolicyBasedRoutingService::Client", + "full_name": "::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client" + }, + "method": { + "short_name": "DeletePolicyBasedRoute", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService.DeletePolicyBasedRoute", + "service": { + "short_name": "PolicyBasedRoutingService", + "full_name": "google.cloud.networkconnectivity.v1.PolicyBasedRoutingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb new file mode 100644 index 000000000000..343c94d6ad05 --- /dev/null +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/networkconnectivity/v1/policy_based_routing_pb" +require "google/cloud/networkconnectivity/v1/policy_based_routing_services_pb" +require "google/cloud/network_connectivity/v1/policy_based_routing_service" + +class ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations::Configuration, config + end +end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb new file mode 100644 index 000000000000..364ef0bc0b85 --- /dev/null +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_paths_test.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/network_connectivity/v1/policy_based_routing_service" + +class ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::ClientPathsTest < Minitest::Test + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", resource_id: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_policy_based_route_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.policy_based_route_path project: "value0", location: "value1", policy_based_route: "value2" + assert_equal "projects/value0/value1/global/PolicyBasedRoutes/value2", path + end + end +end diff --git a/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb new file mode 100644 index 000000000000..cf81c640d573 --- /dev/null +++ b/google-cloud-network_connectivity-v1/test/google/cloud/network_connectivity/v1/policy_based_routing_service_test.rb @@ -0,0 +1,343 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/networkconnectivity/v1/policy_based_routing_pb" +require "google/cloud/networkconnectivity/v1/policy_based_routing_services_pb" +require "google/cloud/network_connectivity/v1/policy_based_routing_service" + +class ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_policy_based_routes + # Create GRPC objects. + grpc_response = ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_policy_based_routes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_policy_based_routes, name + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["order_by"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_policy_based_routes_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_policy_based_routes({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_policy_based_routes parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_policy_based_routes ::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_policy_based_routes({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_policy_based_routes(::Google::Cloud::NetworkConnectivity::V1::ListPolicyBasedRoutesRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_policy_based_routes_client_stub.call_rpc_count + end + end + + def test_get_policy_based_route + # Create GRPC objects. + grpc_response = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_policy_based_route_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_policy_based_route, name + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_policy_based_route_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_policy_based_route({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_policy_based_route name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_policy_based_route ::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_policy_based_route({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_policy_based_route(::Google::Cloud::NetworkConnectivity::V1::GetPolicyBasedRouteRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_policy_based_route_client_stub.call_rpc_count + end + end + + def test_create_policy_based_route + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + policy_based_route_id = "hello world" + policy_based_route = {} + request_id = "hello world" + + create_policy_based_route_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_policy_based_route, name + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["policy_based_route_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoute), request["policy_based_route"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_policy_based_route_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_policy_based_route({ parent: parent, policy_based_route_id: policy_based_route_id, policy_based_route: policy_based_route, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_policy_based_route parent: parent, policy_based_route_id: policy_based_route_id, policy_based_route: policy_based_route, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_policy_based_route ::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest.new(parent: parent, policy_based_route_id: policy_based_route_id, policy_based_route: policy_based_route, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_policy_based_route({ parent: parent, policy_based_route_id: policy_based_route_id, policy_based_route: policy_based_route, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_policy_based_route(::Google::Cloud::NetworkConnectivity::V1::CreatePolicyBasedRouteRequest.new(parent: parent, policy_based_route_id: policy_based_route_id, policy_based_route: policy_based_route, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_policy_based_route_client_stub.call_rpc_count + end + end + + def test_delete_policy_based_route + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + delete_policy_based_route_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_policy_based_route, name + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_policy_based_route_client_stub do + # Create client + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_policy_based_route({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_policy_based_route name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_policy_based_route ::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_policy_based_route({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_policy_based_route(::Google::Cloud::NetworkConnectivity::V1::DeletePolicyBasedRouteRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_policy_based_route_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Operations, client.operations_client + end +end From 8451598ca759c3f72827d2f729ddb651af72dab2 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Mon, 7 Nov 2022 07:43:09 +0530 Subject: [PATCH 018/112] chore(video-transcoder): assert output outside retry (#19366) --- .../samples/acceptance/job_test.rb | 70 +++++++++++-------- 1 file changed, 41 insertions(+), 29 deletions(-) diff --git a/google-cloud-video-transcoder/samples/acceptance/job_test.rb b/google-cloud-video-transcoder/samples/acceptance/job_test.rb index 34f70338d769..4dbdd6653c95 100644 --- a/google-cloud-video-transcoder/samples/acceptance/job_test.rb +++ b/google-cloud-video-transcoder/samples/acceptance/job_test.rb @@ -60,7 +60,7 @@ let(:output_uri_for_concat) { "#{output_uri_prefix}/test-output-concat/" } let(:job_state_retries) { 4 } let(:job_state_succeeded) { "SUCCEEDED" } - let(:job_state_succeeded_message) { "Job state: #{job_state_succeeded}" } + let(:job_state_succeeded_message) { "Job state: #{job_state_succeeded}\n" } before do bucket @@ -97,15 +97,17 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -126,15 +128,17 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -166,15 +170,17 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -251,15 +257,17 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -280,15 +288,16 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" - + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -309,15 +318,16 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" - + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -338,15 +348,16 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" - + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end @@ -370,15 +381,16 @@ job_id = str_slice[str_slice.length - 1].rstrip }.must_output(%r{Job: projects/#{project_number}/locations/#{location_id}/jobs/}) - state = "" - + output = "" job_state_retries.times do sleep rand(30..35) - expect { + state = "" + output = capture_io { state = get_job_state project_id: project_id, location: location_id, job_id: job_id - }.must_output(/#{job_state_succeeded_message}/) + } break if state.eql? job_state_succeeded end + expect(output).must_include(job_state_succeeded_message) end end end From 39ec66b28f99cb8491f1df4bd370c4a28791e4cb Mon Sep 17 00:00:00 2001 From: meredithslota Date: Mon, 7 Nov 2022 03:52:20 -0800 Subject: [PATCH 019/112] chore: Remove broken links and fix outdated content in the auth page (#19289) --- google-cloud-bigquery/AUTHENTICATION.md | 34 ++++++------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/google-cloud-bigquery/AUTHENTICATION.md b/google-cloud-bigquery/AUTHENTICATION.md index 2dc2e5f4320f..bd8ddeba1cdf 100644 --- a/google-cloud-bigquery/AUTHENTICATION.md +++ b/google-cloud-bigquery/AUTHENTICATION.md @@ -106,15 +106,6 @@ To configure your system for this, simply: **NOTE:** This is _not_ recommended for running in production. The Cloud SDK *should* only be used during development. -[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using -[dev-console]: https://console.cloud.google.com/project - -[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png - -[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png -[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png -[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png - ## Creating a Service Account Google Cloud requires a **Project ID** and **Service Account Credentials** to @@ -124,31 +115,22 @@ connect to most services with google-cloud-bigquery. If you are not running this client on Google Compute Engine, you need a Google Developers service account. -1. Visit the [Google Developers Console][dev-console]. +1. Visit the [Google Cloud Console](https://console.cloud.google.com/project). 1. Create a new project or click on an existing project. -1. Activate the slide-out navigation tray and select **API Manager**. From +1. Activate the menu in the upper left and select **APIs & Services**. From here, you will enable the APIs that your application requires. - ![Enable the APIs that your application requires][enable-apis] - *Note: You may need to enable billing in order to use these services.* 1. Select **Credentials** from the side navigation. - You should see a screen like one of the following. - - ![Create a new service account][create-new-service-account] - - ![Create a new service account With Existing Keys][create-new-service-account-existing-keys] - - Find the "Add credentials" drop down and select "Service account" to be - guided through downloading a new JSON key file. - - If you want to re-use an existing service account, you can easily generate a - new key file. Just select the account you wish to re-use, and click "Generate - new JSON key": + Find the "Create credentials" drop down near the top of the page, and select + "Service account" to be guided through downloading a new JSON key file. - ![Re-use an existing service account][reuse-service-account] + If you want to re-use an existing service account, you can easily generate + a new key file. Just select the account you wish to re-use click the pencil + tool on the right side to edit the service account, select the **Keys** tab, + and then select **Add Key**. The key file you download will be used by this library to authenticate API requests and should be stored in a secure location. From 7646c653cf86cb2ee432f4e49580b555e12510a0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:32:20 +0530 Subject: [PATCH 020/112] feat(cloud-run-v2): support jobs and executions feat(cloud-run-v2): support new IAM policy --- google-cloud-run-v2/.owlbot-manifest.json | 49 + google-cloud-run-v2/AUTHENTICATION.md | 12 +- google-cloud-run-v2/README.md | 6 +- google-cloud-run-v2/Rakefile | 4 +- google-cloud-run-v2/gapic_metadata.json | 97 ++ .../lib/google/cloud/run/v2.rb | 5 +- .../lib/google/cloud/run/v2/execution_pb.rb | 76 + .../cloud/run/v2/execution_services_pb.rb | 49 + .../cloud/run/v2/execution_template_pb.rb | 29 + .../lib/google/cloud/run/v2/executions.rb | 50 + .../google/cloud/run/v2/executions/client.rb | 635 +++++++++ .../cloud/run/v2/executions/credentials.rb | 47 + .../cloud/run/v2/executions/operations.rb | 770 ++++++++++ .../google/cloud/run/v2/executions/paths.rb | 73 + .../lib/google/cloud/run/v2/job_pb.rb | 104 ++ .../google/cloud/run/v2/job_services_pb.rb | 65 + .../lib/google/cloud/run/v2/jobs.rb | 50 + .../lib/google/cloud/run/v2/jobs/client.rb | 1259 +++++++++++++++++ .../google/cloud/run/v2/jobs/credentials.rb | 47 + .../google/cloud/run/v2/jobs/operations.rb | 770 ++++++++++ .../lib/google/cloud/run/v2/jobs/paths.rb | 166 +++ .../lib/google/cloud/run/v2/k8s.min_pb.rb | 6 + .../cloud/run/v2/revision_services_pb.rb | 4 +- .../google/cloud/run/v2/revisions/client.rb | 4 +- .../cloud/run/v2/service_services_pb.rb | 4 +- .../google/cloud/run/v2/services/client.rb | 23 +- .../lib/google/cloud/run/v2/task_pb.rb | 81 ++ .../google/cloud/run/v2/task_services_pb.rb | 47 + .../google/cloud/run/v2/task_template_pb.rb | 36 + .../lib/google/cloud/run/v2/tasks.rb | 49 + .../lib/google/cloud/run/v2/tasks/client.rb | 512 +++++++ .../google/cloud/run/v2/tasks/credentials.rb | 47 + .../lib/google/cloud/run/v2/tasks/paths.rb | 77 + .../google/cloud/run/v2/execution.rb | 223 +++ .../google/cloud/run/v2/execution_template.rb | 76 + .../proto_docs/google/cloud/run/v2/job.rb | 308 ++++ .../proto_docs/google/cloud/run/v2/k8s.min.rb | 36 +- .../proto_docs/google/cloud/run/v2/service.rb | 19 +- .../proto_docs/google/cloud/run/v2/task.rb | 229 +++ .../google/cloud/run/v2/task_template.rb | 66 + .../google/cloud/run/v2/vendor_settings.rb | 3 +- .../snippets/executions/delete_execution.rb | 46 + .../snippets/executions/get_execution.rb | 39 + .../snippets/executions/list_executions.rb | 45 + .../snippets/jobs/create_job.rb | 46 + .../snippets/jobs/delete_job.rb | 46 + .../snippets/jobs/get_iam_policy.rb | 39 + google-cloud-run-v2/snippets/jobs/get_job.rb | 39 + .../snippets/jobs/list_jobs.rb | 45 + google-cloud-run-v2/snippets/jobs/run_job.rb | 46 + .../snippets/jobs/set_iam_policy.rb | 39 + .../snippets/jobs/test_iam_permissions.rb | 39 + .../snippets/jobs/update_job.rb | 46 + .../snippet_metadata_google.cloud.run.v2.json | 560 ++++++++ .../snippets/tasks/get_task.rb | 39 + .../snippets/tasks/list_tasks.rb | 45 + .../run/v2/executions_operations_test.rb | 380 +++++ .../cloud/run/v2/executions_paths_test.rb | 49 + .../google/cloud/run/v2/executions_test.rb | 274 ++++ .../cloud/run/v2/jobs_operations_test.rb | 380 +++++ .../google/cloud/run/v2/jobs_paths_test.rb | 109 ++ .../test/google/cloud/run/v2/jobs_test.rb | 659 +++++++++ .../google/cloud/run/v2/tasks_paths_test.rb | 49 + .../test/google/cloud/run/v2/tasks_test.rb | 194 +++ 64 files changed, 9422 insertions(+), 44 deletions(-) create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/execution_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/execution_services_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/execution_template_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/executions.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/executions/credentials.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/executions/operations.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/executions/paths.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/job_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/job_services_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/jobs.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/jobs/credentials.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/jobs/operations.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/jobs/paths.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/task_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/task_services_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/task_template_pb.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/tasks.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/tasks/credentials.rb create mode 100644 google-cloud-run-v2/lib/google/cloud/run/v2/tasks/paths.rb create mode 100644 google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution.rb create mode 100644 google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution_template.rb create mode 100644 google-cloud-run-v2/proto_docs/google/cloud/run/v2/job.rb create mode 100644 google-cloud-run-v2/proto_docs/google/cloud/run/v2/task.rb create mode 100644 google-cloud-run-v2/proto_docs/google/cloud/run/v2/task_template.rb create mode 100644 google-cloud-run-v2/snippets/executions/delete_execution.rb create mode 100644 google-cloud-run-v2/snippets/executions/get_execution.rb create mode 100644 google-cloud-run-v2/snippets/executions/list_executions.rb create mode 100644 google-cloud-run-v2/snippets/jobs/create_job.rb create mode 100644 google-cloud-run-v2/snippets/jobs/delete_job.rb create mode 100644 google-cloud-run-v2/snippets/jobs/get_iam_policy.rb create mode 100644 google-cloud-run-v2/snippets/jobs/get_job.rb create mode 100644 google-cloud-run-v2/snippets/jobs/list_jobs.rb create mode 100644 google-cloud-run-v2/snippets/jobs/run_job.rb create mode 100644 google-cloud-run-v2/snippets/jobs/set_iam_policy.rb create mode 100644 google-cloud-run-v2/snippets/jobs/test_iam_permissions.rb create mode 100644 google-cloud-run-v2/snippets/jobs/update_job.rb create mode 100644 google-cloud-run-v2/snippets/tasks/get_task.rb create mode 100644 google-cloud-run-v2/snippets/tasks/list_tasks.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb create mode 100644 google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb diff --git a/google-cloud-run-v2/.owlbot-manifest.json b/google-cloud-run-v2/.owlbot-manifest.json index 747e97554b3c..fa3fceff56e8 100644 --- a/google-cloud-run-v2/.owlbot-manifest.json +++ b/google-cloud-run-v2/.owlbot-manifest.json @@ -15,6 +15,21 @@ "lib/google-cloud-run-v2.rb", "lib/google/cloud/run/v2.rb", "lib/google/cloud/run/v2/condition_pb.rb", + "lib/google/cloud/run/v2/execution_pb.rb", + "lib/google/cloud/run/v2/execution_services_pb.rb", + "lib/google/cloud/run/v2/execution_template_pb.rb", + "lib/google/cloud/run/v2/executions.rb", + "lib/google/cloud/run/v2/executions/client.rb", + "lib/google/cloud/run/v2/executions/credentials.rb", + "lib/google/cloud/run/v2/executions/operations.rb", + "lib/google/cloud/run/v2/executions/paths.rb", + "lib/google/cloud/run/v2/job_pb.rb", + "lib/google/cloud/run/v2/job_services_pb.rb", + "lib/google/cloud/run/v2/jobs.rb", + "lib/google/cloud/run/v2/jobs/client.rb", + "lib/google/cloud/run/v2/jobs/credentials.rb", + "lib/google/cloud/run/v2/jobs/operations.rb", + "lib/google/cloud/run/v2/jobs/paths.rb", "lib/google/cloud/run/v2/k8s.min_pb.rb", "lib/google/cloud/run/v2/revision_pb.rb", "lib/google/cloud/run/v2/revision_services_pb.rb", @@ -31,6 +46,13 @@ "lib/google/cloud/run/v2/services/credentials.rb", "lib/google/cloud/run/v2/services/operations.rb", "lib/google/cloud/run/v2/services/paths.rb", + "lib/google/cloud/run/v2/task_pb.rb", + "lib/google/cloud/run/v2/task_services_pb.rb", + "lib/google/cloud/run/v2/task_template_pb.rb", + "lib/google/cloud/run/v2/tasks.rb", + "lib/google/cloud/run/v2/tasks/client.rb", + "lib/google/cloud/run/v2/tasks/credentials.rb", + "lib/google/cloud/run/v2/tasks/paths.rb", "lib/google/cloud/run/v2/traffic_target_pb.rb", "lib/google/cloud/run/v2/vendor_settings_pb.rb", "lib/google/cloud/run/v2/version.rb", @@ -40,10 +62,15 @@ "proto_docs/google/api/resource.rb", "proto_docs/google/api/routing.rb", "proto_docs/google/cloud/run/v2/condition.rb", + "proto_docs/google/cloud/run/v2/execution.rb", + "proto_docs/google/cloud/run/v2/execution_template.rb", + "proto_docs/google/cloud/run/v2/job.rb", "proto_docs/google/cloud/run/v2/k8s.min.rb", "proto_docs/google/cloud/run/v2/revision.rb", "proto_docs/google/cloud/run/v2/revision_template.rb", "proto_docs/google/cloud/run/v2/service.rb", + "proto_docs/google/cloud/run/v2/task.rb", + "proto_docs/google/cloud/run/v2/task_template.rb", "proto_docs/google/cloud/run/v2/traffic_target.rb", "proto_docs/google/cloud/run/v2/vendor_settings.rb", "proto_docs/google/iam/v1/iam_policy.rb", @@ -58,6 +85,18 @@ "proto_docs/google/rpc/status.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", + "snippets/executions/delete_execution.rb", + "snippets/executions/get_execution.rb", + "snippets/executions/list_executions.rb", + "snippets/jobs/create_job.rb", + "snippets/jobs/delete_job.rb", + "snippets/jobs/get_iam_policy.rb", + "snippets/jobs/get_job.rb", + "snippets/jobs/list_jobs.rb", + "snippets/jobs/run_job.rb", + "snippets/jobs/set_iam_policy.rb", + "snippets/jobs/test_iam_permissions.rb", + "snippets/jobs/update_job.rb", "snippets/revisions/delete_revision.rb", "snippets/revisions/get_revision.rb", "snippets/revisions/list_revisions.rb", @@ -70,12 +109,22 @@ "snippets/services/test_iam_permissions.rb", "snippets/services/update_service.rb", "snippets/snippet_metadata_google.cloud.run.v2.json", + "snippets/tasks/get_task.rb", + "snippets/tasks/list_tasks.rb", + "test/google/cloud/run/v2/executions_operations_test.rb", + "test/google/cloud/run/v2/executions_paths_test.rb", + "test/google/cloud/run/v2/executions_test.rb", + "test/google/cloud/run/v2/jobs_operations_test.rb", + "test/google/cloud/run/v2/jobs_paths_test.rb", + "test/google/cloud/run/v2/jobs_test.rb", "test/google/cloud/run/v2/revisions_operations_test.rb", "test/google/cloud/run/v2/revisions_paths_test.rb", "test/google/cloud/run/v2/revisions_test.rb", "test/google/cloud/run/v2/services_operations_test.rb", "test/google/cloud/run/v2/services_paths_test.rb", "test/google/cloud/run/v2/services_test.rb", + "test/google/cloud/run/v2/tasks_paths_test.rb", + "test/google/cloud/run/v2/tasks_test.rb", "test/helper.rb" ], "static": [ diff --git a/google-cloud-run-v2/AUTHENTICATION.md b/google-cloud-run-v2/AUTHENTICATION.md index 5f554a786cfd..31ae16693097 100644 --- a/google-cloud-run-v2/AUTHENTICATION.md +++ b/google-cloud-run-v2/AUTHENTICATION.md @@ -27,7 +27,7 @@ export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json ```ruby require "google/cloud/run/v2" -client = ::Google::Cloud::Run::V2::Revisions::Client.new +client = ::Google::Cloud::Run::V2::Executions::Client.new ``` ## Credential Lookup @@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged. The environment variables that google-cloud-run-v2 checks for credentials are configured on the service Credentials class (such as -{::Google::Cloud::Run::V2::Revisions::Credentials}): +{::Google::Cloud::Run::V2::Executions::Credentials}): * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents @@ -75,7 +75,7 @@ require "google/cloud/run/v2" ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" -client = ::Google::Cloud::Run::V2::Revisions::Client.new +client = ::Google::Cloud::Run::V2::Executions::Client.new ``` ### Configuration @@ -86,7 +86,7 @@ it in an environment variable. Either on an individual client initialization: ```ruby require "google/cloud/run/v2" -client = ::Google::Cloud::Run::V2::Revisions::Client.new do |config| +client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| config.credentials = "path/to/keyfile.json" end ``` @@ -96,11 +96,11 @@ Or globally for all clients: ```ruby require "google/cloud/run/v2" -::Google::Cloud::Run::V2::Revisions::Client.configure do |config| +::Google::Cloud::Run::V2::Executions::Client.configure do |config| config.credentials = "path/to/keyfile.json" end -client = ::Google::Cloud::Run::V2::Revisions::Client.new +client = ::Google::Cloud::Run::V2::Executions::Client.new ``` ### Cloud SDK diff --git a/google-cloud-run-v2/README.md b/google-cloud-run-v2/README.md index 367ec1d9c01f..14c0d9856c42 100644 --- a/google-cloud-run-v2/README.md +++ b/google-cloud-run-v2/README.md @@ -32,9 +32,9 @@ In order to use this library, you first need to go through the following steps: ```ruby require "google/cloud/run/v2" -client = ::Google::Cloud::Run::V2::Revisions::Client.new -request = ::Google::Cloud::Run::V2::GetRevisionRequest.new # (request fields as keyword arguments...) -response = client.get_revision request +client = ::Google::Cloud::Run::V2::Executions::Client.new +request = ::Google::Cloud::Run::V2::GetExecutionRequest.new # (request fields as keyword arguments...) +response = client.get_execution request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-run-v2/latest) diff --git a/google-cloud-run-v2/Rakefile b/google-cloud-run-v2/Rakefile index a4a286bc999e..b5be84a33a53 100644 --- a/google-cloud-run-v2/Rakefile +++ b/google-cloud-run-v2/Rakefile @@ -85,8 +85,8 @@ task :acceptance, :project, :keyfile do |t, args| if project.nil? || keyfile.nil? fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" end - require "google/cloud/run/v2/revisions/credentials" - ::Google::Cloud::Run::V2::Revisions::Credentials.env_vars.each do |path| + require "google/cloud/run/v2/executions/credentials" + ::Google::Cloud::Run::V2::Executions::Credentials.env_vars.each do |path| ENV[path] = nil end ENV["GOOGLE_CLOUD_PROJECT"] = project diff --git a/google-cloud-run-v2/gapic_metadata.json b/google-cloud-run-v2/gapic_metadata.json index 95887d160357..8690ce71e45a 100644 --- a/google-cloud-run-v2/gapic_metadata.json +++ b/google-cloud-run-v2/gapic_metadata.json @@ -5,6 +5,84 @@ "protoPackage": "google.cloud.run.v2", "libraryPackage": "::Google::Cloud::Run::V2", "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Run::V2::Executions::Client", + "rpcs": { + "GetExecution": { + "methods": [ + "get_execution" + ] + }, + "ListExecutions": { + "methods": [ + "list_executions" + ] + }, + "DeleteExecution": { + "methods": [ + "delete_execution" + ] + } + } + } + } + }, + "Jobs": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Run::V2::Jobs::Client", + "rpcs": { + "CreateJob": { + "methods": [ + "create_job" + ] + }, + "GetJob": { + "methods": [ + "get_job" + ] + }, + "ListJobs": { + "methods": [ + "list_jobs" + ] + }, + "UpdateJob": { + "methods": [ + "update_job" + ] + }, + "DeleteJob": { + "methods": [ + "delete_job" + ] + }, + "RunJob": { + "methods": [ + "run_job" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + }, "Revisions": { "clients": { "grpc": { @@ -77,6 +155,25 @@ } } } + }, + "Tasks": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Run::V2::Tasks::Client", + "rpcs": { + "GetTask": { + "methods": [ + "get_task" + ] + }, + "ListTasks": { + "methods": [ + "list_tasks" + ] + } + } + } + } } } } diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2.rb b/google-cloud-run-v2/lib/google/cloud/run/v2.rb index f9e1b34f8f79..7b22c72c6cec 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2.rb @@ -16,8 +16,11 @@ # Auto-generated by gapic-generator-ruby. DO NOT EDIT! +require "google/cloud/run/v2/executions" +require "google/cloud/run/v2/jobs" require "google/cloud/run/v2/revisions" require "google/cloud/run/v2/services" +require "google/cloud/run/v2/tasks" require "google/cloud/run/v2/version" module Google @@ -29,7 +32,7 @@ module Run # @example # # require "google/cloud/run/v2" - # client = ::Google::Cloud::Run::V2::Revisions::Client.new + # client = ::Google::Cloud::Run::V2::Executions::Client.new # module V2 end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/execution_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_pb.rb new file mode 100644 index 000000000000..a1f64a9db57c --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_pb.rb @@ -0,0 +1,76 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/run/v2/execution.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/launch_stage_pb' +require 'google/api/resource_pb' +require 'google/cloud/run/v2/condition_pb' +require 'google/cloud/run/v2/task_template_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/run/v2/execution.proto", :syntax => :proto3) do + add_message "google.cloud.run.v2.GetExecutionRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.run.v2.ListExecutionsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + optional :show_deleted, :bool, 4 + end + add_message "google.cloud.run.v2.ListExecutionsResponse" do + repeated :executions, :message, 1, "google.cloud.run.v2.Execution" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.run.v2.DeleteExecutionRequest" do + optional :name, :string, 1 + optional :validate_only, :bool, 2 + optional :etag, :string, 3 + end + add_message "google.cloud.run.v2.Execution" do + optional :name, :string, 1 + optional :uid, :string, 2 + optional :generation, :int64, 3 + map :labels, :string, :string, 4 + map :annotations, :string, :string, 5 + optional :create_time, :message, 6, "google.protobuf.Timestamp" + optional :start_time, :message, 22, "google.protobuf.Timestamp" + optional :completion_time, :message, 7, "google.protobuf.Timestamp" + optional :update_time, :message, 8, "google.protobuf.Timestamp" + optional :delete_time, :message, 9, "google.protobuf.Timestamp" + optional :expire_time, :message, 10, "google.protobuf.Timestamp" + optional :launch_stage, :enum, 11, "google.api.LaunchStage" + optional :job, :string, 12 + optional :parallelism, :int32, 13 + optional :task_count, :int32, 14 + optional :template, :message, 15, "google.cloud.run.v2.TaskTemplate" + optional :reconciling, :bool, 16 + repeated :conditions, :message, 17, "google.cloud.run.v2.Condition" + optional :observed_generation, :int64, 18 + optional :running_count, :int32, 19 + optional :succeeded_count, :int32, 20 + optional :failed_count, :int32, 21 + optional :etag, :string, 99 + end + end +end + +module Google + module Cloud + module Run + module V2 + GetExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.GetExecutionRequest").msgclass + ListExecutionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListExecutionsRequest").msgclass + ListExecutionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListExecutionsResponse").msgclass + DeleteExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.DeleteExecutionRequest").msgclass + Execution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.Execution").msgclass + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/execution_services_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_services_pb.rb new file mode 100644 index 000000000000..62d060f6bce6 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_services_pb.rb @@ -0,0 +1,49 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/run/v2/execution.proto for package 'google.cloud.run.v2' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/run/v2/execution_pb' + +module Google + module Cloud + module Run + module V2 + module Executions + # Cloud Run Execution Control Plane API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.run.v2.Executions' + + # Gets information about an Execution. + rpc :GetExecution, ::Google::Cloud::Run::V2::GetExecutionRequest, ::Google::Cloud::Run::V2::Execution + # Lists Executions from a Job. + rpc :ListExecutions, ::Google::Cloud::Run::V2::ListExecutionsRequest, ::Google::Cloud::Run::V2::ListExecutionsResponse + # Deletes an Execution. + rpc :DeleteExecution, ::Google::Cloud::Run::V2::DeleteExecutionRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/execution_template_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_template_pb.rb new file mode 100644 index 000000000000..2fb390c59cbe --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/execution_template_pb.rb @@ -0,0 +1,29 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/run/v2/execution_template.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/cloud/run/v2/task_template_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/run/v2/execution_template.proto", :syntax => :proto3) do + add_message "google.cloud.run.v2.ExecutionTemplate" do + map :labels, :string, :string, 1 + map :annotations, :string, :string, 2 + optional :parallelism, :int32, 3 + optional :task_count, :int32, 4 + optional :template, :message, 5, "google.cloud.run.v2.TaskTemplate" + end + end +end + +module Google + module Cloud + module Run + module V2 + ExecutionTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ExecutionTemplate").msgclass + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions.rb new file mode 100644 index 000000000000..4888f8656d65 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/run/v2/version" + +require "google/cloud/run/v2/executions/credentials" +require "google/cloud/run/v2/executions/paths" +require "google/cloud/run/v2/executions/operations" +require "google/cloud/run/v2/executions/client" + +module Google + module Cloud + module Run + module V2 + ## + # Cloud Run Execution Control Plane API. + # + # To load this service and instantiate a client: + # + # require "google/cloud/run/v2/executions" + # client = ::Google::Cloud::Run::V2::Executions::Client.new + # + module Executions + end + end + end + end +end + +helper_path = ::File.join __dir__, "executions", "helpers.rb" +require "google/cloud/run/v2/executions/helpers" if ::File.file? helper_path diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb new file mode 100644 index 000000000000..14ccc4813272 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/client.rb @@ -0,0 +1,635 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/run/v2/execution_pb" +require "google/cloud/location" + +module Google + module Cloud + module Run + module V2 + module Executions + ## + # Client for the Executions service. + # + # Cloud Run Execution Control Plane API. + # + class Client + include Paths + + # @private + attr_reader :executions_stub + + ## + # Configure the Executions Client class. + # + # See {::Google::Cloud::Run::V2::Executions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Executions clients + # ::Google::Cloud::Run::V2::Executions::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Run", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Executions Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Run::V2::Executions::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Executions client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Run::V2::Executions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Executions client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/run/v2/execution_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @executions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Run::V2::Executions::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Run::V2::Executions::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Gets information about an Execution. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::Run::V2::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::GetExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_execution(name: nil) + # Pass arguments to `get_execution` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of the Execution. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}, + # where \\{project} can be project id or number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Run::V2::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Run::V2::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::Run::V2::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::GetExecutionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_execution.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :get_execution, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Executions from a Job. + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::Run::V2::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::ListExecutionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_executions(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_executions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The Execution from which the Executions should be listed. + # To list all Executions across Jobs, use "-" instead of Job name. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @param page_size [::Integer] + # Maximum number of Executions to return in this call. + # @param page_token [::String] + # A page token received from a previous call to ListExecutions. + # All other parameters must match. + # @param show_deleted [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Execution>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Execution>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::Run::V2::Execution. + # p response + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::ListExecutionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_executions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :list_executions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @executions_stub, :list_executions, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes an Execution. + # + # @overload delete_execution(request, options = nil) + # Pass arguments to `delete_execution` via a request object, either of type + # {::Google::Cloud::Run::V2::DeleteExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::DeleteExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_execution(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_execution` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the Execution to delete. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}, + # where \\{project} can be project id or number. + # @param validate_only [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @param etag [::String] + # A system-generated fingerprint for this version of the resource. + # This may be used to detect modification conflict during updates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::DeleteExecutionRequest.new + # + # # Call the delete_execution method. + # result = client.delete_execution request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def delete_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::DeleteExecutionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_execution.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :delete_execution, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Executions API. + # + # This class represents the configuration for Executions, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Run::V2::Executions::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_execution to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Run::V2::Executions::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_execution.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_execution.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"run.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "run.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Executions API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `list_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `delete_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_execution + + # @private + def initialize parent_rpcs = nil + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + delete_execution_config = parent_rpcs.delete_execution if parent_rpcs.respond_to? :delete_execution + @delete_execution = ::Gapic::Config::Method.new delete_execution_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/credentials.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/credentials.rb new file mode 100644 index 000000000000..1dc6b35bcfca --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Run + module V2 + module Executions + # Credentials for the Executions API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/operations.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/operations.rb new file mode 100644 index 000000000000..b48ee05d41ba --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/operations.rb @@ -0,0 +1,770 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Run + module V2 + module Executions + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the Executions Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the Executions Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Longrunning::Operation. + # p response + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"run.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "run.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/executions/paths.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/paths.rb new file mode 100644 index 000000000000..64ddc4698cad --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/executions/paths.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + module Executions + # Path helper methods for the Executions API. + module Paths + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, job:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}" + end + + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/job_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/job_pb.rb new file mode 100644 index 000000000000..fcd291c21ca7 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/job_pb.rb @@ -0,0 +1,104 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/run/v2/job.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/launch_stage_pb' +require 'google/api/resource_pb' +require 'google/cloud/run/v2/condition_pb' +require 'google/cloud/run/v2/execution_template_pb' +require 'google/cloud/run/v2/vendor_settings_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/run/v2/job.proto", :syntax => :proto3) do + add_message "google.cloud.run.v2.CreateJobRequest" do + optional :parent, :string, 1 + optional :job, :message, 2, "google.cloud.run.v2.Job" + optional :job_id, :string, 3 + optional :validate_only, :bool, 4 + end + add_message "google.cloud.run.v2.GetJobRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.run.v2.UpdateJobRequest" do + optional :job, :message, 1, "google.cloud.run.v2.Job" + optional :validate_only, :bool, 3 + optional :allow_missing, :bool, 4 + end + add_message "google.cloud.run.v2.ListJobsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + optional :show_deleted, :bool, 4 + end + add_message "google.cloud.run.v2.ListJobsResponse" do + repeated :jobs, :message, 1, "google.cloud.run.v2.Job" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.run.v2.DeleteJobRequest" do + optional :name, :string, 1 + optional :validate_only, :bool, 3 + optional :etag, :string, 4 + end + add_message "google.cloud.run.v2.RunJobRequest" do + optional :name, :string, 1 + optional :validate_only, :bool, 2 + optional :etag, :string, 3 + end + add_message "google.cloud.run.v2.Job" do + optional :name, :string, 1 + optional :uid, :string, 2 + optional :generation, :int64, 3 + map :labels, :string, :string, 4 + map :annotations, :string, :string, 5 + optional :create_time, :message, 6, "google.protobuf.Timestamp" + optional :update_time, :message, 7, "google.protobuf.Timestamp" + optional :delete_time, :message, 8, "google.protobuf.Timestamp" + optional :expire_time, :message, 9, "google.protobuf.Timestamp" + optional :creator, :string, 10 + optional :last_modifier, :string, 11 + optional :client, :string, 12 + optional :client_version, :string, 13 + optional :launch_stage, :enum, 14, "google.api.LaunchStage" + optional :binary_authorization, :message, 15, "google.cloud.run.v2.BinaryAuthorization" + optional :template, :message, 16, "google.cloud.run.v2.ExecutionTemplate" + optional :observed_generation, :int64, 17 + optional :terminal_condition, :message, 18, "google.cloud.run.v2.Condition" + repeated :conditions, :message, 19, "google.cloud.run.v2.Condition" + optional :execution_count, :int32, 20 + optional :latest_created_execution, :message, 22, "google.cloud.run.v2.ExecutionReference" + optional :reconciling, :bool, 23 + optional :etag, :string, 99 + end + add_message "google.cloud.run.v2.ExecutionReference" do + optional :name, :string, 1 + optional :create_time, :message, 2, "google.protobuf.Timestamp" + optional :completion_time, :message, 3, "google.protobuf.Timestamp" + end + end +end + +module Google + module Cloud + module Run + module V2 + CreateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.CreateJobRequest").msgclass + GetJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.GetJobRequest").msgclass + UpdateJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.UpdateJobRequest").msgclass + ListJobsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListJobsRequest").msgclass + ListJobsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListJobsResponse").msgclass + DeleteJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.DeleteJobRequest").msgclass + RunJobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.RunJobRequest").msgclass + Job = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.Job").msgclass + ExecutionReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ExecutionReference").msgclass + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/job_services_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/job_services_pb.rb new file mode 100644 index 000000000000..425311429573 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/job_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/run/v2/job.proto for package 'google.cloud.run.v2' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/run/v2/job_pb' + +module Google + module Cloud + module Run + module V2 + module Jobs + # Cloud Run Job Control Plane API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.run.v2.Jobs' + + # Creates a Job. + rpc :CreateJob, ::Google::Cloud::Run::V2::CreateJobRequest, ::Google::Longrunning::Operation + # Gets information about a Job. + rpc :GetJob, ::Google::Cloud::Run::V2::GetJobRequest, ::Google::Cloud::Run::V2::Job + # Lists Jobs. + rpc :ListJobs, ::Google::Cloud::Run::V2::ListJobsRequest, ::Google::Cloud::Run::V2::ListJobsResponse + # Updates a Job. + rpc :UpdateJob, ::Google::Cloud::Run::V2::UpdateJobRequest, ::Google::Longrunning::Operation + # Deletes a Job. + rpc :DeleteJob, ::Google::Cloud::Run::V2::DeleteJobRequest, ::Google::Longrunning::Operation + # Triggers creation of a new Execution of this Job. + rpc :RunJob, ::Google::Cloud::Run::V2::RunJobRequest, ::Google::Longrunning::Operation + # Gets the IAM Access Control policy currently in effect for the given Job. + # This result does not include any inherited policies. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Sets the IAM Access control policy for the specified Job. Overwrites + # any existing policy. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified Project. + # + # There are no permissions required for making this API call. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs.rb new file mode 100644 index 000000000000..ac64df44e97e --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/run/v2/version" + +require "google/cloud/run/v2/jobs/credentials" +require "google/cloud/run/v2/jobs/paths" +require "google/cloud/run/v2/jobs/operations" +require "google/cloud/run/v2/jobs/client" + +module Google + module Cloud + module Run + module V2 + ## + # Cloud Run Job Control Plane API. + # + # To load this service and instantiate a client: + # + # require "google/cloud/run/v2/jobs" + # client = ::Google::Cloud::Run::V2::Jobs::Client.new + # + module Jobs + end + end + end + end +end + +helper_path = ::File.join __dir__, "jobs", "helpers.rb" +require "google/cloud/run/v2/jobs/helpers" if ::File.file? helper_path diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb new file mode 100644 index 000000000000..48c0e0694244 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/client.rb @@ -0,0 +1,1259 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/run/v2/job_pb" +require "google/cloud/location" + +module Google + module Cloud + module Run + module V2 + module Jobs + ## + # Client for the Jobs service. + # + # Cloud Run Job Control Plane API. + # + class Client + include Paths + + # @private + attr_reader :jobs_stub + + ## + # Configure the Jobs Client class. + # + # See {::Google::Cloud::Run::V2::Jobs::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Jobs clients + # ::Google::Cloud::Run::V2::Jobs::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Run", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Jobs Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Run::V2::Jobs::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Jobs client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Jobs client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/run/v2/job_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_client = Operations.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @jobs_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Run::V2::Jobs::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Run::V2::Jobs::Operations] + # + attr_reader :operations_client + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Creates a Job. + # + # @overload create_job(request, options = nil) + # Pass arguments to `create_job` via a request object, either of type + # {::Google::Cloud::Run::V2::CreateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::CreateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_job(parent: nil, job: nil, job_id: nil, validate_only: nil) + # Pass arguments to `create_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location and project in which this Job should be created. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. + # @param job [::Google::Cloud::Run::V2::Job, ::Hash] + # Required. The Job instance to create. + # @param job_id [::String] + # Required. The unique identifier for the Job. The name of the job becomes + # \\{parent}/jobs/\\{job_id}. + # @param validate_only [::Boolean] + # Indicates that the request should be validated and default values + # populated, without persisting the request or creating any resources. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::CreateJobRequest.new + # + # # Call the create_job method. + # result = client.create_job request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def create_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::CreateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :create_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets information about a Job. + # + # @overload get_job(request, options = nil) + # Pass arguments to `get_job` via a request object, either of type + # {::Google::Cloud::Run::V2::GetJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::GetJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_job(name: nil) + # Pass arguments to `get_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Run::V2::Job] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Run::V2::Job] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::GetJobRequest.new + # + # # Call the get_job method. + # result = client.get_job request + # + # # The returned object is of type Google::Cloud::Run::V2::Job. + # p result + # + def get_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::GetJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :get_job, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Jobs. + # + # @overload list_jobs(request, options = nil) + # Pass arguments to `list_jobs` via a request object, either of type + # {::Google::Cloud::Run::V2::ListJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::ListJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_jobs(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_jobs` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The location and project to list resources on. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. + # @param page_size [::Integer] + # Maximum number of Jobs to return in this call. + # @param page_token [::String] + # A page token received from a previous call to ListJobs. + # All other parameters must match. + # @param show_deleted [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Job>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Job>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::ListJobsRequest.new + # + # # Call the list_jobs method. + # result = client.list_jobs request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::Run::V2::Job. + # p response + # end + # + def list_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::ListJobsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_jobs.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :list_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @jobs_stub, :list_jobs, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Updates a Job. + # + # @overload update_job(request, options = nil) + # Pass arguments to `update_job` via a request object, either of type + # {::Google::Cloud::Run::V2::UpdateJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::UpdateJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_job(job: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param job [::Google::Cloud::Run::V2::Job, ::Hash] + # Required. The Job to be updated. + # @param validate_only [::Boolean] + # Indicates that the request should be validated and default values + # populated, without persisting the request or updating any resources. + # @param allow_missing [::Boolean] + # If set to true, and if the Job does not exist, it will create a new + # one. Caller must have both create and update permissions for this call if + # this is set to true. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::UpdateJobRequest.new + # + # # Call the update_job method. + # result = client.update_job request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def update_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::UpdateJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.job&.name + header_params["job.name"] = request.job.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :update_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a Job. + # + # @overload delete_job(request, options = nil) + # Pass arguments to `delete_job` via a request object, either of type + # {::Google::Cloud::Run::V2::DeleteJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::DeleteJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_job(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @param validate_only [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @param etag [::String] + # A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::DeleteJobRequest.new + # + # # Call the delete_job method. + # result = client.delete_job request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def delete_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::DeleteJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :delete_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Triggers creation of a new Execution of this Job. + # + # @overload run_job(request, options = nil) + # Pass arguments to `run_job` via a request object, either of type + # {::Google::Cloud::Run::V2::RunJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::RunJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_job(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `run_job` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @param validate_only [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @param etag [::String] + # A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::RunJobRequest.new + # + # # Call the run_job method. + # result = client.run_job request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def run_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::RunJobRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.run_job.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.run_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :run_job, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the IAM Access Control policy currently in effect for the given Job. + # This result does not include any inherited policies. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Sets the IAM Access control policy for the specified Job. Overwrites + # any existing policy. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified Project. + # + # There are no permissions required for making this API call. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Jobs::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @jobs_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Jobs API. + # + # This class represents the configuration for Jobs, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Run::V2::Jobs::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # create_job to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Run::V2::Jobs::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_job.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"run.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "run.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Jobs API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `create_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_job + ## + # RPC-specific configuration for `get_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_job + ## + # RPC-specific configuration for `list_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_jobs + ## + # RPC-specific configuration for `update_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_job + ## + # RPC-specific configuration for `delete_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_job + ## + # RPC-specific configuration for `run_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_job + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + create_job_config = parent_rpcs.create_job if parent_rpcs.respond_to? :create_job + @create_job = ::Gapic::Config::Method.new create_job_config + get_job_config = parent_rpcs.get_job if parent_rpcs.respond_to? :get_job + @get_job = ::Gapic::Config::Method.new get_job_config + list_jobs_config = parent_rpcs.list_jobs if parent_rpcs.respond_to? :list_jobs + @list_jobs = ::Gapic::Config::Method.new list_jobs_config + update_job_config = parent_rpcs.update_job if parent_rpcs.respond_to? :update_job + @update_job = ::Gapic::Config::Method.new update_job_config + delete_job_config = parent_rpcs.delete_job if parent_rpcs.respond_to? :delete_job + @delete_job = ::Gapic::Config::Method.new delete_job_config + run_job_config = parent_rpcs.run_job if parent_rpcs.respond_to? :run_job + @run_job = ::Gapic::Config::Method.new run_job_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/credentials.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/credentials.rb new file mode 100644 index 000000000000..6b85379e53e2 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Run + module V2 + module Jobs + # Credentials for the Jobs API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/operations.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/operations.rb new file mode 100644 index 000000000000..b7195b3d28b3 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/operations.rb @@ -0,0 +1,770 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/operation" +require "google/longrunning/operations_pb" + +module Google + module Cloud + module Run + module V2 + module Jobs + # Service that implements Longrunning Operations API. + class Operations + # @private + attr_reader :operations_stub + + ## + # Configuration for the Jobs Operations API. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def self.configure + @configure ||= Operations::Configuration.new + yield @configure if block_given? + @configure + end + + ## + # Configure the Jobs Operations instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Operations.configure}. + # + # @yield [config] Configure the Operations client. + # @yieldparam config [Operations::Configuration] + # + # @return [Operations::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Operations client object. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Operations::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/longrunning/operations_services_pb" + + # Create the configuration object + @config = Configuration.new Operations.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + credentials ||= Credentials.default scope: @config.scope + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @operations_stub = ::Gapic::ServiceStub.new( + ::Google::Longrunning::Operations::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + + # Used by an LRO wrapper for some methods of this service + @operations_client = self + end + + # Service calls + + ## + # Lists operations that match the specified filter in the request. If the + # server doesn't support this method, it returns `UNIMPLEMENTED`. + # + # NOTE: the `name` binding allows API services to override the binding + # to use different resource name schemes, such as `users/*/operations`. To + # override the binding, API services can add a binding such as + # `"/v1/{name=users/*}/operations"` to their service configuration. + # For backwards compatibility, the default name includes the operations + # collection id, however overriding users must ensure the name binding + # is the parent resource, without the operations collection id. + # + # @overload list_operations(request, options = nil) + # Pass arguments to `list_operations` via a request object, either of type + # {::Google::Longrunning::ListOperationsRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::ListOperationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_operations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation's parent resource. + # @param filter [::String] + # The standard list filter. + # @param page_size [::Integer] + # The standard list page size. + # @param page_token [::String] + # The standard list page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Gapic::Operation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::ListOperationsRequest.new + # + # # Call the list_operations method. + # result = client.list_operations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Longrunning::Operation. + # p response + # end + # + def list_operations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::ListOperationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_operations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_operations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :list_operations, request, options: options do |response, operation| + wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client } + response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the latest state of a long-running operation. Clients can use this + # method to poll the operation result at intervals as recommended by the API + # service. + # + # @overload get_operation(request, options = nil) + # Pass arguments to `get_operation` via a request object, either of type + # {::Google::Longrunning::GetOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::GetOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_operation(name: nil) + # Pass arguments to `get_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::GetOperationRequest.new + # + # # Call the get_operation method. + # result = client.get_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def get_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::GetOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :get_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Deletes a long-running operation. This method indicates that the client is + # no longer interested in the operation result. It does not cancel the + # operation. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # + # @overload delete_operation(request, options = nil) + # Pass arguments to `delete_operation` via a request object, either of type + # {::Google::Longrunning::DeleteOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::DeleteOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload delete_operation(name: nil) + # Pass arguments to `delete_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be deleted. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::DeleteOperationRequest.new + # + # # Call the delete_operation method. + # result = client.delete_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::DeleteOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.delete_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.delete_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Starts asynchronous cancellation on a long-running operation. The server + # makes a best effort to cancel the operation, but success is not + # guaranteed. If the server doesn't support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. Clients can use + # Operations.GetOperation or + # other methods to check whether the cancellation succeeded or whether the + # operation completed despite cancellation. On successful cancellation, + # the operation is not deleted; instead, it becomes an operation with + # an {::Google::Longrunning::Operation#error Operation.error} value with a {::Google::Rpc::Status#code google.rpc.Status.code} of 1, + # corresponding to `Code.CANCELLED`. + # + # @overload cancel_operation(request, options = nil) + # Pass arguments to `cancel_operation` via a request object, either of type + # {::Google::Longrunning::CancelOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::CancelOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload cancel_operation(name: nil) + # Pass arguments to `cancel_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to be cancelled. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Protobuf::Empty] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Protobuf::Empty] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::CancelOperationRequest.new + # + # # Call the cancel_operation method. + # result = client.cancel_operation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def cancel_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::CancelOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.cancel_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Waits until the specified long-running operation is done or reaches at most + # a specified timeout, returning the latest state. If the operation is + # already done, the latest state is immediately returned. If the timeout + # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC + # timeout is used. If the server does not support this method, it returns + # `google.rpc.Code.UNIMPLEMENTED`. + # Note that this method is on a best-effort basis. It may return the latest + # state before the specified timeout (including immediately), meaning even an + # immediate response is no guarantee that the operation is done. + # + # @overload wait_operation(request, options = nil) + # Pass arguments to `wait_operation` via a request object, either of type + # {::Google::Longrunning::WaitOperationRequest} or an equivalent Hash. + # + # @param request [::Google::Longrunning::WaitOperationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload wait_operation(name: nil, timeout: nil) + # Pass arguments to `wait_operation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # The name of the operation resource to wait on. + # @param timeout [::Google::Protobuf::Duration, ::Hash] + # The maximum duration to wait before timing out. If left blank, the wait + # will be at most the time permitted by the underlying HTTP/RPC protocol. + # If RPC context deadline is also specified, the shorter one will be used. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/longrunning" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Longrunning::Operations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Longrunning::WaitOperationRequest.new + # + # # Call the wait_operation method. + # result = client.wait_operation request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def wait_operation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Longrunning::WaitOperationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.wait_operation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + options.apply_defaults timeout: @config.rpcs.wait_operation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.wait_operation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Operations API. + # + # This class represents the configuration for Operations, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Longrunning::Operations::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # list_operations to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Longrunning::Operations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Longrunning::Operations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_operations.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"run.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "run.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Operations API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `list_operations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operations + ## + # RPC-specific configuration for `get_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operation + ## + # RPC-specific configuration for `delete_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operation + ## + # RPC-specific configuration for `cancel_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_operation + ## + # RPC-specific configuration for `wait_operation` + # @return [::Gapic::Config::Method] + # + attr_reader :wait_operation + + # @private + def initialize parent_rpcs = nil + list_operations_config = parent_rpcs.list_operations if parent_rpcs.respond_to? :list_operations + @list_operations = ::Gapic::Config::Method.new list_operations_config + get_operation_config = parent_rpcs.get_operation if parent_rpcs.respond_to? :get_operation + @get_operation = ::Gapic::Config::Method.new get_operation_config + delete_operation_config = parent_rpcs.delete_operation if parent_rpcs.respond_to? :delete_operation + @delete_operation = ::Gapic::Config::Method.new delete_operation_config + cancel_operation_config = parent_rpcs.cancel_operation if parent_rpcs.respond_to? :cancel_operation + @cancel_operation = ::Gapic::Config::Method.new cancel_operation_config + wait_operation_config = parent_rpcs.wait_operation if parent_rpcs.respond_to? :wait_operation + @wait_operation = ::Gapic::Config::Method.new wait_operation_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/paths.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/paths.rb new file mode 100644 index 000000000000..e37ec72b5948 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/jobs/paths.rb @@ -0,0 +1,166 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + module Jobs + # Path helper methods for the Jobs API. + module Paths + ## + # Create a fully-qualified Connector resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/connectors/{connector}` + # + # @param project [String] + # @param location [String] + # @param connector [String] + # + # @return [::String] + def connector_path project:, location:, connector: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/connectors/#{connector}" + end + + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, job:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}" + end + + ## + # Create a fully-qualified Job resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def job_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}" + end + + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + + ## + # Create a fully-qualified Secret resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}` + # + # @param project [String] + # @param secret [String] + # + # @return [::String] + def secret_path project:, secret: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}" + end + + ## + # Create a fully-qualified SecretVersion resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/secrets/{secret}/versions/{version}` + # + # @param project [String] + # @param secret [String] + # @param version [String] + # + # @return [::String] + def secret_version_path project:, secret:, version: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "secret cannot contain /" if secret.to_s.include? "/" + + "projects/#{project}/secrets/#{secret}/versions/#{version}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/k8s.min_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/k8s.min_pb.rb index a2ee5a633fed..c965224e2932 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/k8s.min_pb.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/k8s.min_pb.rb @@ -75,6 +75,7 @@ oneof :probe_type do optional :http_get, :message, 5, "google.cloud.run.v2.HTTPGetAction" optional :tcp_socket, :message, 6, "google.cloud.run.v2.TCPSocketAction" + optional :grpc, :message, 7, "google.cloud.run.v2.GRPCAction" end end add_message "google.cloud.run.v2.HTTPGetAction" do @@ -88,6 +89,10 @@ add_message "google.cloud.run.v2.TCPSocketAction" do optional :port, :int32, 1 end + add_message "google.cloud.run.v2.GRPCAction" do + optional :port, :int32, 1 + optional :service, :string, 2 + end end end @@ -110,6 +115,7 @@ module V2 HTTPGetAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.HTTPGetAction").msgclass HTTPHeader = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.HTTPHeader").msgclass TCPSocketAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.TCPSocketAction").msgclass + GRPCAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.GRPCAction").msgclass end end end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/revision_services_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/revision_services_pb.rb index 2563abe0de31..c5281fce4514 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/revision_services_pb.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/revision_services_pb.rb @@ -35,9 +35,9 @@ class Service # Gets information about a Revision. rpc :GetRevision, ::Google::Cloud::Run::V2::GetRevisionRequest, ::Google::Cloud::Run::V2::Revision - # List Revisions from a given Service, or from a given location. + # Lists Revisions from a given Service, or from a given location. rpc :ListRevisions, ::Google::Cloud::Run::V2::ListRevisionsRequest, ::Google::Cloud::Run::V2::ListRevisionsResponse - # Delete a Revision. + # Deletes a Revision. rpc :DeleteRevision, ::Google::Cloud::Run::V2::DeleteRevisionRequest, ::Google::Longrunning::Operation end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb index 0200bc8b2053..8edc74842d82 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/revisions/client.rb @@ -262,7 +262,7 @@ def get_revision request, options = nil end ## - # List Revisions from a given Service, or from a given location. + # Lists Revisions from a given Service, or from a given location. # # @overload list_revisions(request, options = nil) # Pass arguments to `list_revisions` via a request object, either of type @@ -367,7 +367,7 @@ def list_revisions request, options = nil end ## - # Delete a Revision. + # Deletes a Revision. # # @overload delete_revision(request, options = nil) # Pass arguments to `delete_revision` via a request object, either of type diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/service_services_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/service_services_pb.rb index 649a26e89d29..bd643c67fbcd 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/service_services_pb.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/service_services_pb.rb @@ -37,7 +37,7 @@ class Service rpc :CreateService, ::Google::Cloud::Run::V2::CreateServiceRequest, ::Google::Longrunning::Operation # Gets information about a Service. rpc :GetService, ::Google::Cloud::Run::V2::GetServiceRequest, ::Google::Cloud::Run::V2::Service - # List Services. + # Lists Services. rpc :ListServices, ::Google::Cloud::Run::V2::ListServicesRequest, ::Google::Cloud::Run::V2::ListServicesResponse # Updates a Service. rpc :UpdateService, ::Google::Cloud::Run::V2::UpdateServiceRequest, ::Google::Longrunning::Operation @@ -45,7 +45,7 @@ class Service # This will cause the Service to stop serving traffic and will delete all # revisions. rpc :DeleteService, ::Google::Cloud::Run::V2::DeleteServiceRequest, ::Google::Longrunning::Operation - # Get the IAM Access Control policy currently in effect for the given + # Gets the IAM Access Control policy currently in effect for the given # Cloud Run Service. This result does not include any inherited policies. rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy # Sets the IAM Access control policy for the specified Service. Overwrites diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb index 5b638957d66f..436909ee0d8a 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/services/client.rb @@ -206,14 +206,14 @@ def initialize # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] - # The location and project in which this service should be created. - # Format: projects/\\{project}/locations/\\{location} - # Only lowercase characters, digits, and hyphens. + # Required. The location and project in which this service should be created. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. Only lowercase characters, digits, and hyphens. # @param service [::Google::Cloud::Run::V2::Service, ::Hash] # Required. The Service instance to create. # @param service_id [::String] # Required. The unique identifier for the Service. It must begin with letter, - # and may not end with hyphen; must contain fewer than 50 characters. + # and cannot end with hyphen; must contain fewer than 50 characters. # The name of the service becomes \\{parent}/services/\\{service_id}. # @param validate_only [::Boolean] # Indicates that the request should be validated and default values @@ -314,7 +314,8 @@ def create_service request, options = nil # # @param name [::String] # Required. The full name of the Service. - # Format: projects/\\{project}/locations/\\{location}/services/\\{service} + # Format: projects/\\{project}/locations/\\{location}/services/\\{service}, where + # \\{project} can be project id or number. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Run::V2::Service] @@ -384,7 +385,7 @@ def get_service request, options = nil end ## - # List Services. + # Lists Services. # # @overload list_services(request, options = nil) # Pass arguments to `list_services` via a request object, either of type @@ -403,8 +404,9 @@ def get_service request, options = nil # # @param parent [::String] # Required. The location and project to list resources on. - # Location must be a valid GCP region, and may not be the "-" wildcard. - # Format: projects/\\{project}/locations/\\{location} + # Location must be a valid GCP region, and cannot be the "-" wildcard. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. # @param page_size [::Integer] # Maximum number of Services to return in this call. # @param page_token [::String] @@ -612,7 +614,8 @@ def update_service request, options = nil # # @param name [::String] # Required. The full name of the Service. - # Format: projects/\\{project}/locations/\\{location}/services/\\{service} + # Format: projects/\\{project}/locations/\\{location}/services/\\{service}, where + # \\{project} can be project id or number. # @param validate_only [::Boolean] # Indicates that the request should be validated without actually # deleting any resources. @@ -696,7 +699,7 @@ def delete_service request, options = nil end ## - # Get the IAM Access Control policy currently in effect for the given + # Gets the IAM Access Control policy currently in effect for the given # Cloud Run Service. This result does not include any inherited policies. # # @overload get_iam_policy(request, options = nil) diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/task_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/task_pb.rb new file mode 100644 index 000000000000..37e007fd1a76 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/task_pb.rb @@ -0,0 +1,81 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/run/v2/task.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/run/v2/condition_pb' +require 'google/cloud/run/v2/k8s.min_pb' +require 'google/cloud/run/v2/vendor_settings_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/run/v2/task.proto", :syntax => :proto3) do + add_message "google.cloud.run.v2.GetTaskRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.run.v2.ListTasksRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + optional :show_deleted, :bool, 4 + end + add_message "google.cloud.run.v2.ListTasksResponse" do + repeated :tasks, :message, 1, "google.cloud.run.v2.Task" + optional :next_page_token, :string, 2 + end + add_message "google.cloud.run.v2.Task" do + optional :name, :string, 1 + optional :uid, :string, 2 + optional :generation, :int64, 3 + map :labels, :string, :string, 4 + map :annotations, :string, :string, 5 + optional :create_time, :message, 6, "google.protobuf.Timestamp" + optional :start_time, :message, 27, "google.protobuf.Timestamp" + optional :completion_time, :message, 7, "google.protobuf.Timestamp" + optional :update_time, :message, 8, "google.protobuf.Timestamp" + optional :delete_time, :message, 9, "google.protobuf.Timestamp" + optional :expire_time, :message, 10, "google.protobuf.Timestamp" + optional :job, :string, 12 + optional :execution, :string, 13 + repeated :containers, :message, 14, "google.cloud.run.v2.Container" + repeated :volumes, :message, 15, "google.cloud.run.v2.Volume" + optional :max_retries, :int32, 16 + optional :timeout, :message, 17, "google.protobuf.Duration" + optional :service_account, :string, 18 + optional :execution_environment, :enum, 20, "google.cloud.run.v2.ExecutionEnvironment" + optional :reconciling, :bool, 21 + repeated :conditions, :message, 22, "google.cloud.run.v2.Condition" + optional :observed_generation, :int64, 23 + optional :index, :int32, 24 + optional :retried, :int32, 25 + optional :last_attempt_result, :message, 26, "google.cloud.run.v2.TaskAttemptResult" + optional :encryption_key, :string, 28 + optional :vpc_access, :message, 29, "google.cloud.run.v2.VpcAccess" + optional :etag, :string, 99 + end + add_message "google.cloud.run.v2.TaskAttemptResult" do + optional :status, :message, 1, "google.rpc.Status" + optional :exit_code, :int32, 2 + end + end +end + +module Google + module Cloud + module Run + module V2 + GetTaskRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.GetTaskRequest").msgclass + ListTasksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListTasksRequest").msgclass + ListTasksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListTasksResponse").msgclass + Task = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.Task").msgclass + TaskAttemptResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.TaskAttemptResult").msgclass + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/task_services_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/task_services_pb.rb new file mode 100644 index 000000000000..ee63a2d76143 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/task_services_pb.rb @@ -0,0 +1,47 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/run/v2/task.proto for package 'google.cloud.run.v2' +# Original file comments: +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +require 'grpc' +require 'google/cloud/run/v2/task_pb' + +module Google + module Cloud + module Run + module V2 + module Tasks + # Cloud Run Task Control Plane API. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.run.v2.Tasks' + + # Gets information about a Task. + rpc :GetTask, ::Google::Cloud::Run::V2::GetTaskRequest, ::Google::Cloud::Run::V2::Task + # Lists Tasks from an Execution of a Job. + rpc :ListTasks, ::Google::Cloud::Run::V2::ListTasksRequest, ::Google::Cloud::Run::V2::ListTasksResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/task_template_pb.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/task_template_pb.rb new file mode 100644 index 000000000000..1896801b6fd5 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/task_template_pb.rb @@ -0,0 +1,36 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/run/v2/task_template.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/run/v2/k8s.min_pb' +require 'google/cloud/run/v2/vendor_settings_pb' +require 'google/protobuf/duration_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/run/v2/task_template.proto", :syntax => :proto3) do + add_message "google.cloud.run.v2.TaskTemplate" do + repeated :containers, :message, 1, "google.cloud.run.v2.Container" + repeated :volumes, :message, 2, "google.cloud.run.v2.Volume" + optional :timeout, :message, 4, "google.protobuf.Duration" + optional :service_account, :string, 5 + optional :execution_environment, :enum, 6, "google.cloud.run.v2.ExecutionEnvironment" + optional :encryption_key, :string, 7 + optional :vpc_access, :message, 8, "google.cloud.run.v2.VpcAccess" + oneof :retries do + optional :max_retries, :int32, 3 + end + end + end +end + +module Google + module Cloud + module Run + module V2 + TaskTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.TaskTemplate").msgclass + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks.rb new file mode 100644 index 000000000000..66bc39e5d113 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/run/v2/version" + +require "google/cloud/run/v2/tasks/credentials" +require "google/cloud/run/v2/tasks/paths" +require "google/cloud/run/v2/tasks/client" + +module Google + module Cloud + module Run + module V2 + ## + # Cloud Run Task Control Plane API. + # + # To load this service and instantiate a client: + # + # require "google/cloud/run/v2/tasks" + # client = ::Google::Cloud::Run::V2::Tasks::Client.new + # + module Tasks + end + end + end + end +end + +helper_path = ::File.join __dir__, "tasks", "helpers.rb" +require "google/cloud/run/v2/tasks/helpers" if ::File.file? helper_path diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb new file mode 100644 index 000000000000..7e6c26059089 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/client.rb @@ -0,0 +1,512 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "google/cloud/errors" +require "google/cloud/run/v2/task_pb" +require "google/cloud/location" + +module Google + module Cloud + module Run + module V2 + module Tasks + ## + # Client for the Tasks service. + # + # Cloud Run Task Control Plane API. + # + class Client + include Paths + + # @private + attr_reader :tasks_stub + + ## + # Configure the Tasks Client class. + # + # See {::Google::Cloud::Run::V2::Tasks::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Tasks clients + # ::Google::Cloud::Run::V2::Tasks::Client.configure do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Run", "V2"] + parent_config = while namespace.any? + parent_name = namespace.join "::" + parent_const = const_get parent_name + break parent_const.configure if parent_const.respond_to? :configure + namespace.pop + end + default_config = Client::Configuration.new parent_config + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Tasks Client instance. + # + # The configuration is set to the derived mode, meaning that values can be changed, + # but structural changes (adding new fields, etc.) are not allowed. Structural changes + # should be made on {Client.configure}. + # + # See {::Google::Cloud::Run::V2::Tasks::Client::Configuration} + # for a description of the configuration fields. + # + # @yield [config] Configure the Client client. + # @yieldparam config [Client::Configuration] + # + # @return [Client::Configuration] + # + def configure + yield @config if block_given? + @config + end + + ## + # Create a new Tasks client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Run::V2::Tasks::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Tasks client. + # @yieldparam config [Client::Configuration] + # + def initialize + # These require statements are intentionally placed here to initialize + # the gRPC module only when it's required. + # See https://github.com/googleapis/toolkit/issues/446 + require "gapic/grpc" + require "google/cloud/run/v2/task_services_pb" + + # Create the configuration object + @config = Configuration.new Client.configure + + # Yield the configuration if needed + yield @config if block_given? + + # Create credentials + credentials = @config.credentials + # Use self-signed JWT if the endpoint is unchanged from default, + # but only if the default endpoint does not have a region prefix. + enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && + !@config.endpoint.split(".").first.include?("-") + credentials ||= Credentials.default scope: @config.scope, + enable_self_signed_jwt: enable_self_signed_jwt + if credentials.is_a?(::String) || credentials.is_a?(::Hash) + credentials = Credentials.new credentials, scope: @config.scope + end + @quota_project_id = @config.quota_project + @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id + + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @tasks_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Run::V2::Tasks::Stub, + credentials: credentials, + endpoint: @config.endpoint, + channel_args: @config.channel_args, + interceptors: @config.interceptors + ) + end + + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + # Service calls + + ## + # Gets information about a Task. + # + # @overload get_task(request, options = nil) + # Pass arguments to `get_task` via a request object, either of type + # {::Google::Cloud::Run::V2::GetTaskRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::GetTaskRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_task(name: nil) + # Pass arguments to `get_task` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The full name of the Task. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}/tasks/\\{task} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Run::V2::Task] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Run::V2::Task] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Tasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::GetTaskRequest.new + # + # # Call the get_task method. + # result = client.get_task request + # + # # The returned object is of type Google::Cloud::Run::V2::Task. + # p result + # + def get_task request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::GetTaskRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_task.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_task.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_task.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tasks_stub.call_rpc :get_task, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Lists Tasks from an Execution of a Job. + # + # @overload list_tasks(request, options = nil) + # Pass arguments to `list_tasks` via a request object, either of type + # {::Google::Cloud::Run::V2::ListTasksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Run::V2::ListTasksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_tasks(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_tasks` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The Execution from which the Tasks should be listed. + # To list all Tasks across Executions of a Job, use "-" instead of Execution + # name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution} + # @param page_size [::Integer] + # Maximum number of Tasks to return in this call. + # @param page_token [::String] + # A page token received from a previous call to ListTasks. + # All other parameters must match. + # @param show_deleted [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Task>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Run::V2::Task>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/run/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Run::V2::Tasks::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Run::V2::ListTasksRequest.new + # + # # Call the list_tasks method. + # result = client.list_tasks request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::Run::V2::Task. + # p response + # end + # + def list_tasks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::ListTasksRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_tasks.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Run::V2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_tasks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_tasks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @tasks_stub.call_rpc :list_tasks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @tasks_stub, :list_tasks, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Configuration class for the Tasks API. + # + # This class represents the configuration for Tasks, + # providing control over timeouts, retry behavior, logging, transport + # parameters, and other low-level controls. Certain parameters can also be + # applied individually to specific RPCs. See + # {::Google::Cloud::Run::V2::Tasks::Client::Configuration::Rpcs} + # for a list of RPCs that can be configured independently. + # + # Configuration can be applied globally to all clients, or to a single client + # on construction. + # + # @example + # + # # Modify the global config, setting the timeout for + # # get_task to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Run::V2::Tasks::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_task.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_task.timeout = 20.0 + # end + # + # @!attribute [rw] endpoint + # The hostname or hostname:port of the service endpoint. + # Defaults to `"run.googleapis.com"`. + # @return [::String] + # @!attribute [rw] credentials + # Credentials to send with calls. You may provide any of the following types: + # * (`String`) The path to a service account key file in JSON format + # * (`Hash`) A service account key as a Hash + # * (`Google::Auth::Credentials`) A googleauth credentials object + # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html)) + # * (`Signet::OAuth2::Client`) A signet oauth2 client object + # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html)) + # * (`GRPC::Core::Channel`) a gRPC channel with included credentials + # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object + # * (`nil`) indicating no credentials + # @return [::Object] + # @!attribute [rw] scope + # The OAuth scopes + # @return [::Array<::String>] + # @!attribute [rw] lib_name + # The library name as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] lib_version + # The library version as recorded in instrumentation and logging + # @return [::String] + # @!attribute [rw] channel_args + # Extra parameters passed to the gRPC channel. Note: this is ignored if a + # `GRPC::Core::Channel` object is provided as the credential. + # @return [::Hash] + # @!attribute [rw] interceptors + # An array of interceptors that are run before calls are executed. + # @return [::Array<::GRPC::ClientInterceptor>] + # @!attribute [rw] timeout + # The call timeout in seconds. + # @return [::Numeric] + # @!attribute [rw] metadata + # Additional gRPC headers to be sent with the call. + # @return [::Hash{::Symbol=>::String}] + # @!attribute [rw] retry_policy + # The retry policy. The value is a hash with the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # @return [::Hash] + # @!attribute [rw] quota_project + # A separate project against which to charge quota. + # @return [::String] + # + class Configuration + extend ::Gapic::Config + + config_attr :endpoint, "run.googleapis.com", ::String + config_attr :credentials, nil do |value| + allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil] + allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC + allowed.any? { |klass| klass === value } + end + config_attr :scope, nil, ::String, ::Array, nil + config_attr :lib_name, nil, ::String, nil + config_attr :lib_version, nil, ::String, nil + config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil) + config_attr :interceptors, nil, ::Array, nil + config_attr :timeout, nil, ::Numeric, nil + config_attr :metadata, nil, ::Hash, nil + config_attr :retry_policy, nil, ::Hash, ::Proc, nil + config_attr :quota_project, nil, ::String, nil + + # @private + def initialize parent_config = nil + @parent_config = parent_config unless parent_config.nil? + + yield self if block_given? + end + + ## + # Configurations for individual RPCs + # @return [Rpcs] + # + def rpcs + @rpcs ||= begin + parent_rpcs = nil + parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs) + Rpcs.new parent_rpcs + end + end + + ## + # Configuration RPC class for the Tasks API. + # + # Includes fields providing the configuration for each RPC in this service. + # Each configuration object is of type `Gapic::Config::Method` and includes + # the following configuration fields: + # + # * `timeout` (*type:* `Numeric`) - The call timeout in seconds + # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers + # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields + # include the following keys: + # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds. + # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds. + # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier. + # * `:retry_codes` (*type:* `Array`) - The error codes that should + # trigger a retry. + # + class Rpcs + ## + # RPC-specific configuration for `get_task` + # @return [::Gapic::Config::Method] + # + attr_reader :get_task + ## + # RPC-specific configuration for `list_tasks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_tasks + + # @private + def initialize parent_rpcs = nil + get_task_config = parent_rpcs.get_task if parent_rpcs.respond_to? :get_task + @get_task = ::Gapic::Config::Method.new get_task_config + list_tasks_config = parent_rpcs.list_tasks if parent_rpcs.respond_to? :list_tasks + @list_tasks = ::Gapic::Config::Method.new list_tasks_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/credentials.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/credentials.rb new file mode 100644 index 000000000000..4f9ca03feea7 --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/credentials.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "googleauth" + +module Google + module Cloud + module Run + module V2 + module Tasks + # Credentials for the Tasks API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS_JSON", + "GOOGLE_CLOUD_KEYFILE_JSON", + "GCLOUD_KEYFILE_JSON" + ] + self.paths = [ + "~/.config/google_cloud/application_default_credentials.json" + ] + end + end + end + end + end +end diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/paths.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/paths.rb new file mode 100644 index 000000000000..745bac83704e --- /dev/null +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/tasks/paths.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + module Tasks + # Path helper methods for the Tasks API. + module Paths + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, job:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}" + end + + ## + # Create a fully-qualified Task resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}/tasks/{task}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param execution [String] + # @param task [String] + # + # @return [::String] + def task_path project:, location:, job:, execution:, task: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + raise ::ArgumentError, "execution cannot contain /" if execution.to_s.include? "/" + + "projects/#{project}/locations/#{location}/jobs/#{job}/executions/#{execution}/tasks/#{task}" + end + + extend self + end + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution.rb new file mode 100644 index 000000000000..fcafc28a6f37 --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + # Request message for obtaining a Execution by its full name. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the Execution. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}, + # where \\{project} can be project id or number. + class GetExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a list of Executions. + # @!attribute [rw] parent + # @return [::String] + # Required. The Execution from which the Executions should be listed. + # To list all Executions across Jobs, use "-" instead of Job name. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of Executions to return in this call. + # @!attribute [rw] page_token + # @return [::String] + # A page token received from a previous call to ListExecutions. + # All other parameters must match. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + class ListExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message containing a list of Executions. + # @!attribute [rw] executions + # @return [::Array<::Google::Cloud::Run::V2::Execution>] + # The resulting list of Executions. + # @!attribute [rw] next_page_token + # @return [::String] + # A token indicating there are more items than page_size. Use it in the next + # ListExecutions request to continue. + class ListExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting an Execution. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the Execution to delete. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}, + # where \\{project} can be project id or number. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @!attribute [rw] etag + # @return [::String] + # A system-generated fingerprint for this version of the resource. + # This may be used to detect modification conflict during updates. + class DeleteExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Execution represents the configuration of a single execution. A execution an + # immutable resource that references a container image which is run to + # completion. + # @!attribute [r] name + # @return [::String] + # Output only. The unique name of this Execution. + # @!attribute [r] uid + # @return [::String] + # Output only. Server assigned unique identifier for the Execution. The value is a UUID4 + # string and guaranteed to remain unchanged until the resource is deleted. + # @!attribute [r] generation + # @return [::Integer] + # Output only. A number that monotonically increases every time the user + # modifies the desired state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style labels for the resource. + # User-provided labels are shared with Google's billing system, so they can + # be used to filter, or break down billing charges by team, component, + # environment, state, etc. For more information, visit + # https://cloud.google.com/resource-manager/docs/creating-managing-labels or + # https://cloud.google.com/run/docs/configuring/labels + # Cloud Run will populate some labels with 'run.googleapis.com' or + # 'serving.knative.dev' namespaces. Those labels are read-only, and user + # changes will not be preserved. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style annotations for the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the execution was acknowledged by the execution + # controller. It is not guaranteed to be set in happens-before order across + # separate operations. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the execution started to run. + # It is not guaranteed to be set in happens-before order across separate + # operations. + # @!attribute [r] completion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the execution was completed. It is not guaranteed to + # be set in happens-before order across separate operations. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last-modified time. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. For a deleted resource, the deletion time. It is only + # populated as a response to a Delete request. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. For a deleted resource, the time after which it will be + # permamently deleted. It is only populated as a response to a Delete + # request. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Set the launch stage to a preview stage on write to allow use of preview + # features in that stage. On read, describes whether the resource uses + # preview features. Launch Stages are defined at [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + # @!attribute [r] job + # @return [::String] + # Output only. The name of the parent Job. + # @!attribute [r] parallelism + # @return [::Integer] + # Output only. Specifies the maximum desired number of tasks the execution should + # run at any given time. Must be <= task_count. The actual number of + # tasks running in steady state will be less than this number when + # ((.spec.task_count - .status.successful) < .spec.parallelism), i.e. when + # the work left to do is less than max parallelism. More info: + # https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ + # @!attribute [r] task_count + # @return [::Integer] + # Output only. Specifies the desired number of tasks the execution should run. + # Setting to 1 means that parallelism is limited to 1 and the success of + # that task signals the success of the execution. + # More info: + # https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ + # @!attribute [r] template + # @return [::Google::Cloud::Run::V2::TaskTemplate] + # Output only. The template used to create tasks for this execution. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether the resource's reconciliation is still in progress. + # See comments in `Job.reconciling` for additional information on + # reconciliation process in Cloud Run. + # @!attribute [r] conditions + # @return [::Array<::Google::Cloud::Run::V2::Condition>] + # Output only. The Condition of this Execution, containing its readiness status, and + # detailed error information in case it did not reach the desired state. + # @!attribute [r] observed_generation + # @return [::Integer] + # Output only. The generation of this Execution. See comments in `reconciling` for + # additional information on reconciliation process in Cloud Run. + # @!attribute [r] running_count + # @return [::Integer] + # Output only. The number of actively running tasks. + # @!attribute [r] succeeded_count + # @return [::Integer] + # Output only. The number of tasks which reached phase Succeeded. + # @!attribute [r] failed_count + # @return [::Integer] + # Output only. The number of tasks which reached phase Failed. + # @!attribute [r] etag + # @return [::String] + # Output only. A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + class Execution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution_template.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution_template.rb new file mode 100644 index 000000000000..ca3ead89c13e --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/execution_template.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + # ExecutionTemplate describes the data an execution should have when created + # from a template. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style labels for the resource. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style annotations for the resource. + # @!attribute [rw] parallelism + # @return [::Integer] + # Specifies the maximum desired number of tasks the execution should run at + # given time. Must be <= task_count. + # When the job is run, if this field is 0 or unset, the maximum possible + # value will be used for that execution. + # The actual number of tasks running in steady state will be less than this + # number when there are fewer tasks waiting to be completed remaining, + # i.e. when the work left to do is less than max parallelism. + # @!attribute [rw] task_count + # @return [::Integer] + # Specifies the desired number of tasks the execution should run. + # Setting to 1 means that parallelism is limited to 1 and the success of + # that task signals the success of the execution. + # More info: + # https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ + # @!attribute [rw] template + # @return [::Google::Cloud::Run::V2::TaskTemplate] + # Required. Describes the task(s) that will be created when executing an execution. + class ExecutionTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/job.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/job.rb new file mode 100644 index 000000000000..bd0a2170a2d2 --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/job.rb @@ -0,0 +1,308 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + # Request message for creating a Job. + # @!attribute [rw] parent + # @return [::String] + # Required. The location and project in which this Job should be created. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. + # @!attribute [rw] job + # @return [::Google::Cloud::Run::V2::Job] + # Required. The Job instance to create. + # @!attribute [rw] job_id + # @return [::String] + # Required. The unique identifier for the Job. The name of the job becomes + # \\{parent}/jobs/\\{job_id}. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Indicates that the request should be validated and default values + # populated, without persisting the request or creating any resources. + class CreateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for obtaining a Job by its full name. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + class GetJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating a Job. + # @!attribute [rw] job + # @return [::Google::Cloud::Run::V2::Job] + # Required. The Job to be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Indicates that the request should be validated and default values + # populated, without persisting the request or updating any resources. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If set to true, and if the Job does not exist, it will create a new + # one. Caller must have both create and update permissions for this call if + # this is set to true. + class UpdateJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a list of Jobs. + # @!attribute [rw] parent + # @return [::String] + # Required. The location and project to list resources on. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of Jobs to return in this call. + # @!attribute [rw] page_token + # @return [::String] + # A page token received from a previous call to ListJobs. + # All other parameters must match. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + class ListJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message containing a list of Jobs. + # @!attribute [rw] jobs + # @return [::Array<::Google::Cloud::Run::V2::Job>] + # The resulting list of Jobs. + # @!attribute [rw] next_page_token + # @return [::String] + # A token indicating there are more items than page_size. Use it in the next + # ListJobs request to continue. + class ListJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to delete a Job by its full name. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @!attribute [rw] etag + # @return [::String] + # A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + class DeleteJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message to create a new Execution of a Job. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the Job. + # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project} + # can be project id or number. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Indicates that the request should be validated without actually + # deleting any resources. + # @!attribute [rw] etag + # @return [::String] + # A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + class RunJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Job represents the configuration of a single job. A job an immutable resource + # that references a container image which is run to completion. + # @!attribute [rw] name + # @return [::String] + # The fully qualified name of this Job. + # + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job} + # @!attribute [r] uid + # @return [::String] + # Output only. Server assigned unique identifier for the Execution. The value is a UUID4 + # string and guaranteed to remain unchanged until the resource is deleted. + # @!attribute [r] generation + # @return [::Integer] + # Output only. A number that monotonically increases every time the user + # modifies the desired state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style labels for the resource. + # User-provided labels are shared with Google's billing system, so they can + # be used to filter, or break down billing charges by team, component, + # environment, state, etc. For more information, visit + # https://cloud.google.com/resource-manager/docs/creating-managing-labels or + # https://cloud.google.com/run/docs/configuring/labels + # Cloud Run will populate some labels with 'run.googleapis.com' or + # 'serving.knative.dev' namespaces. Those labels are read-only, and user + # changes will not be preserved. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style annotations for the resource. Unstructured key value map that may + # be set by external tools to store and arbitrary metadata. + # They are not queryable and should be preserved + # when modifying objects. Cloud Run will populate some annotations using + # 'run.googleapis.com' or 'serving.knative.dev' namespaces. This field + # follows Kubernetes annotations' namespacing, limits, and rules. More info: + # https://kubernetes.io/docs/user-guide/annotations + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The creation time. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last-modified time. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The deletion time. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. For a deleted resource, the time after which it will be + # permamently deleted. + # @!attribute [r] creator + # @return [::String] + # Output only. Email address of the authenticated creator. + # @!attribute [r] last_modifier + # @return [::String] + # Output only. Email address of the last authenticated modifier. + # @!attribute [rw] client + # @return [::String] + # Arbitrary identifier for the API client. + # @!attribute [rw] client_version + # @return [::String] + # Arbitrary version identifier for the API client. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + # Cloud Run supports `ALPHA`, `BETA`, and `GA`. If no value is specified, GA + # is assumed. + # @!attribute [rw] binary_authorization + # @return [::Google::Cloud::Run::V2::BinaryAuthorization] + # Settings for the Binary Authorization feature. + # @!attribute [rw] template + # @return [::Google::Cloud::Run::V2::ExecutionTemplate] + # Required. The template used to create executions for this Job. + # @!attribute [r] observed_generation + # @return [::Integer] + # Output only. The generation of this Job. See comments in `reconciling` for additional + # information on reconciliation process in Cloud Run. + # @!attribute [r] terminal_condition + # @return [::Google::Cloud::Run::V2::Condition] + # Output only. The Condition of this Job, containing its readiness status, and + # detailed error information in case it did not reach the desired state. + # @!attribute [r] conditions + # @return [::Array<::Google::Cloud::Run::V2::Condition>] + # Output only. The Conditions of all other associated sub-resources. They contain + # additional diagnostics information in case the Job does not reach its + # desired state. See comments in `reconciling` for additional information on + # reconciliation process in Cloud Run. + # @!attribute [r] execution_count + # @return [::Integer] + # Output only. Number of executions created for this job. + # @!attribute [r] latest_created_execution + # @return [::Google::Cloud::Run::V2::ExecutionReference] + # Output only. Name of the last created execution. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Returns true if the Job is currently being acted upon by the system to + # bring it into the desired state. + # + # When a new Job is created, or an existing one is updated, Cloud Run + # will asynchronously perform all necessary steps to bring the Job to the + # desired state. This process is called reconciliation. + # While reconciliation is in process, `observed_generation` and + # `latest_succeeded_execution`, will have transient values that might + # mismatch the intended state: Once reconciliation is over (and this field is + # false), there are two possible outcomes: reconciliation succeeded and the + # state matches the Job, or there was an error, and reconciliation failed. + # This state can be found in `terminal_condition.state`. + # + # If reconciliation succeeded, the following fields will match: + # `observed_generation` and `generation`, `latest_succeeded_execution` and + # `latest_created_execution`. + # + # If reconciliation failed, `observed_generation` and + # `latest_succeeded_execution` will have the state of the last succeeded + # execution or empty for newly created Job. Additional information on the + # failure can be found in `terminal_condition` and `conditions`. + # @!attribute [r] etag + # @return [::String] + # Output only. A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + class Job + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Reference to an Execution. Use /Executions.GetExecution with the given name + # to get full execution including the latest status. + # @!attribute [rw] name + # @return [::String] + # Name of the execution. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation timestamp of the execution. + # @!attribute [rw] completion_time + # @return [::Google::Protobuf::Timestamp] + # Creation timestamp of the execution. + class ExecutionReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/k8s.min.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/k8s.min.rb index 3e9e761b73d7..77d7302121ee 100644 --- a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/k8s.min.rb +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/k8s.min.rb @@ -102,9 +102,9 @@ class Container # @!attribute [rw] limits # @return [::Google::Protobuf::Map{::String => ::String}] # Only memory and CPU are supported. Note: The only - # supported values for CPU are '1', '2', and '4'. Setting 4 CPU requires at - # least 2Gi of memory. - # The values of the map is string form of the 'quantity' k8s type: + # supported values for CPU are '1', '2', '4', and '8'. Setting 4 CPU + # requires at least 2Gi of memory. The values of the map is string form of + # the 'quantity' k8s type: # https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go # @!attribute [rw] cpu_idle # @return [::Boolean] @@ -165,7 +165,8 @@ class EnvVarSource # @!attribute [rw] version # @return [::String] # The Cloud Secret Manager secret version. - # Can be 'latest' for the latest value or an integer for a specific version. + # Can be 'latest' for the latest version, an integer for a specific version, + # or a version alias. class SecretKeySelector include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -268,7 +269,8 @@ class SecretVolumeSource # @!attribute [rw] version # @return [::String] # The Cloud Secret Manager secret version. - # Can be 'latest' for the latest value or an integer for a specific version. + # Can be 'latest' for the latest value, or an integer or a secret alias for a + # specific version. # @!attribute [rw] mode # @return [::Integer] # Integer octal mode bits to use on this file, must be a value between @@ -334,11 +336,15 @@ class CloudSqlInstance # @!attribute [rw] http_get # @return [::Google::Cloud::Run::V2::HTTPGetAction] # HTTPGet specifies the http request to perform. - # Exactly one of HTTPGet or TCPSocket must be specified. + # Exactly one of httpGet, tcpSocket, or grpc must be specified. # @!attribute [rw] tcp_socket # @return [::Google::Cloud::Run::V2::TCPSocketAction] # TCPSocket specifies an action involving a TCP port. - # Exactly one of HTTPGet or TCPSocket must be specified. + # Exactly one of httpGet, tcpSocket, or grpc must be specified. + # @!attribute [rw] grpc + # @return [::Google::Cloud::Run::V2::GRPCAction] + # GRPC specifies an action involving a gRPC port. + # Exactly one of httpGet, tcpSocket, or grpc must be specified. class Probe include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -372,10 +378,26 @@ class HTTPHeader # @!attribute [rw] port # @return [::Integer] # Port number to access on the container. Must be in the range 1 to 65535. + # If not specified, defaults to 8080. class TCPSocketAction include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # GRPCAction describes an action involving a GRPC port. + # @!attribute [rw] port + # @return [::Integer] + # Port number of the gRPC service. Number must be in the range 1 to 65535. + # If not specified, defaults to 8080. + # @!attribute [rw] service + # @return [::String] + # Service is the name of the service to place in the gRPC HealthCheckRequest + # (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). If + # this is not specified, the default behavior is defined by gRPC. + class GRPCAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/service.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/service.rb index 9b246ae8c05d..5d6b7c25e3f8 100644 --- a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/service.rb +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/service.rb @@ -24,16 +24,16 @@ module V2 # Request message for creating a Service. # @!attribute [rw] parent # @return [::String] - # The location and project in which this service should be created. - # Format: projects/\\{project}/locations/\\{location} - # Only lowercase characters, digits, and hyphens. + # Required. The location and project in which this service should be created. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. Only lowercase characters, digits, and hyphens. # @!attribute [rw] service # @return [::Google::Cloud::Run::V2::Service] # Required. The Service instance to create. # @!attribute [rw] service_id # @return [::String] # Required. The unique identifier for the Service. It must begin with letter, - # and may not end with hyphen; must contain fewer than 50 characters. + # and cannot end with hyphen; must contain fewer than 50 characters. # The name of the service becomes \\{parent}/services/\\{service_id}. # @!attribute [rw] validate_only # @return [::Boolean] @@ -66,8 +66,9 @@ class UpdateServiceRequest # @!attribute [rw] parent # @return [::String] # Required. The location and project to list resources on. - # Location must be a valid GCP region, and may not be the "-" wildcard. - # Format: projects/\\{project}/locations/\\{location} + # Location must be a valid GCP region, and cannot be the "-" wildcard. + # Format: projects/\\{project}/locations/\\{location}, where \\{project} can be + # project id or number. # @!attribute [rw] page_size # @return [::Integer] # Maximum number of Services to return in this call. @@ -100,7 +101,8 @@ class ListServicesResponse # @!attribute [rw] name # @return [::String] # Required. The full name of the Service. - # Format: projects/\\{project}/locations/\\{location}/services/\\{service} + # Format: projects/\\{project}/locations/\\{location}/services/\\{service}, where + # \\{project} can be project id or number. class GetServiceRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -110,7 +112,8 @@ class GetServiceRequest # @!attribute [rw] name # @return [::String] # Required. The full name of the Service. - # Format: projects/\\{project}/locations/\\{location}/services/\\{service} + # Format: projects/\\{project}/locations/\\{location}/services/\\{service}, where + # \\{project} can be project id or number. # @!attribute [rw] validate_only # @return [::Boolean] # Indicates that the request should be validated without actually diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task.rb new file mode 100644 index 000000000000..22eaedc27993 --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + # Request message for obtaining a Task by its full name. + # @!attribute [rw] name + # @return [::String] + # Required. The full name of the Task. + # Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution}/tasks/\\{task} + class GetTaskRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for retrieving a list of Tasks. + # @!attribute [rw] parent + # @return [::String] + # Required. The Execution from which the Tasks should be listed. + # To list all Tasks across Executions of a Job, use "-" instead of Execution + # name. To list all Tasks across Jobs, use "-" instead of Job name. Format: + # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution} + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of Tasks to return in this call. + # @!attribute [rw] page_token + # @return [::String] + # A page token received from a previous call to ListTasks. + # All other parameters must match. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # If true, returns deleted (but unexpired) resources along with active ones. + class ListTasksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message containing a list of Tasks. + # @!attribute [rw] tasks + # @return [::Array<::Google::Cloud::Run::V2::Task>] + # The resulting list of Tasks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token indicating there are more items than page_size. Use it in the next + # ListTasks request to continue. + class ListTasksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Task represents a single run of a container to completion. + # @!attribute [r] name + # @return [::String] + # Output only. The unique name of this Task. + # @!attribute [r] uid + # @return [::String] + # Output only. Server assigned unique identifier for the Task. The value is a UUID4 + # string and guaranteed to remain unchanged until the resource is deleted. + # @!attribute [r] generation + # @return [::Integer] + # Output only. A number that monotonically increases every time the user + # modifies the desired state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style labels for the resource. + # User-provided labels are shared with Google's billing system, so they can + # be used to filter, or break down billing charges by team, component, + # environment, state, etc. For more information, visit + # https://cloud.google.com/resource-manager/docs/creating-managing-labels or + # https://cloud.google.com/run/docs/configuring/labels + # Cloud Run will populate some labels with 'run.googleapis.com' or + # 'serving.knative.dev' namespaces. Those labels are read-only, and user + # changes will not be preserved. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # KRM-style annotations for the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the task was created by the job controller. + # It is not guaranteed to be set in happens-before order across separate + # operations. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the task started to run. + # It is not guaranteed to be set in happens-before order across separate + # operations. + # @!attribute [r] completion_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Represents time when the Task was completed. It is not guaranteed to + # be set in happens-before order across separate operations. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last-modified time. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. For a deleted resource, the deletion time. It is only + # populated as a response to a Delete request. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. For a deleted resource, the time after which it will be + # permamently deleted. It is only populated as a response to a Delete + # request. + # @!attribute [r] job + # @return [::String] + # Output only. The name of the parent Job. + # @!attribute [r] execution + # @return [::String] + # Output only. The name of the parent Execution. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::Run::V2::Container>] + # Holds the single container that defines the unit of execution for this + # task. + # @!attribute [rw] volumes + # @return [::Array<::Google::Cloud::Run::V2::Volume>] + # A list of Volumes to make available to containers. + # @!attribute [rw] max_retries + # @return [::Integer] + # Number of retries allowed per Task, before marking this Task failed. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # Max allowed time duration the Task may be active before the system will + # actively try to mark it failed and kill associated containers. This applies + # per attempt of a task, meaning each retry can run for the full timeout. + # @!attribute [rw] service_account + # @return [::String] + # Email address of the IAM service account associated with the Task of a + # Job. The service account represents the identity of the + # running task, and determines what permissions the task has. If + # not provided, the task will use the project's default service account. + # @!attribute [rw] execution_environment + # @return [::Google::Cloud::Run::V2::ExecutionEnvironment] + # The execution environment being used to host this Task. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether the resource's reconciliation is still in progress. + # See comments in `Job.reconciling` for additional information on + # reconciliation process in Cloud Run. + # @!attribute [r] conditions + # @return [::Array<::Google::Cloud::Run::V2::Condition>] + # Output only. The Condition of this Task, containing its readiness status, and + # detailed error information in case it did not reach the desired state. + # @!attribute [r] observed_generation + # @return [::Integer] + # Output only. The generation of this Task. See comments in `Job.reconciling` + # for additional information on reconciliation process in Cloud Run. + # @!attribute [r] index + # @return [::Integer] + # Output only. Index of the Task, unique per execution, and beginning at 0. + # @!attribute [r] retried + # @return [::Integer] + # Output only. The number of times this Task was retried. + # Tasks are retried when they fail up to the maxRetries limit. + # @!attribute [r] last_attempt_result + # @return [::Google::Cloud::Run::V2::TaskAttemptResult] + # Output only. Result of the last attempt of this Task. + # @!attribute [r] encryption_key + # @return [::String] + # Output only. A reference to a customer managed encryption key (CMEK) to use to encrypt + # this container image. For more information, go to + # https://cloud.google.com/run/docs/securing/using-cmek + # @!attribute [r] vpc_access + # @return [::Google::Cloud::Run::V2::VpcAccess] + # Output only. VPC Access configuration to use for this Task. For more information, + # visit https://cloud.google.com/run/docs/configuring/connecting-vpc. + # @!attribute [r] etag + # @return [::String] + # Output only. A system-generated fingerprint for this version of the + # resource. May be used to detect modification conflict during updates. + class Task + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Result of a task attempt. + # @!attribute [r] status + # @return [::Google::Rpc::Status] + # Output only. The status of this attempt. + # If the status code is OK, then the attempt succeeded. + # @!attribute [r] exit_code + # @return [::Integer] + # Output only. The exit code of this attempt. + # This may be unset if the container was unable to exit cleanly with a code + # due to some other failure. + # See status field for possible failure details. + class TaskAttemptResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task_template.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task_template.rb new file mode 100644 index 000000000000..cb988e8d04a5 --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/task_template.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Run + module V2 + # TaskTemplate describes the data a task should have when created + # from a template. + # @!attribute [rw] containers + # @return [::Array<::Google::Cloud::Run::V2::Container>] + # Holds the single container that defines the unit of execution for this + # task. + # @!attribute [rw] volumes + # @return [::Array<::Google::Cloud::Run::V2::Volume>] + # A list of Volumes to make available to containers. + # @!attribute [rw] max_retries + # @return [::Integer] + # Number of retries allowed per Task, before marking this Task failed. + # @!attribute [rw] timeout + # @return [::Google::Protobuf::Duration] + # Max allowed time duration the Task may be active before the system will + # actively try to mark it failed and kill associated containers. This applies + # per attempt of a task, meaning each retry can run for the full timeout. + # @!attribute [rw] service_account + # @return [::String] + # Email address of the IAM service account associated with the Task of a + # Job. The service account represents the identity of the + # running task, and determines what permissions the task has. If + # not provided, the task will use the project's default service account. + # @!attribute [rw] execution_environment + # @return [::Google::Cloud::Run::V2::ExecutionEnvironment] + # The execution environment being used to host this Task. + # @!attribute [rw] encryption_key + # @return [::String] + # A reference to a customer managed encryption key (CMEK) to use to encrypt + # this container image. For more information, go to + # https://cloud.google.com/run/docs/securing/using-cmek + # @!attribute [rw] vpc_access + # @return [::Google::Cloud::Run::V2::VpcAccess] + # VPC Access configuration to use for this Task. For more information, + # visit https://cloud.google.com/run/docs/configuring/connecting-vpc. + class TaskTemplate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/vendor_settings.rb b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/vendor_settings.rb index 40cab988236d..1117e3387949 100644 --- a/google-cloud-run-v2/proto_docs/google/cloud/run/v2/vendor_settings.rb +++ b/google-cloud-run-v2/proto_docs/google/cloud/run/v2/vendor_settings.rb @@ -28,7 +28,8 @@ module V2 # @!attribute [rw] connector # @return [::String] # VPC Access connector name. - # Format: projects/\\{project}/locations/\\{location}/connectors/\\{connector} + # Format: projects/\\{project}/locations/\\{location}/connectors/\\{connector}, + # where \\{project} can be project id or number. # @!attribute [rw] egress # @return [::Google::Cloud::Run::V2::VpcAccess::VpcEgress] # Traffic VPC egress settings. diff --git a/google-cloud-run-v2/snippets/executions/delete_execution.rb b/google-cloud-run-v2/snippets/executions/delete_execution.rb new file mode 100644 index 000000000000..b20c35f7bd60 --- /dev/null +++ b/google-cloud-run-v2/snippets/executions/delete_execution.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Executions_DeleteExecution_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Executions::Client#delete_execution +# +def delete_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::DeleteExecutionRequest.new + + # Call the delete_execution method. + result = client.delete_execution request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END run_v2_generated_Executions_DeleteExecution_sync] diff --git a/google-cloud-run-v2/snippets/executions/get_execution.rb b/google-cloud-run-v2/snippets/executions/get_execution.rb new file mode 100644 index 000000000000..84e3ae674d05 --- /dev/null +++ b/google-cloud-run-v2/snippets/executions/get_execution.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Executions_GetExecution_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Executions::Client#get_execution +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::GetExecutionRequest.new + + # Call the get_execution method. + result = client.get_execution request + + # The returned object is of type Google::Cloud::Run::V2::Execution. + p result +end +# [END run_v2_generated_Executions_GetExecution_sync] diff --git a/google-cloud-run-v2/snippets/executions/list_executions.rb b/google-cloud-run-v2/snippets/executions/list_executions.rb new file mode 100644 index 000000000000..f24e232825ca --- /dev/null +++ b/google-cloud-run-v2/snippets/executions/list_executions.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Executions_ListExecutions_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Executions::Client#list_executions +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::ListExecutionsRequest.new + + # Call the list_executions method. + result = client.list_executions request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Run::V2::Execution. + p response + end +end +# [END run_v2_generated_Executions_ListExecutions_sync] diff --git a/google-cloud-run-v2/snippets/jobs/create_job.rb b/google-cloud-run-v2/snippets/jobs/create_job.rb new file mode 100644 index 000000000000..faf64c84350f --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/create_job.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_CreateJob_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#create_job +# +def create_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::CreateJobRequest.new + + # Call the create_job method. + result = client.create_job request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END run_v2_generated_Jobs_CreateJob_sync] diff --git a/google-cloud-run-v2/snippets/jobs/delete_job.rb b/google-cloud-run-v2/snippets/jobs/delete_job.rb new file mode 100644 index 000000000000..a0d515c1c4ad --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/delete_job.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_DeleteJob_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#delete_job +# +def delete_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::DeleteJobRequest.new + + # Call the delete_job method. + result = client.delete_job request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END run_v2_generated_Jobs_DeleteJob_sync] diff --git a/google-cloud-run-v2/snippets/jobs/get_iam_policy.rb b/google-cloud-run-v2/snippets/jobs/get_iam_policy.rb new file mode 100644 index 000000000000..a20fbe776f34 --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/get_iam_policy.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_GetIamPolicy_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END run_v2_generated_Jobs_GetIamPolicy_sync] diff --git a/google-cloud-run-v2/snippets/jobs/get_job.rb b/google-cloud-run-v2/snippets/jobs/get_job.rb new file mode 100644 index 000000000000..c0a4372eac73 --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/get_job.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_GetJob_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#get_job +# +def get_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::GetJobRequest.new + + # Call the get_job method. + result = client.get_job request + + # The returned object is of type Google::Cloud::Run::V2::Job. + p result +end +# [END run_v2_generated_Jobs_GetJob_sync] diff --git a/google-cloud-run-v2/snippets/jobs/list_jobs.rb b/google-cloud-run-v2/snippets/jobs/list_jobs.rb new file mode 100644 index 000000000000..d5abc270da1a --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/list_jobs.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_ListJobs_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#list_jobs +# +def list_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::ListJobsRequest.new + + # Call the list_jobs method. + result = client.list_jobs request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Run::V2::Job. + p response + end +end +# [END run_v2_generated_Jobs_ListJobs_sync] diff --git a/google-cloud-run-v2/snippets/jobs/run_job.rb b/google-cloud-run-v2/snippets/jobs/run_job.rb new file mode 100644 index 000000000000..3622a3ea76af --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/run_job.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_RunJob_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#run_job +# +def run_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::RunJobRequest.new + + # Call the run_job method. + result = client.run_job request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END run_v2_generated_Jobs_RunJob_sync] diff --git a/google-cloud-run-v2/snippets/jobs/set_iam_policy.rb b/google-cloud-run-v2/snippets/jobs/set_iam_policy.rb new file mode 100644 index 000000000000..6d6ff14910ed --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/set_iam_policy.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_SetIamPolicy_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END run_v2_generated_Jobs_SetIamPolicy_sync] diff --git a/google-cloud-run-v2/snippets/jobs/test_iam_permissions.rb b/google-cloud-run-v2/snippets/jobs/test_iam_permissions.rb new file mode 100644 index 000000000000..a6e8394fa95a --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/test_iam_permissions.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_TestIamPermissions_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END run_v2_generated_Jobs_TestIamPermissions_sync] diff --git a/google-cloud-run-v2/snippets/jobs/update_job.rb b/google-cloud-run-v2/snippets/jobs/update_job.rb new file mode 100644 index 000000000000..6f293dc92e02 --- /dev/null +++ b/google-cloud-run-v2/snippets/jobs/update_job.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Jobs_UpdateJob_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Jobs::Client#update_job +# +def update_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Jobs::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::UpdateJobRequest.new + + # Call the update_job method. + result = client.update_job request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END run_v2_generated_Jobs_UpdateJob_sync] diff --git a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json index da23b2e24c8f..b373d68f7c31 100644 --- a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json +++ b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json @@ -11,6 +11,486 @@ ] }, "snippets": [ + { + "region_tag": "run_v2_generated_Executions_GetExecution_sync", + "title": "Snippet for get_execution in Executions", + "description": "Basic snippet for get_execution in Executions", + "file": "executions/get_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_execution", + "full_name": "::Google::Cloud::Run::V2::Executions::Client#get_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::GetExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Run::V2::Executions::Client" + }, + "method": { + "short_name": "GetExecution", + "full_name": "google.cloud.run.v2.Executions.GetExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.run.v2.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Executions_ListExecutions_sync", + "title": "Snippet for list_executions in Executions", + "description": "Basic snippet for list_executions in Executions", + "file": "executions/list_executions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_executions", + "full_name": "::Google::Cloud::Run::V2::Executions::Client#list_executions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::ListExecutionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::ListExecutionsResponse", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Run::V2::Executions::Client" + }, + "method": { + "short_name": "ListExecutions", + "full_name": "google.cloud.run.v2.Executions.ListExecutions", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.run.v2.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Executions_DeleteExecution_sync", + "title": "Snippet for delete_execution in Executions", + "description": "Basic snippet for delete_execution in Executions", + "file": "executions/delete_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_execution", + "full_name": "::Google::Cloud::Run::V2::Executions::Client#delete_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::DeleteExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Run::V2::Executions::Client" + }, + "method": { + "short_name": "DeleteExecution", + "full_name": "google.cloud.run.v2.Executions.DeleteExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.run.v2.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_CreateJob_sync", + "title": "Snippet for create_job in Jobs", + "description": "Basic snippet for create_job in Jobs", + "file": "jobs/create_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_job", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#create_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::CreateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "CreateJob", + "full_name": "google.cloud.run.v2.Jobs.CreateJob", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_GetJob_sync", + "title": "Snippet for get_job in Jobs", + "description": "Basic snippet for get_job in Jobs", + "file": "jobs/get_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_job", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#get_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::GetJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::Job", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "GetJob", + "full_name": "google.cloud.run.v2.Jobs.GetJob", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_ListJobs_sync", + "title": "Snippet for list_jobs in Jobs", + "description": "Basic snippet for list_jobs in Jobs", + "file": "jobs/list_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_jobs", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#list_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::ListJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::ListJobsResponse", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "ListJobs", + "full_name": "google.cloud.run.v2.Jobs.ListJobs", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_UpdateJob_sync", + "title": "Snippet for update_job in Jobs", + "description": "Basic snippet for update_job in Jobs", + "file": "jobs/update_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_job", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#update_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::UpdateJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "UpdateJob", + "full_name": "google.cloud.run.v2.Jobs.UpdateJob", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_DeleteJob_sync", + "title": "Snippet for delete_job in Jobs", + "description": "Basic snippet for delete_job in Jobs", + "file": "jobs/delete_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_job", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#delete_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::DeleteJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "DeleteJob", + "full_name": "google.cloud.run.v2.Jobs.DeleteJob", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_RunJob_sync", + "title": "Snippet for run_job in Jobs", + "description": "Basic snippet for run_job in Jobs", + "file": "jobs/run_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_job", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#run_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::RunJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "RunJob", + "full_name": "google.cloud.run.v2.Jobs.RunJob", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_GetIamPolicy_sync", + "title": "Snippet for get_iam_policy in Jobs", + "description": "Basic snippet for get_iam_policy in Jobs", + "file": "jobs/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.cloud.run.v2.Jobs.GetIamPolicy", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_SetIamPolicy_sync", + "title": "Snippet for set_iam_policy in Jobs", + "description": "Basic snippet for set_iam_policy in Jobs", + "file": "jobs/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.cloud.run.v2.Jobs.SetIamPolicy", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Jobs_TestIamPermissions_sync", + "title": "Snippet for test_iam_permissions in Jobs", + "description": "Basic snippet for test_iam_permissions in Jobs", + "file": "jobs/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "Jobs::Client", + "full_name": "::Google::Cloud::Run::V2::Jobs::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.cloud.run.v2.Jobs.TestIamPermissions", + "service": { + "short_name": "Jobs", + "full_name": "google.cloud.run.v2.Jobs" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, { "region_tag": "run_v2_generated_Revisions_GetRevision_sync", "title": "Snippet for get_revision in Revisions", @@ -450,6 +930,86 @@ "type": "FULL" } ] + }, + { + "region_tag": "run_v2_generated_Tasks_GetTask_sync", + "title": "Snippet for get_task in Tasks", + "description": "Basic snippet for get_task in Tasks", + "file": "tasks/get_task.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_task", + "full_name": "::Google::Cloud::Run::V2::Tasks::Client#get_task", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::GetTaskRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::Task", + "client": { + "short_name": "Tasks::Client", + "full_name": "::Google::Cloud::Run::V2::Tasks::Client" + }, + "method": { + "short_name": "GetTask", + "full_name": "google.cloud.run.v2.Tasks.GetTask", + "service": { + "short_name": "Tasks", + "full_name": "google.cloud.run.v2.Tasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "run_v2_generated_Tasks_ListTasks_sync", + "title": "Snippet for list_tasks in Tasks", + "description": "Basic snippet for list_tasks in Tasks", + "file": "tasks/list_tasks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_tasks", + "full_name": "::Google::Cloud::Run::V2::Tasks::Client#list_tasks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Run::V2::ListTasksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Run::V2::ListTasksResponse", + "client": { + "short_name": "Tasks::Client", + "full_name": "::Google::Cloud::Run::V2::Tasks::Client" + }, + "method": { + "short_name": "ListTasks", + "full_name": "google.cloud.run.v2.Tasks.ListTasks", + "service": { + "short_name": "Tasks", + "full_name": "google.cloud.run.v2.Tasks" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-run-v2/snippets/tasks/get_task.rb b/google-cloud-run-v2/snippets/tasks/get_task.rb new file mode 100644 index 000000000000..12928d3ee348 --- /dev/null +++ b/google-cloud-run-v2/snippets/tasks/get_task.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Tasks_GetTask_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Tasks::Client#get_task +# +def get_task + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Tasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::GetTaskRequest.new + + # Call the get_task method. + result = client.get_task request + + # The returned object is of type Google::Cloud::Run::V2::Task. + p result +end +# [END run_v2_generated_Tasks_GetTask_sync] diff --git a/google-cloud-run-v2/snippets/tasks/list_tasks.rb b/google-cloud-run-v2/snippets/tasks/list_tasks.rb new file mode 100644 index 000000000000..d286ece193f6 --- /dev/null +++ b/google-cloud-run-v2/snippets/tasks/list_tasks.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START run_v2_generated_Tasks_ListTasks_sync] +require "google/cloud/run/v2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Run::V2::Tasks::Client#list_tasks +# +def list_tasks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Run::V2::Tasks::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Run::V2::ListTasksRequest.new + + # Call the list_tasks method. + result = client.list_tasks request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::Run::V2::Task. + p response + end +end +# [END run_v2_generated_Tasks_ListTasks_sync] diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb new file mode 100644 index 000000000000..ddbb78660678 --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/execution_pb" +require "google/cloud/run/v2/execution_services_pb" +require "google/cloud/run/v2/executions" + +class ::Google::Cloud::Run::V2::Executions::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Executions::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Run::V2::Executions::Operations::Configuration, config + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb new file mode 100644 index 000000000000..2d6711cd04ca --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/executions" + +class ::Google::Cloud::Run::V2::Executions::ClientPathsTest < Minitest::Test + def test_execution_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.execution_path project: "value0", location: "value1", job: "value2", execution: "value3" + assert_equal "projects/value0/locations/value1/jobs/value2/executions/value3", path + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb new file mode 100644 index 000000000000..a1f81fa0160b --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/executions_test.rb @@ -0,0 +1,274 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/execution_pb" +require "google/cloud/run/v2/execution_services_pb" +require "google/cloud/run/v2/executions" + +class ::Google::Cloud::Run::V2::Executions::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_get_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::Execution.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_execution, name + assert_kind_of ::Google::Cloud::Run::V2::GetExecutionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_execution_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_execution({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_execution name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_execution ::Google::Cloud::Run::V2::GetExecutionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_execution({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_execution(::Google::Cloud::Run::V2::GetExecutionRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_execution_client_stub.call_rpc_count + end + end + + def test_list_executions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::ListExecutionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_executions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_executions, name + assert_kind_of ::Google::Cloud::Run::V2::ListExecutionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_executions_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_executions({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_executions parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_executions ::Google::Cloud::Run::V2::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_executions({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_executions(::Google::Cloud::Run::V2::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_executions_client_stub.call_rpc_count + end + end + + def test_delete_execution + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + delete_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_execution, name + assert_kind_of ::Google::Cloud::Run::V2::DeleteExecutionRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_execution_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_execution({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_execution name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_execution ::Google::Cloud::Run::V2::DeleteExecutionRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_execution({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_execution(::Google::Cloud::Run::V2::DeleteExecutionRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_execution_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Run::V2::Executions::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Executions::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Run::V2::Executions::Operations, client.operations_client + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb new file mode 100644 index 000000000000..7ca5dbfaa12e --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_operations_test.rb @@ -0,0 +1,380 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/job_pb" +require "google/cloud/run/v2/job_services_pb" +require "google/cloud/run/v2/jobs" + +class ::Google::Cloud::Run::V2::Jobs::OperationsTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_list_operations + # Create GRPC objects. + grpc_response = ::Google::Longrunning::ListOperationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + filter = "hello world" + page_size = 42 + page_token = "hello world" + + list_operations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operations, name + assert_kind_of ::Google::Longrunning::ListOperationsRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["filter"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_operations_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_operations name: name, filter: filter, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_operations ::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_operations({ name: name, filter: filter, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_operations(::Google::Longrunning::ListOperationsRequest.new(name: name, filter: filter, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_operations_client_stub.call_rpc_count + end + end + + def test_get_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operation, name + assert_kind_of ::Google::Longrunning::GetOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operation({ name: name }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operation name: name do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operation ::Google::Longrunning::GetOperationRequest.new(name: name) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operation({ name: name }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_operation(::Google::Longrunning::GetOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_operation_client_stub.call_rpc_count + end + end + + def test_delete_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + delete_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operation, name + assert_kind_of ::Google::Longrunning::DeleteOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_operation ::Google::Longrunning::DeleteOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_operation(::Google::Longrunning::DeleteOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_operation_client_stub.call_rpc_count + end + end + + def test_cancel_operation + # Create GRPC objects. + grpc_response = ::Google::Protobuf::Empty.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_operation, name + assert_kind_of ::Google::Longrunning::CancelOperationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_operation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_operation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_operation ::Google::Longrunning::CancelOperationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_operation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.cancel_operation(::Google::Longrunning::CancelOperationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, cancel_operation_client_stub.call_rpc_count + end + end + + def test_wait_operation + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + timeout = {} + + wait_operation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :wait_operation, name + assert_kind_of ::Google::Longrunning::WaitOperationRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["timeout"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, wait_operation_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.wait_operation({ name: name, timeout: timeout }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.wait_operation name: name, timeout: timeout do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.wait_operation ::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.wait_operation({ name: name, timeout: timeout }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.wait_operation(::Google::Longrunning::WaitOperationRequest.new(name: name, timeout: timeout), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, wait_operation_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Operations.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Run::V2::Jobs::Operations::Configuration, config + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb new file mode 100644 index 000000000000..42d9123b7d0a --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_paths_test.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/jobs" + +class ::Google::Cloud::Run::V2::Jobs::ClientPathsTest < Minitest::Test + def test_connector_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.connector_path project: "value0", location: "value1", connector: "value2" + assert_equal "projects/value0/locations/value1/connectors/value2", path + end + end + + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_execution_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.execution_path project: "value0", location: "value1", job: "value2", execution: "value3" + assert_equal "projects/value0/locations/value1/jobs/value2/executions/value3", path + end + end + + def test_job_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.job_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/jobs/value2", path + end + end + + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + + def test_secret_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_path project: "value0", secret: "value1" + assert_equal "projects/value0/secrets/value1", path + end + end + + def test_secret_version_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.secret_version_path project: "value0", secret: "value1", version: "value2" + assert_equal "projects/value0/secrets/value1/versions/value2", path + end + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb new file mode 100644 index 000000000000..a6a46c9a3e56 --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/jobs_test.rb @@ -0,0 +1,659 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/job_pb" +require "google/cloud/run/v2/job_services_pb" +require "google/cloud/run/v2/jobs" + +class ::Google::Cloud::Run::V2::Jobs::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_create_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + job = {} + job_id = "hello world" + validate_only = true + + create_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_job, name + assert_kind_of ::Google::Cloud::Run::V2::CreateJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Run::V2::Job), request["job"] + assert_equal "hello world", request["job_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_job_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_job({ parent: parent, job: job, job_id: job_id, validate_only: validate_only }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_job parent: parent, job: job, job_id: job_id, validate_only: validate_only do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_job ::Google::Cloud::Run::V2::CreateJobRequest.new(parent: parent, job: job, job_id: job_id, validate_only: validate_only) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_job({ parent: parent, job: job, job_id: job_id, validate_only: validate_only }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_job(::Google::Cloud::Run::V2::CreateJobRequest.new(parent: parent, job: job, job_id: job_id, validate_only: validate_only), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_job_client_stub.call_rpc_count + end + end + + def test_get_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::Job.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_job, name + assert_kind_of ::Google::Cloud::Run::V2::GetJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_job_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_job ::Google::Cloud::Run::V2::GetJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_job({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_job(::Google::Cloud::Run::V2::GetJobRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_job_client_stub.call_rpc_count + end + end + + def test_list_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::ListJobsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_jobs, name + assert_kind_of ::Google::Cloud::Run::V2::ListJobsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_jobs_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_jobs parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_jobs ::Google::Cloud::Run::V2::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_jobs({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_jobs(::Google::Cloud::Run::V2::ListJobsRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_jobs_client_stub.call_rpc_count + end + end + + def test_update_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + job = {} + validate_only = true + allow_missing = true + + update_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_job, name + assert_kind_of ::Google::Cloud::Run::V2::UpdateJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Run::V2::Job), request["job"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_job_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_job({ job: job, validate_only: validate_only, allow_missing: allow_missing }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_job job: job, validate_only: validate_only, allow_missing: allow_missing do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_job ::Google::Cloud::Run::V2::UpdateJobRequest.new(job: job, validate_only: validate_only, allow_missing: allow_missing) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_job({ job: job, validate_only: validate_only, allow_missing: allow_missing }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_job(::Google::Cloud::Run::V2::UpdateJobRequest.new(job: job, validate_only: validate_only, allow_missing: allow_missing), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_job_client_stub.call_rpc_count + end + end + + def test_delete_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + delete_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_job, name + assert_kind_of ::Google::Cloud::Run::V2::DeleteJobRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_job_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_job({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_job name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_job ::Google::Cloud::Run::V2::DeleteJobRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_job({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.delete_job(::Google::Cloud::Run::V2::DeleteJobRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, delete_job_client_stub.call_rpc_count + end + end + + def test_run_job + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + validate_only = true + etag = "hello world" + + run_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_job, name + assert_kind_of ::Google::Cloud::Run::V2::RunJobRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_job_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_job({ name: name, validate_only: validate_only, etag: etag }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.run_job name: name, validate_only: validate_only, etag: etag do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.run_job ::Google::Cloud::Run::V2::RunJobRequest.new(name: name, validate_only: validate_only, etag: etag) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.run_job({ name: name, validate_only: validate_only, etag: etag }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.run_job(::Google::Cloud::Run::V2::RunJobRequest.new(name: name, validate_only: validate_only, etag: etag), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, run_job_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Run::V2::Jobs::Client::Configuration, config + end + + def test_operations_client + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Jobs::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Run::V2::Jobs::Operations, client.operations_client + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb new file mode 100644 index 000000000000..32106d86d259 --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_paths_test.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/tasks" + +class ::Google::Cloud::Run::V2::Tasks::ClientPathsTest < Minitest::Test + def test_execution_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.execution_path project: "value0", location: "value1", job: "value2", execution: "value3" + assert_equal "projects/value0/locations/value1/jobs/value2/executions/value3", path + end + end + + def test_task_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.task_path project: "value0", location: "value1", job: "value2", execution: "value3", task: "value4" + assert_equal "projects/value0/locations/value1/jobs/value2/executions/value3/tasks/value4", path + end + end +end diff --git a/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb new file mode 100644 index 000000000000..817153fbc78b --- /dev/null +++ b/google-cloud-run-v2/test/google/cloud/run/v2/tasks_test.rb @@ -0,0 +1,194 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/run/v2/task_pb" +require "google/cloud/run/v2/task_services_pb" +require "google/cloud/run/v2/tasks" + +class ::Google::Cloud::Run::V2::Tasks::ClientTest < Minitest::Test + class ClientStub + attr_accessor :call_rpc_count, :requests + + def initialize response, operation, &block + @response = response + @operation = operation + @block = block + @call_rpc_count = 0 + @requests = [] + end + + def call_rpc *args, **kwargs + @call_rpc_count += 1 + + @requests << @block&.call(*args, **kwargs) + + yield @response, @operation if block_given? + + @response + end + end + + def test_get_task + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::Task.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_task_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_task, name + assert_kind_of ::Google::Cloud::Run::V2::GetTaskRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_task_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_task({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_task name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_task ::Google::Cloud::Run::V2::GetTaskRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_task({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_task(::Google::Cloud::Run::V2::GetTaskRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_task_client_stub.call_rpc_count + end + end + + def test_list_tasks + # Create GRPC objects. + grpc_response = ::Google::Cloud::Run::V2::ListTasksResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + show_deleted = true + + list_tasks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_tasks, name + assert_kind_of ::Google::Cloud::Run::V2::ListTasksRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_tasks_client_stub do + # Create client + client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_tasks({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_tasks parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_tasks ::Google::Cloud::Run::V2::ListTasksRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_tasks({ parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_tasks(::Google::Cloud::Run::V2::ListTasksRequest.new(parent: parent, page_size: page_size, page_token: page_token, show_deleted: show_deleted), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_tasks_client_stub.call_rpc_count + end + end + + def test_configure + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + + client = block_config = config = nil + Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Run::V2::Tasks::Client.new do |config| + config.credentials = grpc_channel + end + end + + config = client.configure do |c| + block_config = c + end + + assert_same block_config, config + assert_kind_of ::Google::Cloud::Run::V2::Tasks::Client::Configuration, config + end +end From 85860084fa83bf78cb05c5446120da76e6c06e04 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:39:54 +0530 Subject: [PATCH 021/112] docs(bigquery-storage): remove stale header guidance for AppendRows --- .../cloud/bigquery/storage/v1/big_query_write/client.rb | 7 ------- .../cloud/bigquery/storage/v1/storage_services_pb.rb | 7 ------- 2 files changed, 14 deletions(-) diff --git a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/big_query_write/client.rb b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/big_query_write/client.rb index 27a43bf810e3..78d8efb60665 100644 --- a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/big_query_write/client.rb +++ b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/big_query_write/client.rb @@ -306,13 +306,6 @@ def create_write_stream request, options = nil # finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly # committed via the `BatchCommitWriteStreams` rpc. # - # Note: For users coding against the gRPC api directly, it may be - # necessary to supply the x-goog-request-params system parameter - # with `write_stream=`. - # - # More information about system parameters: - # https://cloud.google.com/apis/docs/system-parameters - # # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest, ::Hash>] # An enumerable of {::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest} instances. # @param options [::Gapic::CallOptions, ::Hash] diff --git a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_services_pb.rb b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_services_pb.rb index 586c71233cb9..421d1ebcf206 100644 --- a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_services_pb.rb +++ b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_services_pb.rb @@ -134,13 +134,6 @@ class Service # * For PENDING streams, data is not made visible until the stream itself is # finalized (via the `FinalizeWriteStream` rpc), and the stream is explicitly # committed via the `BatchCommitWriteStreams` rpc. - # - # Note: For users coding against the gRPC api directly, it may be - # necessary to supply the x-goog-request-params system parameter - # with `write_stream=`. - # - # More information about system parameters: - # https://cloud.google.com/apis/docs/system-parameters rpc :AppendRows, stream(::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest), stream(::Google::Cloud::Bigquery::Storage::V1::AppendRowsResponse) # Gets information about a write stream. rpc :GetWriteStream, ::Google::Cloud::Bigquery::Storage::V1::GetWriteStreamRequest, ::Google::Cloud::Bigquery::Storage::V1::WriteStream From 182a06b8ad9d54f7250b9788cd389d214c444c1c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:44:33 +0530 Subject: [PATCH 022/112] feat(ai-platform): add annotation_labels to ImportDataConfig feat(ai-platform): add start_time to BatchReadFeatureValuesRequest feat(ai-platform): add metadata_artifact to Model feat(ai-platform): add failed_main_jobs and failed_pre_caching_check_jobs to ContainerDetail feat(ai-platform): add persist_ml_use_assignment to InputDataConfig --- .../v1/featurestore_service/client.rb | 8 ++++++-- .../ai_platform/v1/metadata_service/client.rb | 13 +++++++++---- .../v1/tensorboard_service/client.rb | 8 ++++---- .../google/cloud/aiplatform/v1/dataset_pb.rb | 1 + .../aiplatform/v1/featurestore_service_pb.rb | 1 + .../lib/google/cloud/aiplatform/v1/model_pb.rb | 1 + .../cloud/aiplatform/v1/pipeline_job_pb.rb | 2 ++ .../aiplatform/v1/training_pipeline_pb.rb | 1 + .../google/cloud/aiplatform/v1/artifact.rb | 1 + .../google/cloud/aiplatform/v1/context.rb | 1 + .../google/cloud/aiplatform/v1/dataset.rb | 18 ++++++++++++++++++ .../google/cloud/aiplatform/v1/execution.rb | 1 + .../google/cloud/aiplatform/v1/featurestore.rb | 6 ++++-- .../aiplatform/v1/featurestore_service.rb | 7 ++++++- .../cloud/aiplatform/v1/index_endpoint.rb | 2 +- .../cloud/aiplatform/v1/metadata_service.rb | 13 +++++++++---- .../google/cloud/aiplatform/v1/model.rb | 9 +++++++-- .../google/cloud/aiplatform/v1/pipeline_job.rb | 15 +++++++++++++-- .../cloud/aiplatform/v1/tensorboard_service.rb | 8 ++++---- .../cloud/aiplatform/v1/training_pipeline.rb | 3 +++ .../aiplatform/v1/user_action_reference.rb | 4 ++-- .../v1/featurestore_service_test.rb | 12 +++++++----- 22 files changed, 102 insertions(+), 33 deletions(-) diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb index 0f50ef0de0d6..773960944849 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb @@ -1286,7 +1286,7 @@ def delete_entity_type request, options = nil # Required. The ID to use for the Feature, which will become the final component of # the Feature's resource name. # - # This value may be up to 60 characters, and valid characters are + # This value may be up to 128 characters, and valid characters are # `[a-z0-9_]`. The first character cannot be a number. # # The value must be unique within an EntityType. @@ -2052,7 +2052,7 @@ def import_feature_values request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload batch_read_feature_values(csv_read_instances: nil, bigquery_read_instances: nil, featurestore: nil, destination: nil, pass_through_fields: nil, entity_type_specs: nil) + # @overload batch_read_feature_values(csv_read_instances: nil, bigquery_read_instances: nil, featurestore: nil, destination: nil, pass_through_fields: nil, entity_type_specs: nil, start_time: nil) # Pass arguments to `batch_read_feature_values` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -2104,6 +2104,10 @@ def import_feature_values request, options = nil # [BatchReadFeatureValuesRequest.entity_type_specs] must have a column # specifying entity IDs in the EntityType in # [BatchReadFeatureValuesRequest.request][] . + # @param start_time [::Google::Protobuf::Timestamp, ::Hash] + # Optional. Excludes Feature values with feature generation timestamp before this + # timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb index 85515d5caa76..2af0b52242af 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/metadata_service/client.rb @@ -824,7 +824,8 @@ def get_artifact request, options = nil # `in_context("projects//locations//metadataStores//contexts/")` # # Each of the above supported filter types can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @param order_by [::String] @@ -1448,7 +1449,8 @@ def get_context request, options = nil # ``` # # Each of the above supported filters can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @param order_by [::String] @@ -2452,7 +2454,9 @@ def get_execution request, options = nil # `in_context("projects//locations//metadataStores//contexts/")` # # Each of the above supported filters can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @param order_by [::String] # How the list of messages is ordered. Specify the values to order by and an @@ -3359,7 +3363,8 @@ def list_metadata_schemas request, options = nil # For example: `metadata.field_1.number_value = 10.0` # # Each of the above supported filter types can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb index 45db49986920..f41acfa5c3de 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb @@ -975,7 +975,7 @@ def update_tensorboard_experiment request, options = nil # @param parent [::String] # Required. The resource name of the Tensorboard to list TensorboardExperiments. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` # @param filter [::String] # Lists the TensorboardExperiments that match the filter expression. # @param page_size [::Integer] @@ -1551,7 +1551,7 @@ def update_tensorboard_run request, options = nil # @param parent [::String] # Required. The resource name of the TensorboardExperiment to list TensorboardRuns. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` # @param filter [::String] # Lists the TensorboardRuns that match the filter expression. # @param page_size [::Integer] @@ -2130,7 +2130,7 @@ def update_tensorboard_time_series request, options = nil # @param parent [::String] # Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}/runs/\\{run}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` # @param filter [::String] # Lists the TensorboardTimeSeries that match the filter expression. # @param page_size [::Integer] @@ -2535,7 +2535,7 @@ def read_tensorboard_time_series_data request, options = nil # @param time_series [::String] # Required. The resource name of the TensorboardTimeSeries to list Blobs. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}/runs/\\{run}/timeSeries/\\{time_series}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` # @param blob_ids [::Array<::String>] # IDs of the blobs to read. # diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb index e07bb7fa1786..f1d962e04f17 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/dataset_pb.rb @@ -26,6 +26,7 @@ end add_message "google.cloud.aiplatform.v1.ImportDataConfig" do map :data_item_labels, :string, :string, 2 + map :annotation_labels, :string, :string, 3 optional :import_schema_uri, :string, 4 oneof :source do optional :gcs_source, :message, 1, "google.cloud.aiplatform.v1.GcsSource" diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb index 309afe691dc2..66dd00e19e18 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/featurestore_service_pb.rb @@ -79,6 +79,7 @@ optional :destination, :message, 4, "google.cloud.aiplatform.v1.FeatureValueDestination" repeated :pass_through_fields, :message, 8, "google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.PassThroughField" repeated :entity_type_specs, :message, 7, "google.cloud.aiplatform.v1.BatchReadFeatureValuesRequest.EntityTypeSpec" + optional :start_time, :message, 11, "google.protobuf.Timestamp" oneof :read_option do optional :csv_read_instances, :message, 3, "google.cloud.aiplatform.v1.CsvSource" optional :bigquery_read_instances, :message, 5, "google.cloud.aiplatform.v1.BigQuerySource" diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb index b46bb9b8a95c..41f701f59ed7 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/model_pb.rb @@ -41,6 +41,7 @@ map :labels, :string, :string, 17 optional :encryption_spec, :message, 24, "google.cloud.aiplatform.v1.EncryptionSpec" optional :model_source_info, :message, 38, "google.cloud.aiplatform.v1.ModelSourceInfo" + optional :metadata_artifact, :string, 44 end add_message "google.cloud.aiplatform.v1.Model.ExportFormat" do optional :id, :string, 1 diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb index d4023a3b6d7f..79026f5b5ffa 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/pipeline_job_pb.rb @@ -101,6 +101,8 @@ add_message "google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.ContainerDetail" do optional :main_job, :string, 1 optional :pre_caching_check_job, :string, 2 + repeated :failed_main_jobs, :string, 3 + repeated :failed_pre_caching_check_jobs, :string, 4 end add_message "google.cloud.aiplatform.v1.PipelineTaskExecutorDetail.CustomJobDetail" do optional :job, :string, 1 diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb index 7ae518a8c7f0..f2afb8e5f5a5 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/training_pipeline_pb.rb @@ -39,6 +39,7 @@ optional :annotations_filter, :string, 6 optional :annotation_schema_uri, :string, 9 optional :saved_query_id, :string, 7 + optional :persist_ml_use_assignment, :bool, 11 oneof :split do optional :fraction_split, :message, 2, "google.cloud.aiplatform.v1.FractionSplit" optional :filter_split, :message, 3, "google.cloud.aiplatform.v1.FilterSplit" diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb index 266bb32c26a0..6ec75d7e810e 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/artifact.rb @@ -75,6 +75,7 @@ module V1 # @!attribute [rw] metadata # @return [::Google::Protobuf::Struct] # Properties of the Artifact. + # Top level metadata keys' heading and trailing spaces will be trimmed. # The size of this field should not exceed 200KB. # @!attribute [rw] description # @return [::String] diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb index 1f03cda80a49..893eb5a0f6fd 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/context.rb @@ -69,6 +69,7 @@ module V1 # @!attribute [rw] metadata # @return [::Google::Protobuf::Struct] # Properties of the Context. + # Top level metadata keys' heading and trailing spaces will be trimmed. # The size of this field should not exceed 200KB. # @!attribute [rw] description # @return [::String] diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb index 13bb7a87c9f1..ce6da357fd18 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/dataset.rb @@ -105,6 +105,15 @@ class LabelsEntry # or pdf bytes). # These labels will be overridden by Annotation labels specified inside index # file referenced by {::Google::Cloud::AIPlatform::V1::ImportDataConfig#import_schema_uri import_schema_uri}, e.g. jsonl file. + # @!attribute [rw] annotation_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels that will be applied to newly imported Annotations. If two + # Annotations are identical, one of them will be deduped. Two Annotations are + # considered identical if their {::Google::Cloud::AIPlatform::V1::Annotation#payload payload}, + # {::Google::Cloud::AIPlatform::V1::Annotation#payload_schema_uri payload_schema_uri} and all of their + # {::Google::Cloud::AIPlatform::V1::Annotation#labels labels} are the same. + # These labels will be overridden by Annotation labels specified inside index + # file referenced by {::Google::Cloud::AIPlatform::V1::ImportDataConfig#import_schema_uri import_schema_uri}, e.g. jsonl file. # @!attribute [rw] import_schema_uri # @return [::String] # Required. Points to a YAML file stored on Google Cloud Storage describing the import @@ -123,6 +132,15 @@ class DataItemLabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Describes what part of the Dataset is to be exported, the destination of diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb index 6570f1e8a3fa..3f7b82d9aa2a 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/execution.rb @@ -71,6 +71,7 @@ module V1 # @!attribute [rw] metadata # @return [::Google::Protobuf::Struct] # Properties of the Execution. + # Top level metadata keys' heading and trailing spaces will be trimmed. # The size of this field should not exceed 200KB. # @!attribute [rw] description # @return [::String] diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb index 32d159d93ec7..f84f61b98931 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore.rb @@ -53,8 +53,10 @@ module V1 # and are immutable. # @!attribute [rw] online_serving_config # @return [::Google::Cloud::AIPlatform::V1::Featurestore::OnlineServingConfig] - # Optional. Config for online storage resources. If unset, the featurestore will - # not have an online store and cannot be used for online serving. + # Optional. Config for online storage resources. The field should not co-exist with the + # field of `OnlineStoreReplicationConfig`. If both of it and + # OnlineStoreReplicationConfig are unset, the feature store will not have an + # online store and cannot be used for online serving. # @!attribute [r] state # @return [::Google::Cloud::AIPlatform::V1::Featurestore::State] # Output only. State of the featurestore. diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb index 346ad47939ec..5ae5e9d6c91f 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb @@ -310,6 +310,11 @@ class ImportFeatureValuesResponse # [BatchReadFeatureValuesRequest.entity_type_specs] must have a column # specifying entity IDs in the EntityType in # [BatchReadFeatureValuesRequest.request][] . + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Optional. Excludes Feature values with feature generation timestamp before this + # timestamp. If not set, retrieve oldest values kept in Feature Store. + # Timestamp, if present, must not have higher than millisecond precision. class BatchReadFeatureValuesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -626,7 +631,7 @@ class DeleteEntityTypeRequest # Required. The ID to use for the Feature, which will become the final component of # the Feature's resource name. # - # This value may be up to 60 characters, and valid characters are + # This value may be up to 128 characters, and valid characters are # `[a-z0-9_]`. The first character cannot be a number. # # The value must be unique within an EntityType. diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb index c4dc2b2799b9..80bcd1a7c02c 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb @@ -73,7 +73,7 @@ module V1 # are mutually exclusive. # # [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/insert): - # projects/\\{project}/global/networks/\\{network}. + # `projects/{project}/global/networks/{network}`. # Where \\{project} is a project number, as in '12345', and \\{network} is # network name. # @!attribute [rw] enable_private_service_connect diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb index 74c7bba2e8f9..14bd9965ff58 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/metadata_service.rb @@ -206,7 +206,8 @@ class GetArtifactRequest # `in_context("projects//locations//metadataStores//contexts/")` # # Each of the above supported filter types can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @!attribute [rw] order_by @@ -400,7 +401,8 @@ class GetContextRequest # ``` # # Each of the above supported filters can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @!attribute [rw] order_by @@ -685,7 +687,9 @@ class GetExecutionRequest # `in_context("projects//locations//metadataStores//contexts/")` # # Each of the above supported filters can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. + # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. # @!attribute [rw] order_by # @return [::String] @@ -945,7 +949,8 @@ class ListMetadataSchemasResponse # For example: `metadata.field_1.number_value = 10.0` # # Each of the above supported filter types can be combined together using - # logical operators (`AND` & `OR`). + # logical operators (`AND` & `OR`). Maximum nested expression depth allowed + # is 5. # # For example: `display_name = "test" AND metadata.field1.bool_value = true`. class QueryArtifactLineageSubgraphRequest diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb index 0424c725fd9b..48c71e904f06 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/model.rb @@ -35,9 +35,9 @@ module V1 # @return [::Array<::String>] # User provided version aliases so that a model version can be referenced via # alias (i.e. - # projects/\\{project}/locations/\\{location}/models/\\{model_id}@\\{version_alias} + # `projects/{project}/locations/{location}/models/{model_id}@{version_alias}` # instead of auto-generated version id (i.e. - # projects/\\{project}/locations/\\{location}/models/\\{model_id}@\\{version_id}). + # `projects/{project}/locations/{location}/models/{model_id}@{version_id})`. # The format is [a-z][a-zA-Z0-9-]\\{0,126}[a-z0-9] to distinguish from # version_id. A default version alias will be created for the first version # of the model, and there must be exactly one default version alias for a @@ -243,6 +243,11 @@ module V1 # @return [::Google::Cloud::AIPlatform::V1::ModelSourceInfo] # Output only. Source of a model. It can either be automl training pipeline, custom # training pipeline, BigQuery ML, or existing Vertex AI Model. + # @!attribute [r] metadata_artifact + # @return [::String] + # Output only. The resource name of the Artifact that was created in MetadataStore when + # creating the Model. The Artifact resource name pattern is + # `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`. class Model include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb index 47878a047cbf..756d7272efa3 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb @@ -154,8 +154,8 @@ class RuntimeConfig # @!attribute [rw] artifact_id # @return [::String] # Artifact resource id from MLMD. Which is the last portion of an - # artifact resource - # name(projects/\\{project}/locations/\\{location}/metadataStores/default/artifacts/\\{artifact_id}). + # artifact resource name: + # `projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}`. # The artifact must stay within the same project, location and default # metadatastore as the pipeline. class InputArtifact @@ -385,6 +385,17 @@ class PipelineTaskExecutorDetail # execution. This job will be available if the # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} specifies the `pre_caching_check` hook in # the lifecycle events. + # @!attribute [r] failed_main_jobs + # @return [::Array<::String>] + # Output only. The names of the previously failed {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the main container + # executions. The list includes the all attempts in chronological order. + # @!attribute [r] failed_pre_caching_check_jobs + # @return [::Array<::String>] + # Output only. The names of the previously failed {::Google::Cloud::AIPlatform::V1::CustomJob CustomJob} for the + # pre-caching-check container executions. This job will be available if the + # {::Google::Cloud::AIPlatform::V1::PipelineJob#pipeline_spec PipelineJob.pipeline_spec} specifies the `pre_caching_check` hook in + # the lifecycle events. + # The list includes the all attempts in chronological order. class ContainerDetail include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb index 9833cc2f5f33..29ccb1caca08 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb @@ -161,7 +161,7 @@ class GetTensorboardExperimentRequest # @return [::String] # Required. The resource name of the Tensorboard to list TensorboardExperiments. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}` # @!attribute [rw] filter # @return [::String] # Lists the TensorboardExperiments that match the filter expression. @@ -298,7 +298,7 @@ class GetTensorboardRunRequest # @return [::String] # Required. The resource name of the TensorboardTimeSeries to list Blobs. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}/runs/\\{run}/timeSeries/\\{time_series}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}/timeSeries/{time_series}` # @!attribute [rw] blob_ids # @return [::Array<::String>] # IDs of the blobs to read. @@ -321,7 +321,7 @@ class ReadTensorboardBlobDataResponse # @return [::String] # Required. The resource name of the TensorboardExperiment to list TensorboardRuns. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}` # @!attribute [rw] filter # @return [::String] # Lists the TensorboardRuns that match the filter expression. @@ -460,7 +460,7 @@ class GetTensorboardTimeSeriesRequest # @return [::String] # Required. The resource name of the TensorboardRun to list TensorboardTimeSeries. # Format: - # 'projects/\\{project}/locations/\\{location}/tensorboards/\\{tensorboard}/experiments/\\{experiment}/runs/\\{run}' + # `projects/{project}/locations/{location}/tensorboards/{tensorboard}/experiments/{experiment}/runs/{run}` # @!attribute [rw] filter # @return [::String] # Lists the TensorboardTimeSeries that match the filter expression. diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb index b59aeb00d141..a06dd43722cb 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/training_pipeline.rb @@ -262,6 +262,9 @@ class LabelsEntry # # Only one of {::Google::Cloud::AIPlatform::V1::InputDataConfig#saved_query_id saved_query_id} and {::Google::Cloud::AIPlatform::V1::InputDataConfig#annotation_schema_uri annotation_schema_uri} should be # specified as both of them represent the same thing: problem type. + # @!attribute [rw] persist_ml_use_assignment + # @return [::Boolean] + # Whether to persist the ML use assignment to data item system labels. class InputDataConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb index a1fb76746dfd..7c56bb4f96a0 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/user_action_reference.rb @@ -28,13 +28,13 @@ module V1 # For API calls that return a long running operation. # Resource name of the long running operation. # Format: - # 'projects/\\{project}/locations/\\{location}/operations/\\{operation}' + # `projects/{project}/locations/{location}/operations/{operation}` # @!attribute [rw] data_labeling_job # @return [::String] # For API calls that start a LabelingJob. # Resource name of the LabelingJob. # Format: - # 'projects/\\{project}/locations/\\{location}/dataLabelingJobs/\\{data_labeling_job}' + # `projects/{project}/locations/{location}/dataLabelingJobs/{data_labeling_job}` # @!attribute [rw] method # @return [::String] # The method name of the API RPC call. For example, diff --git a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_test.rb b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_test.rb index 983000f71d25..6ed42011722f 100644 --- a/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_test.rb +++ b/google-cloud-ai_platform-v1/test/google/cloud/ai_platform/v1/featurestore_service_test.rb @@ -1178,6 +1178,7 @@ def test_batch_read_feature_values destination = {} pass_through_fields = [{}] entity_type_specs = [{}] + start_time = {} batch_read_feature_values_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :batch_read_feature_values, name @@ -1188,6 +1189,7 @@ def test_batch_read_feature_values assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::AIPlatform::V1::FeatureValueDestination), request["destination"] assert_kind_of ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::PassThroughField, request["pass_through_fields"].first assert_kind_of ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest::EntityTypeSpec, request["entity_type_specs"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["start_time"] refute_nil options end @@ -1198,35 +1200,35 @@ def test_batch_read_feature_values end # Use hash object - client.batch_read_feature_values({ csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs }) do |response, operation| + client.batch_read_feature_values({ csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs, start_time: start_time }) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use named arguments - client.batch_read_feature_values csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs do |response, operation| + client.batch_read_feature_values csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs, start_time: start_time do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object - client.batch_read_feature_values ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new(csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs) do |response, operation| + client.batch_read_feature_values ::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new(csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs, start_time: start_time) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use hash object with options - client.batch_read_feature_values({ csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs }, grpc_options) do |response, operation| + client.batch_read_feature_values({ csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs, start_time: start_time }, grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object with options - client.batch_read_feature_values(::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new(csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs), grpc_options) do |response, operation| + client.batch_read_feature_values(::Google::Cloud::AIPlatform::V1::BatchReadFeatureValuesRequest.new(csv_read_instances: csv_read_instances, featurestore: featurestore, destination: destination, pass_through_fields: pass_through_fields, entity_type_specs: entity_type_specs, start_time: start_time), grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation From a64024da5f9dfeeb186ef6591e0f67bf25872247 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 17:57:38 +0530 Subject: [PATCH 023/112] feat(container): support enabling private nodes feat(container): support GatewayAPIConfig feat(container): support enabling private nodes --- .../v1beta1/cluster_manager/client.rb | 5 +- .../container/v1beta1/cluster_service_pb.rb | 26 +++++ .../container/v1beta1/cluster_service.rb | 94 ++++++++++++++++++- .../container/v1beta1/cluster_manager_test.rb | 12 ++- 4 files changed, 130 insertions(+), 7 deletions(-) diff --git a/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/cluster_manager/client.rb b/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/cluster_manager/client.rb index 17019113683c..68409cb92973 100644 --- a/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/cluster_manager/client.rb +++ b/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/cluster_manager/client.rb @@ -660,7 +660,7 @@ def update_cluster request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, locations: nil, workload_metadata_config: nil, name: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, logging_config: nil) + # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, locations: nil, workload_metadata_config: nil, name: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, logging_config: nil, resource_labels: nil) # Pass arguments to `update_node_pool` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -735,6 +735,9 @@ def update_cluster request, options = nil # Enable or disable gvnic on the node pool. # @param logging_config [::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig, ::Hash] # Logging configuration. + # @param resource_labels [::Google::Cloud::Container::V1beta1::ResourceLabels, ::Hash] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Container::V1beta1::Operation] diff --git a/google-cloud-container-v1beta1/lib/google/container/v1beta1/cluster_service_pb.rb b/google-cloud-container-v1beta1/lib/google/container/v1beta1/cluster_service_pb.rb index df7cea6a293b..a29826ff62bc 100644 --- a/google-cloud-container-v1beta1/lib/google/container/v1beta1/cluster_service_pb.rb +++ b/google-cloud-container-v1beta1/lib/google/container/v1beta1/cluster_service_pb.rb @@ -61,6 +61,7 @@ optional :gvnic, :message, 29, "google.container.v1beta1.VirtualNIC" optional :spot, :bool, 32 optional :confidential_nodes, :message, 35, "google.container.v1beta1.ConfidentialNodes" + map :resource_labels, :string, :string, 37 optional :logging_config, :message, 38, "google.container.v1beta1.NodePoolLoggingConfig" end add_message "google.container.v1beta1.AdvancedMachineFeatures" do @@ -70,6 +71,7 @@ optional :create_pod_range, :bool, 4 optional :pod_range, :string, 5 optional :pod_ipv4_cidr_block, :string, 6 + proto3_optional :enable_private_nodes, :bool, 9 proto3_optional :network_performance_config, :message, 11, "google.container.v1beta1.NodeNetworkConfig.NetworkPerformanceConfig" end add_message "google.container.v1beta1.NodeNetworkConfig.NetworkPerformanceConfig" do @@ -126,6 +128,9 @@ add_message "google.container.v1beta1.NodeLabels" do map :labels, :string, :string, 1 end + add_message "google.container.v1beta1.ResourceLabels" do + map :labels, :string, :string, 1 + end add_message "google.container.v1beta1.NetworkTags" do repeated :tags, :string, 1 end @@ -195,6 +200,7 @@ optional :public_endpoint, :string, 5 optional :peering_name, :string, 7 optional :master_global_access_config, :message, 8, "google.container.v1beta1.PrivateClusterMasterGlobalAccessConfig" + optional :private_endpoint_subnetwork, :string, 10 end add_message "google.container.v1beta1.IstioConfig" do optional :disabled, :bool, 1 @@ -216,6 +222,7 @@ add_message "google.container.v1beta1.MasterAuthorizedNetworksConfig" do optional :enabled, :bool, 1 repeated :cidr_blocks, :message, 2, "google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock" + proto3_optional :gcp_public_cidrs_access_enabled, :bool, 3 end add_message "google.container.v1beta1.MasterAuthorizedNetworksConfig.CidrBlock" do optional :display_name, :string, 1 @@ -439,8 +446,10 @@ optional :desired_logging_config, :message, 64, "google.container.v1beta1.LoggingConfig" optional :desired_monitoring_config, :message, 65, "google.container.v1beta1.MonitoringConfig" optional :desired_identity_service_config, :message, 66, "google.container.v1beta1.IdentityServiceConfig" + proto3_optional :desired_enable_private_endpoint, :bool, 71 optional :desired_node_pool_auto_config_network_tags, :message, 110, "google.container.v1beta1.NetworkTags" proto3_optional :desired_protect_config, :message, 112, "google.container.v1beta1.ProtectConfig" + optional :desired_gateway_api_config, :message, 114, "google.container.v1beta1.GatewayAPIConfig" optional :desired_node_pool_logging_config, :message, 116, "google.container.v1beta1.NodePoolLoggingConfig" end add_message "google.container.v1beta1.Operation" do @@ -540,6 +549,7 @@ optional :confidential_nodes, :message, 23, "google.container.v1beta1.ConfidentialNodes" optional :gvnic, :message, 29, "google.container.v1beta1.VirtualNIC" optional :logging_config, :message, 32, "google.container.v1beta1.NodePoolLoggingConfig" + optional :resource_labels, :message, 33, "google.container.v1beta1.ResourceLabels" end add_message "google.container.v1beta1.SetNodePoolAutoscalingRequest" do optional :project_id, :string, 1 @@ -1000,6 +1010,16 @@ optional :private_ipv6_google_access, :enum, 12, "google.container.v1beta1.PrivateIPv6GoogleAccess" optional :dns_config, :message, 13, "google.container.v1beta1.DNSConfig" optional :service_external_ips_config, :message, 15, "google.container.v1beta1.ServiceExternalIPsConfig" + optional :gateway_api_config, :message, 16, "google.container.v1beta1.GatewayAPIConfig" + end + add_message "google.container.v1beta1.GatewayAPIConfig" do + optional :channel, :enum, 1, "google.container.v1beta1.GatewayAPIConfig.Channel" + end + add_enum "google.container.v1beta1.GatewayAPIConfig.Channel" do + value :CHANNEL_UNSPECIFIED, 0 + value :CHANNEL_DISABLED, 1 + value :CHANNEL_EXPERIMENTAL, 3 + value :CHANNEL_STANDARD, 4 end add_message "google.container.v1beta1.ServiceExternalIPsConfig" do optional :enabled, :bool, 1 @@ -1214,6 +1234,9 @@ value :COMPONENT_UNSPECIFIED, 0 value :SYSTEM_COMPONENTS, 1 value :WORKLOADS, 2 + value :APISERVER, 3 + value :SCHEDULER, 4 + value :CONTROLLER_MANAGER, 5 end add_message "google.container.v1beta1.MonitoringConfig" do optional :component_config, :message, 1, "google.container.v1beta1.MonitoringComponentConfig" @@ -1288,6 +1311,7 @@ module V1beta1 NodeTaint::Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.NodeTaint.Effect").enummodule NodeTaints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.NodeTaints").msgclass NodeLabels = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.NodeLabels").msgclass + ResourceLabels = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.ResourceLabels").msgclass NetworkTags = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.NetworkTags").msgclass MasterAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.MasterAuth").msgclass ClientCertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.ClientCertificateConfig").msgclass @@ -1416,6 +1440,8 @@ module V1beta1 StatusCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.StatusCondition").msgclass StatusCondition::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.StatusCondition.Code").enummodule NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.NetworkConfig").msgclass + GatewayAPIConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.GatewayAPIConfig").msgclass + GatewayAPIConfig::Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.GatewayAPIConfig.Channel").enummodule ServiceExternalIPsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.ServiceExternalIPsConfig").msgclass ListUsableSubnetworksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.ListUsableSubnetworksRequest").msgclass ListUsableSubnetworksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1beta1.ListUsableSubnetworksResponse").msgclass diff --git a/google-cloud-container-v1beta1/proto_docs/google/container/v1beta1/cluster_service.rb b/google-cloud-container-v1beta1/proto_docs/google/container/v1beta1/cluster_service.rb index 6308272f1e19..7b3318988652 100644 --- a/google-cloud-container-v1beta1/proto_docs/google/container/v1beta1/cluster_service.rb +++ b/google-cloud-container-v1beta1/proto_docs/google/container/v1beta1/cluster_service.rb @@ -307,6 +307,10 @@ class NodeKubeletConfig # @return [::Google::Cloud::Container::V1beta1::ConfidentialNodes] # Confidential nodes config. # All the nodes in the node pool will be Confidential VM once enabled. + # @!attribute [rw] resource_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. # @!attribute [rw] logging_config # @return [::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig] # Logging configuration. @@ -331,6 +335,15 @@ class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Specifies options for controlling advanced machine features. @@ -386,6 +399,11 @@ class AdvancedMachineFeatures # Only applicable if `ip_allocation_policy.use_ip_aliases` is true. # # This field cannot be changed after the node pool has been created. + # @!attribute [rw] enable_private_nodes + # @return [::Boolean] + # Whether nodes have internal IP addresses only. + # If enable_private_nodes is not specified, then the value is derived from + # [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] # @!attribute [rw] network_performance_config # @return [::Google::Cloud::Container::V1beta1::NodeNetworkConfig::NetworkPerformanceConfig] # Network bandwidth tier configuration. @@ -579,6 +597,25 @@ class LabelsEntry end end + # Collection of [GCP + # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of node label keys and node label values. + class ResourceLabels + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + # Collection of Compute Engine network tags that can be applied to a node's # underlying VM instance. (See `tags` field in # [`NodeConfig`](/kubernetes-engine/docs/reference/rest/v1/NodeConfig)). @@ -835,6 +872,10 @@ class PrivateClusterMasterGlobalAccessConfig # @!attribute [rw] master_global_access_config # @return [::Google::Cloud::Container::V1beta1::PrivateClusterMasterGlobalAccessConfig] # Controls master global access settings. + # @!attribute [rw] private_endpoint_subnetwork + # @return [::String] + # Subnet to provision the master's private endpoint during cluster creation. + # Specified in projects/*/regions/*/subnetworks/* format. class PrivateClusterConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -896,6 +937,9 @@ module LoadBalancerType # @return [::Array<::Google::Cloud::Container::V1beta1::MasterAuthorizedNetworksConfig::CidrBlock>] # cidr_blocks define up to 10 external networks that could access # Kubernetes master through HTTPS. + # @!attribute [rw] gcp_public_cidrs_access_enabled + # @return [::Boolean] + # Whether master is accessbile via Google Compute Engine Public IP addresses. class MasterAuthorizedNetworksConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1864,6 +1908,9 @@ class NodePoolAutoConfig # @!attribute [rw] desired_identity_service_config # @return [::Google::Cloud::Container::V1beta1::IdentityServiceConfig] # The desired Identity Service component configuration. + # @!attribute [rw] desired_enable_private_endpoint + # @return [::Boolean] + # Enable/Disable private endpoint for the cluster's master. # @!attribute [rw] desired_node_pool_auto_config_network_tags # @return [::Google::Cloud::Container::V1beta1::NetworkTags] # The desired network tags that apply to all auto-provisioned node pools @@ -1871,6 +1918,9 @@ class NodePoolAutoConfig # @!attribute [rw] desired_protect_config # @return [::Google::Cloud::Container::V1beta1::ProtectConfig] # Enable/Disable Protect API features for the cluster. + # @!attribute [rw] desired_gateway_api_config + # @return [::Google::Cloud::Container::V1beta1::GatewayAPIConfig] + # The desired config of Gateway API on this cluster. # @!attribute [rw] desired_node_pool_logging_config # @return [::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig] # The desired node pool logging configuration defaults for the cluster. @@ -2226,6 +2276,10 @@ class UpdateClusterRequest # @!attribute [rw] logging_config # @return [::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig] # Logging configuration. + # @!attribute [rw] resource_labels + # @return [::Google::Cloud::Container::V1beta1::ResourceLabels] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. class UpdateNodePoolRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -2877,7 +2931,7 @@ class BlueGreenSettings # Standard rollout policy is the default policy for blue-green. # @!attribute [rw] batch_percentage # @return [::Float] - # Percentage of the bool pool nodes to drain in a batch. + # Percentage of the blue pool nodes to drain in a batch. # The range of this field should be (0.0, 1.0]. # @!attribute [rw] batch_node_count # @return [::Integer] @@ -4081,11 +4135,40 @@ module Code # @return [::Google::Cloud::Container::V1beta1::ServiceExternalIPsConfig] # ServiceExternalIPsConfig specifies if services with externalIPs field are # blocked or not. + # @!attribute [rw] gateway_api_config + # @return [::Google::Cloud::Container::V1beta1::GatewayAPIConfig] + # GatewayAPIConfig contains the desired config of Gateway API on this + # cluster. class NetworkConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + # GatewayAPIConfig contains the desired config of Gateway API on this cluster. + # @!attribute [rw] channel + # @return [::Google::Cloud::Container::V1beta1::GatewayAPIConfig::Channel] + # The Gateway API release channel to use for Gateway API. + class GatewayAPIConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Channel describes if/how Gateway API should be installed and implemented in + # a cluster. + module Channel + # Default value. + CHANNEL_UNSPECIFIED = 0 + + # Gateway API support is disabled + CHANNEL_DISABLED = 1 + + # Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3 + + # Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4 + end + end + # Config to block services with externalIPs field. # @!attribute [rw] enabled # @return [::Boolean] @@ -4804,6 +4887,15 @@ module Component # workloads WORKLOADS = 2 + + # kube-apiserver + APISERVER = 3 + + # kube-scheduler + SCHEDULER = 4 + + # kube-controller-manager + CONTROLLER_MANAGER = 5 end end diff --git a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb index d0a795fed600..3ffd69913992 100644 --- a/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb +++ b/google-cloud-container-v1beta1/test/google/cloud/container/v1beta1/cluster_manager_test.rb @@ -331,6 +331,7 @@ def test_update_node_pool confidential_nodes = {} gvnic = {} logging_config = {} + resource_labels = {} update_node_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :update_node_pool, name @@ -355,6 +356,7 @@ def test_update_node_pool assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1beta1::ConfidentialNodes), request["confidential_nodes"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1beta1::VirtualNIC), request["gvnic"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1beta1::NodePoolLoggingConfig), request["logging_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1beta1::ResourceLabels), request["resource_labels"] refute_nil options end @@ -365,31 +367,31 @@ def test_update_node_pool end # Use hash object - client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config }) do |response, operation| + client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.update_node_pool project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config do |response, operation| + client.update_node_pool project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.update_node_pool ::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config) do |response, operation| + client.update_node_pool ::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config }, grpc_options) do |response, operation| + client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.update_node_pool(::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config), grpc_options) do |response, operation| + client.update_node_pool(::Google::Cloud::Container::V1beta1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, locations: locations, workload_metadata_config: workload_metadata_config, name: name, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end From d43eb4e54a23749a5df413c905c6ca01ef221d0c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 18:01:37 +0530 Subject: [PATCH 024/112] feat(container: add nodeconfig resource_labels api feat(container): support GatewayAPIConfig feat(container): support enabling private nodes --- .../container/v1/cluster_manager/client.rb | 5 +- .../google/container/v1/cluster_service_pb.rb | 33 ++++++ .../google/container/v1/cluster_service.rb | 112 +++++++++++++++++- .../container/v1/cluster_manager_test.rb | 12 +- 4 files changed, 155 insertions(+), 7 deletions(-) diff --git a/google-cloud-container-v1/lib/google/cloud/container/v1/cluster_manager/client.rb b/google-cloud-container-v1/lib/google/cloud/container/v1/cluster_manager/client.rb index 522e4e9b5880..faf465ad5902 100644 --- a/google-cloud-container-v1/lib/google/cloud/container/v1/cluster_manager/client.rb +++ b/google-cloud-container-v1/lib/google/cloud/container/v1/cluster_manager/client.rb @@ -650,7 +650,7 @@ def update_cluster request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, name: nil, locations: nil, workload_metadata_config: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, logging_config: nil) + # @overload update_node_pool(project_id: nil, zone: nil, cluster_id: nil, node_pool_id: nil, node_version: nil, image_type: nil, name: nil, locations: nil, workload_metadata_config: nil, upgrade_settings: nil, tags: nil, taints: nil, labels: nil, linux_node_config: nil, kubelet_config: nil, node_network_config: nil, gcfs_config: nil, confidential_nodes: nil, gvnic: nil, logging_config: nil, resource_labels: nil) # Pass arguments to `update_node_pool` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -725,6 +725,9 @@ def update_cluster request, options = nil # Enable or disable gvnic on the node pool. # @param logging_config [::Google::Cloud::Container::V1::NodePoolLoggingConfig, ::Hash] # Logging configuration. + # @param resource_labels [::Google::Cloud::Container::V1::ResourceLabels, ::Hash] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Container::V1::Operation] diff --git a/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb b/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb index b9ce8affc5cc..fa41225375ab 100644 --- a/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb +++ b/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb @@ -18,6 +18,12 @@ add_file("google/container/v1/cluster_service.proto", :syntax => :proto3) do add_message "google.container.v1.LinuxNodeConfig" do map :sysctls, :string, :string, 1 + optional :cgroup_mode, :enum, 2, "google.container.v1.LinuxNodeConfig.CgroupMode" + end + add_enum "google.container.v1.LinuxNodeConfig.CgroupMode" do + value :CGROUP_MODE_UNSPECIFIED, 0 + value :CGROUP_MODE_V1, 1 + value :CGROUP_MODE_V2, 2 end add_message "google.container.v1.NodeKubeletConfig" do optional :cpu_manager_policy, :string, 1 @@ -53,6 +59,7 @@ optional :gvnic, :message, 29, "google.container.v1.VirtualNIC" optional :spot, :bool, 32 optional :confidential_nodes, :message, 35, "google.container.v1.ConfidentialNodes" + map :resource_labels, :string, :string, 37 optional :logging_config, :message, 38, "google.container.v1.NodePoolLoggingConfig" end add_message "google.container.v1.AdvancedMachineFeatures" do @@ -62,6 +69,7 @@ optional :create_pod_range, :bool, 4 optional :pod_range, :string, 5 optional :pod_ipv4_cidr_block, :string, 6 + proto3_optional :enable_private_nodes, :bool, 9 proto3_optional :network_performance_config, :message, 11, "google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig" end add_message "google.container.v1.NodeNetworkConfig.NetworkPerformanceConfig" do @@ -113,6 +121,9 @@ add_message "google.container.v1.NodeLabels" do map :labels, :string, :string, 1 end + add_message "google.container.v1.ResourceLabels" do + map :labels, :string, :string, 1 + end add_message "google.container.v1.NetworkTags" do repeated :tags, :string, 1 end @@ -165,6 +176,7 @@ optional :public_endpoint, :string, 5 optional :peering_name, :string, 7 optional :master_global_access_config, :message, 8, "google.container.v1.PrivateClusterMasterGlobalAccessConfig" + optional :private_endpoint_subnetwork, :string, 10 end add_message "google.container.v1.AuthenticatorGroupsConfig" do optional :enabled, :bool, 1 @@ -194,6 +206,7 @@ add_message "google.container.v1.MasterAuthorizedNetworksConfig" do optional :enabled, :bool, 1 repeated :cidr_blocks, :message, 2, "google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock" + proto3_optional :gcp_public_cidrs_access_enabled, :bool, 3 end add_message "google.container.v1.MasterAuthorizedNetworksConfig.CidrBlock" do optional :display_name, :string, 1 @@ -352,9 +365,11 @@ optional :desired_monitoring_config, :message, 65, "google.container.v1.MonitoringConfig" optional :desired_identity_service_config, :message, 66, "google.container.v1.IdentityServiceConfig" optional :desired_service_external_ips_config, :message, 60, "google.container.v1.ServiceExternalIPsConfig" + proto3_optional :desired_enable_private_endpoint, :bool, 71 optional :desired_master_version, :string, 100 optional :desired_gcfs_config, :message, 109, "google.container.v1.GcfsConfig" optional :desired_node_pool_auto_config_network_tags, :message, 110, "google.container.v1.NetworkTags" + optional :desired_gateway_api_config, :message, 114, "google.container.v1.GatewayAPIConfig" optional :desired_node_pool_logging_config, :message, 116, "google.container.v1.NodePoolLoggingConfig" end add_message "google.container.v1.Operation" do @@ -454,6 +469,7 @@ optional :confidential_nodes, :message, 23, "google.container.v1.ConfidentialNodes" optional :gvnic, :message, 29, "google.container.v1.VirtualNIC" optional :logging_config, :message, 32, "google.container.v1.NodePoolLoggingConfig" + optional :resource_labels, :message, 33, "google.container.v1.ResourceLabels" end add_message "google.container.v1.SetNodePoolAutoscalingRequest" do optional :project_id, :string, 1 @@ -864,6 +880,16 @@ optional :private_ipv6_google_access, :enum, 12, "google.container.v1.PrivateIPv6GoogleAccess" optional :dns_config, :message, 13, "google.container.v1.DNSConfig" optional :service_external_ips_config, :message, 15, "google.container.v1.ServiceExternalIPsConfig" + optional :gateway_api_config, :message, 16, "google.container.v1.GatewayAPIConfig" + end + add_message "google.container.v1.GatewayAPIConfig" do + optional :channel, :enum, 1, "google.container.v1.GatewayAPIConfig.Channel" + end + add_enum "google.container.v1.GatewayAPIConfig.Channel" do + value :CHANNEL_UNSPECIFIED, 0 + value :CHANNEL_DISABLED, 1 + value :CHANNEL_EXPERIMENTAL, 3 + value :CHANNEL_STANDARD, 4 end add_message "google.container.v1.ServiceExternalIPsConfig" do optional :enabled, :bool, 1 @@ -1061,6 +1087,9 @@ value :COMPONENT_UNSPECIFIED, 0 value :SYSTEM_COMPONENTS, 1 value :WORKLOADS, 2 + value :APISERVER, 3 + value :SCHEDULER, 4 + value :CONTROLLER_MANAGER, 5 end add_message "google.container.v1.MonitoringConfig" do optional :component_config, :message, 1, "google.container.v1.MonitoringComponentConfig" @@ -1129,6 +1158,7 @@ module Cloud module Container module V1 LinuxNodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.LinuxNodeConfig").msgclass + LinuxNodeConfig::CgroupMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.LinuxNodeConfig.CgroupMode").enummodule NodeKubeletConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeKubeletConfig").msgclass NodeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeConfig").msgclass AdvancedMachineFeatures = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.AdvancedMachineFeatures").msgclass @@ -1145,6 +1175,7 @@ module V1 NodeTaint::Effect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeTaint.Effect").enummodule NodeTaints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeTaints").msgclass NodeLabels = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeLabels").msgclass + ResourceLabels = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.ResourceLabels").msgclass NetworkTags = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NetworkTags").msgclass MasterAuth = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.MasterAuth").msgclass ClientCertificateConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.ClientCertificateConfig").msgclass @@ -1250,6 +1281,8 @@ module V1 StatusCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.StatusCondition").msgclass StatusCondition::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.StatusCondition.Code").enummodule NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NetworkConfig").msgclass + GatewayAPIConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.GatewayAPIConfig").msgclass + GatewayAPIConfig::Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.GatewayAPIConfig.Channel").enummodule ServiceExternalIPsConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.ServiceExternalIPsConfig").msgclass GetOpenIDConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.GetOpenIDConfigRequest").msgclass GetOpenIDConfigResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.GetOpenIDConfigResponse").msgclass diff --git a/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb b/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb index 2302dbd7e6f6..f3526c99fc91 100644 --- a/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb +++ b/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb @@ -40,6 +40,9 @@ module V1 # net.ipv4.tcp_rmem # net.ipv4.tcp_wmem # net.ipv4.tcp_tw_reuse + # @!attribute [rw] cgroup_mode + # @return [::Google::Cloud::Container::V1::LinuxNodeConfig::CgroupMode] + # cgroup_mode specifies the cgroup mode to be used on the node. class LinuxNodeConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -52,6 +55,21 @@ class SysctlsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Possible cgroup modes that can be used. + module CgroupMode + # CGROUP_MODE_UNSPECIFIED is when unspecified cgroup configuration is used. + # The default for the GKE node OS image will be used. + CGROUP_MODE_UNSPECIFIED = 0 + + # CGROUP_MODE_V1 specifies to use cgroupv1 for the cgroup configuration on + # the node image. + CGROUP_MODE_V1 = 1 + + # CGROUP_MODE_V2 specifies to use cgroupv2 for the cgroup configuration on + # the node image. + CGROUP_MODE_V2 = 2 + end end # Node kubelet configs. @@ -284,6 +302,10 @@ class NodeKubeletConfig # @return [::Google::Cloud::Container::V1::ConfidentialNodes] # Confidential nodes config. # All the nodes in the node pool will be Confidential VM once enabled. + # @!attribute [rw] resource_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. # @!attribute [rw] logging_config # @return [::Google::Cloud::Container::V1::NodePoolLoggingConfig] # Logging configuration. @@ -308,6 +330,15 @@ class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ResourceLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Specifies options for controlling advanced machine features. @@ -363,6 +394,11 @@ class AdvancedMachineFeatures # Only applicable if `ip_allocation_policy.use_ip_aliases` is true. # # This field cannot be changed after the node pool has been created. + # @!attribute [rw] enable_private_nodes + # @return [::Boolean] + # Whether nodes have internal IP addresses only. + # If enable_private_nodes is not specified, then the value is derived from + # [cluster.privateClusterConfig.enablePrivateNodes][google.container.v1beta1.PrivateClusterConfig.enablePrivateNodes] # @!attribute [rw] network_performance_config # @return [::Google::Cloud::Container::V1::NodeNetworkConfig::NetworkPerformanceConfig] # Network bandwidth tier configuration. @@ -538,6 +574,25 @@ class LabelsEntry end end + # Collection of [GCP + # labels](https://cloud.google.com/resource-manager/docs/creating-managing-labels). + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map of node label keys and node label values. + class ResourceLabels + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + # Collection of Compute Engine network tags that can be applied to a node's # underlying VM instance. # @!attribute [rw] tags @@ -741,6 +796,10 @@ class PrivateClusterMasterGlobalAccessConfig # @!attribute [rw] master_global_access_config # @return [::Google::Cloud::Container::V1::PrivateClusterMasterGlobalAccessConfig] # Controls master global access settings. + # @!attribute [rw] private_endpoint_subnetwork + # @return [::String] + # Subnet to provision the master's private endpoint during cluster creation. + # Specified in projects/*/regions/*/subnetworks/* format. class PrivateClusterConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -831,6 +890,9 @@ class GkeBackupAgentConfig # @return [::Array<::Google::Cloud::Container::V1::MasterAuthorizedNetworksConfig::CidrBlock>] # cidr_blocks define up to 50 external networks that could access # Kubernetes master through HTTPS. + # @!attribute [rw] gcp_public_cidrs_access_enabled + # @return [::Boolean] + # Whether master is accessbile via Google Compute Engine Public IP addresses. class MasterAuthorizedNetworksConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1574,6 +1636,9 @@ class NodeConfigDefaults # @return [::Google::Cloud::Container::V1::ServiceExternalIPsConfig] # ServiceExternalIPsConfig specifies the config for the use of Services with # ExternalIPs field. + # @!attribute [rw] desired_enable_private_endpoint + # @return [::Boolean] + # Enable/Disable private endpoint for the cluster's master. # @!attribute [rw] desired_master_version # @return [::String] # The Kubernetes version to change the master to. @@ -1593,6 +1658,9 @@ class NodeConfigDefaults # @return [::Google::Cloud::Container::V1::NetworkTags] # The desired network tags that apply to all auto-provisioned node pools # in autopilot clusters and node auto-provisioning enabled clusters. + # @!attribute [rw] desired_gateway_api_config + # @return [::Google::Cloud::Container::V1::GatewayAPIConfig] + # The desired config of Gateway API on this cluster. # @!attribute [rw] desired_node_pool_logging_config # @return [::Google::Cloud::Container::V1::NodePoolLoggingConfig] # The desired node pool logging configuration defaults for the cluster. @@ -1948,6 +2016,10 @@ class UpdateClusterRequest # @!attribute [rw] logging_config # @return [::Google::Cloud::Container::V1::NodePoolLoggingConfig] # Logging configuration. + # @!attribute [rw] resource_labels + # @return [::Google::Cloud::Container::V1::ResourceLabels] + # The resource labels for the node pool to use to annotate any related + # Google Compute Engine resources. class UpdateNodePoolRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -2546,7 +2618,7 @@ class BlueGreenSettings # Standard rollout policy is the default policy for blue-green. # @!attribute [rw] batch_percentage # @return [::Float] - # Percentage of the bool pool nodes to drain in a batch. + # Percentage of the blue pool nodes to drain in a batch. # The range of this field should be (0.0, 1.0]. # @!attribute [rw] batch_node_count # @return [::Integer] @@ -3619,11 +3691,40 @@ module Code # @return [::Google::Cloud::Container::V1::ServiceExternalIPsConfig] # ServiceExternalIPsConfig specifies if services with externalIPs field are # blocked or not. + # @!attribute [rw] gateway_api_config + # @return [::Google::Cloud::Container::V1::GatewayAPIConfig] + # GatewayAPIConfig contains the desired config of Gateway API on this + # cluster. class NetworkConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + # GatewayAPIConfig contains the desired config of Gateway API on this cluster. + # @!attribute [rw] channel + # @return [::Google::Cloud::Container::V1::GatewayAPIConfig::Channel] + # The Gateway API release channel to use for Gateway API. + class GatewayAPIConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Channel describes if/how Gateway API should be installed and implemented in + # a cluster. + module Channel + # Default value. + CHANNEL_UNSPECIFIED = 0 + + # Gateway API support is disabled + CHANNEL_DISABLED = 1 + + # Gateway API support is enabled, experimental CRDs are installed + CHANNEL_EXPERIMENTAL = 3 + + # Gateway API support is enabled, standard CRDs are installed + CHANNEL_STANDARD = 4 + end + end + # Config to block services with externalIPs field. # @!attribute [rw] enabled # @return [::Boolean] @@ -4278,6 +4379,15 @@ module Component # workloads WORKLOADS = 2 + + # kube-apiserver + APISERVER = 3 + + # kube-scheduler + SCHEDULER = 4 + + # kube-controller-manager + CONTROLLER_MANAGER = 5 end end diff --git a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb index 9d300e3204cd..70c74a0506d9 100644 --- a/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb +++ b/google-cloud-container-v1/test/google/cloud/container/v1/cluster_manager_test.rb @@ -331,6 +331,7 @@ def test_update_node_pool confidential_nodes = {} gvnic = {} logging_config = {} + resource_labels = {} update_node_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :update_node_pool, name @@ -355,6 +356,7 @@ def test_update_node_pool assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1::ConfidentialNodes), request["confidential_nodes"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1::VirtualNIC), request["gvnic"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1::NodePoolLoggingConfig), request["logging_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Container::V1::ResourceLabels), request["resource_labels"] refute_nil options end @@ -365,31 +367,31 @@ def test_update_node_pool end # Use hash object - client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config }) do |response, operation| + client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.update_node_pool project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config do |response, operation| + client.update_node_pool project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.update_node_pool ::Google::Cloud::Container::V1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config) do |response, operation| + client.update_node_pool ::Google::Cloud::Container::V1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config }, grpc_options) do |response, operation| + client.update_node_pool({ project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.update_node_pool(::Google::Cloud::Container::V1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config), grpc_options) do |response, operation| + client.update_node_pool(::Google::Cloud::Container::V1::UpdateNodePoolRequest.new(project_id: project_id, zone: zone, cluster_id: cluster_id, node_pool_id: node_pool_id, node_version: node_version, image_type: image_type, name: name, locations: locations, workload_metadata_config: workload_metadata_config, upgrade_settings: upgrade_settings, tags: tags, taints: taints, labels: labels, linux_node_config: linux_node_config, kubelet_config: kubelet_config, node_network_config: node_network_config, gcfs_config: gcfs_config, confidential_nodes: confidential_nodes, gvnic: gvnic, logging_config: logging_config, resource_labels: resource_labels), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end From 9712594980a4dd2baa5d66d5a37e74888c781b2f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 7 Nov 2022 18:07:33 +0530 Subject: [PATCH 025/112] feat(eventarc-publishing): add text_event in publish_channel_connection_events --- .../publishing/v1/publisher/client.rb | 18 ++++++++++++-- .../eventarc/publishing/v1/publisher_pb.rb | 2 ++ .../publishing/v1/publisher_services_pb.rb | 1 - .../cloud/eventarc/publishing/v1/publisher.rb | 16 +++++++++++++ .../eventarc/publishing/v1/publisher_test.rb | 24 +++++++++++-------- 5 files changed, 48 insertions(+), 13 deletions(-) diff --git a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/client.rb b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/client.rb index d34b2c4bc67d..969d2878d81a 100644 --- a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/client.rb +++ b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher/client.rb @@ -181,7 +181,7 @@ def initialize # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload publish_channel_connection_events(channel_connection: nil, events: nil) + # @overload publish_channel_connection_events(channel_connection: nil, events: nil, text_events: nil) # Pass arguments to `publish_channel_connection_events` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -191,6 +191,13 @@ def initialize # `projects/{partner_project_id}/locations/{location}/channelConnections/{channel_connection_id}`. # @param events [::Array<::Google::Protobuf::Any, ::Hash>] # The CloudEvents v1.0 events to publish. No other types are allowed. + # If this field is set, then the `text_events` fields must not be set. + # @param text_events [::Array<::String>] + # The text representation of events to publish. + # CloudEvent v1.0 in JSON format is the only allowed type. Refer to + # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + # for specification. + # If this field is set, then the `events` fields must not be set. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsResponse] @@ -269,7 +276,7 @@ def publish_channel_connection_events request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload publish_events(channel: nil, events: nil) + # @overload publish_events(channel: nil, events: nil, text_events: nil) # Pass arguments to `publish_events` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -279,6 +286,13 @@ def publish_channel_connection_events request, options = nil # `projects/{project}/locations/{location}/channels/{channel-id}`. # @param events [::Array<::Google::Protobuf::Any, ::Hash>] # The CloudEvents v1.0 events to publish. No other types are allowed. + # If this field is set, then the `text_events` fields must not be set. + # @param text_events [::Array<::String>] + # The text representation of events to publish. + # CloudEvent v1.0 in JSON format is the only allowed type. Refer to + # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + # for specification. + # If this field is set, then the `events` fields must not be set. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Eventarc::Publishing::V1::PublishEventsResponse] diff --git a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_pb.rb b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_pb.rb index 51027d4a26eb..9a14c2105a48 100644 --- a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_pb.rb +++ b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_pb.rb @@ -12,12 +12,14 @@ add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsRequest" do optional :channel_connection, :string, 1 repeated :events, :message, 2, "google.protobuf.Any" + repeated :text_events, :string, 3 end add_message "google.cloud.eventarc.publishing.v1.PublishChannelConnectionEventsResponse" do end add_message "google.cloud.eventarc.publishing.v1.PublishEventsRequest" do optional :channel, :string, 1 repeated :events, :message, 2, "google.protobuf.Any" + repeated :text_events, :string, 3 end add_message "google.cloud.eventarc.publishing.v1.PublishEventsResponse" do end diff --git a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb index 806ab1ed2dc9..7eaf42aedaaa 100644 --- a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb +++ b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb @@ -14,7 +14,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -# require 'grpc' require 'google/cloud/eventarc/publishing/v1/publisher_pb' diff --git a/google-cloud-eventarc-publishing-v1/proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb b/google-cloud-eventarc-publishing-v1/proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb index ca7e5e624345..063ff9af5097 100644 --- a/google-cloud-eventarc-publishing-v1/proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb +++ b/google-cloud-eventarc-publishing-v1/proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb @@ -30,6 +30,14 @@ module V1 # @!attribute [rw] events # @return [::Array<::Google::Protobuf::Any>] # The CloudEvents v1.0 events to publish. No other types are allowed. + # If this field is set, then the `text_events` fields must not be set. + # @!attribute [rw] text_events + # @return [::Array<::String>] + # The text representation of events to publish. + # CloudEvent v1.0 in JSON format is the only allowed type. Refer to + # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + # for specification. + # If this field is set, then the `events` fields must not be set. class PublishChannelConnectionEventsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -49,6 +57,14 @@ class PublishChannelConnectionEventsResponse # @!attribute [rw] events # @return [::Array<::Google::Protobuf::Any>] # The CloudEvents v1.0 events to publish. No other types are allowed. + # If this field is set, then the `text_events` fields must not be set. + # @!attribute [rw] text_events + # @return [::Array<::String>] + # The text representation of events to publish. + # CloudEvent v1.0 in JSON format is the only allowed type. Refer to + # https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/formats/json-format.md + # for specification. + # If this field is set, then the `events` fields must not be set. class PublishEventsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb index feca9a4e0f9d..4964afe64fcb 100644 --- a/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb +++ b/google-cloud-eventarc-publishing-v1/test/google/cloud/eventarc/publishing/v1/publisher_test.rb @@ -57,12 +57,14 @@ def test_publish_channel_connection_events # Create request parameters for a unary method. channel_connection = "hello world" events = [{}] + text_events = ["hello world"] publish_channel_connection_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :publish_channel_connection_events, name assert_kind_of ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest, request assert_equal "hello world", request["channel_connection"] assert_kind_of ::Google::Protobuf::Any, request["events"].first + assert_equal ["hello world"], request["text_events"] refute_nil options end @@ -73,31 +75,31 @@ def test_publish_channel_connection_events end # Use hash object - client.publish_channel_connection_events({ channel_connection: channel_connection, events: events }) do |response, operation| + client.publish_channel_connection_events({ channel_connection: channel_connection, events: events, text_events: text_events }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.publish_channel_connection_events channel_connection: channel_connection, events: events do |response, operation| + client.publish_channel_connection_events channel_connection: channel_connection, events: events, text_events: text_events do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.publish_channel_connection_events ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new(channel_connection: channel_connection, events: events) do |response, operation| + client.publish_channel_connection_events ::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new(channel_connection: channel_connection, events: events, text_events: text_events) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.publish_channel_connection_events({ channel_connection: channel_connection, events: events }, grpc_options) do |response, operation| + client.publish_channel_connection_events({ channel_connection: channel_connection, events: events, text_events: text_events }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.publish_channel_connection_events(::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new(channel_connection: channel_connection, events: events), grpc_options) do |response, operation| + client.publish_channel_connection_events(::Google::Cloud::Eventarc::Publishing::V1::PublishChannelConnectionEventsRequest.new(channel_connection: channel_connection, events: events, text_events: text_events), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end @@ -117,12 +119,14 @@ def test_publish_events # Create request parameters for a unary method. channel = "hello world" events = [{}] + text_events = ["hello world"] publish_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :publish_events, name assert_kind_of ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest, request assert_equal "hello world", request["channel"] assert_kind_of ::Google::Protobuf::Any, request["events"].first + assert_equal ["hello world"], request["text_events"] refute_nil options end @@ -133,31 +137,31 @@ def test_publish_events end # Use hash object - client.publish_events({ channel: channel, events: events }) do |response, operation| + client.publish_events({ channel: channel, events: events, text_events: text_events }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.publish_events channel: channel, events: events do |response, operation| + client.publish_events channel: channel, events: events, text_events: text_events do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.publish_events ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new(channel: channel, events: events) do |response, operation| + client.publish_events ::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new(channel: channel, events: events, text_events: text_events) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.publish_events({ channel: channel, events: events }, grpc_options) do |response, operation| + client.publish_events({ channel: channel, events: events, text_events: text_events }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.publish_events(::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new(channel: channel, events: events), grpc_options) do |response, operation| + client.publish_events(::Google::Cloud::Eventarc::Publishing::V1::PublishEventsRequest.new(channel: channel, events: events, text_events: text_events), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end From a02919a1ac75c5525fd07eff977c765a5c598d82 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:01:21 -0800 Subject: [PATCH 026/112] chore(main): release google-cloud-network_connectivity-v1 0.4.0 (#19375) --- .release-please-manifest.json | 2 +- google-cloud-network_connectivity-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/network_connectivity/v1/version.rb | 2 +- ...nippet_metadata_google.cloud.networkconnectivity.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 26cc12746a68..aea8f1cd6d76 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -373,7 +373,7 @@ "google-cloud-monitoring-v3+FILLER": "0.0.0", "google-cloud-network_connectivity": "1.1.0", "google-cloud-network_connectivity+FILLER": "0.0.0", - "google-cloud-network_connectivity-v1": "0.3.0", + "google-cloud-network_connectivity-v1": "0.4.0", "google-cloud-network_connectivity-v1+FILLER": "0.0.0", "google-cloud-network_connectivity-v1alpha1": "0.5.0", "google-cloud-network_connectivity-v1alpha1+FILLER": "0.0.0", diff --git a/google-cloud-network_connectivity-v1/CHANGELOG.md b/google-cloud-network_connectivity-v1/CHANGELOG.md index b489eb49a851..727a242db4c8 100644 --- a/google-cloud-network_connectivity-v1/CHANGELOG.md +++ b/google-cloud-network_connectivity-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.4.0 (2022-11-07) + +#### Features + +* Added support for policy-based routing ([#19362](https://github.com/googleapis/google-cloud-ruby/issues/19362)) + ### 0.3.0 (2022-07-05) #### Features diff --git a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/version.rb b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/version.rb index 4e5ae8ed2a50..05d012eb9236 100644 --- a/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/version.rb +++ b/google-cloud-network_connectivity-v1/lib/google/cloud/network_connectivity/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module NetworkConnectivity module V1 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json index 9eccf0581284..eb4da049c4af 100644 --- a/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json +++ b/google-cloud-network_connectivity-v1/snippets/snippet_metadata_google.cloud.networkconnectivity.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-network_connectivity-v1", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 61536c9be49db5ab4ce75834c3e8a7277d1ff8fd Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Mon, 7 Nov 2022 22:13:36 -0800 Subject: [PATCH 027/112] chore(main): release google-cloud-run-v2 0.5.0 (#19379) --- .release-please-manifest.json | 2 +- google-cloud-run-v2/CHANGELOG.md | 7 +++++++ google-cloud-run-v2/lib/google/cloud/run/v2/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.run.v2.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index aea8f1cd6d76..a80fdb26112e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -469,7 +469,7 @@ "google-cloud-retail-v2+FILLER": "0.0.0", "google-cloud-run-client": "0.2.0", "google-cloud-run-client+FILLER": "0.0.0", - "google-cloud-run-v2": "0.4.0", + "google-cloud-run-v2": "0.5.0", "google-cloud-run-v2+FILLER": "0.0.0", "google-cloud-scheduler": "2.3.0", "google-cloud-scheduler+FILLER": "0.0.0", diff --git a/google-cloud-run-v2/CHANGELOG.md b/google-cloud-run-v2/CHANGELOG.md index b31b5a81e9d3..5f1e8d68b573 100644 --- a/google-cloud-run-v2/CHANGELOG.md +++ b/google-cloud-run-v2/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 0.5.0 (2022-11-08) + +#### Features + +* support jobs and executions +* support new IAM policy + ### 0.4.0 (2022-10-19) #### Features diff --git a/google-cloud-run-v2/lib/google/cloud/run/v2/version.rb b/google-cloud-run-v2/lib/google/cloud/run/v2/version.rb index 0f656bb6b58c..7fc88f4cfcb3 100644 --- a/google-cloud-run-v2/lib/google/cloud/run/v2/version.rb +++ b/google-cloud-run-v2/lib/google/cloud/run/v2/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Run module V2 - VERSION = "0.4.0" + VERSION = "0.5.0" end end end diff --git a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json index b373d68f7c31..691d919e9c19 100644 --- a/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json +++ b/google-cloud-run-v2/snippets/snippet_metadata_google.cloud.run.v2.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-run-v2", - "version": "0.4.0", + "version": "0.5.0", "language": "RUBY", "apis": [ { From 37f2ab48d777e04b02e177c014c8adaafa3ed30e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:20:05 +0530 Subject: [PATCH 028/112] docs(talent): mark company_size and keyword_searchable_job_custom_attributes deprecated --- .../lib/google/cloud/talent/v4/job_service/client.rb | 8 ++++---- .../proto_docs/google/cloud/talent/v4/company.rb | 3 +++ .../proto_docs/google/cloud/talent/v4/job_service.rb | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb index 72ff09a42117..98924aba3db7 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/job_service/client.rb @@ -1088,8 +1088,8 @@ def list_jobs request, options = nil # * company_display_name: histogram by {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. @@ -1418,8 +1418,8 @@ def search_jobs request, options = nil # * company_display_name: histogram by {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb index ad390213dbe2..688d22feec92 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/company.rb @@ -80,6 +80,9 @@ module V4 # A URI that hosts the employer's company logo. # @!attribute [rw] keyword_searchable_job_custom_attributes # @return [::Array<::String>] + # This field is deprecated. Please set the searchability of the custom + # attribute in the {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes} going forward. + # # A list of keys of filterable {::Google::Cloud::Talent::V4::Job#custom_attributes Job.custom_attributes}, whose # corresponding `string_values` are used in keyword searches. Jobs with # `string_values` under these specified field keys are returned if any diff --git a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb index 77781c0f9f89..7a6e55e93517 100644 --- a/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb +++ b/google-cloud-talent-v4/proto_docs/google/cloud/talent/v4/job_service.rb @@ -218,8 +218,8 @@ class ListJobsResponse # * company_display_name: histogram by {::Google::Cloud::Talent::V4::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. From db856df8e85e949e38f7a93ac6db83baf27b9e74 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:20:49 +0530 Subject: [PATCH 029/112] docs(talent): mark company_size and keyword_searchable_job_custom_attributes deprecated --- .../lib/google/cloud/talent/v4beta1/job_service/client.rb | 8 ++++---- .../proto_docs/google/cloud/talent/v4beta1/company.rb | 3 +++ .../proto_docs/google/cloud/talent/v4beta1/job_service.rb | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb index 2f570ac03b02..5b4f65158aab 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/job_service/client.rb @@ -1095,8 +1095,8 @@ def list_jobs request, options = nil # * company_display_name: histogram by {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. @@ -1427,8 +1427,8 @@ def search_jobs request, options = nil # * company_display_name: histogram by {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb index eeb079d0c98e..48bf30e1c59b 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/company.rb @@ -83,6 +83,9 @@ module V4beta1 # A URI that hosts the employer's company logo. # @!attribute [rw] keyword_searchable_job_custom_attributes # @return [::Array<::String>] + # This field is deprecated. Please set the searchability of the custom + # attribute in the {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes} going forward. + # # A list of keys of filterable {::Google::Cloud::Talent::V4beta1::Job#custom_attributes Job.custom_attributes}, whose # corresponding `string_values` are used in keyword searches. Jobs with # `string_values` under these specified field keys are returned if any diff --git a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb index 56971d80583e..daa78fcb2202 100644 --- a/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb +++ b/google-cloud-talent-v4beta1/proto_docs/google/cloud/talent/v4beta1/job_service.rb @@ -256,8 +256,8 @@ class ListJobsResponse # * company_display_name: histogram by {::Google::Cloud::Talent::V4beta1::Job#company_display_name Job.company_display_name}. # * employment_type: histogram by {::Google::Cloud::Talent::V4beta1::Job#employment_types Job.employment_types}, for example, # "FULL_TIME", "PART_TIME". - # * company_size: histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, "SMALL", - # "MEDIUM", "BIG". + # * company_size (DEPRECATED): histogram by {::Google::Cloud::Talent::V4beta1::CompanySize CompanySize}, for example, + # "SMALL", "MEDIUM", "BIG". # * publish_time_in_day: histogram by the {::Google::Cloud::Talent::V4beta1::Job#posting_publish_time Job.posting_publish_time} # in days. # Must specify list of numeric buckets in spec. From feb85f3734cf9300fa1efea810f901d7ca092d1c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:22:28 +0530 Subject: [PATCH 030/112] docs(data_catalog): update documentation --- .../cloud/datacatalog/v1/bigquery_pb.rb | 2 ++ .../google/cloud/datacatalog/v1/usage_pb.rb | 1 + .../cloud/datacatalog/v1/datacatalog.rb | 34 ++++++++++--------- .../google/cloud/datacatalog/v1/usage.rb | 4 +-- 4 files changed, 23 insertions(+), 18 deletions(-) diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb b/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb index 93be9513104b..b709121cf181 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/bigquery_pb.rb @@ -3,6 +3,8 @@ require 'google/protobuf' +require 'google/api/field_behavior_pb' + Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/datacatalog/v1/bigquery.proto", :syntax => :proto3) do add_message "google.cloud.datacatalog.v1.BigQueryConnectionSpec" do diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb b/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb index 1326b0e9e1dc..e7cd1f95a09a 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/datacatalog/v1/usage_pb.rb @@ -3,6 +3,7 @@ require 'google/protobuf' +require 'google/api/field_behavior_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do diff --git a/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb b/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb index 87901bdd8373..549bbbcc7feb 100644 --- a/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb +++ b/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/datacatalog.rb @@ -479,14 +479,14 @@ class LookupEntryRequest # @return [::Google::Cloud::DataCatalog::V1::GcsFilesetSpec] # Specification that applies to a Cloud Storage fileset. Valid only # for entries with the `FILESET` type. - # @!attribute [rw] bigquery_table_spec + # @!attribute [r] bigquery_table_spec # @return [::Google::Cloud::DataCatalog::V1::BigQueryTableSpec] - # Specification that applies to a BigQuery table. Valid only for - # entries with the `TABLE` type. - # @!attribute [rw] bigquery_date_sharded_spec + # Output only. Specification that applies to a BigQuery table. Valid only + # for entries with the `TABLE` type. + # @!attribute [r] bigquery_date_sharded_spec # @return [::Google::Cloud::DataCatalog::V1::BigQueryDateShardedSpec] - # Specification for a group of BigQuery tables with the `[prefix]YYYYMMDD` - # name pattern. + # Output only. Specification for a group of BigQuery tables with + # the `[prefix]YYYYMMDD` name pattern. # # For more information, see [Introduction to partitioned tables] # (https://cloud.google.com/bigquery/docs/partitioned-tables#partitioning_versus_sharding). @@ -535,12 +535,12 @@ class LookupEntryRequest # Timestamps from the underlying resource, not from the Data Catalog # entry. # - # Output only when the entry has a type listed in the `EntryType` enum. - # For entries with `user_specified_type`, this field is optional and defaults - # to an empty timestamp. - # @!attribute [r] usage_signal + # Output only when the entry has a system listed in the `IntegratedSystem` + # enum. For entries with `user_specified_system`, this field is optional + # and defaults to an empty timestamp. + # @!attribute [rw] usage_signal # @return [::Google::Cloud::DataCatalog::V1::UsageSignal] - # Output only. Resource usage statistics. + # Resource usage statistics. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Cloud labels attached to the entry. @@ -573,10 +573,10 @@ class LabelsEntry # @!attribute [rw] type # @return [::Google::Cloud::DataCatalog::V1::DatabaseTableSpec::TableType] # Type of this table. - # @!attribute [rw] dataplex_table + # @!attribute [r] dataplex_table # @return [::Google::Cloud::DataCatalog::V1::DataplexTableSpec] - # Fields specific to a Dataplex table and present only in the Dataplex table - # entries. + # Output only. Fields specific to a Dataplex table and present only in the + # Dataplex table entries. class DatabaseTableSpec include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -607,9 +607,11 @@ class FilesetSpec # Specification that applies to a data source connection. Valid only for # entries with the `DATA_SOURCE_CONNECTION` type. + # Only one of internal specs can be set at the time, and cannot + # be changed later. # @!attribute [rw] bigquery_connection_spec # @return [::Google::Cloud::DataCatalog::V1::BigQueryConnectionSpec] - # Fields specific to BigQuery connections. + # Output only. Fields specific to BigQuery connections. class DataSourceConnectionSpec include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -1119,7 +1121,7 @@ module EntryType # Default unknown type. ENTRY_TYPE_UNSPECIFIED = 0 - # Output only. The entry type that has a GoogleSQL schema, including + # The entry type that has a GoogleSQL schema, including # logical views. TABLE = 2 diff --git a/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb b/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb index 028f8269f3d0..2ed0975e0432 100644 --- a/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb +++ b/google-cloud-data_catalog-v1/proto_docs/google/cloud/datacatalog/v1/usage.rb @@ -55,9 +55,9 @@ class UsageStats # @!attribute [rw] update_time # @return [::Google::Protobuf::Timestamp] # The end timestamp of the duration of usage statistics. - # @!attribute [rw] usage_within_time_range + # @!attribute [r] usage_within_time_range # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DataCatalog::V1::UsageStats}] - # Usage statistics over each of the predefined time ranges. + # Output only. BigQuery usage statistics over each of the predefined time ranges. # # Supported time ranges are `{"24H", "7D", "30D"}`. class UsageSignal From 3c1c2b5a045696bec7e951415913827ed3370869 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 15:35:18 +0530 Subject: [PATCH 031/112] feat(eventarc): support google_channel_config feat(eventarc): add crypto_key_name to channel feat(eventarc): add StateCondition to trigger and workflow to destination of trigger feat(eventarc): support filters for listing triggers --- .../.owlbot-manifest.json | 6 + google-cloud-eventarc-v1/gapic_metadata.json | 10 + .../google-cloud-eventarc-v1.gemspec | 2 + .../google/cloud/eventarc/v1/channel_pb.rb | 1 + .../cloud/eventarc/v1/eventarc/client.rb | 225 +++++++++++++++++- .../cloud/eventarc/v1/eventarc/paths.rb | 57 +++++ .../google/cloud/eventarc/v1/eventarc_pb.rb | 11 + .../cloud/eventarc/v1/eventarc_services_pb.rb | 4 + .../eventarc/v1/google_channel_config_pb.rb | 28 +++ .../google/cloud/eventarc/v1/trigger_pb.rb | 8 + .../google/cloud/eventarc/v1/channel.rb | 30 ++- .../google/cloud/eventarc/v1/eventarc.rb | 39 ++- .../eventarc/v1/google_channel_config.rb | 50 ++++ .../google/cloud/eventarc/v1/trigger.rb | 32 ++- .../proto_docs/google/rpc/code.rb | 185 ++++++++++++++ .../proto_docs/google/rpc/status.rb | 2 +- .../proto_docs/google/type/expr.rb | 75 ++++++ .../eventarc/get_google_channel_config.rb | 39 +++ .../eventarc/update_google_channel_config.rb | 39 +++ ...pet_metadata_google.cloud.eventarc.v1.json | 80 +++++++ .../cloud/eventarc/v1/eventarc_paths_test.rb | 36 +++ .../google/cloud/eventarc/v1/eventarc_test.rb | 130 +++++++++- 22 files changed, 1067 insertions(+), 22 deletions(-) create mode 100644 google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/google_channel_config_pb.rb create mode 100644 google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/google_channel_config.rb create mode 100644 google-cloud-eventarc-v1/proto_docs/google/rpc/code.rb create mode 100644 google-cloud-eventarc-v1/proto_docs/google/type/expr.rb create mode 100644 google-cloud-eventarc-v1/snippets/eventarc/get_google_channel_config.rb create mode 100644 google-cloud-eventarc-v1/snippets/eventarc/update_google_channel_config.rb diff --git a/google-cloud-eventarc-v1/.owlbot-manifest.json b/google-cloud-eventarc-v1/.owlbot-manifest.json index 45dddff8be61..1397acb34d3a 100644 --- a/google-cloud-eventarc-v1/.owlbot-manifest.json +++ b/google-cloud-eventarc-v1/.owlbot-manifest.json @@ -24,6 +24,7 @@ "lib/google/cloud/eventarc/v1/eventarc/paths.rb", "lib/google/cloud/eventarc/v1/eventarc_pb.rb", "lib/google/cloud/eventarc/v1/eventarc_services_pb.rb", + "lib/google/cloud/eventarc/v1/google_channel_config_pb.rb", "lib/google/cloud/eventarc/v1/trigger_pb.rb", "lib/google/cloud/eventarc/v1/version.rb", "proto_docs/README.md", @@ -33,6 +34,7 @@ "proto_docs/google/cloud/eventarc/v1/channel_connection.rb", "proto_docs/google/cloud/eventarc/v1/discovery.rb", "proto_docs/google/cloud/eventarc/v1/eventarc.rb", + "proto_docs/google/cloud/eventarc/v1/google_channel_config.rb", "proto_docs/google/cloud/eventarc/v1/trigger.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/protobuf/any.rb", @@ -40,7 +42,9 @@ "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", + "proto_docs/google/rpc/code.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/expr.rb", "snippets/Gemfile", "snippets/eventarc/create_channel.rb", "snippets/eventarc/create_channel_connection.rb", @@ -50,6 +54,7 @@ "snippets/eventarc/delete_trigger.rb", "snippets/eventarc/get_channel.rb", "snippets/eventarc/get_channel_connection.rb", + "snippets/eventarc/get_google_channel_config.rb", "snippets/eventarc/get_provider.rb", "snippets/eventarc/get_trigger.rb", "snippets/eventarc/list_channel_connections.rb", @@ -57,6 +62,7 @@ "snippets/eventarc/list_providers.rb", "snippets/eventarc/list_triggers.rb", "snippets/eventarc/update_channel.rb", + "snippets/eventarc/update_google_channel_config.rb", "snippets/eventarc/update_trigger.rb", "snippets/snippet_metadata_google.cloud.eventarc.v1.json", "test/google/cloud/eventarc/v1/eventarc_operations_test.rb", diff --git a/google-cloud-eventarc-v1/gapic_metadata.json b/google-cloud-eventarc-v1/gapic_metadata.json index 5ab6e2a346d3..1038f9cac4e6 100644 --- a/google-cloud-eventarc-v1/gapic_metadata.json +++ b/google-cloud-eventarc-v1/gapic_metadata.json @@ -89,6 +89,16 @@ "methods": [ "delete_channel_connection" ] + }, + "GetGoogleChannelConfig": { + "methods": [ + "get_google_channel_config" + ] + }, + "UpdateGoogleChannelConfig": { + "methods": [ + "update_google_channel_config" + ] } } } diff --git a/google-cloud-eventarc-v1/google-cloud-eventarc-v1.gemspec b/google-cloud-eventarc-v1/google-cloud-eventarc-v1.gemspec index 34240b91bf91..9ae8eddaac99 100644 --- a/google-cloud-eventarc-v1/google-cloud-eventarc-v1.gemspec +++ b/google-cloud-eventarc-v1/google-cloud-eventarc-v1.gemspec @@ -25,6 +25,8 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" + gem.add_dependency "google-iam-v1", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/channel_pb.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/channel_pb.rb index 4289378b8c3e..077088bdba89 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/channel_pb.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/channel_pb.rb @@ -17,6 +17,7 @@ optional :provider, :string, 7 optional :state, :enum, 9, "google.cloud.eventarc.v1.Channel.State" optional :activation_token, :string, 10 + optional :crypto_key_name, :string, 11 oneof :transport do optional :pubsub_topic, :string, 8 end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb index d440b61759ba..49f04acc5e63 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/client.rb @@ -18,6 +18,8 @@ require "google/cloud/errors" require "google/cloud/eventarc/v1/eventarc_pb" +require "google/cloud/location" +require "google/iam/v1" module Google module Cloud @@ -140,6 +142,18 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @eventarc_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Eventarc::V1::Eventarc::Stub, credentials: credentials, @@ -156,6 +170,20 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + # Service calls ## @@ -256,7 +284,7 @@ def get_trigger request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload list_triggers(parent: nil, page_size: nil, page_token: nil, order_by: nil) + # @overload list_triggers(parent: nil, page_size: nil, page_token: nil, order_by: nil, filter: nil) # Pass arguments to `list_triggers` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -265,6 +293,7 @@ def get_trigger request, options = nil # Required. The parent collection to list triggers on. # @param page_size [::Integer] # The maximum number of triggers to return on each page. + # # Note: The service may send fewer. # @param page_token [::String] # The page token; provide the value from the `next_page_token` field in a @@ -277,6 +306,10 @@ def get_trigger request, options = nil # comma-separated list of fields. The default sorting order is ascending. To # specify descending order for a field, append a `desc` suffix; for example: # `name desc, trigger_id`. + # @param filter [::String] + # Filter field. Used to filter the Triggers to be listed. Possible filters + # are described in https://google.aip.dev/160. For example, using + # "?filter=destination:gke" would list only Triggers with a gke destination. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Eventarc::V1::Trigger>] @@ -761,6 +794,7 @@ def get_channel request, options = nil # Required. The parent collection to list channels on. # @param page_size [::Integer] # The maximum number of channels to return on each page. + # # Note: The service may send fewer. # @param page_token [::String] # The page token; provide the value from the `next_page_token` field in a @@ -1440,6 +1474,7 @@ def get_channel_connection request, options = nil # Required. The parent collection from which to list channel connections. # @param page_size [::Integer] # The maximum number of channel connections to return on each page. + # # Note: The service may send fewer responses. # @param page_token [::String] # The page token; provide the value from the `next_page_token` field in a @@ -1709,6 +1744,180 @@ def delete_channel_connection request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Get a GoogleChannelConfig + # + # @overload get_google_channel_config(request, options = nil) + # Pass arguments to `get_google_channel_config` via a request object, either of type + # {::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_google_channel_config(name: nil) + # Pass arguments to `get_google_channel_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The name of the config to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Eventarc::V1::GoogleChannelConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Eventarc::V1::GoogleChannelConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/eventarc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest.new + # + # # Call the get_google_channel_config method. + # result = client.get_google_channel_config request + # + # # The returned object is of type Google::Cloud::Eventarc::V1::GoogleChannelConfig. + # p result + # + def get_google_channel_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_google_channel_config.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Eventarc::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_google_channel_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_google_channel_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @eventarc_stub.call_rpc :get_google_channel_config, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Update a single GoogleChannelConfig + # + # @overload update_google_channel_config(request, options = nil) + # Pass arguments to `update_google_channel_config` via a request object, either of type + # {::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_google_channel_config(google_channel_config: nil, update_mask: nil) + # Pass arguments to `update_google_channel_config` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param google_channel_config [::Google::Cloud::Eventarc::V1::GoogleChannelConfig, ::Hash] + # Required. The config to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The fields to be updated; only fields explicitly provided are updated. + # If no field mask is provided, all provided fields in the request are + # updated. To update all fields, provide a field mask of "*". + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Eventarc::V1::GoogleChannelConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Eventarc::V1::GoogleChannelConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/eventarc/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Eventarc::V1::Eventarc::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest.new + # + # # Call the update_google_channel_config method. + # result = client.update_google_channel_config request + # + # # The returned object is of type Google::Cloud::Eventarc::V1::GoogleChannelConfig. + # p result + # + def update_google_channel_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_google_channel_config.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Eventarc::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.google_channel_config&.name + header_params["google_channel_config.name"] = request.google_channel_config.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_google_channel_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_google_channel_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @eventarc_stub.call_rpc :update_google_channel_config, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the Eventarc API. # @@ -1924,6 +2133,16 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :delete_channel_connection + ## + # RPC-specific configuration for `get_google_channel_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_google_channel_config + ## + # RPC-specific configuration for `update_google_channel_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_google_channel_config # @private def initialize parent_rpcs = nil @@ -1959,6 +2178,10 @@ def initialize parent_rpcs = nil @create_channel_connection = ::Gapic::Config::Method.new create_channel_connection_config delete_channel_connection_config = parent_rpcs.delete_channel_connection if parent_rpcs.respond_to? :delete_channel_connection @delete_channel_connection = ::Gapic::Config::Method.new delete_channel_connection_config + get_google_channel_config_config = parent_rpcs.get_google_channel_config if parent_rpcs.respond_to? :get_google_channel_config + @get_google_channel_config = ::Gapic::Config::Method.new get_google_channel_config_config + update_google_channel_config_config = parent_rpcs.update_google_channel_config if parent_rpcs.respond_to? :update_google_channel_config + @update_google_channel_config = ::Gapic::Config::Method.new update_google_channel_config_config yield self if block_given? end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/paths.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/paths.rb index a511047e6730..dfd35f4ed3a3 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/paths.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc/paths.rb @@ -81,6 +81,44 @@ def cloud_function_path project:, location:, function: "projects/#{project}/locations/#{location}/functions/#{function}" end + ## + # Create a fully-qualified CryptoKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}` + # + # @param project [String] + # @param location [String] + # @param key_ring [String] + # @param crypto_key [String] + # + # @return [::String] + def crypto_key_path project:, location:, key_ring:, crypto_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/" + + "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}" + end + + ## + # Create a fully-qualified GoogleChannelConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/googleChannelConfig` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def google_channel_config_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/googleChannelConfig" + end + ## # Create a fully-qualified Location resource string. # @@ -153,6 +191,25 @@ def trigger_path project:, location:, trigger: "projects/#{project}/locations/#{location}/triggers/#{trigger}" end + ## + # Create a fully-qualified Workflow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # + # @return [::String] + def workflow_path project:, location:, workflow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}" + end + extend self end end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_pb.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_pb.rb index 510bc3ea1111..965ccc2d77d2 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_pb.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_pb.rb @@ -10,6 +10,7 @@ require 'google/cloud/eventarc/v1/channel_pb' require 'google/cloud/eventarc/v1/channel_connection_pb' require 'google/cloud/eventarc/v1/discovery_pb' +require 'google/cloud/eventarc/v1/google_channel_config_pb' require 'google/cloud/eventarc/v1/trigger_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/field_mask_pb' @@ -25,6 +26,7 @@ optional :page_size, :int32, 2 optional :page_token, :string, 3 optional :order_by, :string, 4 + optional :filter, :string, 5 end add_message "google.cloud.eventarc.v1.ListTriggersResponse" do repeated :triggers, :message, 1, "google.cloud.eventarc.v1.Trigger" @@ -114,6 +116,13 @@ add_message "google.cloud.eventarc.v1.DeleteChannelConnectionRequest" do optional :name, :string, 1 end + add_message "google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest" do + optional :google_channel_config, :message, 1, "google.cloud.eventarc.v1.GoogleChannelConfig" + optional :update_mask, :message, 2, "google.protobuf.FieldMask" + end + add_message "google.cloud.eventarc.v1.GetGoogleChannelConfigRequest" do + optional :name, :string, 1 + end add_message "google.cloud.eventarc.v1.OperationMetadata" do optional :create_time, :message, 1, "google.protobuf.Timestamp" optional :end_time, :message, 2, "google.protobuf.Timestamp" @@ -150,6 +159,8 @@ module V1 ListChannelConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.ListChannelConnectionsResponse").msgclass CreateChannelConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.CreateChannelConnectionRequest").msgclass DeleteChannelConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.DeleteChannelConnectionRequest").msgclass + UpdateGoogleChannelConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.UpdateGoogleChannelConfigRequest").msgclass + GetGoogleChannelConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.GetGoogleChannelConfigRequest").msgclass OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.OperationMetadata").msgclass end end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_services_pb.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_services_pb.rb index b21e21b95a72..7819f6a48269 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_services_pb.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/eventarc_services_pb.rb @@ -66,6 +66,10 @@ class Service rpc :CreateChannelConnection, ::Google::Cloud::Eventarc::V1::CreateChannelConnectionRequest, ::Google::Longrunning::Operation # Delete a single ChannelConnection. rpc :DeleteChannelConnection, ::Google::Cloud::Eventarc::V1::DeleteChannelConnectionRequest, ::Google::Longrunning::Operation + # Get a GoogleChannelConfig + rpc :GetGoogleChannelConfig, ::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest, ::Google::Cloud::Eventarc::V1::GoogleChannelConfig + # Update a single GoogleChannelConfig + rpc :UpdateGoogleChannelConfig, ::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest, ::Google::Cloud::Eventarc::V1::GoogleChannelConfig end Stub = Service.rpc_stub_class diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/google_channel_config_pb.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/google_channel_config_pb.rb new file mode 100644 index 000000000000..0200623404be --- /dev/null +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/google_channel_config_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/eventarc/v1/google_channel_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/eventarc/v1/google_channel_config.proto", :syntax => :proto3) do + add_message "google.cloud.eventarc.v1.GoogleChannelConfig" do + optional :name, :string, 1 + optional :update_time, :message, 6, "google.protobuf.Timestamp" + optional :crypto_key_name, :string, 7 + end + end +end + +module Google + module Cloud + module Eventarc + module V1 + GoogleChannelConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.GoogleChannelConfig").msgclass + end + end + end +end diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/trigger_pb.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/trigger_pb.rb index dcd996baebcd..cca0d0e006da 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/trigger_pb.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/trigger_pb.rb @@ -6,6 +6,7 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/protobuf/timestamp_pb' +require 'google/rpc/code_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/eventarc/v1/trigger.proto", :syntax => :proto3) do @@ -20,6 +21,7 @@ optional :transport, :message, 11, "google.cloud.eventarc.v1.Transport" map :labels, :string, :string, 12 optional :channel, :string, 13 + map :conditions, :string, :message, 15, "google.cloud.eventarc.v1.StateCondition" optional :etag, :string, 99 end add_message "google.cloud.eventarc.v1.EventFilter" do @@ -27,11 +29,16 @@ optional :value, :string, 2 optional :operator, :string, 3 end + add_message "google.cloud.eventarc.v1.StateCondition" do + optional :code, :enum, 1, "google.rpc.Code" + optional :message, :string, 2 + end add_message "google.cloud.eventarc.v1.Destination" do oneof :descriptor do optional :cloud_run, :message, 1, "google.cloud.eventarc.v1.CloudRun" optional :cloud_function, :string, 2 optional :gke, :message, 3, "google.cloud.eventarc.v1.GKE" + optional :workflow, :string, 4 end end add_message "google.cloud.eventarc.v1.Transport" do @@ -64,6 +71,7 @@ module Eventarc module V1 Trigger = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.Trigger").msgclass EventFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.EventFilter").msgclass + StateCondition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.StateCondition").msgclass Destination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.Destination").msgclass Transport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.Transport").msgclass CloudRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.eventarc.v1.CloudRun").msgclass diff --git a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/channel.rb b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/channel.rb index ffe625302e4d..5cf3fedc52a0 100644 --- a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/channel.rb +++ b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/channel.rb @@ -27,13 +27,14 @@ module V1 # channel. Note that a channel is associated with exactly one event provider. # @!attribute [rw] name # @return [::String] - # Required. The resource name of the channel. Must be unique within the location - # on the project and must be in + # Required. The resource name of the channel. Must be unique within the + # location on the project and must be in # `projects/{project}/locations/{location}/channels/{channel_id}` format. # @!attribute [r] uid # @return [::String] - # Output only. Server assigned unique identifier for the channel. The value is a UUID4 - # string and guaranteed to remain unchanged until the resource is deleted. + # Output only. Server assigned unique identifier for the channel. The value + # is a UUID4 string and guaranteed to remain unchanged until the resource is + # deleted. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The creation time. @@ -42,22 +43,29 @@ module V1 # Output only. The last-modified time. # @!attribute [rw] provider # @return [::String] - # Required. The name of the event provider (e.g. Eventarc SaaS partner) associated + # The name of the event provider (e.g. Eventarc SaaS partner) associated # with the channel. This provider will be granted permissions to publish # events to the channel. Format: # `projects/{project}/locations/{location}/providers/{provider_id}`. # @!attribute [r] pubsub_topic # @return [::String] - # Output only. The name of the Pub/Sub topic created and managed by Eventarc system as - # a transport for the event delivery. Format: + # Output only. The name of the Pub/Sub topic created and managed by + # Eventarc system as a transport for the event delivery. Format: # `projects/{project}/topics/{topic_id}`. # @!attribute [r] state # @return [::Google::Cloud::Eventarc::V1::Channel::State] # Output only. The state of a Channel. # @!attribute [r] activation_token # @return [::String] - # Output only. The activation token for the channel. The token must be used by the - # provider to register the channel for publishing. + # Output only. The activation token for the channel. The token must be used + # by the provider to register the channel for publishing. + # @!attribute [rw] crypto_key_name + # @return [::String] + # Optional. Resource name of a KMS crypto key (managed by the user) used to + # encrypt/decrypt their event data. + # + # It must match the pattern + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. class Channel include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -78,11 +86,13 @@ module State # event provider. ACTIVE = 2 - # The INACTIVE state means that the Channel cannot receive events + # The INACTIVE state indicates that the Channel cannot receive events # permanently. There are two possible cases this state can happen: + # # 1. The SaaS provider disconnected from this Channel. # 2. The Channel activation token has expired but the SaaS provider # wasn't connected. + # # To re-establish a Connection with a provider, the subscriber # should create a new Channel and give it to the provider. INACTIVE = 3 diff --git a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/eventarc.rb b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/eventarc.rb index 5043e2b5b1af..6feb81946064 100644 --- a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/eventarc.rb +++ b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/eventarc.rb @@ -37,6 +37,7 @@ class GetTriggerRequest # @!attribute [rw] page_size # @return [::Integer] # The maximum number of triggers to return on each page. + # # Note: The service may send fewer. # @!attribute [rw] page_token # @return [::String] @@ -51,6 +52,11 @@ class GetTriggerRequest # comma-separated list of fields. The default sorting order is ascending. To # specify descending order for a field, append a `desc` suffix; for example: # `name desc, trigger_id`. + # @!attribute [rw] filter + # @return [::String] + # Filter field. Used to filter the Triggers to be listed. Possible filters + # are described in https://google.aip.dev/160. For example, using + # "?filter=destination:gke" would list only Triggers with a gke destination. class ListTriggersRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -62,7 +68,7 @@ class ListTriggersRequest # The requested triggers, up to the number specified in `page_size`. # @!attribute [rw] next_page_token # @return [::String] - # A page token that can be sent to ListTriggers to request the next page. + # A page token that can be sent to `ListTriggers` to request the next page. # If this is empty, then there are no more pages. # @!attribute [rw] unreachable # @return [::Array<::String>] @@ -150,6 +156,7 @@ class GetChannelRequest # @!attribute [rw] page_size # @return [::Integer] # The maximum number of channels to return on each page. + # # Note: The service may send fewer. # @!attribute [rw] page_token # @return [::String] @@ -175,7 +182,7 @@ class ListChannelsRequest # The requested channels, up to the number specified in `page_size`. # @!attribute [rw] next_page_token # @return [::String] - # A page token that can be sent to ListChannels to request the next page. + # A page token that can be sent to `ListChannels` to request the next page. # If this is empty, then there are no more pages. # @!attribute [rw] unreachable # @return [::Array<::String>] @@ -278,7 +285,7 @@ class ListProvidersRequest # The requested providers, up to the number specified in `page_size`. # @!attribute [rw] next_page_token # @return [::String] - # A page token that can be sent to ListProviders to request the next page. + # A page token that can be sent to `ListProviders` to request the next page. # If this is empty, then there are no more pages. # @!attribute [rw] unreachable # @return [::Array<::String>] @@ -304,6 +311,7 @@ class GetChannelConnectionRequest # @!attribute [rw] page_size # @return [::Integer] # The maximum number of channel connections to return on each page. + # # Note: The service may send fewer responses. # @!attribute [rw] page_token # @return [::String] @@ -324,7 +332,7 @@ class ListChannelConnectionsRequest # `page_size`. # @!attribute [rw] next_page_token # @return [::String] - # A page token that can be sent to ListChannelConnections to request the + # A page token that can be sent to `ListChannelConnections` to request the # next page. # If this is empty, then there are no more pages. # @!attribute [rw] unreachable @@ -359,6 +367,29 @@ class DeleteChannelConnectionRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # The request message for the UpdateGoogleChannelConfig method. + # @!attribute [rw] google_channel_config + # @return [::Google::Cloud::Eventarc::V1::GoogleChannelConfig] + # Required. The config to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The fields to be updated; only fields explicitly provided are updated. + # If no field mask is provided, all provided fields in the request are + # updated. To update all fields, provide a field mask of "*". + class UpdateGoogleChannelConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for the GetGoogleChannelConfig method. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the config to get. + class GetGoogleChannelConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents the metadata of the long-running operation. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] diff --git a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/google_channel_config.rb b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/google_channel_config.rb new file mode 100644 index 000000000000..08d206d3ccf9 --- /dev/null +++ b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/google_channel_config.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Eventarc + module V1 + # A GoogleChannelConfig is a resource that stores the custom settings + # respected by Eventarc first-party triggers in the matching region. + # Once configured, first-party event data will be protected + # using the specified custom managed encryption key instead of Google-managed + # encryption keys. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the config. Must be in the format of, + # `projects/{project}/locations/{location}/googleChannelConfig`. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last-modified time. + # @!attribute [rw] crypto_key_name + # @return [::String] + # Optional. Resource name of a KMS crypto key (managed by the user) used to + # encrypt/decrypt their event data. + # + # It must match the pattern + # `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + class GoogleChannelConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/trigger.rb b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/trigger.rb index 46c7806217b3..ecfe78becf99 100644 --- a/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/trigger.rb +++ b/google-cloud-eventarc-v1/proto_docs/google/cloud/eventarc/v1/trigger.rb @@ -39,7 +39,7 @@ module V1 # Output only. The last-modified time. # @!attribute [rw] event_filters # @return [::Array<::Google::Cloud::Eventarc::V1::EventFilter>] - # Required. null The list of filters that applies to event attributes. Only events that + # Required. Unordered list. The list of filters that applies to event attributes. Only events that # match all the provided filters are sent to the destination. # @!attribute [rw] service_account # @return [::String] @@ -74,6 +74,9 @@ module V1 # Optional. The name of the channel associated with the trigger in # `projects/{project}/locations/{location}/channels/{channel}` format. # You must provide a channel to receive events from Eventarc SaaS partners. + # @!attribute [r] conditions + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Eventarc::V1::StateCondition}] + # Output only. The reason(s) why a trigger is in FAILED state. # @!attribute [r] etag # @return [::String] # Output only. This checksum is computed by the server based on the value of other @@ -91,6 +94,15 @@ class LabelsEntry include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Eventarc::V1::StateCondition] + class ConditionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end # Filters events based on exact matches on the CloudEvents attributes. @@ -114,6 +126,18 @@ class EventFilter extend ::Google::Protobuf::MessageExts::ClassMethods end + # A condition that is part of the trigger state computation. + # @!attribute [rw] code + # @return [::Google::Rpc::Code] + # The canonical code of the condition. + # @!attribute [rw] message + # @return [::String] + # Human-readable message. + class StateCondition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Represents a target of an invocation over HTTP. # @!attribute [rw] cloud_run # @return [::Google::Cloud::Eventarc::V1::CloudRun] @@ -127,6 +151,12 @@ class EventFilter # @return [::Google::Cloud::Eventarc::V1::GKE] # A GKE service capable of receiving events. The service should be running # in the same project as the trigger. + # @!attribute [rw] workflow + # @return [::String] + # The resource name of the Workflow whose Executions are triggered by + # the events. The Workflow resource should be deployed in the same project + # as the trigger. + # Format: `projects/{project}/locations/{location}/workflows/{workflow}` class Destination include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-eventarc-v1/proto_docs/google/rpc/code.rb b/google-cloud-eventarc-v1/proto_docs/google/rpc/code.rb new file mode 100644 index 000000000000..4c09e390ba07 --- /dev/null +++ b/google-cloud-eventarc-v1/proto_docs/google/rpc/code.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Rpc + # The canonical error codes for gRPC APIs. + # + # + # Sometimes multiple error codes may apply. Services should return + # the most specific error code that applies. For example, prefer + # `OUT_OF_RANGE` over `FAILED_PRECONDITION` if both codes apply. + # Similarly prefer `NOT_FOUND` or `ALREADY_EXISTS` over `FAILED_PRECONDITION`. + module Code + # Not an error; returned on success + # + # HTTP Mapping: 200 OK + OK = 0 + + # The operation was cancelled, typically by the caller. + # + # HTTP Mapping: 499 Client Closed Request + CANCELLED = 1 + + # Unknown error. For example, this error may be returned when + # a `Status` value received from another address space belongs to + # an error space that is not known in this address space. Also + # errors raised by APIs that do not return enough error information + # may be converted to this error. + # + # HTTP Mapping: 500 Internal Server Error + UNKNOWN = 2 + + # The client specified an invalid argument. Note that this differs + # from `FAILED_PRECONDITION`. `INVALID_ARGUMENT` indicates arguments + # that are problematic regardless of the state of the system + # (e.g., a malformed file name). + # + # HTTP Mapping: 400 Bad Request + INVALID_ARGUMENT = 3 + + # The deadline expired before the operation could complete. For operations + # that change the state of the system, this error may be returned + # even if the operation has completed successfully. For example, a + # successful response from a server could have been delayed long + # enough for the deadline to expire. + # + # HTTP Mapping: 504 Gateway Timeout + DEADLINE_EXCEEDED = 4 + + # Some requested entity (e.g., file or directory) was not found. + # + # Note to server developers: if a request is denied for an entire class + # of users, such as gradual feature rollout or undocumented whitelist, + # `NOT_FOUND` may be used. If a request is denied for some users within + # a class of users, such as user-based access control, `PERMISSION_DENIED` + # must be used. + # + # HTTP Mapping: 404 Not Found + NOT_FOUND = 5 + + # The entity that a client attempted to create (e.g., file or directory) + # already exists. + # + # HTTP Mapping: 409 Conflict + ALREADY_EXISTS = 6 + + # The caller does not have permission to execute the specified + # operation. `PERMISSION_DENIED` must not be used for rejections + # caused by exhausting some resource (use `RESOURCE_EXHAUSTED` + # instead for those errors). `PERMISSION_DENIED` must not be + # used if the caller can not be identified (use `UNAUTHENTICATED` + # instead for those errors). This error code does not imply the + # request is valid or the requested entity exists or satisfies + # other pre-conditions. + # + # HTTP Mapping: 403 Forbidden + PERMISSION_DENIED = 7 + + # The request does not have valid authentication credentials for the + # operation. + # + # HTTP Mapping: 401 Unauthorized + UNAUTHENTICATED = 16 + + # Some resource has been exhausted, perhaps a per-user quota, or + # perhaps the entire file system is out of space. + # + # HTTP Mapping: 429 Too Many Requests + RESOURCE_EXHAUSTED = 8 + + # The operation was rejected because the system is not in a state + # required for the operation's execution. For example, the directory + # to be deleted is non-empty, an rmdir operation is applied to + # a non-directory, etc. + # + # Service implementors can use the following guidelines to decide + # between `FAILED_PRECONDITION`, `ABORTED`, and `UNAVAILABLE`: + # (a) Use `UNAVAILABLE` if the client can retry just the failing call. + # (b) Use `ABORTED` if the client should retry at a higher level + # (e.g., when a client-specified test-and-set fails, indicating the + # client should restart a read-modify-write sequence). + # (c) Use `FAILED_PRECONDITION` if the client should not retry until + # the system state has been explicitly fixed. E.g., if an "rmdir" + # fails because the directory is non-empty, `FAILED_PRECONDITION` + # should be returned since the client should not retry unless + # the files are deleted from the directory. + # + # HTTP Mapping: 400 Bad Request + FAILED_PRECONDITION = 9 + + # The operation was aborted, typically due to a concurrency issue such as + # a sequencer check failure or transaction abort. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 409 Conflict + ABORTED = 10 + + # The operation was attempted past the valid range. E.g., seeking or + # reading past end-of-file. + # + # Unlike `INVALID_ARGUMENT`, this error indicates a problem that may + # be fixed if the system state changes. For example, a 32-bit file + # system will generate `INVALID_ARGUMENT` if asked to read at an + # offset that is not in the range [0,2^32-1], but it will generate + # `OUT_OF_RANGE` if asked to read from an offset past the current + # file size. + # + # There is a fair bit of overlap between `FAILED_PRECONDITION` and + # `OUT_OF_RANGE`. We recommend using `OUT_OF_RANGE` (the more specific + # error) when it applies so that callers who are iterating through + # a space can easily look for an `OUT_OF_RANGE` error to detect when + # they are done. + # + # HTTP Mapping: 400 Bad Request + OUT_OF_RANGE = 11 + + # The operation is not implemented or is not supported/enabled in this + # service. + # + # HTTP Mapping: 501 Not Implemented + UNIMPLEMENTED = 12 + + # Internal errors. This means that some invariants expected by the + # underlying system have been broken. This error code is reserved + # for serious errors. + # + # HTTP Mapping: 500 Internal Server Error + INTERNAL = 13 + + # The service is currently unavailable. This is most likely a + # transient condition, which can be corrected by retrying with + # a backoff. Note that it is not always safe to retry + # non-idempotent operations. + # + # See the guidelines above for deciding between `FAILED_PRECONDITION`, + # `ABORTED`, and `UNAVAILABLE`. + # + # HTTP Mapping: 503 Service Unavailable + UNAVAILABLE = 14 + + # Unrecoverable data loss or corruption. + # + # HTTP Mapping: 500 Internal Server Error + DATA_LOSS = 15 + end + end +end diff --git a/google-cloud-eventarc-v1/proto_docs/google/rpc/status.rb b/google-cloud-eventarc-v1/proto_docs/google/rpc/status.rb index 5959350b78a1..f7b3dae87931 100644 --- a/google-cloud-eventarc-v1/proto_docs/google/rpc/status.rb +++ b/google-cloud-eventarc-v1/proto_docs/google/rpc/status.rb @@ -28,7 +28,7 @@ module Rpc # [API Design Guide](https://cloud.google.com/apis/design/errors). # @!attribute [rw] code # @return [::Integer] - # The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + # The status code, which should be an enum value of {::Google::Rpc::Code google.rpc.Code}. # @!attribute [rw] message # @return [::String] # A developer-facing error message, which should be in English. Any diff --git a/google-cloud-eventarc-v1/proto_docs/google/type/expr.rb b/google-cloud-eventarc-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..0602180c6ada --- /dev/null +++ b/google-cloud-eventarc-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-eventarc-v1/snippets/eventarc/get_google_channel_config.rb b/google-cloud-eventarc-v1/snippets/eventarc/get_google_channel_config.rb new file mode 100644 index 000000000000..fc19a36dcd14 --- /dev/null +++ b/google-cloud-eventarc-v1/snippets/eventarc/get_google_channel_config.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_sync] +require "google/cloud/eventarc/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#get_google_channel_config +# +def get_google_channel_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest.new + + # Call the get_google_channel_config method. + result = client.get_google_channel_config request + + # The returned object is of type Google::Cloud::Eventarc::V1::GoogleChannelConfig. + p result +end +# [END eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_sync] diff --git a/google-cloud-eventarc-v1/snippets/eventarc/update_google_channel_config.rb b/google-cloud-eventarc-v1/snippets/eventarc/update_google_channel_config.rb new file mode 100644 index 000000000000..75d9f2c44a1b --- /dev/null +++ b/google-cloud-eventarc-v1/snippets/eventarc/update_google_channel_config.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_sync] +require "google/cloud/eventarc/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Eventarc::V1::Eventarc::Client#update_google_channel_config +# +def update_google_channel_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Eventarc::V1::Eventarc::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest.new + + # Call the update_google_channel_config method. + result = client.update_google_channel_config request + + # The returned object is of type Google::Cloud::Eventarc::V1::GoogleChannelConfig. + p result +end +# [END eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_sync] diff --git a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json index 1f7ee57181a4..dd216a68d3ec 100644 --- a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json +++ b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json @@ -650,6 +650,86 @@ "type": "FULL" } ] + }, + { + "region_tag": "eventarc_v1_generated_Eventarc_GetGoogleChannelConfig_sync", + "title": "Snippet for get_google_channel_config in Eventarc", + "description": "Basic snippet for get_google_channel_config in Eventarc", + "file": "eventarc/get_google_channel_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_google_channel_config", + "full_name": "::Google::Cloud::Eventarc::V1::Eventarc::Client#get_google_channel_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Eventarc::V1::GoogleChannelConfig", + "client": { + "short_name": "Eventarc::Client", + "full_name": "::Google::Cloud::Eventarc::V1::Eventarc::Client" + }, + "method": { + "short_name": "GetGoogleChannelConfig", + "full_name": "google.cloud.eventarc.v1.Eventarc.GetGoogleChannelConfig", + "service": { + "short_name": "Eventarc", + "full_name": "google.cloud.eventarc.v1.Eventarc" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "eventarc_v1_generated_Eventarc_UpdateGoogleChannelConfig_sync", + "title": "Snippet for update_google_channel_config in Eventarc", + "description": "Basic snippet for update_google_channel_config in Eventarc", + "file": "eventarc/update_google_channel_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_google_channel_config", + "full_name": "::Google::Cloud::Eventarc::V1::Eventarc::Client#update_google_channel_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Eventarc::V1::GoogleChannelConfig", + "client": { + "short_name": "Eventarc::Client", + "full_name": "::Google::Cloud::Eventarc::V1::Eventarc::Client" + }, + "method": { + "short_name": "UpdateGoogleChannelConfig", + "full_name": "google.cloud.eventarc.v1.Eventarc.UpdateGoogleChannelConfig", + "service": { + "short_name": "Eventarc", + "full_name": "google.cloud.eventarc.v1.Eventarc" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb index 384991da6b20..f6a09dfa44e7 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_paths_test.rb @@ -59,6 +59,30 @@ def test_cloud_function_path end end + def test_crypto_key_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.crypto_key_path project: "value0", location: "value1", key_ring: "value2", crypto_key: "value3" + assert_equal "projects/value0/locations/value1/keyRings/value2/cryptoKeys/value3", path + end + end + + def test_google_channel_config_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.google_channel_config_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/googleChannelConfig", path + end + end + def test_location_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, nil do @@ -115,4 +139,16 @@ def test_trigger_path assert_equal "projects/value0/locations/value1/triggers/value2", path end end + + def test_workflow_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_path project: "value0", location: "value1", workflow: "value2" + assert_equal "projects/value0/locations/value1/workflows/value2", path + end + end end diff --git a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb index 1c3e525896c5..9050143a5cf5 100644 --- a/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb +++ b/google-cloud-eventarc-v1/test/google/cloud/eventarc/v1/eventarc_test.rb @@ -117,6 +117,7 @@ def test_list_triggers page_size = 42 page_token = "hello world" order_by = "hello world" + filter = "hello world" list_triggers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :list_triggers, name @@ -125,6 +126,7 @@ def test_list_triggers assert_equal 42, request["page_size"] assert_equal "hello world", request["page_token"] assert_equal "hello world", request["order_by"] + assert_equal "hello world", request["filter"] refute_nil options end @@ -135,35 +137,35 @@ def test_list_triggers end # Use hash object - client.list_triggers({ parent: parent, page_size: page_size, page_token: page_token, order_by: order_by }) do |response, operation| + client.list_triggers({ parent: parent, page_size: page_size, page_token: page_token, order_by: order_by, filter: filter }) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use named arguments - client.list_triggers parent: parent, page_size: page_size, page_token: page_token, order_by: order_by do |response, operation| + client.list_triggers parent: parent, page_size: page_size, page_token: page_token, order_by: order_by, filter: filter do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object - client.list_triggers ::Google::Cloud::Eventarc::V1::ListTriggersRequest.new(parent: parent, page_size: page_size, page_token: page_token, order_by: order_by) do |response, operation| + client.list_triggers ::Google::Cloud::Eventarc::V1::ListTriggersRequest.new(parent: parent, page_size: page_size, page_token: page_token, order_by: order_by, filter: filter) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use hash object with options - client.list_triggers({ parent: parent, page_size: page_size, page_token: page_token, order_by: order_by }, grpc_options) do |response, operation| + client.list_triggers({ parent: parent, page_size: page_size, page_token: page_token, order_by: order_by, filter: filter }, grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation end # Use protobuf object with options - client.list_triggers(::Google::Cloud::Eventarc::V1::ListTriggersRequest.new(parent: parent, page_size: page_size, page_token: page_token, order_by: order_by), grpc_options) do |response, operation| + client.list_triggers(::Google::Cloud::Eventarc::V1::ListTriggersRequest.new(parent: parent, page_size: page_size, page_token: page_token, order_by: order_by, filter: filter), grpc_options) do |response, operation| assert_kind_of Gapic::PagedEnumerable, response assert_equal grpc_response, response.response assert_equal grpc_operation, operation @@ -1093,6 +1095,124 @@ def test_delete_channel_connection end end + def test_get_google_channel_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Eventarc::V1::GoogleChannelConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_google_channel_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_google_channel_config, name + assert_kind_of ::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_google_channel_config_client_stub do + # Create client + client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_google_channel_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_google_channel_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_google_channel_config ::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_google_channel_config({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_google_channel_config(::Google::Cloud::Eventarc::V1::GetGoogleChannelConfigRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_google_channel_config_client_stub.call_rpc_count + end + end + + def test_update_google_channel_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Eventarc::V1::GoogleChannelConfig.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + google_channel_config = {} + update_mask = {} + + update_google_channel_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_google_channel_config, name + assert_kind_of ::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Eventarc::V1::GoogleChannelConfig), request["google_channel_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_google_channel_config_client_stub do + # Create client + client = ::Google::Cloud::Eventarc::V1::Eventarc::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_google_channel_config({ google_channel_config: google_channel_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_google_channel_config google_channel_config: google_channel_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_google_channel_config ::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest.new(google_channel_config: google_channel_config, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_google_channel_config({ google_channel_config: google_channel_config, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_google_channel_config(::Google::Cloud::Eventarc::V1::UpdateGoogleChannelConfigRequest.new(google_channel_config: google_channel_config, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_google_channel_config_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure From fe7474022b9fe3762911000e39cc5b1fefe3ad20 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:32:33 -0800 Subject: [PATCH 032/112] chore(main): release google-cloud-ai_platform-v1 0.14.0 (#19380) --- .release-please-manifest.json | 2 +- google-cloud-ai_platform-v1/CHANGELOG.md | 10 ++++++++++ .../lib/google/cloud/ai_platform/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.aiplatform.v1.json | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a80fdb26112e..2c6ce65f60d3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -19,7 +19,7 @@ "google-cloud-access_approval-v1+FILLER": "0.0.0", "google-cloud-ai_platform": "0.2.0", "google-cloud-ai_platform+FILLER": "0.0.0", - "google-cloud-ai_platform-v1": "0.13.0", + "google-cloud-ai_platform-v1": "0.14.0", "google-cloud-ai_platform-v1+FILLER": "0.0.0", "google-cloud-api_gateway": "1.1.0", "google-cloud-api_gateway+FILLER": "0.0.0", diff --git a/google-cloud-ai_platform-v1/CHANGELOG.md b/google-cloud-ai_platform-v1/CHANGELOG.md index 7db31aa408f3..2a8b23834ef8 100644 --- a/google-cloud-ai_platform-v1/CHANGELOG.md +++ b/google-cloud-ai_platform-v1/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +### 0.14.0 (2022-11-08) + +#### Features + +* add annotation_labels to ImportDataConfig +* add failed_main_jobs and failed_pre_caching_check_jobs to ContainerDetail +* add metadata_artifact to Model +* add persist_ml_use_assignment to InputDataConfig +* add start_time to BatchReadFeatureValuesRequest + ### 0.13.0 (2022-09-28) #### Features diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb index 8d42785725b3..081e7d70b024 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module AIPlatform module V1 - VERSION = "0.13.0" + VERSION = "0.14.0" end end end diff --git a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json index a7c105791c9f..8fb3cc15ed62 100644 --- a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-ai_platform-v1", - "version": "0.13.0", + "version": "0.14.0", "language": "RUBY", "apis": [ { From 31171d0c3a4d42c727b91e92565e57ffedb78345 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:33:02 -0800 Subject: [PATCH 033/112] chore(main): release google-cloud-bigquery-storage-v1 0.15.1 (#19381) --- .release-please-manifest.json | 2 +- google-cloud-bigquery-storage-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/bigquery/storage/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.bigquery.storage.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2c6ce65f60d3..43bfb1702dd7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -115,7 +115,7 @@ "google-cloud-bigquery-reservation-v1+FILLER": "0.0.0", "google-cloud-bigquery-storage": "1.3.0", "google-cloud-bigquery-storage+FILLER": "0.0.0", - "google-cloud-bigquery-storage-v1": "0.15.0", + "google-cloud-bigquery-storage-v1": "0.15.1", "google-cloud-bigquery-storage-v1+FILLER": "0.0.0", "google-cloud-bigtable": "2.7.0", "google-cloud-bigtable+FILLER": "0.0.0", diff --git a/google-cloud-bigquery-storage-v1/CHANGELOG.md b/google-cloud-bigquery-storage-v1/CHANGELOG.md index 2e101636e1f0..329e397194b3 100644 --- a/google-cloud-bigquery-storage-v1/CHANGELOG.md +++ b/google-cloud-bigquery-storage-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.15.1 (2022-11-08) + +#### Documentation + +* remove stale header guidance for AppendRows + ### 0.15.0 (2022-09-08) #### Features diff --git a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb index f2684c57a211..ca329341f617 100644 --- a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb +++ b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Bigquery module Storage module V1 - VERSION = "0.15.0" + VERSION = "0.15.1" end end end diff --git a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json index ad13538d71ee..6e087fc04e54 100644 --- a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json +++ b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-bigquery-storage-v1", - "version": "0.15.0", + "version": "0.15.1", "language": "RUBY", "apis": [ { From aa6b30caa0ab6b5e8370275e9239ad294a07569d Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:33:22 -0800 Subject: [PATCH 034/112] chore(main): release google-cloud-container-v1beta1 0.13.0 (#19382) --- .release-please-manifest.json | 2 +- google-cloud-container-v1beta1/CHANGELOG.md | 8 ++++++++ .../lib/google/cloud/container/v1beta1/version.rb | 2 +- .../snippet_metadata_google.container.v1beta1.json | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 43bfb1702dd7..938bb735f843 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -167,7 +167,7 @@ "google-cloud-container+FILLER": "0.0.0", "google-cloud-container-v1": "0.11.0", "google-cloud-container-v1+FILLER": "0.0.0", - "google-cloud-container-v1beta1": "0.12.0", + "google-cloud-container-v1beta1": "0.13.0", "google-cloud-container-v1beta1+FILLER": "0.0.0", "google-cloud-container_analysis": "1.2.0", "google-cloud-container_analysis+FILLER": "0.0.0", diff --git a/google-cloud-container-v1beta1/CHANGELOG.md b/google-cloud-container-v1beta1/CHANGELOG.md index 4f3d420d6881..6ea790a50af6 100644 --- a/google-cloud-container-v1beta1/CHANGELOG.md +++ b/google-cloud-container-v1beta1/CHANGELOG.md @@ -1,5 +1,13 @@ # Release History +### 0.13.0 (2022-11-08) + +#### Features + +* support enabling private nodes +* support enabling private nodes +* support GatewayAPIConfig + ### 0.12.0 (2022-10-18) #### Features diff --git a/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/version.rb b/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/version.rb index 12891db33dbc..00d9337cbf2b 100644 --- a/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/version.rb +++ b/google-cloud-container-v1beta1/lib/google/cloud/container/v1beta1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Container module V1beta1 - VERSION = "0.12.0" + VERSION = "0.13.0" end end end diff --git a/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json b/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json index 4e030b6c3ce5..7c05a3244008 100644 --- a/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json +++ b/google-cloud-container-v1beta1/snippets/snippet_metadata_google.container.v1beta1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-container-v1beta1", - "version": "0.12.0", + "version": "0.13.0", "language": "RUBY", "apis": [ { From 3b0cf355a3c0545b3c7a590e47f57fbe6e8c1c83 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:33:56 -0800 Subject: [PATCH 035/112] chore(main): release google-cloud-eventarc-publishing-v1 0.4.0 (#19383) --- .release-please-manifest.json | 2 +- google-cloud-eventarc-publishing-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/eventarc/publishing/v1/version.rb | 2 +- ...nippet_metadata_google.cloud.eventarc.publishing.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 938bb735f843..a898da279277 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -269,7 +269,7 @@ "google-cloud-eventarc+FILLER": "0.0.0", "google-cloud-eventarc-publishing": "0.2.0", "google-cloud-eventarc-publishing+FILLER": "0.0.0", - "google-cloud-eventarc-publishing-v1": "0.3.0", + "google-cloud-eventarc-publishing-v1": "0.4.0", "google-cloud-eventarc-publishing-v1+FILLER": "0.0.0", "google-cloud-eventarc-v1": "0.4.0", "google-cloud-eventarc-v1+FILLER": "0.0.0", diff --git a/google-cloud-eventarc-publishing-v1/CHANGELOG.md b/google-cloud-eventarc-publishing-v1/CHANGELOG.md index a7905664aef2..ff9e72c166fd 100644 --- a/google-cloud-eventarc-publishing-v1/CHANGELOG.md +++ b/google-cloud-eventarc-publishing-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.4.0 (2022-11-08) + +#### Features + +* add text_event in publish_channel_connection_events + ### 0.3.0 (2022-07-02) #### Features diff --git a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/version.rb b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/version.rb index ceec7377cc1a..591a1072123a 100644 --- a/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/version.rb +++ b/google-cloud-eventarc-publishing-v1/lib/google/cloud/eventarc/publishing/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Eventarc module Publishing module V1 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json b/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json index cee1cea9a9b5..4cbed2daa380 100644 --- a/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json +++ b/google-cloud-eventarc-publishing-v1/snippets/snippet_metadata_google.cloud.eventarc.publishing.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-eventarc-publishing-v1", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 2258b297cb4c85977e13b2bcffe0c9433c9c7fb9 Mon Sep 17 00:00:00 2001 From: meredithslota Date: Tue, 8 Nov 2022 22:02:06 -0800 Subject: [PATCH 036/112] chore(firestore): updating obsolete region tag (#19390) --- google-cloud-firestore/samples/get_data.rb | 4 ++-- google-cloud-firestore/samples/order_limit_data.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/google-cloud-firestore/samples/get_data.rb b/google-cloud-firestore/samples/get_data.rb index f5d6bdc7d4f5..bcea0518a84e 100644 --- a/google-cloud-firestore/samples/get_data.rb +++ b/google-cloud-firestore/samples/get_data.rb @@ -121,14 +121,14 @@ def add_subcollection project_id:, collection_path: "cities" # collection_path = "cities" firestore = Google::Cloud::Firestore.new project_id: project_id - # [START fs_add_subcollection] + # [START firestore_data_add_sub_collection] city_ref = firestore.doc "#{collection_path}/SF" subcollection_ref = city_ref.col "neighborhoods" added_doc_ref = subcollection_ref.add name: "Marina" puts "Added document with ID: #{added_doc_ref.document_id}." - # [END fs_add_subcollection] + # [END firestore_data_add_sub_collection] end def list_subcollections project_id:, collection_path: "cities" diff --git a/google-cloud-firestore/samples/order_limit_data.rb b/google-cloud-firestore/samples/order_limit_data.rb index bce7a50b91f5..d2b962dbc25d 100644 --- a/google-cloud-firestore/samples/order_limit_data.rb +++ b/google-cloud-firestore/samples/order_limit_data.rb @@ -108,9 +108,9 @@ def order_by_name_limit_to_last_query project_id:, collection_path: "cities" firestore = Google::Cloud::Firestore.new project_id: project_id cities_ref = firestore.col collection_path - # [START fs_order_by_name_limit_to_last_query] + # [START firestore_query_order_limit_to_last] query = cities_ref.order("name").limit_to_last(3) - # [END fs_order_by_name_limit_to_last_query] + # [END firestore_query_order_limit_to_last] query.get do |city| puts "Document #{city.document_id} returned by order by name with limit_to_last query." end From 89edb8cc72cb19ace6565a55c6518cf50b78992a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:40:03 +0530 Subject: [PATCH 037/112] feat(document_ai): add font_family, ImageQualityScores and Provenance to document feat(document_ai): add document_schema to processor --- .../v1/document_processor_service/client.rb | 2 + .../cloud/documentai/v1/document_io_pb.rb | 3 + .../google/cloud/documentai/v1/document_pb.rb | 13 ++++ .../cloud/documentai/v1/processor_pb.rb | 2 + .../google/cloud/documentai/v1/barcode.rb | 56 ++++++++-------- .../google/cloud/documentai/v1/document.rb | 66 +++++++++++++++---- .../google/cloud/documentai/v1/document_io.rb | 9 ++- .../v1/document_processor_service.rb | 2 + .../cloud/documentai/v1/document_schema.rb | 7 +- .../google/cloud/documentai/v1/processor.rb | 13 ++-- .../cloud/documentai/v1/processor_type.rb | 4 +- 11 files changed, 127 insertions(+), 50 deletions(-) diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb index b39549015886..7e4c8c7cf265 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/document_processor_service/client.rb @@ -223,6 +223,8 @@ def initialize # false. # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::DocumentAI::V1::ProcessResponse] diff --git a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb index 660eacb90621..a3a2c5743160 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_io_pb.rb @@ -3,6 +3,8 @@ require 'google/protobuf' +require 'google/protobuf/field_mask_pb' + Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/documentai/v1/document_io.proto", :syntax => :proto3) do add_message "google.cloud.documentai.v1.RawDocument" do @@ -32,6 +34,7 @@ end add_message "google.cloud.documentai.v1.DocumentOutputConfig.GcsOutputConfig" do optional :gcs_uri, :string, 1 + optional :field_mask, :message, 2, "google.protobuf.FieldMask" end end end diff --git a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb index c2039e340718..307b5708290b 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/document_pb.rb @@ -45,6 +45,7 @@ optional :text_style, :string, 5 optional :text_decoration, :string, 6 optional :font_size, :message, 7, "google.cloud.documentai.v1.Document.Style.FontSize" + optional :font_family, :string, 8 end add_message "google.cloud.documentai.v1.Document.Style.FontSize" do optional :size, :float, 1 @@ -66,6 +67,7 @@ repeated :form_fields, :message, 11, "google.cloud.documentai.v1.Document.Page.FormField" repeated :symbols, :message, 12, "google.cloud.documentai.v1.Document.Page.Symbol" repeated :detected_barcodes, :message, 15, "google.cloud.documentai.v1.Document.Page.DetectedBarcode" + optional :image_quality_scores, :message, 17, "google.cloud.documentai.v1.Document.Page.ImageQualityScores" optional :provenance, :message, 16, "google.cloud.documentai.v1.Document.Provenance" end add_message "google.cloud.documentai.v1.Document.Page.Dimension" do @@ -142,6 +144,7 @@ repeated :header_rows, :message, 2, "google.cloud.documentai.v1.Document.Page.Table.TableRow" repeated :body_rows, :message, 3, "google.cloud.documentai.v1.Document.Page.Table.TableRow" repeated :detected_languages, :message, 4, "google.cloud.documentai.v1.Document.Page.DetectedLanguage" + optional :provenance, :message, 5, "google.cloud.documentai.v1.Document.Provenance" end add_message "google.cloud.documentai.v1.Document.Page.Table.TableRow" do repeated :cells, :message, 1, "google.cloud.documentai.v1.Document.Page.Table.TableCell" @@ -170,6 +173,14 @@ optional :language_code, :string, 1 optional :confidence, :float, 2 end + add_message "google.cloud.documentai.v1.Document.Page.ImageQualityScores" do + optional :quality_score, :float, 1 + repeated :detected_defects, :message, 2, "google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect" + end + add_message "google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect" do + optional :type, :string, 1 + optional :confidence, :float, 2 + end add_message "google.cloud.documentai.v1.Document.Entity" do optional :text_anchor, :message, 1, "google.cloud.documentai.v1.Document.TextAnchor" optional :type, :string, 2 @@ -299,6 +310,8 @@ module V1 Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.FormField").msgclass Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedBarcode").msgclass Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.DetectedLanguage").msgclass + Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores").msgclass + Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Page.ImageQualityScores.DetectedDefect").msgclass Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity").msgclass Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.Entity.NormalizedValue").msgclass Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1.Document.EntityRelation").msgclass diff --git a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb index 425a5e8f119e..16dfe24ce01d 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/documentai/v1/processor_pb.rb @@ -5,6 +5,7 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/cloud/documentai/v1/document_schema_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do @@ -12,6 +13,7 @@ add_message "google.cloud.documentai.v1.ProcessorVersion" do optional :name, :string, 1 optional :display_name, :string, 2 + optional :document_schema, :message, 12, "google.cloud.documentai.v1.DocumentSchema" optional :state, :enum, 6, "google.cloud.documentai.v1.ProcessorVersion.State" optional :create_time, :message, 7, "google.protobuf.Timestamp" optional :kms_key_name, :string, 9 diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb index f527ddab75c9..d60d0abc1395 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/barcode.rb @@ -26,41 +26,43 @@ module V1 # @return [::String] # Format of a barcode. # The supported formats are: - # CODE_128: Code 128 type. - # CODE_39: Code 39 type. - # CODE_93: Code 93 type. - # CODABAR: Codabar type. - # DATA_MATRIX: 2D Data Matrix type. - # ITF: ITF type. - # EAN_13: EAN-13 type. - # EAN_8: EAN-8 type. - # QR_CODE: 2D QR code type. - # UPC_A: UPC-A type. - # UPC_E: UPC-E type. - # PDF417: PDF417 type. - # AZTEC: 2D Aztec code type. - # DATABAR: GS1 DataBar code type. + # + # - `CODE_128`: Code 128 type. + # - `CODE_39`: Code 39 type. + # - `CODE_93`: Code 93 type. + # - `CODABAR`: Codabar type. + # - `DATA_MATRIX`: 2D Data Matrix type. + # - `ITF`: ITF type. + # - `EAN_13`: EAN-13 type. + # - `EAN_8`: EAN-8 type. + # - `QR_CODE`: 2D QR code type. + # - `UPC_A`: UPC-A type. + # - `UPC_E`: UPC-E type. + # - `PDF417`: PDF417 type. + # - `AZTEC`: 2D Aztec code type. + # - `DATABAR`: GS1 DataBar code type. # @!attribute [rw] value_format # @return [::String] # Value format describes the format of the value that a barcode # encodes. # The supported formats are: - # CONTACT_INFO: Contact information. - # EMAIL: Email address. - # ISBN: ISBN identifier. - # PHONE: Phone number. - # PRODUCT: Product. - # SMS: SMS message. - # TEXT: Text string. - # URL: URL address. - # WIFI: Wifi information. - # GEO: Geo-localization. - # CALENDAR_EVENT: Calendar event. - # DRIVER_LICENSE: Driver's license. + # + # - `CONTACT_INFO`: Contact information. + # - `EMAIL`: Email address. + # - `ISBN`: ISBN identifier. + # - `PHONE`: Phone number. + # - `PRODUCT`: Product. + # - `SMS`: SMS message. + # - `TEXT`: Text string. + # - `URL`: URL address. + # - `WIFI`: Wifi information. + # - `GEO`: Geo-localization. + # - `CALENDAR_EVENT`: Calendar event. + # - `DRIVER_LICENSE`: Driver's license. # @!attribute [rw] raw_value # @return [::String] # Raw value encoded in the barcode. - # For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. + # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. class Barcode include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb index 8bc584507edc..58c52418d773 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document.rb @@ -60,9 +60,9 @@ module V1 # Placeholder. Relationship among {::Google::Cloud::DocumentAI::V1::Document#entities Document.entities}. # @!attribute [rw] text_changes # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::TextChange>] - # Placeholder. A list of text corrections made to [Document.text]. This is - # usually used for annotating corrections to OCR mistakes. Text changes for - # a given revision may not overlap with each other. + # Placeholder. A list of text corrections made to {::Google::Cloud::DocumentAI::V1::Document#text Document.text}. This + # is usually used for annotating corrections to OCR mistakes. Text changes + # for a given revision may not overlap with each other. # @!attribute [rw] shard_info # @return [::Google::Cloud::DocumentAI::V1::Document::ShardInfo] # Information about the sharding if this document is sharded part of a larger @@ -122,6 +122,10 @@ class ShardInfo # @!attribute [rw] font_size # @return [::Google::Cloud::DocumentAI::V1::Document::Style::FontSize] # Font size. + # @!attribute [rw] font_family + # @return [::String] + # Font family such as `Arial`, `Times New Roman`. + # https://www.w3schools.com/cssref/pr_font_font-family.asp class Style include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -195,6 +199,9 @@ class FontSize # @!attribute [rw] detected_barcodes # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedBarcode>] # A list of detected barcodes. + # @!attribute [rw] image_quality_scores + # @return [::Google::Cloud::DocumentAI::V1::Document::Page::ImageQualityScores] + # Image Quality Scores. # @!attribute [rw] provenance # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] # The history of this page. @@ -265,7 +272,7 @@ class Matrix # @return [::Float] # Confidence of the current {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout} within context of the object this # layout is for. e.g. confidence can be for a single token, a table, - # a visual element, etc. depending on context. Range [0, 1]. + # a visual element, etc. depending on context. Range `[0, 1]`. # @!attribute [rw] bounding_poly # @return [::Google::Cloud::DocumentAI::V1::BoundingPoly] # The bounding polygon for the {::Google::Cloud::DocumentAI::V1::Document::Page::Layout Layout}. @@ -357,7 +364,7 @@ class Line # A list of detected languages together with confidence. # @!attribute [rw] provenance # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] - # The history of this annotation. + # The history of this annotation. class Token include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +435,9 @@ class VisualElement # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1::Document::Provenance] + # The history of this table. class Table include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -514,16 +524,50 @@ class DetectedBarcode # Detected language for a structural component. # @!attribute [rw] language_code # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # The BCP-47 language code, such as `en-US` or `sr-Latn`. For more # information, see # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. # @!attribute [rw] confidence # @return [::Float] - # Confidence of detected language. Range [0, 1]. + # Confidence of detected language. Range `[0, 1]`. class DetectedLanguage include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Image Quality Scores for the page image + # @!attribute [rw] quality_score + # @return [::Float] + # The overall quality score. Range `[0, 1]` where 1 is perfect quality. + # @!attribute [rw] detected_defects + # @return [::Array<::Google::Cloud::DocumentAI::V1::Document::Page::ImageQualityScores::DetectedDefect>] + # A list of detected defects. + class ImageQualityScores + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Image Quality Defects + # @!attribute [rw] type + # @return [::String] + # Name of the defect type. Supported values are: + # + # - `quality/defect_blurry` + # - `quality/defect_noisy` + # - `quality/defect_dark` + # - `quality/defect_faint` + # - `quality/defect_text_too_small` + # - `quality/defect_document_cutoff` + # - `quality/defect_text_cutoff` + # - `quality/defect_glare` + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected defect. Range `[0, 1]` where 1 indicates + # strong confidence of that the defect exists. + class DetectedDefect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end end # An entity that could be a phrase in the text or a property that belongs to @@ -538,14 +582,13 @@ class DetectedLanguage # Required. Entity type from a schema e.g. `Address`. # @!attribute [rw] mention_text # @return [::String] - # Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity - # is not present in the document, this field will be empty. + # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. # @!attribute [rw] mention_id # @return [::String] # Optional. Deprecated. Use `id` field instead. # @!attribute [rw] confidence # @return [::Float] - # Optional. Confidence of detected Schema entity. Range [0, 1]. + # Optional. Confidence of detected Schema entity. Range `[0, 1]`. # @!attribute [rw] page_anchor # @return [::Google::Cloud::DocumentAI::V1::Document::PageAnchor] # Optional. Represents the provenance of this entity wrt. the location on the @@ -610,6 +653,7 @@ class Entity # or int normalized text by default. # # Below are sample formats mapped to structured values. + # # - Money/Currency type (`money_value`) is in the ISO 4217 text format. # - Date type (`date_value`) is in the ISO 8601 text format. # - Datetime type (`datetime_value`) is in the ISO 8601 text format. @@ -691,7 +735,7 @@ class PageAnchor # Optional. Identifies the bounding polygon of a layout element on the page. # @!attribute [rw] confidence # @return [::Float] - # Optional. Confidence of detected page element, if applicable. Range [0, 1]. + # Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. class PageRef include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb index bf0103e5bef9..c039c814aa82 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_io.rb @@ -28,7 +28,7 @@ module V1 # @!attribute [rw] mime_type # @return [::String] # An IANA MIME type (RFC6838) indicating the nature and format of the - # [content]. + # {::Google::Cloud::DocumentAI::V1::RawDocument#content content}. class RawDocument include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -67,7 +67,7 @@ class GcsPrefix # The common config to specify a set of documents used as input. # @!attribute [rw] gcs_prefix # @return [::Google::Cloud::DocumentAI::V1::GcsPrefix] - # The set of documents that match the specified Cloud Storage [gcs_prefix]. + # The set of documents that match the specified Cloud Storage `gcs_prefix`. # @!attribute [rw] gcs_documents # @return [::Google::Cloud::DocumentAI::V1::GcsDocuments] # The set of documents individually specified on Cloud Storage. @@ -89,6 +89,11 @@ class DocumentOutputConfig # @!attribute [rw] gcs_uri # @return [::String] # The Cloud Storage uri (a directory) of the output. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in the output documents. + # Only supports top level document and pages field so it must be in the + # form of `{document_field_name}` or `pages.{page_field_name}`. class GcsOutputConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb index bc0f050db208..55959f98e2b6 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_processor_service.rb @@ -43,6 +43,8 @@ module V1 # @!attribute [rw] field_mask # @return [::Google::Protobuf::FieldMask] # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. class ProcessRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb index 94f054d971b1..bb3a01f39f71 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/document_schema.rb @@ -56,15 +56,16 @@ class DocumentSchema # Name of the type. It must be unique within the schema file and # cannot be a 'Common Type'. Besides that we use the following naming # conventions: - # - *use snake_casing* + # + # - *use `snake_casing`* # - name matching is case-insensitive # - Maximum 64 characters. # - Must start with a letter. # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward # compatibility internal infrastructure and tooling can handle any ascii # character) - # - The '/' is sometimes used to denote a property of a type. For example - # line_item/amount. This convention is deprecated, but will still be + # - The `/` is sometimes used to denote a property of a type. For example + # `line_item/amount`. This convention is deprecated, but will still be # honored for backward compatibility. # @!attribute [rw] base_types # @return [::Array<::String>] diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb index 5995bb6d743b..e9b78df2f8d0 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor.rb @@ -34,6 +34,9 @@ module V1 # @!attribute [rw] display_name # @return [::String] # The display name of the processor version. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1::DocumentSchema] + # The schema of the processor version. Describes the output. # @!attribute [rw] state # @return [::Google::Cloud::DocumentAI::V1::ProcessorVersion::State] # The state of the processor version. @@ -104,7 +107,7 @@ module State # Format: `projects/{project}/locations/{location}/processors/{processor}` # @!attribute [rw] type # @return [::String] - # The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc. + # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. # To get a list of processors types, see # {::Google::Cloud::DocumentAI::V1::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. # @!attribute [rw] display_name @@ -143,14 +146,14 @@ module State # The processor is disabled. DISABLED = 2 - # The processor is being enabled, will become ENABLED if successful. + # The processor is being enabled, will become `ENABLED` if successful. ENABLING = 3 - # The processor is being disabled, will become DISABLED if successful. + # The processor is being disabled, will become `DISABLED` if successful. DISABLING = 4 - # The processor is being created, will become either ENABLED (for - # successful creation) or FAILED (for failed ones). + # The processor is being created, will become either `ENABLED` (for + # successful creation) or `FAILED` (for failed ones). # Once a processor is in this state, it can then be used for document # processing, but the feature dependencies of the processor might not be # fully created yet. diff --git a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb index 536421a0c5d9..62a5fa544185 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/cloud/documentai/v1/processor_type.rb @@ -26,10 +26,10 @@ module V1 # @!attribute [rw] name # @return [::String] # The resource name of the processor type. - # Format: projects/\\{project}/processorTypes/\\{processor_type} + # Format: `projects/{project}/processorTypes/{processor_type}` # @!attribute [rw] type # @return [::String] - # The type of the processor, e.g., "invoice_parsing". + # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. # @!attribute [rw] category # @return [::String] # The processor category, used by UI to group processor types. From fa1de3aa1e933c5ccc099e4eb09a2ad855ecd5d4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:41:53 +0530 Subject: [PATCH 038/112] docs(identity-access_context_manager): cleanup docs --- .../.repo-metadata.json | 2 +- .../google/identity/access_context_manager.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/google-identity-access_context_manager/.repo-metadata.json b/google-identity-access_context_manager/.repo-metadata.json index 7afc64088f4f..d34858009197 100644 --- a/google-identity-access_context_manager/.repo-metadata.json +++ b/google-identity-access_context_manager/.repo-metadata.json @@ -13,5 +13,5 @@ "requires_billing": true, "ruby-cloud-description": "Access Context Manager allows enterprises to configure access levels which map to a policy defined on request attributes.", "ruby-cloud-product-url": "https://cloud.google.com/access-context-manager/", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } diff --git a/google-identity-access_context_manager/lib/google/identity/access_context_manager.rb b/google-identity-access_context_manager/lib/google/identity/access_context_manager.rb index 1e92cfc760bb..21b76aedc70d 100644 --- a/google-identity-access_context_manager/lib/google/identity/access_context_manager.rb +++ b/google-identity-access_context_manager/lib/google/identity/access_context_manager.rb @@ -40,15 +40,15 @@ module AccessContextManager # # ## About AccessContextManager # - # API for setting [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] and [Service - # Perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] - # for Google Cloud Projects. Each organization has one [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] containing the - # [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] - # and [Service Perimeters] + # API for setting [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] and [service + # perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] + # for Google Cloud projects. Each organization has one [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the + # [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] + # and [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. This - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] is + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is # applicable to all resources in the organization. # AccessPolicies # From 1a4bd37a68605e357161e85519efcb759afce338 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Wed, 9 Nov 2022 11:42:12 +0530 Subject: [PATCH 039/112] chore(dataflow-admin): create bucket if not exists for test (#19370) --- google-cloud-datastore-admin-v1/samples/Gemfile | 1 + .../samples/acceptance/helper.rb | 8 ++++++++ .../samples/acceptance/snippets_test.rb | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/google-cloud-datastore-admin-v1/samples/Gemfile b/google-cloud-datastore-admin-v1/samples/Gemfile index fc9c55e4aa2f..477c041fd9c4 100644 --- a/google-cloud-datastore-admin-v1/samples/Gemfile +++ b/google-cloud-datastore-admin-v1/samples/Gemfile @@ -30,5 +30,6 @@ group :test do gem "google-style", "~> 1.25.1" gem "minitest", "~> 5.14" gem "minitest-focus", "~> 1.1" + gem "minitest-hooks", "~> 1.5" gem "rake" end diff --git a/google-cloud-datastore-admin-v1/samples/acceptance/helper.rb b/google-cloud-datastore-admin-v1/samples/acceptance/helper.rb index 95937fc4bed9..c17703d4be4c 100644 --- a/google-cloud-datastore-admin-v1/samples/acceptance/helper.rb +++ b/google-cloud-datastore-admin-v1/samples/acceptance/helper.rb @@ -17,11 +17,19 @@ require "securerandom" require "google/cloud/datastore/admin/v1" +require "google/cloud/storage" + def storage_bucket_name ENV["GOOGLE_CLOUD_STORAGE_BUCKET"] || "ruby-samples-test" end +def create_bucket + storage = Google::Cloud::Storage.new + bucket = storage.bucket storage_bucket_name + storage.create_bucket storage_bucket_name if bucket.nil? +end + def random_storage_file_prefix "datastore-admin-v1-#{SecureRandom.hex 4}" end diff --git a/google-cloud-datastore-admin-v1/samples/acceptance/snippets_test.rb b/google-cloud-datastore-admin-v1/samples/acceptance/snippets_test.rb index 2d13dec31670..3b0db7224075 100644 --- a/google-cloud-datastore-admin-v1/samples/acceptance/snippets_test.rb +++ b/google-cloud-datastore-admin-v1/samples/acceptance/snippets_test.rb @@ -14,12 +14,17 @@ require_relative "helper" require_relative "../snippets" +require "minitest/hooks" describe "Firestore in Datastore mode Admin V1 samples" do let(:project_id) { ENV["GOOGLE_CLOUD_PROJECT"] || raise("missing GOOGLE_CLOUD_PROJECT") } let(:storage_file_prefix) { random_storage_file_prefix } let(:output_url_prefix) { storage_url prefix: storage_file_prefix } + before :all do + create_bucket + end + it "client_create" do client = client_create assert_kind_of Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client, client From ed3e98c45d5ee1f4780b07a12af6de0d6ef85c92 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:44:58 +0530 Subject: [PATCH 040/112] feat(access_context_manager): support IAM policies and permissions --- .../.owlbot-manifest.json | 6 + .../gapic_metadata.json | 15 + ...identity-access_context_manager-v1.gemspec | 1 + .../v1/access_context_manager.rb | 16 +- .../v1/access_context_manager/client.rb | 551 ++++++++++++++---- .../v1/access_context_manager_pb.rb | 2 + .../v1/access_context_manager_services_pb.rb | 240 ++++---- .../v1/access_policy_pb.rb | 1 + .../v1/service_perimeter_pb.rb | 21 +- .../proto_docs/google/iam/v1/iam_policy.rb | 87 +++ .../proto_docs/google/iam/v1/options.rb | 50 ++ .../proto_docs/google/iam/v1/policy.rb | 418 +++++++++++++ .../v1/access_context_manager.rb | 2 +- .../accesscontextmanager/v1/access_policy.rb | 16 + .../v1/service_perimeter.rb | 136 +++-- .../access_context_manager/get_iam_policy.rb | 39 ++ .../access_context_manager/set_iam_policy.rb | 39 ++ .../test_iam_permissions.rb | 39 ++ ...ogle.identity.accesscontextmanager.v1.json | 120 ++++ .../v1/access_context_manager_test.rb | 194 +++++- 20 files changed, 1679 insertions(+), 314 deletions(-) create mode 100644 google-identity-access_context_manager-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 google-identity-access_context_manager-v1/proto_docs/google/iam/v1/options.rb create mode 100644 google-identity-access_context_manager-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 google-identity-access_context_manager-v1/snippets/access_context_manager/get_iam_policy.rb create mode 100644 google-identity-access_context_manager-v1/snippets/access_context_manager/set_iam_policy.rb create mode 100644 google-identity-access_context_manager-v1/snippets/access_context_manager/test_iam_permissions.rb diff --git a/google-identity-access_context_manager-v1/.owlbot-manifest.json b/google-identity-access_context_manager-v1/.owlbot-manifest.json index c1bc12152ee8..14b045f9bc8b 100644 --- a/google-identity-access_context_manager-v1/.owlbot-manifest.json +++ b/google-identity-access_context_manager-v1/.owlbot-manifest.json @@ -30,6 +30,9 @@ "proto_docs/README.md", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/resource.rb", + "proto_docs/google/iam/v1/iam_policy.rb", + "proto_docs/google/iam/v1/options.rb", + "proto_docs/google/iam/v1/policy.rb", "proto_docs/google/identity/accesscontextmanager/type/device_resources.rb", "proto_docs/google/identity/accesscontextmanager/v1/access_context_manager.rb", "proto_docs/google/identity/accesscontextmanager/v1/access_level.rb", @@ -57,6 +60,7 @@ "snippets/access_context_manager/get_access_level.rb", "snippets/access_context_manager/get_access_policy.rb", "snippets/access_context_manager/get_gcp_user_access_binding.rb", + "snippets/access_context_manager/get_iam_policy.rb", "snippets/access_context_manager/get_service_perimeter.rb", "snippets/access_context_manager/list_access_levels.rb", "snippets/access_context_manager/list_access_policies.rb", @@ -64,6 +68,8 @@ "snippets/access_context_manager/list_service_perimeters.rb", "snippets/access_context_manager/replace_access_levels.rb", "snippets/access_context_manager/replace_service_perimeters.rb", + "snippets/access_context_manager/set_iam_policy.rb", + "snippets/access_context_manager/test_iam_permissions.rb", "snippets/access_context_manager/update_access_level.rb", "snippets/access_context_manager/update_access_policy.rb", "snippets/access_context_manager/update_gcp_user_access_binding.rb", diff --git a/google-identity-access_context_manager-v1/gapic_metadata.json b/google-identity-access_context_manager-v1/gapic_metadata.json index abb925902f10..a47b974d0dbf 100644 --- a/google-identity-access_context_manager-v1/gapic_metadata.json +++ b/google-identity-access_context_manager-v1/gapic_metadata.json @@ -124,6 +124,21 @@ "methods": [ "delete_gcp_user_access_binding" ] + }, + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] } } } diff --git a/google-identity-access_context_manager-v1/google-identity-access_context_manager-v1.gemspec b/google-identity-access_context_manager-v1/google-identity-access_context_manager-v1.gemspec index e323b91bb046..b75cb84812b6 100644 --- a/google-identity-access_context_manager-v1/google-identity-access_context_manager-v1.gemspec +++ b/google-identity-access_context_manager-v1/google-identity-access_context_manager-v1.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.1" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager.rb b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager.rb index 9932eb0e28c2..4d5acd418a4f 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager.rb @@ -32,15 +32,15 @@ module Identity module AccessContextManager module V1 ## - # API for setting [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] and [Service - # Perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] - # for Google Cloud Projects. Each organization has one [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] containing the - # [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] - # and [Service Perimeters] + # API for setting [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] and [service + # perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] + # for Google Cloud projects. Each organization has one [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the + # [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] + # and [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. This - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] is + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is # applicable to all resources in the organization. # AccessPolicies # diff --git a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/client.rb b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/client.rb index 920bcef611c9..7bc54a4ebb25 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/client.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/access_context_manager/client.rb @@ -27,15 +27,15 @@ module AccessContextManager ## # Client for the AccessContextManager service. # - # API for setting [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] and [Service - # Perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] - # for Google Cloud Projects. Each organization has one [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] containing the - # [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] - # and [Service Perimeters] + # API for setting [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] and [service + # perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] + # for Google Cloud projects. Each organization has one [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the + # [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] + # and [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. This - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] is + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is # applicable to all resources in the organization. # AccessPolicies # @@ -170,9 +170,9 @@ def initialize # Service calls ## - # List all [AccessPolicies] - # [google.identity.accesscontextmanager.v1.AccessPolicy] under a - # container. + # Lists all [access policies] + # [google.identity.accesscontextmanager.v1.AccessPolicy] in an + # organization. # # @overload list_access_policies(request, options = nil) # Pass arguments to `list_access_policies` via a request object, either of type @@ -265,8 +265,8 @@ def list_access_policies request, options = nil end ## - # Get an [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] by name. + # Returns an [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. # # @overload get_access_policy(request, options = nil) # Pass arguments to `get_access_policy` via a request object, either of type @@ -353,10 +353,10 @@ def get_access_policy request, options = nil end ## - # Create an `AccessPolicy`. Fails if this organization already has a - # `AccessPolicy`. The longrunning Operation will have a successful status - # once the `AccessPolicy` has propagated to long-lasting storage. - # Syntactic and basic semantic errors will be returned in `metadata` as a + # Creates an access policy. This method fails if the organization already has + # an access policy. The long-running operation has a successful status + # after the access policy propagates to long-lasting storage. + # Syntactic and basic semantic errors are returned in `metadata` as a # BadRequest proto. # # @overload create_access_policy(request, options = nil) @@ -369,7 +369,7 @@ def get_access_policy request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload create_access_policy(name: nil, parent: nil, title: nil, create_time: nil, update_time: nil, etag: nil) + # @overload create_access_policy(name: nil, parent: nil, title: nil, scopes: nil, create_time: nil, update_time: nil, etag: nil) # Pass arguments to `create_access_policy` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -383,6 +383,21 @@ def get_access_policy request, options = nil # `organizations/{organization_id}` # @param title [::String] # Required. Human readable title. Does not affect behavior. + # @param scopes [::Array<::String>] + # The scopes of a policy define which resources an ACM policy can restrict, + # and where ACM resources can be referenced. + # For example, a policy with scopes=["folders/123"] has the following + # behavior: + # - vpcsc perimeters can only restrict projects within folders/123 + # - access levels can only be referenced by resources within folders/123. + # If empty, there are no limitations on which resources can be restricted by + # an ACM policy, and there are no limitations on where ACM resources can be + # referenced. + # Only one policy can include a given scope (attempting to create a second + # policy which includes "folders/123" will result in an error). + # Currently, scopes cannot be modified after a policy is created. + # Currently, policies can only have a single scope. + # Format: list of `folders/{folder_number}` or `projects/{project_number}` # @param create_time [::Google::Protobuf::Timestamp, ::Hash] # Output only. Time the `AccessPolicy` was created in UTC. # @param update_time [::Google::Protobuf::Timestamp, ::Hash] @@ -458,13 +473,12 @@ def create_access_policy request, options = nil end ## - # Update an [AccessPolicy] + # Updates an [access policy] # [google.identity.accesscontextmanager.v1.AccessPolicy]. The - # longrunning Operation from this RPC will have a successful status once the - # changes to the [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] have propagated - # to long-lasting storage. Syntactic and basic semantic errors will be - # returned in `metadata` as a BadRequest proto. + # long-running operation from this RPC has a successful status after the + # changes to the [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + # to long-lasting storage. # # @overload update_access_policy(request, options = nil) # Pass arguments to `update_access_policy` via a request object, either of type @@ -559,11 +573,11 @@ def update_access_policy request, options = nil end ## - # Delete an [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] by resource - # name. The longrunning Operation will have a successful status once the - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] - # has been removed from long-lasting storage. + # Deletes an [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + # resource name. The long-running operation has a successful status after the + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + # is removed from long-lasting storage. # # @overload delete_access_policy(request, options = nil) # Pass arguments to `delete_access_policy` via a request object, either of type @@ -658,7 +672,7 @@ def delete_access_policy request, options = nil end ## - # List all [Access Levels] + # Lists all [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] for an access # policy. # @@ -768,8 +782,8 @@ def list_access_levels request, options = nil end ## - # Get an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] by resource + # Gets an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource # name. # # @overload get_access_level(request, options = nil) @@ -868,13 +882,13 @@ def get_access_level request, options = nil end ## - # Create an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel]. The longrunning - # operation from this RPC will have a successful status once the [Access - # Level] [google.identity.accesscontextmanager.v1.AccessLevel] has - # propagated to long-lasting storage. [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] containing - # errors will result in an error response for the first error encountered. + # Creates an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + # operation from this RPC has a successful status after the [access + # level] [google.identity.accesscontextmanager.v1.AccessLevel] + # propagates to long-lasting storage. If [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] contain + # errors, an error response is returned for the first error encountered. # # @overload create_access_level(request, options = nil) # Pass arguments to `create_access_level` via a request object, either of type @@ -976,14 +990,14 @@ def create_access_level request, options = nil end ## - # Update an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel]. The longrunning - # operation from this RPC will have a successful status once the changes to - # the [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] have propagated - # to long-lasting storage. [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] containing - # errors will result in an error response for the first error encountered. + # Updates an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + # operation from this RPC has a successful status after the changes to + # the [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] propagate + # to long-lasting storage. If [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] contain + # errors, an error response is returned for the first error encountered. # # @overload update_access_level(request, options = nil) # Pass arguments to `update_access_level` via a request object, either of type @@ -1082,10 +1096,10 @@ def update_access_level request, options = nil end ## - # Delete an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] by resource - # name. The longrunning operation from this RPC will have a successful status - # once the [Access Level] + # Deletes an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + # name. The long-running operation from this RPC has a successful status + # after the [access level] # [google.identity.accesscontextmanager.v1.AccessLevel] has been removed # from long-lasting storage. # @@ -1184,22 +1198,22 @@ def delete_access_level request, options = nil end ## - # Replace all existing [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] in an [Access - # Policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with - # the [Access Levels] + # Replaces all existing [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + # the [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] provided. This - # is done atomically. The longrunning operation from this RPC will have a - # successful status once all replacements have propagated to long-lasting - # storage. Replacements containing errors will result in an error response - # for the first error encountered. Replacement will be cancelled on error, - # existing [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] will not be - # affected. Operation.response field will contain - # ReplaceAccessLevelsResponse. Removing [Access Levels] + # is done atomically. The long-running operation from this RPC has a + # successful status after all replacements propagate to long-lasting + # storage. If the replacement contains errors, an error response is returned + # for the first error encountered. Upon error, the replacement is cancelled, + # and existing [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] are not + # affected. The Operation.response field contains + # ReplaceAccessLevelsResponse. Removing [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing - # [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] will result in + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an # error. # # @overload replace_access_levels(request, options = nil) @@ -1312,7 +1326,7 @@ def replace_access_levels request, options = nil end ## - # List all [Service Perimeters] + # Lists all [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] for an # access policy. # @@ -1418,9 +1432,9 @@ def list_service_perimeters request, options = nil end ## - # Get a [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] by resource - # name. + # Gets a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + # resource name. # # @overload get_service_perimeter(request, options = nil) # Pass arguments to `get_service_perimeter` via a request object, either of type @@ -1509,14 +1523,14 @@ def get_service_perimeter request, options = nil end ## - # Create a [Service Perimeter] + # Creates a [service perimeter] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The - # longrunning operation from this RPC will have a successful status once the - # [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] has - # propagated to long-lasting storage. [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] containing - # errors will result in an error response for the first error encountered. + # long-running operation from this RPC has a successful status after the + # [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] + # propagates to long-lasting storage. If a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + # errors, an error response is returned for the first error encountered. # # @overload create_service_perimeter(request, options = nil) # Pass arguments to `create_service_perimeter` via a request object, either of type @@ -1618,14 +1632,14 @@ def create_service_perimeter request, options = nil end ## - # Update a [Service Perimeter] + # Updates a [service perimeter] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The - # longrunning operation from this RPC will have a successful status once the - # changes to the [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] have - # propagated to long-lasting storage. [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] containing - # errors will result in an error response for the first error encountered. + # long-running operation from this RPC has a successful status after the + # [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] + # propagates to long-lasting storage. If a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + # errors, an error response is returned for the first error encountered. # # @overload update_service_perimeter(request, options = nil) # Pass arguments to `update_service_perimeter` via a request object, either of type @@ -1721,12 +1735,12 @@ def update_service_perimeter request, options = nil end ## - # Delete a [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] by resource - # name. The longrunning operation from this RPC will have a successful status - # once the [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] has been - # removed from long-lasting storage. + # Deletes a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + # resource name. The long-running operation from this RPC has a successful + # status after the [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + # long-lasting storage. # # @overload delete_service_perimeter(request, options = nil) # Pass arguments to `delete_service_perimeter` via a request object, either of type @@ -1823,18 +1837,18 @@ def delete_service_perimeter request, options = nil end ## - # Replace all existing [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an - # [Access Policy] [google.identity.accesscontextmanager.v1.AccessPolicy] - # with the [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. - # This is done atomically. The longrunning operation from this - # RPC will have a successful status once all replacements have propagated to - # long-lasting storage. Replacements containing errors will result in an - # error response for the first error encountered. Replacement will be - # cancelled on error, existing [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] will not be - # affected. Operation.response field will contain + # Replace all existing [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + # is done atomically. The long-running operation from this RPC has a + # successful status after all replacements propagate to long-lasting storage. + # Replacements containing errors result in an error response for the first + # error encountered. Upon an error, replacement are cancelled and existing + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + # affected. The Operation.response field contains # ReplaceServicePerimetersResponse. # # @overload replace_service_perimeters(request, options = nil) @@ -1947,21 +1961,21 @@ def replace_service_perimeters request, options = nil end ## - # Commit the dry-run spec for all the [Service Perimeters] + # Commits the dry-run specification for all the [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an - # {::Google::Identity::AccessContextManager::V1::AccessPolicy Access Policy}. - # A commit operation on a Service Perimeter involves copying its `spec` field - # to that Service Perimeter's `status` field. Only [Service Perimeters] + # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}. + # A commit operation on a service perimeter involves copying its `spec` field + # to the `status` field of the service perimeter. Only [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] with # `use_explicit_dry_run_spec` field set to true are affected by a commit - # operation. The longrunning operation from this RPC will have a successful - # status once the dry-run specs for all the [Service Perimeters] + # operation. The long-running operation from this RPC has a successful + # status after the dry-run specifications for all the [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] have been - # committed. If a commit fails, it will cause the longrunning operation to - # return an error response and the entire commit operation will be cancelled. - # When successful, Operation.response field will contain - # CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will - # be cleared after a successful commit operation. + # committed. If a commit fails, it causes the long-running operation to + # return an error response and the entire commit operation is cancelled. + # When successful, the Operation.response field contains + # CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + # cleared after a successful commit operation. # # @overload commit_service_perimeters(request, options = nil) # Pass arguments to `commit_service_perimeters` via a request object, either of type @@ -1988,7 +2002,7 @@ def replace_service_perimeters request, options = nil # Format: `accessPolicies/{policy_id}` # @param etag [::String] # Optional. The etag for the version of the [Access Policy] - # [google.identity.accesscontextmanager.v1alpha.AccessPolicy] that this + # [google.identity.accesscontextmanager.v1.AccessPolicy] that this # commit operation is to be performed on. If, at the time of commit, the # etag for the Access Policy stored in Access Context Manager is different # from the specified etag, then the commit operation will not be performed @@ -2261,7 +2275,7 @@ def get_gcp_user_access_binding request, options = nil # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the # client specifies a [name] # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], - # the server will ignore it. Fails if a resource already exists with the same + # the server ignores it. Fails if a resource already exists with the same # [group_key] # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. # Completion of this long-running operation does not necessarily signify that @@ -2563,6 +2577,294 @@ def delete_gcp_user_access_binding request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Sets the IAM policy for the specified Access Context Manager + # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}. + # This method replaces the existing IAM policy on the access policy. The IAM + # policy controls the set of users who can perform specific operations on the + # Access Context Manager [access + # policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/identity/access_context_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.set_iam_policy.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_context_manager_stub.call_rpc :set_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the IAM policy for the specified Access Context Manager + # {::Google::Identity::AccessContextManager::V1::AccessPolicy access policy}. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/identity/access_context_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_iam_policy.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_context_manager_stub.call_rpc :get_iam_policy, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns the IAM permissions that the caller has on the specified Access + # Context Manager resource. The resource can be an + # {::Google::Identity::AccessContextManager::V1::AccessPolicy AccessPolicy}, + # {::Google::Identity::AccessContextManager::V1::AccessLevel AccessLevel}, or + # [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + # ]. This method does not support other resources. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/identity/access_context_manager/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.test_iam_permissions.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Identity::AccessContextManager::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.resource + header_params["resource"] = request.resource + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @access_context_manager_stub.call_rpc :test_iam_permissions, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the AccessContextManager API. # @@ -2813,6 +3115,21 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :delete_gcp_user_access_binding + ## + # RPC-specific configuration for `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions # @private def initialize parent_rpcs = nil @@ -2862,6 +3179,12 @@ def initialize parent_rpcs = nil @update_gcp_user_access_binding = ::Gapic::Config::Method.new update_gcp_user_access_binding_config delete_gcp_user_access_binding_config = parent_rpcs.delete_gcp_user_access_binding if parent_rpcs.respond_to? :delete_gcp_user_access_binding @delete_gcp_user_access_binding = ::Gapic::Config::Method.new delete_gcp_user_access_binding_config + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config yield self if block_given? end diff --git a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_pb.rb b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_pb.rb index 27d7c293bbb6..d9e27fd7f9ef 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_pb.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_pb.rb @@ -7,6 +7,8 @@ require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/iam/v1/iam_policy_pb' +require 'google/iam/v1/policy_pb' require 'google/identity/accesscontextmanager/v1/access_level_pb' require 'google/identity/accesscontextmanager/v1/access_policy_pb' require 'google/identity/accesscontextmanager/v1/gcp_user_access_binding_pb' diff --git a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_services_pb.rb b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_services_pb.rb index 01835eb5b128..5e322fd0b5df 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_services_pb.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_context_manager_services_pb.rb @@ -24,15 +24,15 @@ module Identity module AccessContextManager module V1 module AccessContextManager - # API for setting [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] and [Service - # Perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] - # for Google Cloud Projects. Each organization has one [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] containing the - # [Access Levels] [google.identity.accesscontextmanager.v1.AccessLevel] - # and [Service Perimeters] + # API for setting [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] and [service + # perimeters] [google.identity.accesscontextmanager.v1.ServicePerimeter] + # for Google Cloud projects. Each organization has one [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] that contains the + # [access levels] [google.identity.accesscontextmanager.v1.AccessLevel] + # and [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. This - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] is + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] is # applicable to all resources in the organization. # AccessPolicies class Service @@ -43,145 +43,144 @@ class Service self.unmarshal_class_method = :decode self.service_name = 'google.identity.accesscontextmanager.v1.AccessContextManager' - # List all [AccessPolicies] - # [google.identity.accesscontextmanager.v1.AccessPolicy] under a - # container. + # Lists all [access policies] + # [google.identity.accesscontextmanager.v1.AccessPolicy] in an + # organization. rpc :ListAccessPolicies, ::Google::Identity::AccessContextManager::V1::ListAccessPoliciesRequest, ::Google::Identity::AccessContextManager::V1::ListAccessPoliciesResponse - # Get an [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] by name. + # Returns an [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the name. rpc :GetAccessPolicy, ::Google::Identity::AccessContextManager::V1::GetAccessPolicyRequest, ::Google::Identity::AccessContextManager::V1::AccessPolicy - # Create an `AccessPolicy`. Fails if this organization already has a - # `AccessPolicy`. The longrunning Operation will have a successful status - # once the `AccessPolicy` has propagated to long-lasting storage. - # Syntactic and basic semantic errors will be returned in `metadata` as a + # Creates an access policy. This method fails if the organization already has + # an access policy. The long-running operation has a successful status + # after the access policy propagates to long-lasting storage. + # Syntactic and basic semantic errors are returned in `metadata` as a # BadRequest proto. rpc :CreateAccessPolicy, ::Google::Identity::AccessContextManager::V1::AccessPolicy, ::Google::Longrunning::Operation - # Update an [AccessPolicy] + # Updates an [access policy] # [google.identity.accesscontextmanager.v1.AccessPolicy]. The - # longrunning Operation from this RPC will have a successful status once the - # changes to the [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] have propagated - # to long-lasting storage. Syntactic and basic semantic errors will be - # returned in `metadata` as a BadRequest proto. + # long-running operation from this RPC has a successful status after the + # changes to the [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] propagate + # to long-lasting storage. rpc :UpdateAccessPolicy, ::Google::Identity::AccessContextManager::V1::UpdateAccessPolicyRequest, ::Google::Longrunning::Operation - # Delete an [AccessPolicy] - # [google.identity.accesscontextmanager.v1.AccessPolicy] by resource - # name. The longrunning Operation will have a successful status once the - # [AccessPolicy] [google.identity.accesscontextmanager.v1.AccessPolicy] - # has been removed from long-lasting storage. + # Deletes an [access policy] + # [google.identity.accesscontextmanager.v1.AccessPolicy] based on the + # resource name. The long-running operation has a successful status after the + # [access policy] [google.identity.accesscontextmanager.v1.AccessPolicy] + # is removed from long-lasting storage. rpc :DeleteAccessPolicy, ::Google::Identity::AccessContextManager::V1::DeleteAccessPolicyRequest, ::Google::Longrunning::Operation - # List all [Access Levels] + # Lists all [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] for an access # policy. rpc :ListAccessLevels, ::Google::Identity::AccessContextManager::V1::ListAccessLevelsRequest, ::Google::Identity::AccessContextManager::V1::ListAccessLevelsResponse - # Get an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] by resource + # Gets an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource # name. rpc :GetAccessLevel, ::Google::Identity::AccessContextManager::V1::GetAccessLevelRequest, ::Google::Identity::AccessContextManager::V1::AccessLevel - # Create an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel]. The longrunning - # operation from this RPC will have a successful status once the [Access - # Level] [google.identity.accesscontextmanager.v1.AccessLevel] has - # propagated to long-lasting storage. [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] containing - # errors will result in an error response for the first error encountered. + # Creates an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + # operation from this RPC has a successful status after the [access + # level] [google.identity.accesscontextmanager.v1.AccessLevel] + # propagates to long-lasting storage. If [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] contain + # errors, an error response is returned for the first error encountered. rpc :CreateAccessLevel, ::Google::Identity::AccessContextManager::V1::CreateAccessLevelRequest, ::Google::Longrunning::Operation - # Update an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel]. The longrunning - # operation from this RPC will have a successful status once the changes to - # the [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] have propagated - # to long-lasting storage. [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] containing - # errors will result in an error response for the first error encountered. + # Updates an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel]. The long-running + # operation from this RPC has a successful status after the changes to + # the [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] propagate + # to long-lasting storage. If [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] contain + # errors, an error response is returned for the first error encountered. rpc :UpdateAccessLevel, ::Google::Identity::AccessContextManager::V1::UpdateAccessLevelRequest, ::Google::Longrunning::Operation - # Delete an [Access Level] - # [google.identity.accesscontextmanager.v1.AccessLevel] by resource - # name. The longrunning operation from this RPC will have a successful status - # once the [Access Level] + # Deletes an [access level] + # [google.identity.accesscontextmanager.v1.AccessLevel] based on the resource + # name. The long-running operation from this RPC has a successful status + # after the [access level] # [google.identity.accesscontextmanager.v1.AccessLevel] has been removed # from long-lasting storage. rpc :DeleteAccessLevel, ::Google::Identity::AccessContextManager::V1::DeleteAccessLevelRequest, ::Google::Longrunning::Operation - # Replace all existing [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] in an [Access - # Policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with - # the [Access Levels] + # Replaces all existing [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] in an [access + # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with + # the [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] provided. This - # is done atomically. The longrunning operation from this RPC will have a - # successful status once all replacements have propagated to long-lasting - # storage. Replacements containing errors will result in an error response - # for the first error encountered. Replacement will be cancelled on error, - # existing [Access Levels] - # [google.identity.accesscontextmanager.v1.AccessLevel] will not be - # affected. Operation.response field will contain - # ReplaceAccessLevelsResponse. Removing [Access Levels] + # is done atomically. The long-running operation from this RPC has a + # successful status after all replacements propagate to long-lasting + # storage. If the replacement contains errors, an error response is returned + # for the first error encountered. Upon error, the replacement is cancelled, + # and existing [access levels] + # [google.identity.accesscontextmanager.v1.AccessLevel] are not + # affected. The Operation.response field contains + # ReplaceAccessLevelsResponse. Removing [access levels] # [google.identity.accesscontextmanager.v1.AccessLevel] contained in existing - # [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] will result in + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] result in an # error. rpc :ReplaceAccessLevels, ::Google::Identity::AccessContextManager::V1::ReplaceAccessLevelsRequest, ::Google::Longrunning::Operation - # List all [Service Perimeters] + # Lists all [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] for an # access policy. rpc :ListServicePerimeters, ::Google::Identity::AccessContextManager::V1::ListServicePerimetersRequest, ::Google::Identity::AccessContextManager::V1::ListServicePerimetersResponse - # Get a [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] by resource - # name. + # Gets a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + # resource name. rpc :GetServicePerimeter, ::Google::Identity::AccessContextManager::V1::GetServicePerimeterRequest, ::Google::Identity::AccessContextManager::V1::ServicePerimeter - # Create a [Service Perimeter] + # Creates a [service perimeter] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The - # longrunning operation from this RPC will have a successful status once the - # [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] has - # propagated to long-lasting storage. [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] containing - # errors will result in an error response for the first error encountered. + # long-running operation from this RPC has a successful status after the + # [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] + # propagates to long-lasting storage. If a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + # errors, an error response is returned for the first error encountered. rpc :CreateServicePerimeter, ::Google::Identity::AccessContextManager::V1::CreateServicePerimeterRequest, ::Google::Longrunning::Operation - # Update a [Service Perimeter] + # Updates a [service perimeter] # [google.identity.accesscontextmanager.v1.ServicePerimeter]. The - # longrunning operation from this RPC will have a successful status once the - # changes to the [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] have - # propagated to long-lasting storage. [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] containing - # errors will result in an error response for the first error encountered. + # long-running operation from this RPC has a successful status after the + # [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] + # propagates to long-lasting storage. If a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] contains + # errors, an error response is returned for the first error encountered. rpc :UpdateServicePerimeter, ::Google::Identity::AccessContextManager::V1::UpdateServicePerimeterRequest, ::Google::Longrunning::Operation - # Delete a [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] by resource - # name. The longrunning operation from this RPC will have a successful status - # once the [Service Perimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] has been - # removed from long-lasting storage. + # Deletes a [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] based on the + # resource name. The long-running operation from this RPC has a successful + # status after the [service perimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] is removed from + # long-lasting storage. rpc :DeleteServicePerimeter, ::Google::Identity::AccessContextManager::V1::DeleteServicePerimeterRequest, ::Google::Longrunning::Operation - # Replace all existing [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an - # [Access Policy] [google.identity.accesscontextmanager.v1.AccessPolicy] - # with the [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. - # This is done atomically. The longrunning operation from this - # RPC will have a successful status once all replacements have propagated to - # long-lasting storage. Replacements containing errors will result in an - # error response for the first error encountered. Replacement will be - # cancelled on error, existing [Service Perimeters] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] will not be - # affected. Operation.response field will contain + # Replace all existing [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an [access + # policy] [google.identity.accesscontextmanager.v1.AccessPolicy] with the + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] provided. This + # is done atomically. The long-running operation from this RPC has a + # successful status after all replacements propagate to long-lasting storage. + # Replacements containing errors result in an error response for the first + # error encountered. Upon an error, replacement are cancelled and existing + # [service perimeters] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] are not + # affected. The Operation.response field contains # ReplaceServicePerimetersResponse. rpc :ReplaceServicePerimeters, ::Google::Identity::AccessContextManager::V1::ReplaceServicePerimetersRequest, ::Google::Longrunning::Operation - # Commit the dry-run spec for all the [Service Perimeters] + # Commits the dry-run specification for all the [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] in an - # [Access Policy][google.identity.accesscontextmanager.v1.AccessPolicy]. - # A commit operation on a Service Perimeter involves copying its `spec` field - # to that Service Perimeter's `status` field. Only [Service Perimeters] + # [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + # A commit operation on a service perimeter involves copying its `spec` field + # to the `status` field of the service perimeter. Only [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] with # `use_explicit_dry_run_spec` field set to true are affected by a commit - # operation. The longrunning operation from this RPC will have a successful - # status once the dry-run specs for all the [Service Perimeters] + # operation. The long-running operation from this RPC has a successful + # status after the dry-run specifications for all the [service perimeters] # [google.identity.accesscontextmanager.v1.ServicePerimeter] have been - # committed. If a commit fails, it will cause the longrunning operation to - # return an error response and the entire commit operation will be cancelled. - # When successful, Operation.response field will contain - # CommitServicePerimetersResponse. The `dry_run` and the `spec` fields will - # be cleared after a successful commit operation. + # committed. If a commit fails, it causes the long-running operation to + # return an error response and the entire commit operation is cancelled. + # When successful, the Operation.response field contains + # CommitServicePerimetersResponse. The `dry_run` and the `spec` fields are + # cleared after a successful commit operation. rpc :CommitServicePerimeters, ::Google::Identity::AccessContextManager::V1::CommitServicePerimetersRequest, ::Google::Longrunning::Operation # Lists all [GcpUserAccessBindings] # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding] for a @@ -195,7 +194,7 @@ class Service # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding]. If the # client specifies a [name] # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.name], - # the server will ignore it. Fails if a resource already exists with the same + # the server ignores it. Fails if a resource already exists with the same # [group_key] # [google.identity.accesscontextmanager.v1.GcpUserAccessBinding.group_key]. # Completion of this long-running operation does not necessarily signify that @@ -214,6 +213,23 @@ class Service # the binding deletion is deployed onto all affected users, which may take # more time. rpc :DeleteGcpUserAccessBinding, ::Google::Identity::AccessContextManager::V1::DeleteGcpUserAccessBindingRequest, ::Google::Longrunning::Operation + # Sets the IAM policy for the specified Access Context Manager + # [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + # This method replaces the existing IAM policy on the access policy. The IAM + # policy controls the set of users who can perform specific operations on the + # Access Context Manager [access + # policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the IAM policy for the specified Access Context Manager + # [access policy][google.identity.accesscontextmanager.v1.AccessPolicy]. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns the IAM permissions that the caller has on the specified Access + # Context Manager resource. The resource can be an + # [AccessPolicy][google.identity.accesscontextmanager.v1.AccessPolicy], + # [AccessLevel][google.identity.accesscontextmanager.v1.AccessLevel], or + # [ServicePerimeter][google.identity.accesscontextmanager.v1.ServicePerimeter + # ]. This method does not support other resources. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse end Stub = Service.rpc_stub_class diff --git a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_policy_pb.rb b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_policy_pb.rb index b9459107cb76..01b8ae0d3e5d 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_policy_pb.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/access_policy_pb.rb @@ -12,6 +12,7 @@ optional :name, :string, 1 optional :parent, :string, 2 optional :title, :string, 3 + repeated :scopes, :string, 7 optional :create_time, :message, 4, "google.protobuf.Timestamp" optional :update_time, :message, 5, "google.protobuf.Timestamp" optional :etag, :string, 6 diff --git a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/service_perimeter_pb.rb b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/service_perimeter_pb.rb index ad69c640f974..665c78b0515a 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/service_perimeter_pb.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/accesscontextmanager/v1/service_perimeter_pb.rb @@ -51,10 +51,6 @@ optional :resource, :string, 2 end end - add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo" do - repeated :resources, :string, 1 - repeated :operations, :message, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation" - end add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom" do repeated :sources, :message, 1, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource" repeated :identities, :string, 2 @@ -68,14 +64,19 @@ optional :ingress_from, :message, 1, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom" optional :ingress_to, :message, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo" end - add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy" do - optional :egress_from, :message, 1, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom" - optional :egress_to, :message, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo" - end add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom" do repeated :identities, :string, 1 optional :identity_type, :enum, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType" end + add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo" do + repeated :resources, :string, 1 + repeated :operations, :message, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation" + repeated :external_resources, :string, 3 + end + add_message "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy" do + optional :egress_from, :message, 1, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom" + optional :egress_to, :message, 2, "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo" + end add_enum "google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType" do value :IDENTITY_TYPE_UNSPECIFIED, 0 value :ANY_IDENTITY, 1 @@ -96,12 +97,12 @@ module V1 ServicePerimeterConfig::MethodSelector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.MethodSelector").msgclass ServicePerimeterConfig::ApiOperation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation").msgclass ServicePerimeterConfig::IngressSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressSource").msgclass - ServicePerimeterConfig::EgressTo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo").msgclass ServicePerimeterConfig::IngressFrom = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom").msgclass ServicePerimeterConfig::IngressTo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressTo").msgclass ServicePerimeterConfig::IngressPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy").msgclass - ServicePerimeterConfig::EgressPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy").msgclass ServicePerimeterConfig::EgressFrom = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom").msgclass + ServicePerimeterConfig::EgressTo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo").msgclass + ServicePerimeterConfig::EgressPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy").msgclass ServicePerimeterConfig::IdentityType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IdentityType").enummodule end end diff --git a/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/iam_policy.rb b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..447ba2367b16 --- /dev/null +++ b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/options.rb b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..79dae8815aca --- /dev/null +++ b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/policy.rb b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..ff493741d70b --- /dev/null +++ b/google-identity-access_context_manager-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,418 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # + # **YAML example:** + # + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Cloud Platform resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts jose@example.com from DATA_READ logging, and + # aliya@example.com from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of {::Google::Iam::V1::Binding#members Binding.members}. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Cloud Platform resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_context_manager.rb b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_context_manager.rb index 380d24b95507..26aa6087ad8d 100644 --- a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_context_manager.rb +++ b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_context_manager.rb @@ -395,7 +395,7 @@ class ReplaceServicePerimetersResponse # @!attribute [rw] etag # @return [::String] # Optional. The etag for the version of the [Access Policy] - # [google.identity.accesscontextmanager.v1alpha.AccessPolicy] that this + # [google.identity.accesscontextmanager.v1.AccessPolicy] that this # commit operation is to be performed on. If, at the time of commit, the # etag for the Access Policy stored in Access Context Manager is different # from the specified etag, then the commit operation will not be performed diff --git a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb index 5e9e618ab22a..eab0af3a3ffb 100644 --- a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb +++ b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb @@ -38,6 +38,22 @@ module V1 # @!attribute [rw] title # @return [::String] # Required. Human readable title. Does not affect behavior. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # The scopes of a policy define which resources an ACM policy can restrict, + # and where ACM resources can be referenced. + # For example, a policy with scopes=["folders/123"] has the following + # behavior: + # - vpcsc perimeters can only restrict projects within folders/123 + # - access levels can only be referenced by resources within folders/123. + # If empty, there are no limitations on which resources can be restricted by + # an ACM policy, and there are no limitations on where ACM resources can be + # referenced. + # Only one policy can include a given scope (attempting to create a second + # policy which includes "folders/123" will result in an error). + # Currently, scopes cannot be modified after a policy is created. + # Currently, policies can only have a single scope. + # Format: list of `folders/{folder_number}` or `projects/{project_number}` # @!attribute [rw] create_time # @return [::Google::Protobuf::Timestamp] # Output only. Time the `AccessPolicy` was created in UTC. diff --git a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb index c508fc7914db..5e544e3de333 100644 --- a/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb +++ b/google-identity-access_context_manager-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb @@ -254,44 +254,6 @@ class IngressSource extend ::Google::Protobuf::MessageExts::ClassMethods end - # Defines the conditions under which an [EgressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] - # matches a request. Conditions are based on information about the - # [ApiOperation] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] - # intended to be performed on the `resources` specified. Note that if the - # destination of the request is also protected by a [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have - # an [IngressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] - # which allows access in order for this request to succeed. The request must - # match `operations` AND `resources` fields in order to be allowed egress out - # of the perimeter. - # @!attribute [rw] resources - # @return [::Array<::String>] - # A list of resources, currently only projects in the form - # `projects/`, that are allowed to be accessed by sources - # defined in the corresponding [EgressFrom] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. - # A request matches if it contains a resource in this list. If `*` is - # specified for `resources`, then this [EgressTo] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] - # rule will authorize access to all resources outside the perimeter. - # @!attribute [rw] operations - # @return [::Array<::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::ApiOperation>] - # A list of [ApiOperations] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] - # allowed to be performed by the sources specified in the corresponding - # [EgressFrom] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. - # A request matches if it uses an operation/service in this list. - class EgressTo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - # Defines the conditions under which an [IngressPolicy] # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] # matches a request. Conditions are based on information about the source of @@ -387,6 +349,78 @@ class IngressPolicy extend ::Google::Protobuf::MessageExts::ClassMethods end + # Defines the conditions under which an [EgressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + # matches a request. Conditions based on information about the source of the + # request. Note that if the destination of the request is also protected by a + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + # an [IngressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + # which allows access in order for this request to succeed. + # @!attribute [rw] identities + # @return [::Array<::String>] + # A list of identities that are allowed access through this [EgressPolicy]. + # Should be in the format of email address. The email address should + # represent individual user or service account only. + # @!attribute [rw] identity_type + # @return [::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::IdentityType] + # Specifies the type of identities that are allowed access to outside the + # perimeter. If left unspecified, then members of `identities` field will + # be allowed access. + class EgressFrom + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the conditions under which an [EgressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + # matches a request. Conditions are based on information about the + # [ApiOperation] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + # intended to be performed on the `resources` specified. Note that if the + # destination of the request is also protected by a [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + # an [IngressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + # which allows access in order for this request to succeed. The request must + # match `operations` AND `resources` fields in order to be allowed egress out + # of the perimeter. + # @!attribute [rw] resources + # @return [::Array<::String>] + # A list of resources, currently only projects in the form + # `projects/`, that are allowed to be accessed by sources + # defined in the corresponding [EgressFrom] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + # A request matches if it contains a resource in this list. If `*` is + # specified for `resources`, then this [EgressTo] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + # rule will authorize access to all resources outside the perimeter. + # @!attribute [rw] operations + # @return [::Array<::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::ApiOperation>] + # A list of [ApiOperations] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + # allowed to be performed by the sources specified in the corresponding + # [EgressFrom] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + # A request matches if it uses an operation/service in this list. + # @!attribute [rw] external_resources + # @return [::Array<::String>] + # A list of external resources that are allowed to be accessed. Only AWS + # and Azure resources are supported. For Amazon S3, the supported format is + # s3://BUCKET_NAME. For Azure Storage, the supported format is + # azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + # if it contains an external resource in this list (Example: + # s3://bucket/path). Currently '*' is not allowed. + class EgressTo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Policy for egress from perimeter. # # [EgressPolicies] @@ -432,32 +466,6 @@ class EgressPolicy extend ::Google::Protobuf::MessageExts::ClassMethods end - # Defines the conditions under which an [EgressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] - # matches a request. Conditions based on information about the source of the - # request. Note that if the destination of the request is also protected by a - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have - # an [IngressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] - # which allows access in order for this request to succeed. - # @!attribute [rw] identities - # @return [::Array<::String>] - # A list of identities that are allowed access through this [EgressPolicy]. - # Should be in the format of email address. The email address should - # represent individual user or service account only. - # @!attribute [rw] identity_type - # @return [::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::IdentityType] - # Specifies the type of identities that are allowed access to outside the - # perimeter. If left unspecified, then members of `identities` field will - # be allowed access. - class EgressFrom - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - # Specifies the types of identities that are allowed access in either # [IngressFrom] # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/get_iam_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_iam_policy.rb new file mode 100644 index 000000000000..0beceb9742de --- /dev/null +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/get_iam_policy.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START accesscontextmanager_v1_generated_AccessContextManager_GetIamPolicy_sync] +require "google/identity/access_context_manager/v1" + +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_iam_policy +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END accesscontextmanager_v1_generated_AccessContextManager_GetIamPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/set_iam_policy.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/set_iam_policy.rb new file mode 100644 index 000000000000..5014986e92e9 --- /dev/null +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/set_iam_policy.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START accesscontextmanager_v1_generated_AccessContextManager_SetIamPolicy_sync] +require "google/identity/access_context_manager/v1" + +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#set_iam_policy +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END accesscontextmanager_v1_generated_AccessContextManager_SetIamPolicy_sync] diff --git a/google-identity-access_context_manager-v1/snippets/access_context_manager/test_iam_permissions.rb b/google-identity-access_context_manager-v1/snippets/access_context_manager/test_iam_permissions.rb new file mode 100644 index 000000000000..f9fbfe5a69ea --- /dev/null +++ b/google-identity-access_context_manager-v1/snippets/access_context_manager/test_iam_permissions.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START accesscontextmanager_v1_generated_AccessContextManager_TestIamPermissions_sync] +require "google/identity/access_context_manager/v1" + +## +# Example demonstrating basic usage of +# Google::Identity::AccessContextManager::V1::AccessContextManager::Client#test_iam_permissions +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END accesscontextmanager_v1_generated_AccessContextManager_TestIamPermissions_sync] diff --git a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json index b494dbe02886..37910d71dcf4 100644 --- a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json +++ b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json @@ -930,6 +930,126 @@ "type": "FULL" } ] + }, + { + "region_tag": "accesscontextmanager_v1_generated_AccessContextManager_SetIamPolicy_sync", + "title": "Snippet for set_iam_policy in AccessContextManager", + "description": "Basic snippet for set_iam_policy in AccessContextManager", + "file": "access_context_manager/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "AccessContextManager::Client", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager.SetIamPolicy", + "service": { + "short_name": "AccessContextManager", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "accesscontextmanager_v1_generated_AccessContextManager_GetIamPolicy_sync", + "title": "Snippet for get_iam_policy in AccessContextManager", + "description": "Basic snippet for get_iam_policy in AccessContextManager", + "file": "access_context_manager/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "AccessContextManager::Client", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager.GetIamPolicy", + "service": { + "short_name": "AccessContextManager", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "accesscontextmanager_v1_generated_AccessContextManager_TestIamPermissions_sync", + "title": "Snippet for test_iam_permissions in AccessContextManager", + "description": "Basic snippet for test_iam_permissions in AccessContextManager", + "file": "access_context_manager/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "AccessContextManager::Client", + "full_name": "::Google::Identity::AccessContextManager::V1::AccessContextManager::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager.TestIamPermissions", + "service": { + "short_name": "AccessContextManager", + "full_name": "google.identity.accesscontextmanager.v1.AccessContextManager" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb index 639ad21cf4dd..07552eb40d88 100644 --- a/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb +++ b/google-identity-access_context_manager-v1/test/google/identity/access_context_manager/v1/access_context_manager_test.rb @@ -183,6 +183,7 @@ def test_create_access_policy name = "hello world" parent = "hello world" title = "hello world" + scopes = ["hello world"] create_time = {} update_time = {} etag = "hello world" @@ -193,6 +194,7 @@ def test_create_access_policy assert_equal "hello world", request["name"] assert_equal "hello world", request["parent"] assert_equal "hello world", request["title"] + assert_equal ["hello world"], request["scopes"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["create_time"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["update_time"] assert_equal "hello world", request["etag"] @@ -206,35 +208,35 @@ def test_create_access_policy end # Use hash object - client.create_access_policy({ name: name, parent: parent, title: title, create_time: create_time, update_time: update_time, etag: etag }) do |response, operation| + client.create_access_policy({ name: name, parent: parent, title: title, scopes: scopes, create_time: create_time, update_time: update_time, etag: etag }) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use named arguments - client.create_access_policy name: name, parent: parent, title: title, create_time: create_time, update_time: update_time, etag: etag do |response, operation| + client.create_access_policy name: name, parent: parent, title: title, scopes: scopes, create_time: create_time, update_time: update_time, etag: etag do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object - client.create_access_policy ::Google::Identity::AccessContextManager::V1::AccessPolicy.new(name: name, parent: parent, title: title, create_time: create_time, update_time: update_time, etag: etag) do |response, operation| + client.create_access_policy ::Google::Identity::AccessContextManager::V1::AccessPolicy.new(name: name, parent: parent, title: title, scopes: scopes, create_time: create_time, update_time: update_time, etag: etag) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use hash object with options - client.create_access_policy({ name: name, parent: parent, title: title, create_time: create_time, update_time: update_time, etag: etag }, grpc_options) do |response, operation| + client.create_access_policy({ name: name, parent: parent, title: title, scopes: scopes, create_time: create_time, update_time: update_time, etag: etag }, grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation end # Use protobuf object with options - client.create_access_policy(::Google::Identity::AccessContextManager::V1::AccessPolicy.new(name: name, parent: parent, title: title, create_time: create_time, update_time: update_time, etag: etag), grpc_options) do |response, operation| + client.create_access_policy(::Google::Identity::AccessContextManager::V1::AccessPolicy.new(name: name, parent: parent, title: title, scopes: scopes, create_time: create_time, update_time: update_time, etag: etag), grpc_options) do |response, operation| assert_kind_of Gapic::Operation, response assert_equal grpc_response, response.grpc_op assert_equal grpc_operation, operation @@ -1530,6 +1532,188 @@ def test_delete_gcp_user_access_binding end end + def test_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Identity::AccessContextManager::V1::AccessContextManager::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure From 661af622427cdced258cd7e50ae61b05f34a9ddd Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 11:46:38 +0530 Subject: [PATCH 041/112] chore(asset): rearrange methods and update docs --- .../accesscontextmanager/v1/access_policy.rb | 16 +++ .../v1/service_perimeter.rb | 136 +++++++++--------- 2 files changed, 88 insertions(+), 64 deletions(-) diff --git a/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb b/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb index 8f76c696c0d8..06a119b7e216 100644 --- a/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb +++ b/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/access_policy.rb @@ -38,6 +38,22 @@ module V1 # @!attribute [rw] title # @return [::String] # Required. Human readable title. Does not affect behavior. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # The scopes of a policy define which resources an ACM policy can restrict, + # and where ACM resources can be referenced. + # For example, a policy with scopes=["folders/123"] has the following + # behavior: + # - vpcsc perimeters can only restrict projects within folders/123 + # - access levels can only be referenced by resources within folders/123. + # If empty, there are no limitations on which resources can be restricted by + # an ACM policy, and there are no limitations on where ACM resources can be + # referenced. + # Only one policy can include a given scope (attempting to create a second + # policy which includes "folders/123" will result in an error). + # Currently, scopes cannot be modified after a policy is created. + # Currently, policies can only have a single scope. + # Format: list of `folders/{folder_number}` or `projects/{project_number}` # @!attribute [rw] create_time # @return [::Google::Protobuf::Timestamp] # Output only. Time the `AccessPolicy` was created in UTC. diff --git a/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb b/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb index b0d54fead719..4ab08d1fd12e 100644 --- a/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb +++ b/google-cloud-asset-v1/proto_docs/google/identity/accesscontextmanager/v1/service_perimeter.rb @@ -254,44 +254,6 @@ class IngressSource extend ::Google::Protobuf::MessageExts::ClassMethods end - # Defines the conditions under which an [EgressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] - # matches a request. Conditions are based on information about the - # [ApiOperation] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] - # intended to be performed on the `resources` specified. Note that if the - # destination of the request is also protected by a [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have - # an [IngressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] - # which allows access in order for this request to succeed. The request must - # match `operations` AND `resources` fields in order to be allowed egress out - # of the perimeter. - # @!attribute [rw] resources - # @return [::Array<::String>] - # A list of resources, currently only projects in the form - # `projects/`, that are allowed to be accessed by sources - # defined in the corresponding [EgressFrom] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. - # A request matches if it contains a resource in this list. If `*` is - # specified for `resources`, then this [EgressTo] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] - # rule will authorize access to all resources outside the perimeter. - # @!attribute [rw] operations - # @return [::Array<::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::ApiOperation>] - # A list of [ApiOperations] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] - # allowed to be performed by the sources specified in the corresponding - # [EgressFrom] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. - # A request matches if it uses an operation/service in this list. - class EgressTo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - # Defines the conditions under which an [IngressPolicy] # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] # matches a request. Conditions are based on information about the source of @@ -387,6 +349,78 @@ class IngressPolicy extend ::Google::Protobuf::MessageExts::ClassMethods end + # Defines the conditions under which an [EgressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + # matches a request. Conditions based on information about the source of the + # request. Note that if the destination of the request is also protected by a + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + # an [IngressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + # which allows access in order for this request to succeed. + # @!attribute [rw] identities + # @return [::Array<::String>] + # A list of identities that are allowed access through this [EgressPolicy]. + # Should be in the format of email address. The email address should + # represent individual user or service account only. + # @!attribute [rw] identity_type + # @return [::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::IdentityType] + # Specifies the type of identities that are allowed access to outside the + # perimeter. If left unspecified, then members of `identities` field will + # be allowed access. + class EgressFrom + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines the conditions under which an [EgressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] + # matches a request. Conditions are based on information about the + # [ApiOperation] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + # intended to be performed on the `resources` specified. Note that if the + # destination of the request is also protected by a [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that + # [ServicePerimeter] + # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have + # an [IngressPolicy] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] + # which allows access in order for this request to succeed. The request must + # match `operations` AND `resources` fields in order to be allowed egress out + # of the perimeter. + # @!attribute [rw] resources + # @return [::Array<::String>] + # A list of resources, currently only projects in the form + # `projects/`, that are allowed to be accessed by sources + # defined in the corresponding [EgressFrom] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + # A request matches if it contains a resource in this list. If `*` is + # specified for `resources`, then this [EgressTo] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressTo] + # rule will authorize access to all resources outside the perimeter. + # @!attribute [rw] operations + # @return [::Array<::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::ApiOperation>] + # A list of [ApiOperations] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.ApiOperation] + # allowed to be performed by the sources specified in the corresponding + # [EgressFrom] + # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressFrom]. + # A request matches if it uses an operation/service in this list. + # @!attribute [rw] external_resources + # @return [::Array<::String>] + # A list of external resources that are allowed to be accessed. Only AWS + # and Azure resources are supported. For Amazon S3, the supported format is + # s3://BUCKET_NAME. For Azure Storage, the supported format is + # azure://myaccount.blob.core.windows.net/CONTAINER_NAME. A request matches + # if it contains an external resource in this list (Example: + # s3://bucket/path). Currently '*' is not allowed. + class EgressTo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Policy for egress from perimeter. # # [EgressPolicies] @@ -432,32 +466,6 @@ class EgressPolicy extend ::Google::Protobuf::MessageExts::ClassMethods end - # Defines the conditions under which an [EgressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.EgressPolicy] - # matches a request. Conditions based on information about the source of the - # request. Note that if the destination of the request is also protected by a - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter], then that - # [ServicePerimeter] - # [google.identity.accesscontextmanager.v1.ServicePerimeter] must have - # an [IngressPolicy] - # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressPolicy] - # which allows access in order for this request to succeed. - # @!attribute [rw] identities - # @return [::Array<::String>] - # A list of identities that are allowed access through this [EgressPolicy]. - # Should be in the format of email address. The email address should - # represent individual user or service account only. - # @!attribute [rw] identity_type - # @return [::Google::Identity::AccessContextManager::V1::ServicePerimeterConfig::IdentityType] - # Specifies the type of identities that are allowed access to outside the - # perimeter. If left unspecified, then members of `identities` field will - # be allowed access. - class EgressFrom - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - # Specifies the types of identities that are allowed access in either # [IngressFrom] # [google.identity.accesscontextmanager.v1.ServicePerimeterConfig.IngressFrom] From 7cd8e38f5b56be32f1e27b3f9a7e786c0163edb1 Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Tue, 8 Nov 2022 22:25:28 -0800 Subject: [PATCH 042/112] samples(stitcher): Add Video Stitcher samples and tests (#19367) --- .../acceptance/akamai_cdn_key_definition.rb | 11 ++++ .../acceptance/cloud_cdn_key_definition.rb | 12 ++++ .../samples/acceptance/create_cdn_key_test.rb | 41 ++++++++++++ .../samples/acceptance/delete_cdn_key_test.rb | 51 +++++++++++++++ .../samples/acceptance/get_cdn_key_test.rb | 45 +++++++++++++ .../samples/acceptance/helper.rb | 64 +++++++++++++++++++ .../samples/acceptance/list_cdn_keys_test.rb | 28 ++++++++ .../samples/acceptance/update_cdn_key_test.rb | 45 +++++++++++++ .../samples/create_cdn_key.rb | 63 ++++++++++++++++++ .../samples/delete_cdn_key.rb | 38 +++++++++++ .../samples/get_cdn_key.rb | 38 +++++++++++ .../samples/list_cdn_keys.rb | 39 +++++++++++ .../samples/update_cdn_key.rb | 63 ++++++++++++++++++ 13 files changed, 538 insertions(+) create mode 100644 google-cloud-video-stitcher/samples/acceptance/akamai_cdn_key_definition.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/cloud_cdn_key_definition.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/create_cdn_key_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/delete_cdn_key_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_cdn_key_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/list_cdn_keys_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/update_cdn_key_test.rb create mode 100644 google-cloud-video-stitcher/samples/create_cdn_key.rb create mode 100644 google-cloud-video-stitcher/samples/delete_cdn_key.rb create mode 100644 google-cloud-video-stitcher/samples/get_cdn_key.rb create mode 100644 google-cloud-video-stitcher/samples/list_cdn_keys.rb create mode 100644 google-cloud-video-stitcher/samples/update_cdn_key.rb diff --git a/google-cloud-video-stitcher/samples/acceptance/akamai_cdn_key_definition.rb b/google-cloud-video-stitcher/samples/acceptance/akamai_cdn_key_definition.rb new file mode 100644 index 000000000000..1b238670b893 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/akamai_cdn_key_definition.rb @@ -0,0 +1,11 @@ +require "google/cloud/video/stitcher" + +def akamai_cdn_def cdn_key_path, hostname, akamai_token_key + { + name: cdn_key_path, + hostname: hostname, + akamai_cdn_key: { + token_key: akamai_token_key + } + } +end diff --git a/google-cloud-video-stitcher/samples/acceptance/cloud_cdn_key_definition.rb b/google-cloud-video-stitcher/samples/acceptance/cloud_cdn_key_definition.rb new file mode 100644 index 000000000000..1bc381c1d217 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/cloud_cdn_key_definition.rb @@ -0,0 +1,12 @@ +require "google/cloud/video/stitcher" + +def cloud_cdn_def cdn_key_path, hostname, gcdn_keyname, gcdn_private_key + { + name: cdn_key_path, + hostname: hostname, + google_cdn_key: { + key_name: gcdn_keyname, + private_key: gcdn_private_key + } + } +end diff --git a/google-cloud-video-stitcher/samples/acceptance/create_cdn_key_test.rb b/google-cloud-video-stitcher/samples/acceptance/create_cdn_key_test.rb new file mode 100644 index 000000000000..7218fb86d176 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/create_cdn_key_test.rb @@ -0,0 +1,41 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#create_cdn_key", :stitcher_snippet do + it "creates a Cloud CDN key" do + sample = SampleLoader.load "create_cdn_key.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: gcdn_cdn_key_id, hostname: hostname, gcdn_keyname: gcdn_key_name, gcdn_private_key: gcdn_private_key, akamai_token_key: nil + end + @cloud_cdn_key_created = true + + cdn_key_id_regex = Regexp.escape gcdn_cdn_key_id + assert_match %r{CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end + + it "creates an Akamai CDN key" do + sample = SampleLoader.load "create_cdn_key.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: akamai_cdn_key_id, hostname: hostname, gcdn_keyname: nil, gcdn_private_key: nil, akamai_token_key: akamai_token_key + end + @akamai_cdn_key_created = true + + cdn_key_id_regex = Regexp.escape akamai_cdn_key_id + assert_match %r{CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/delete_cdn_key_test.rb b/google-cloud-video-stitcher/samples/acceptance/delete_cdn_key_test.rb new file mode 100644 index 000000000000..fb051f87ce7b --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/delete_cdn_key_test.rb @@ -0,0 +1,51 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#delete_cdn_key", :stitcher_snippet do + it "deletes the Akamai CDN key" do + sample = SampleLoader.load "delete_cdn_key.rb" + + refute_nil akamai_cdn_key + @akamai_cdn_key_created = true + + client.get_cdn_key name: akamai_cdn_key_name + + assert_output(/Deleted CDN key/) do + sample.run project_id: project_id, location: location_id, cdn_key_id: akamai_cdn_key_id + end + + assert_raises Google::Cloud::NotFoundError do + client.get_cdn_key name: akamai_cdn_key_name + end + end + + it "deletes the Cloud CDN key" do + sample = SampleLoader.load "delete_cdn_key.rb" + + refute_nil cloud_cdn_key + @cloud_cdn_key_created = true + + client.get_cdn_key name: gcdn_cdn_key_name + + assert_output(/Deleted CDN key/) do + sample.run project_id: project_id, location: location_id, cdn_key_id: gcdn_cdn_key_id + end + + assert_raises Google::Cloud::NotFoundError do + client.get_cdn_key name: gcdn_cdn_key_name + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_cdn_key_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_cdn_key_test.rb new file mode 100644 index 000000000000..bf5be75df7ec --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_cdn_key_test.rb @@ -0,0 +1,45 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_cdn_key", :stitcher_snippet do + it "gets the Akamai CDN key" do + sample = SampleLoader.load "get_cdn_key.rb" + + refute_nil akamai_cdn_key + @akamai_cdn_key_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: akamai_cdn_key_id + end + + cdn_key_id_regex = Regexp.escape akamai_cdn_key_id + assert_match %r{CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end + + it "gets the Cloud CDN key" do + sample = SampleLoader.load "get_cdn_key.rb" + + refute_nil cloud_cdn_key + @cloud_cdn_key_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: gcdn_cdn_key_id + end + + cdn_key_id_regex = Regexp.escape gcdn_cdn_key_id + assert_match %r{CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/helper.rb b/google-cloud-video-stitcher/samples/acceptance/helper.rb index d1ed81d97bdb..c05e0a0078bd 100644 --- a/google-cloud-video-stitcher/samples/acceptance/helper.rb +++ b/google-cloud-video-stitcher/samples/acceptance/helper.rb @@ -18,6 +18,8 @@ require "google/cloud/video/stitcher" +require_relative "akamai_cdn_key_definition" +require_relative "cloud_cdn_key_definition" require_relative "slate_definition" require_relative "../../../.toys/.lib/sample_loader" @@ -35,10 +37,28 @@ class StitcherSnippetSpec < Minitest::Spec let(:slate_uri) { "https://storage.googleapis.com/cloud-samples-data/media/ForBiggerEscapes.mp4" } let(:updated_slate_uri) { "https://storage.googleapis.com/cloud-samples-data/media/ForBiggerJoyrides.mp4" } + let(:gcdn_cdn_key_id) { "my-gcdn-test-#{(Time.now.to_f * 1000).to_i}" } + let(:gcdn_cdn_key_name) { "projects/#{project_id}/locations/#{location_id}/cdnKeys/#{gcdn_cdn_key_id}" } + let(:akamai_cdn_key_id) { "my-akamai-test-#{(Time.now.to_f * 1000).to_i}" } + let(:akamai_cdn_key_name) { "projects/#{project_id}/locations/#{location_id}/cdnKeys/#{akamai_cdn_key_id}" } + + let(:hostname) { "cdn.example.com" } + let(:updated_hostname) { "updated.example.com" } + let(:gcdn_key_name) { "gcdn-key" } + let(:updated_gcdn_key_name) { "updated-gcdn-key" } + let(:gcdn_private_key) { "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nLg==" } + let(:updated_gcdn_private_key) { "VGhpcyBpcyBhbiB1cGRhdGVkIHRlc3Qgc3RyaW5nLg==" } + let(:akamai_token_key) { "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nLg==" } + let(:updated_akamai_token_key) { "VGhpcyBpcyBhbiB1cGRhdGVkIHRlc3Qgc3RyaW5nLg==" } + attr_writer :slate_created + attr_writer :akamai_cdn_key_created + attr_writer :cloud_cdn_key_created before do @slate_created = false + @akamai_cdn_key_created = false + @cloud_cdn_key_created = false # Remove old slates in the test project if they exist response = client.list_slates parent: location_path response.each do |slate| @@ -52,6 +72,20 @@ class StitcherSnippetSpec < Minitest::Spec puts "Rescued: #{e.inspect}" end end + + # Remove old CDN keys in the test project if they exist + response = client.list_cdn_keys parent: location_path + response.each do |cdn_key| + tmp = cdn_key.name.to_s.split "-" + create_time = tmp.last.to_i + now = (Time.now.to_f * 1000).to_i # Milliseconds, preserves float value for precision + next if create_time >= (now - DELETION_THRESHOLD_TIME_HOURS_IN_MILLISECONDS) + begin + client.delete_cdn_key name: cdn_key.name.to_s + rescue Google::Cloud::NotFoundError => e + puts "Rescued: #{e.inspect}" + end + end end let :slate do @@ -62,6 +96,22 @@ class StitcherSnippetSpec < Minitest::Spec ) end + let :akamai_cdn_key do + client.create_cdn_key( + parent: location_path, + cdn_key_id: akamai_cdn_key_id, + cdn_key: akamai_cdn_def(akamai_cdn_key_name, hostname, akamai_token_key) + ) + end + + let :cloud_cdn_key do + client.create_cdn_key( + parent: location_path, + cdn_key_id: gcdn_cdn_key_id, + cdn_key: cloud_cdn_def(gcdn_cdn_key_name, hostname, gcdn_key_name, gcdn_private_key) + ) + end + after do if @slate_created begin @@ -70,6 +120,20 @@ class StitcherSnippetSpec < Minitest::Spec puts "Rescued: #{e.inspect}" end end + if @akamai_cdn_key_created + begin + client.delete_cdn_key name: akamai_cdn_key_name + rescue Google::Cloud::NotFoundError, Google::Cloud::FailedPreconditionError => e + puts "Rescued: #{e.inspect}" + end + end + if @cloud_cdn_key_created + begin + client.delete_cdn_key name: gcdn_cdn_key_name + rescue Google::Cloud::NotFoundError, Google::Cloud::FailedPreconditionError => e + puts "Rescued: #{e.inspect}" + end + end end register_spec_type(self) { |*descs| descs.include? :stitcher_snippet } diff --git a/google-cloud-video-stitcher/samples/acceptance/list_cdn_keys_test.rb b/google-cloud-video-stitcher/samples/acceptance/list_cdn_keys_test.rb new file mode 100644 index 000000000000..4f279c253a0e --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/list_cdn_keys_test.rb @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#list_cdn_keys", :stitcher_snippet do + it "lists the CDN keys" do + sample = SampleLoader.load "list_cdn_keys.rb" + + refute_nil cloud_cdn_key + @cloud_cdn_key_created = true + + assert_output(/CDN keys:\n#{gcdn_cdn_key_name}/) do + sample.run project_id: project_id, location: location_id + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/update_cdn_key_test.rb b/google-cloud-video-stitcher/samples/acceptance/update_cdn_key_test.rb new file mode 100644 index 000000000000..d80d286f50f4 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/update_cdn_key_test.rb @@ -0,0 +1,45 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#update_cdn_key", :stitcher_snippet do + it "updates the Akamai CDN key" do + sample = SampleLoader.load "update_cdn_key.rb" + + refute_nil akamai_cdn_key + @akamai_cdn_key_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: akamai_cdn_key_id, hostname: updated_hostname, gcdn_keyname: nil, gcdn_private_key: nil, akamai_token_key: akamai_token_key + end + + cdn_key_id_regex = Regexp.escape akamai_cdn_key_id + assert_match %r{Updated CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end + + it "updates the Cloud CDN key" do + sample = SampleLoader.load "update_cdn_key.rb" + + refute_nil cloud_cdn_key + @cloud_cdn_key_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, cdn_key_id: gcdn_cdn_key_id, hostname: updated_hostname, gcdn_keyname: updated_gcdn_key_name, gcdn_private_key: gcdn_private_key, akamai_token_key: nil + end + + cdn_key_id_regex = Regexp.escape gcdn_cdn_key_id + assert_match %r{Updated CDN key: projects/\S+/locations/#{location_id}/cdnKeys/#{cdn_key_id_regex}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/create_cdn_key.rb b/google-cloud-video-stitcher/samples/create_cdn_key.rb new file mode 100644 index 000000000000..f2417c7d276e --- /dev/null +++ b/google-cloud-video-stitcher/samples/create_cdn_key.rb @@ -0,0 +1,63 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_create_cdn_key] +require "google/cloud/video/stitcher" + +## +# Create a CDN key +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param cdn_key_id [String] The user-defined CDN key ID +# @param hostname [String] The hostname to which this CDN key applies +# @param gcdn_keyname [String] Applies to a Google Cloud CDN key. A base64-encoded string secret. +# @param gcdn_private_key [String] Applies to a Google Cloud CDN key. Public name of the key. +# @param akamai_token_key [String] Applies to an Akamai CDN key. A base64-encoded string token key. +# +def create_cdn_key project_id:, location:, cdn_key_id:, hostname:, gcdn_keyname:, gcdn_private_key:, akamai_token_key: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + # Build the path for the CDN key resource. + cdn_key_path = client.cdn_key_path project: project_id, location: location, cdn_key: cdn_key_id + + # Set the CDN key fields. + new_cdn_key = if akamai_token_key.nil? + { + name: cdn_key_path, + hostname: hostname, + google_cdn_key: { + key_name: gcdn_keyname, + private_key: gcdn_private_key + } + } + else + { + name: cdn_key_path, + hostname: hostname, + akamai_cdn_key: { + token_key: akamai_token_key + } + } + end + + response = client.create_cdn_key parent: parent, cdn_key: new_cdn_key, cdn_key_id: cdn_key_id + + # Print the CDN key name. + puts "CDN key: #{response.name}" +end +# [END videostitcher_create_cdn_key] diff --git a/google-cloud-video-stitcher/samples/delete_cdn_key.rb b/google-cloud-video-stitcher/samples/delete_cdn_key.rb new file mode 100644 index 000000000000..f868e839096c --- /dev/null +++ b/google-cloud-video-stitcher/samples/delete_cdn_key.rb @@ -0,0 +1,38 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_delete_cdn_key] +require "google/cloud/video/stitcher" + +## +# Delete a CDN key +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param cdn_key_id [String] Your CDN key name (e.g. "my-cdn-key") +# +def delete_cdn_key project_id:, location:, cdn_key_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the CDN key. + name = client.cdn_key_path project: project_id, location: location, cdn_key: cdn_key_id + + # Delete the CDN key. + client.delete_cdn_key name: name + + # Print a success message. + puts "Deleted CDN key" +end +# [END videostitcher_delete_cdn_key] diff --git a/google-cloud-video-stitcher/samples/get_cdn_key.rb b/google-cloud-video-stitcher/samples/get_cdn_key.rb new file mode 100644 index 000000000000..5b3640eeac14 --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_cdn_key.rb @@ -0,0 +1,38 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_cdn_key] +require "google/cloud/video/stitcher" + +## +# Get a CDN key +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param cdn_key_id [String] Your CDN key name (e.g. "my-cdn-key") +# +def get_cdn_key project_id:, location:, cdn_key_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the CDN key. + name = client.cdn_key_path project: project_id, location: location, cdn_key: cdn_key_id + + # Get the CDN key. + cdn_key = client.get_cdn_key name: name + + # Print the CDN key name. + puts "CDN key: #{cdn_key.name}" +end +# [END videostitcher_get_cdn_key] diff --git a/google-cloud-video-stitcher/samples/list_cdn_keys.rb b/google-cloud-video-stitcher/samples/list_cdn_keys.rb new file mode 100644 index 000000000000..a234939c0a58 --- /dev/null +++ b/google-cloud-video-stitcher/samples/list_cdn_keys.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_list_cdn_keys] +require "google/cloud/video/stitcher" + +## +# List CDN keys for a given location +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# +def list_cdn_keys project_id:, location: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + + response = client.list_cdn_keys parent: parent + + puts "CDN keys:" + # Print out all CDN keys. + response.each do |cdn_key| + puts cdn_key.name.to_s + end +end +# [END videostitcher_list_cdn_keys] diff --git a/google-cloud-video-stitcher/samples/update_cdn_key.rb b/google-cloud-video-stitcher/samples/update_cdn_key.rb new file mode 100644 index 000000000000..94838b97e95d --- /dev/null +++ b/google-cloud-video-stitcher/samples/update_cdn_key.rb @@ -0,0 +1,63 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_update_cdn_key] +require "google/cloud/video/stitcher" + +## +# Update a CDN key +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param cdn_key_id [String] The user-defined CDN key ID +# @param hostname [String] The hostname to which this CDN key applies +# @param gcdn_keyname [String] Applies to a Google Cloud CDN key. A base64-encoded string secret. +# @param gcdn_private_key [String] Applies to a Google Cloud CDN key. Public name of the key. +# @param akamai_token_key [String] Applies to an Akamai CDN key. A base64-encoded string token key. +# +def update_cdn_key project_id:, location:, cdn_key_id:, hostname:, gcdn_keyname:, gcdn_private_key:, akamai_token_key: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the path for the CDN key resource. + cdn_key_path = client.cdn_key_path project: project_id, location: location, cdn_key: cdn_key_id + + # Set the CDN key fields. + if !akamai_token_key.nil? + update_mask = { paths: ["hostname", "akamai_cdn_key"] } + new_cdn_key = { + name: cdn_key_path, + hostname: hostname, + akamai_cdn_key: { + token_key: akamai_token_key + } + } + elsif !gcdn_private_key.nil? + update_mask = { paths: ["hostname", "google_cdn_key"] } + new_cdn_key = { + name: cdn_key_path, + hostname: hostname, + google_cdn_key: { + key_name: gcdn_keyname, + private_key: gcdn_private_key + } + } + end + + response = client.update_cdn_key cdn_key: new_cdn_key, update_mask: update_mask + + # Print the CDN key name. + puts "Updated CDN key: #{response.name}" +end +# [END videostitcher_update_cdn_key] From 5d1e0514280e311887ee7a7b2990b5bd8c160758 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:38:31 -0800 Subject: [PATCH 043/112] feat(network_connectivity): Support for PolicyBasedRoutingService (#19361) --- .../.repo-metadata.json | 2 +- .../google-cloud-network_connectivity.gemspec | 4 +-- .../lib/google/cloud/network_connectivity.rb | 31 +++++++++++++++++++ .../cloud/network_connectivity/client_test.rb | 10 ++++++ 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/google-cloud-network_connectivity/.repo-metadata.json b/google-cloud-network_connectivity/.repo-metadata.json index eeaf5c668710..fe4500781277 100644 --- a/google-cloud-network_connectivity/.repo-metadata.json +++ b/google-cloud-network_connectivity/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Network Connectivity is Google's suite of products that provide enterprise connectivity from your on-premises network or from another cloud provider to your Virtual Private Cloud (VPC) network.", "ruby-cloud-env-prefix": "NETWORK_CONNECTIVITY", "ruby-cloud-product-url": "https://cloud.google.com/network-connectivity/docs", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } diff --git a/google-cloud-network_connectivity/google-cloud-network_connectivity.gemspec b/google-cloud-network_connectivity/google-cloud-network_connectivity.gemspec index a5d64a8f2484..3530b94d4e01 100644 --- a/google-cloud-network_connectivity/google-cloud-network_connectivity.gemspec +++ b/google-cloud-network_connectivity/google-cloud-network_connectivity.gemspec @@ -23,8 +23,8 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-network_connectivity-v1", ">= 0.0", "< 2.a" - gem.add_dependency "google-cloud-network_connectivity-v1alpha1", ">= 0.0", "< 2.a" + gem.add_dependency "google-cloud-network_connectivity-v1", ">= 0.4", "< 2.a" + gem.add_dependency "google-cloud-network_connectivity-v1alpha1", ">= 0.5", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-network_connectivity/lib/google/cloud/network_connectivity.rb b/google-cloud-network_connectivity/lib/google/cloud/network_connectivity.rb index 2dc0a558e8c5..3256bcd8f222 100644 --- a/google-cloud-network_connectivity/lib/google/cloud/network_connectivity.rb +++ b/google-cloud-network_connectivity/lib/google/cloud/network_connectivity.rb @@ -76,6 +76,37 @@ def self.hub_service version: :v1, &block package_module.const_get(:HubService).const_get(:Client).new(&block) end + ## + # Create a new client object for PolicyBasedRoutingService. + # + # By default, this returns an instance of + # [Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client](https://googleapis.dev/ruby/google-cloud-network_connectivity-v1/latest/Google/Cloud/NetworkConnectivity/V1/PolicyBasedRoutingService/Client.html) + # for version V1 of the API. + # However, you can specify specify a different API version by passing it in the + # `version` parameter. If the PolicyBasedRoutingService service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # ## About PolicyBasedRoutingService + # + # Policy-Based Routing allows GCP customers to specify flexibile routing + # policies for Layer 4 traffic traversing through the connected service. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v1`. + # @return [PolicyBasedRoutingService::Client] A client object for the specified version. + # + def self.policy_based_routing_service version: :v1, &block + require "google/cloud/network_connectivity/#{version.to_s.downcase}" + + package_name = Google::Cloud::NetworkConnectivity + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + package_module = Google::Cloud::NetworkConnectivity.const_get package_name + package_module.const_get(:PolicyBasedRoutingService).const_get(:Client).new(&block) + end + ## # Configure the google-cloud-network_connectivity library. # diff --git a/google-cloud-network_connectivity/test/google/cloud/network_connectivity/client_test.rb b/google-cloud-network_connectivity/test/google/cloud/network_connectivity/client_test.rb index 4d35d757fc7a..18ee37a84434 100644 --- a/google-cloud-network_connectivity/test/google/cloud/network_connectivity/client_test.rb +++ b/google-cloud-network_connectivity/test/google/cloud/network_connectivity/client_test.rb @@ -31,4 +31,14 @@ def test_hub_service assert_kind_of Google::Cloud::NetworkConnectivity::V1::HubService::Client, client end end + + def test_policy_based_routing_service + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::NetworkConnectivity.policy_based_routing_service do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Client, client + end + end end From 52a904999746963889d0b71863b10f5070b12e1a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:39:52 -0800 Subject: [PATCH 044/112] feat(run-client): Support for Executions, Jobs, and Tasks services (#19365) --- google-cloud-run-client/.repo-metadata.json | 2 +- google-cloud-run-client/AUTHENTICATION.md | 10 +-- google-cloud-run-client/Rakefile | 4 +- .../google-cloud-run-client.gemspec | 2 +- .../lib/google/cloud/run.rb | 90 +++++++++++++++++++ .../test/google/cloud/run/client_test.rb | 30 +++++++ 6 files changed, 129 insertions(+), 9 deletions(-) diff --git a/google-cloud-run-client/.repo-metadata.json b/google-cloud-run-client/.repo-metadata.json index 8d38255f19b8..20b9a605e088 100644 --- a/google-cloud-run-client/.repo-metadata.json +++ b/google-cloud-run-client/.repo-metadata.json @@ -13,5 +13,5 @@ "requires_billing": true, "ruby-cloud-description": "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests.", "ruby-cloud-product-url": "https://cloud.google.com/run", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } diff --git a/google-cloud-run-client/AUTHENTICATION.md b/google-cloud-run-client/AUTHENTICATION.md index f6839c3aae1d..fec24db82ceb 100644 --- a/google-cloud-run-client/AUTHENTICATION.md +++ b/google-cloud-run-client/AUTHENTICATION.md @@ -27,7 +27,7 @@ export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json ```ruby require "google/cloud/run" -client = Google::Cloud::Run.revisions +client = Google::Cloud::Run.executions ``` ## Credential Lookup @@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged. The environment variables that google-cloud-run-client checks for credentials are configured on the service Credentials class (such as -`::Google::Cloud::Run::V2::Revisions::Credentials`): +`::Google::Cloud::Run::V2::Executions::Credentials`): * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents @@ -75,7 +75,7 @@ require "google/cloud/run" ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json" -client = Google::Cloud::Run.revisions +client = Google::Cloud::Run.executions ``` ### Configuration @@ -86,7 +86,7 @@ it in an environment variable. Either on an individual client initialization: ```ruby require "google/cloud/run" -client = Google::Cloud::Run.revisions do |config| +client = Google::Cloud::Run.executions do |config| config.credentials = "path/to/keyfile.json" end ``` @@ -100,7 +100,7 @@ Google::Cloud::Run.configure do |config| config.credentials = "path/to/keyfile.json" end -client = Google::Cloud::Run.revisions +client = Google::Cloud::Run.executions ``` ### Cloud SDK diff --git a/google-cloud-run-client/Rakefile b/google-cloud-run-client/Rakefile index c967116dbd8a..7e13148ceb7b 100644 --- a/google-cloud-run-client/Rakefile +++ b/google-cloud-run-client/Rakefile @@ -85,8 +85,8 @@ task :acceptance, :project, :keyfile do |t, args| if project.nil? || keyfile.nil? fail "You must provide a project and keyfile. e.g. rake acceptance[test123, /path/to/keyfile.json] or GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" end - require "google/cloud/run/v2/revisions/credentials" - ::Google::Cloud::Run::V2::Revisions::Credentials.env_vars.each do |path| + require "google/cloud/run/v2/executions/credentials" + ::Google::Cloud::Run::V2::Executions::Credentials.env_vars.each do |path| ENV[path] = nil end ENV["GOOGLE_CLOUD_PROJECT"] = project diff --git a/google-cloud-run-client/google-cloud-run-client.gemspec b/google-cloud-run-client/google-cloud-run-client.gemspec index 85fbdeb8704b..d9604db48175 100644 --- a/google-cloud-run-client/google-cloud-run-client.gemspec +++ b/google-cloud-run-client/google-cloud-run-client.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |gem| gem.required_ruby_version = ">= 2.6" gem.add_dependency "google-cloud-core", "~> 1.6" - gem.add_dependency "google-cloud-run-v2", ">= 0.0", "< 2.a" + gem.add_dependency "google-cloud-run-v2", ">= 0.5", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-run-client/lib/google/cloud/run.rb b/google-cloud-run-client/lib/google/cloud/run.rb index 9cfb2ec54d17..9ef6a22e154f 100644 --- a/google-cloud-run-client/lib/google/cloud/run.rb +++ b/google-cloud-run-client/lib/google/cloud/run.rb @@ -44,6 +44,66 @@ module Google module Cloud module Run + ## + # Create a new client object for Executions. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Executions::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Executions/Client.html) + # for version V2 of the API. + # However, you can specify specify a different API version by passing it in the + # `version` parameter. If the Executions service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # ## About Executions + # + # Cloud Run Execution Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [Executions::Client] A client object for the specified version. + # + def self.executions version: :v2, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + package_module = Google::Cloud::Run.const_get package_name + package_module.const_get(:Executions).const_get(:Client).new(&block) + end + + ## + # Create a new client object for Jobs. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Jobs::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Jobs/Client.html) + # for version V2 of the API. + # However, you can specify specify a different API version by passing it in the + # `version` parameter. If the Jobs service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # ## About Jobs + # + # Cloud Run Job Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [Jobs::Client] A client object for the specified version. + # + def self.jobs version: :v2, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + package_module = Google::Cloud::Run.const_get package_name + package_module.const_get(:Jobs).const_get(:Client).new(&block) + end + ## # Create a new client object for Revisions. # @@ -104,6 +164,36 @@ def self.services version: :v2, &block package_module.const_get(:Services).const_get(:Client).new(&block) end + ## + # Create a new client object for Tasks. + # + # By default, this returns an instance of + # [Google::Cloud::Run::V2::Tasks::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Tasks/Client.html) + # for version V2 of the API. + # However, you can specify specify a different API version by passing it in the + # `version` parameter. If the Tasks service is + # supported by that API version, and the corresponding gem is available, the + # appropriate versioned client will be returned. + # + # ## About Tasks + # + # Cloud Run Task Control Plane API. + # + # @param version [::String, ::Symbol] The API version to connect to. Optional. + # Defaults to `:v2`. + # @return [Tasks::Client] A client object for the specified version. + # + def self.tasks version: :v2, &block + require "google/cloud/run/#{version.to_s.downcase}" + + package_name = Google::Cloud::Run + .constants + .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") } + .first + package_module = Google::Cloud::Run.const_get package_name + package_module.const_get(:Tasks).const_get(:Client).new(&block) + end + ## # Configure the google-cloud-run-client library. # diff --git a/google-cloud-run-client/test/google/cloud/run/client_test.rb b/google-cloud-run-client/test/google/cloud/run/client_test.rb index 8107094c3ff2..f379290d9423 100644 --- a/google-cloud-run-client/test/google/cloud/run/client_test.rb +++ b/google-cloud-run-client/test/google/cloud/run/client_test.rb @@ -22,6 +22,26 @@ require "gapic/grpc" class Google::Cloud::Run::ClientConstructionMinitest < Minitest::Test + def test_executions + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.executions do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Executions::Client, client + end + end + + def test_jobs + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.jobs do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Jobs::Client, client + end + end + def test_revisions Gapic::ServiceStub.stub :new, :stub do grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure @@ -41,4 +61,14 @@ def test_services assert_kind_of Google::Cloud::Run::V2::Services::Client, client end end + + def test_tasks + Gapic::ServiceStub.stub :new, :stub do + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + client = Google::Cloud::Run.tasks do |config| + config.credentials = grpc_channel + end + assert_kind_of Google::Cloud::Run::V2::Tasks::Client, client + end + end end From 8ebf4c0cda04ae3c15c1fe2aac4e3273e8ae663d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:41:30 -0800 Subject: [PATCH 045/112] docs(batch-v1): Fixed a few formatting strings (#19401) --- .../proto_docs/google/cloud/batch/v1/task.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb b/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb index 8714ad982e86..482585f7328b 100644 --- a/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb +++ b/google-cloud-batch-v1/proto_docs/google/cloud/batch/v1/task.rb @@ -168,12 +168,12 @@ class Runnable # @!attribute [rw] username # @return [::String] # Optional username for logging in to a docker registry. If username - # matches "projects/*/secrets/*/versions/*" then Batch will read the + # matches `projects/*/secrets/*/versions/*` then Batch will read the # username from the Secret Manager. # @!attribute [rw] password # @return [::String] # Optional password for logging in to a docker registry. If password - # matches "projects/*/secrets/*/versions/*" then Batch will read the + # matches `projects/*/secrets/*/versions/*` then Batch will read the # password from the Secret Manager; class Container include ::Google::Protobuf::MessageExts From 71d8834c27e531311e19884ef1262af314d67f49 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 20:42:25 -0800 Subject: [PATCH 046/112] feat(channel-v1): Added Offer#deal_code field (#19400) --- .../lib/google/cloud/channel/v1/offers_pb.rb | 1 + .../proto_docs/google/cloud/channel/v1/offers.rb | 3 +++ 2 files changed, 4 insertions(+) diff --git a/google-cloud-channel-v1/lib/google/cloud/channel/v1/offers_pb.rb b/google-cloud-channel-v1/lib/google/cloud/channel/v1/offers_pb.rb index 924305f67687..e479ce93d886 100644 --- a/google-cloud-channel-v1/lib/google/cloud/channel/v1/offers_pb.rb +++ b/google-cloud-channel-v1/lib/google/cloud/channel/v1/offers_pb.rb @@ -22,6 +22,7 @@ optional :start_time, :message, 7, "google.protobuf.Timestamp" optional :end_time, :message, 8, "google.protobuf.Timestamp" repeated :parameter_definitions, :message, 9, "google.cloud.channel.v1.ParameterDefinition" + optional :deal_code, :string, 12 end add_message "google.cloud.channel.v1.ParameterDefinition" do optional :name, :string, 1 diff --git a/google-cloud-channel-v1/proto_docs/google/cloud/channel/v1/offers.rb b/google-cloud-channel-v1/proto_docs/google/cloud/channel/v1/offers.rb index 8335f147f65c..d482a83c709f 100644 --- a/google-cloud-channel-v1/proto_docs/google/cloud/channel/v1/offers.rb +++ b/google-cloud-channel-v1/proto_docs/google/cloud/channel/v1/offers.rb @@ -52,6 +52,9 @@ module V1 # @!attribute [rw] parameter_definitions # @return [::Array<::Google::Cloud::Channel::V1::ParameterDefinition>] # Parameters required to use current Offer to purchase. + # @!attribute [rw] deal_code + # @return [::String] + # The deal code of the offer to get a special promotion or discount. class Offer include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods From bd56c7ebc783eb995819be11b6aecf8131e234c3 Mon Sep 17 00:00:00 2001 From: Viacheslav Rostovtsev <58152857+viacheslav-rostovtsev@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:45:34 -0800 Subject: [PATCH 047/112] chore: add an acceptance test to exercise the generated lro mixin client methods (#18340) --- .../google/cloud/speech/speech_smoke_test.rb | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/google-cloud-speech/acceptance/google/cloud/speech/speech_smoke_test.rb b/google-cloud-speech/acceptance/google/cloud/speech/speech_smoke_test.rb index dafac1714763..a3cac8950c43 100644 --- a/google-cloud-speech/acceptance/google/cloud/speech/speech_smoke_test.rb +++ b/google-cloud-speech/acceptance/google/cloud/speech/speech_smoke_test.rb @@ -34,4 +34,25 @@ def test_recognize response = speech_client.recognize config: config, audio: audio refute_equal 0, response.results.size end + + def test_long_running_recognize + speech_client = Google::Cloud::Speech.speech + config = { + language_code: "en-US", + sample_rate_hertz: 44100, + encoding: :FLAC + } + audio = { + uri: "gs://cloud-samples-data/speech/brooklyn_bridge.flac" + } + op = speech_client.long_running_recognize config: config, audio: audio + # use the operations_client + ops = speech_client.operations_client.list_operations(::Google::Longrunning::ListOperationsRequest.new) + assert ops.count > 0 + op = speech_client.operations_client.get_operation name: op.name + retry_config = ::Gapic::Operation::RetryPolicy.new initial_delay: 1, multiplier: 2, max_delay: 2, timeout: 10 + op.wait_until_done! retry_policy: retry_config + assert op.response? + refute_equal 0, op.response.results.size + end end From 00eb8ec24b5fb1c2c3424ac1ef43847ed3089a7c Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:47:02 -0800 Subject: [PATCH 048/112] chore(main): release google-cloud-data_catalog-v1 0.12.1 (#19391) --- .release-please-manifest.json | 2 +- google-cloud-data_catalog-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/data_catalog/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.datacatalog.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a898da279277..b61e35157b12 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -177,7 +177,7 @@ "google-cloud-core+FILLER": "0.0.0", "google-cloud-data_catalog": "1.3.0", "google-cloud-data_catalog+FILLER": "0.0.0", - "google-cloud-data_catalog-v1": "0.12.0", + "google-cloud-data_catalog-v1": "0.12.1", "google-cloud-data_catalog-v1+FILLER": "0.0.0", "google-cloud-data_fusion": "1.1.0", "google-cloud-data_fusion+FILLER": "0.0.0", diff --git a/google-cloud-data_catalog-v1/CHANGELOG.md b/google-cloud-data_catalog-v1/CHANGELOG.md index fc7645200e77..d6a14243f81a 100644 --- a/google-cloud-data_catalog-v1/CHANGELOG.md +++ b/google-cloud-data_catalog-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.12.1 (2022-11-09) + +#### Documentation + +* update documentation + ### 0.12.0 (2022-07-02) #### Features diff --git a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb index 0b22aee4d630..801a611e721c 100644 --- a/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb +++ b/google-cloud-data_catalog-v1/lib/google/cloud/data_catalog/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module DataCatalog module V1 - VERSION = "0.12.0" + VERSION = "0.12.1" end end end diff --git a/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json b/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json index b5f2e36e74cf..a82e2c3c3b0e 100644 --- a/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json +++ b/google-cloud-data_catalog-v1/snippets/snippet_metadata_google.cloud.datacatalog.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-data_catalog-v1", - "version": "0.12.0", + "version": "0.12.1", "language": "RUBY", "apis": [ { From 3784dd23349f712d779c7da0dbf351c65a3b6f71 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:47:23 -0800 Subject: [PATCH 049/112] chore(main): release google-cloud-document_ai-v1 0.6.0 (#19392) --- .release-please-manifest.json | 2 +- google-cloud-document_ai-v1/CHANGELOG.md | 7 +++++++ .../lib/google/cloud/document_ai/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.documentai.v1.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b61e35157b12..b72966282c95 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -245,7 +245,7 @@ "google-cloud-dns+FILLER": "0.0.0", "google-cloud-document_ai": "1.1.0", "google-cloud-document_ai+FILLER": "0.0.0", - "google-cloud-document_ai-v1": "0.5.0", + "google-cloud-document_ai-v1": "0.6.0", "google-cloud-document_ai-v1+FILLER": "0.0.0", "google-cloud-document_ai-v1beta3": "0.13.0", "google-cloud-document_ai-v1beta3+FILLER": "0.0.0", diff --git a/google-cloud-document_ai-v1/CHANGELOG.md b/google-cloud-document_ai-v1/CHANGELOG.md index 943d5b598bc8..bf979478ea2e 100644 --- a/google-cloud-document_ai-v1/CHANGELOG.md +++ b/google-cloud-document_ai-v1/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 0.6.0 (2022-11-09) + +#### Features + +* add document_schema to processor +* add font_family, ImageQualityScores and Provenance to document + ### 0.5.0 (2022-08-10) #### Features diff --git a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb index 9f9fd35822d1..810686815403 100644 --- a/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb +++ b/google-cloud-document_ai-v1/lib/google/cloud/document_ai/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module DocumentAI module V1 - VERSION = "0.5.0" + VERSION = "0.6.0" end end end diff --git a/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json b/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json index fd60a3a548de..2f67112ae36d 100644 --- a/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json +++ b/google-cloud-document_ai-v1/snippets/snippet_metadata_google.cloud.documentai.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-document_ai-v1", - "version": "0.5.0", + "version": "0.6.0", "language": "RUBY", "apis": [ { From a6d580ba4b89b06d6fbf8a1926a9614f4afb9423 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:47:40 -0800 Subject: [PATCH 050/112] chore(main): release google-cloud-eventarc-v1 0.5.0 (#19393) --- .release-please-manifest.json | 2 +- google-cloud-eventarc-v1/CHANGELOG.md | 9 +++++++++ .../lib/google/cloud/eventarc/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.eventarc.v1.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b72966282c95..42e65023a99d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -271,7 +271,7 @@ "google-cloud-eventarc-publishing+FILLER": "0.0.0", "google-cloud-eventarc-publishing-v1": "0.4.0", "google-cloud-eventarc-publishing-v1+FILLER": "0.0.0", - "google-cloud-eventarc-v1": "0.4.0", + "google-cloud-eventarc-v1": "0.5.0", "google-cloud-eventarc-v1+FILLER": "0.0.0", "google-cloud-filestore": "1.1.0", "google-cloud-filestore+FILLER": "0.0.0", diff --git a/google-cloud-eventarc-v1/CHANGELOG.md b/google-cloud-eventarc-v1/CHANGELOG.md index bec665e00002..5b8ae2a5d0c8 100644 --- a/google-cloud-eventarc-v1/CHANGELOG.md +++ b/google-cloud-eventarc-v1/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### 0.5.0 (2022-11-09) + +#### Features + +* add crypto_key_name to channel +* add StateCondition to trigger and workflow to destination of trigger +* support filters for listing triggers +* support google_channel_config + ### 0.4.0 (2022-07-02) #### Features diff --git a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/version.rb b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/version.rb index 57d17038dfaf..a7f835b1fa41 100644 --- a/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/version.rb +++ b/google-cloud-eventarc-v1/lib/google/cloud/eventarc/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Eventarc module V1 - VERSION = "0.4.0" + VERSION = "0.5.0" end end end diff --git a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json index dd216a68d3ec..225a98e53a81 100644 --- a/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json +++ b/google-cloud-eventarc-v1/snippets/snippet_metadata_google.cloud.eventarc.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-eventarc-v1", - "version": "0.4.0", + "version": "0.5.0", "language": "RUBY", "apis": [ { From b9404981f289a7591e04bea12c2b09fe1cf7ede4 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:48:02 -0800 Subject: [PATCH 051/112] chore(main): release google-cloud-talent-v4 0.8.1 (#19394) --- .release-please-manifest.json | 2 +- google-cloud-talent-v4/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/talent/v4/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.talent.v4.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 42e65023a99d..a047dd02b0a6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -543,7 +543,7 @@ "google-cloud-storage_transfer-v1+FILLER": "0.0.0", "google-cloud-talent": "1.2.0", "google-cloud-talent+FILLER": "0.0.0", - "google-cloud-talent-v4": "0.8.0", + "google-cloud-talent-v4": "0.8.1", "google-cloud-talent-v4+FILLER": "0.0.0", "google-cloud-talent-v4beta1": "0.6.0", "google-cloud-talent-v4beta1+FILLER": "0.0.0", diff --git a/google-cloud-talent-v4/CHANGELOG.md b/google-cloud-talent-v4/CHANGELOG.md index 78b8908f362c..16c625f1d511 100644 --- a/google-cloud-talent-v4/CHANGELOG.md +++ b/google-cloud-talent-v4/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.8.1 (2022-11-09) + +#### Documentation + +* mark company_size and keyword_searchable_job_custom_attributes deprecated + ### 0.8.0 (2022-07-08) #### Features diff --git a/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb b/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb index 4b005794f261..065597a4d798 100644 --- a/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb +++ b/google-cloud-talent-v4/lib/google/cloud/talent/v4/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Talent module V4 - VERSION = "0.8.0" + VERSION = "0.8.1" end end end diff --git a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json index be88c9a20dcf..892a83841a1e 100644 --- a/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json +++ b/google-cloud-talent-v4/snippets/snippet_metadata_google.cloud.talent.v4.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-talent-v4", - "version": "0.8.0", + "version": "0.8.1", "language": "RUBY", "apis": [ { From 4e1260f796ff2f146cbc050169758bdb6c06f0c8 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:48:21 -0800 Subject: [PATCH 052/112] chore(main): release google-cloud-talent-v4beta1 0.6.1 (#19395) --- .release-please-manifest.json | 2 +- google-cloud-talent-v4beta1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/talent/v4beta1/version.rb | 2 +- .../snippet_metadata_google.cloud.talent.v4beta1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a047dd02b0a6..2eb6814c5db9 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -545,7 +545,7 @@ "google-cloud-talent+FILLER": "0.0.0", "google-cloud-talent-v4": "0.8.1", "google-cloud-talent-v4+FILLER": "0.0.0", - "google-cloud-talent-v4beta1": "0.6.0", + "google-cloud-talent-v4beta1": "0.6.1", "google-cloud-talent-v4beta1+FILLER": "0.0.0", "google-cloud-tasks": "2.3.0", "google-cloud-tasks+FILLER": "0.0.0", diff --git a/google-cloud-talent-v4beta1/CHANGELOG.md b/google-cloud-talent-v4beta1/CHANGELOG.md index 7c9dd4b05edb..3a9ecb317c6e 100644 --- a/google-cloud-talent-v4beta1/CHANGELOG.md +++ b/google-cloud-talent-v4beta1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.6.1 (2022-11-09) + +#### Documentation + +* mark company_size and keyword_searchable_job_custom_attributes deprecated + ### 0.6.0 (2022-07-08) #### Features diff --git a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb index b6d2508b4397..2e4561acf078 100644 --- a/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb +++ b/google-cloud-talent-v4beta1/lib/google/cloud/talent/v4beta1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Talent module V4beta1 - VERSION = "0.6.0" + VERSION = "0.6.1" end end end diff --git a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json index 8485709a54d1..1bb49eba6800 100644 --- a/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json +++ b/google-cloud-talent-v4beta1/snippets/snippet_metadata_google.cloud.talent.v4beta1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-talent-v4beta1", - "version": "0.6.0", + "version": "0.6.1", "language": "RUBY", "apis": [ { From bd91619a56f844f6318d3b08c23a930ab4c5fe8d Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:48:39 -0800 Subject: [PATCH 053/112] chore(main): release google-identity-access_context_manager 1.1.1 (#19396) --- .release-please-manifest.json | 2 +- google-identity-access_context_manager/CHANGELOG.md | 6 ++++++ .../lib/google/identity/access_context_manager/version.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 2eb6814c5db9..d2027f1231a4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -653,7 +653,7 @@ "google-iam-v1beta+FILLER": "0.0.0", "google-iam-v2": "0.1.2", "google-iam-v2+FILLER": "0.0.0", - "google-identity-access_context_manager": "1.1.0", + "google-identity-access_context_manager": "1.1.1", "google-identity-access_context_manager+FILLER": "0.0.0", "google-identity-access_context_manager-v1": "0.2.0", "google-identity-access_context_manager-v1+FILLER": "0.0.0", diff --git a/google-identity-access_context_manager/CHANGELOG.md b/google-identity-access_context_manager/CHANGELOG.md index d91363d3a93b..ae64aa1ca50f 100644 --- a/google-identity-access_context_manager/CHANGELOG.md +++ b/google-identity-access_context_manager/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 1.1.1 (2022-11-09) + +#### Documentation + +* cleanup docs + ### 1.1.0 (2022-07-08) #### Features diff --git a/google-identity-access_context_manager/lib/google/identity/access_context_manager/version.rb b/google-identity-access_context_manager/lib/google/identity/access_context_manager/version.rb index 5e084446f26c..3041b8b2e6d2 100644 --- a/google-identity-access_context_manager/lib/google/identity/access_context_manager/version.rb +++ b/google-identity-access_context_manager/lib/google/identity/access_context_manager/version.rb @@ -20,7 +20,7 @@ module Google module Identity module AccessContextManager - VERSION = "1.1.0" + VERSION = "1.1.1" end end end From 6d6ab7a6c5dc47c4906088ce5b07923d4c5ba2cc Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 9 Nov 2022 21:49:03 -0800 Subject: [PATCH 054/112] chore(main): release google-identity-access_context_manager-v1 0.3.0 (#19397) --- .release-please-manifest.json | 2 +- google-identity-access_context_manager-v1/CHANGELOG.md | 6 ++++++ .../google/identity/access_context_manager/v1/version.rb | 2 +- ...et_metadata_google.identity.accesscontextmanager.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d2027f1231a4..52d77c59b6ac 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -655,7 +655,7 @@ "google-iam-v2+FILLER": "0.0.0", "google-identity-access_context_manager": "1.1.1", "google-identity-access_context_manager+FILLER": "0.0.0", - "google-identity-access_context_manager-v1": "0.2.0", + "google-identity-access_context_manager-v1": "0.3.0", "google-identity-access_context_manager-v1+FILLER": "0.0.0", "grafeas": "1.2.0", "grafeas+FILLER": "0.0.0", diff --git a/google-identity-access_context_manager-v1/CHANGELOG.md b/google-identity-access_context_manager-v1/CHANGELOG.md index 46176d84c89d..2787adee0905 100644 --- a/google-identity-access_context_manager-v1/CHANGELOG.md +++ b/google-identity-access_context_manager-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.3.0 (2022-11-09) + +#### Features + +* support IAM policies and permissions + ### 0.2.0 (2022-07-08) #### Features diff --git a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/version.rb b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/version.rb index 57551afd224c..27bd258e4546 100644 --- a/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/version.rb +++ b/google-identity-access_context_manager-v1/lib/google/identity/access_context_manager/v1/version.rb @@ -21,7 +21,7 @@ module Google module Identity module AccessContextManager module V1 - VERSION = "0.2.0" + VERSION = "0.3.0" end end end diff --git a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json index 37910d71dcf4..2684b026bd04 100644 --- a/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json +++ b/google-identity-access_context_manager-v1/snippets/snippet_metadata_google.identity.accesscontextmanager.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-identity-access_context_manager-v1", - "version": "0.2.0", + "version": "0.3.0", "language": "RUBY", "apis": [ { From 7282fa065c6b671b813a91b961b8eff14f190cb7 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Thu, 10 Nov 2022 11:37:26 +0530 Subject: [PATCH 055/112] chore(bigtable): delete table after test (#19398) --- .../acceptance/bigtable/backup_test.rb | 8 +++--- .../bigtable/table/drop_rows_test.rb | 28 ++++++++++++------- .../acceptance/bigtable_helper.rb | 6 ++++ 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/google-cloud-bigtable/acceptance/bigtable/backup_test.rb b/google-cloud-bigtable/acceptance/bigtable/backup_test.rb index d2e8b71ac749..c9f5c014bdd5 100644 --- a/google-cloud-bigtable/acceptance/bigtable/backup_test.rb +++ b/google-cloud-bigtable/acceptance/bigtable/backup_test.rb @@ -134,10 +134,10 @@ _(restore_job).must_be_kind_of Google::Cloud::Bigtable::Table::RestoreJob restore_job.wait_until_done! _(restore_job.error).must_be :nil? - restore_table = restore_job.table - _(restore_table).must_be_kind_of Google::Cloud::Bigtable::Table - _(restore_table.name).must_equal restore_table_id - _(restore_table.instance_id).must_equal instance_2.instance_id + restore_table_2 = restore_job.table + _(restore_table_2).must_be_kind_of Google::Cloud::Bigtable::Table + _(restore_table_2.name).must_equal restore_table_id + _(restore_table_2.instance_id).must_equal instance_2.instance_id ensure # delete backup.delete if backup diff --git a/google-cloud-bigtable/acceptance/bigtable/table/drop_rows_test.rb b/google-cloud-bigtable/acceptance/bigtable/table/drop_rows_test.rb index 7fbcfcadc77a..ec1945934549 100644 --- a/google-cloud-bigtable/acceptance/bigtable/table/drop_rows_test.rb +++ b/google-cloud-bigtable/acceptance/bigtable/table/drop_rows_test.rb @@ -19,22 +19,30 @@ describe "Table drop rows", :bigtable do it "delete all rows" do - table = create_table("test-table-#{random_str}", row_count: 2) + begin + table = create_table("test-table-#{random_str}", row_count: 2) - _(table.delete_all_rows(timeout: 300)).must_equal true + _(table.delete_all_rows(timeout: 300)).must_equal true - sleep 2 - rows = table.read_rows.to_a - _(rows).must_be_empty + sleep 2 + rows = table.read_rows.to_a + _(rows).must_be_empty + ensure + table.delete + end end it "delete rows by prefix" do - table = create_table("test-table-#{random_str}", row_count: 2) + begin + table = create_table("test-table-#{random_str}", row_count: 2) - _(table.delete_rows_by_prefix("test-1", timeout: 300)).must_equal true + _(table.delete_rows_by_prefix("test-1", timeout: 300)).must_equal true - sleep 2 - rows = table.read_rows.to_a - _(rows.length).must_equal 1 + sleep 2 + rows = table.read_rows.to_a + _(rows.length).must_equal 1 + ensure + table.delete + end end end diff --git a/google-cloud-bigtable/acceptance/bigtable_helper.rb b/google-cloud-bigtable/acceptance/bigtable_helper.rb index 43b9a273b186..efccb4079ea0 100644 --- a/google-cloud-bigtable/acceptance/bigtable_helper.rb +++ b/google-cloud-bigtable/acceptance/bigtable_helper.rb @@ -160,6 +160,12 @@ def clean_up_bigtable_objects instance_id, table_ids = [] table_ids.each do |table_id| $bigtable.delete_table(instance_id, table_id) end + + instance = $bigtable.instance instance_id + instance.tables.each do |table| + table.id.starts_with("test-table") + table.delete + end rescue StandardError => e puts "Error while cleaning up #{instance_id} instance tables.\n\n#{e}" end From f8d2744fcca2f12b21a57bce65d9d4ebb22579e9 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:17:07 -0800 Subject: [PATCH 056/112] chore(main): release google-cloud-batch-v1 0.4.1 (#19402) --- .release-please-manifest.json | 2 +- google-cloud-batch-v1/CHANGELOG.md | 6 ++++++ google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.batch.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 52d77c59b6ac..857295f37106 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -69,7 +69,7 @@ "google-cloud-bare_metal_solution-v2+FILLER": "0.0.0", "google-cloud-batch": "0.2.0", "google-cloud-batch+FILLER": "0.0.0", - "google-cloud-batch-v1": "0.4.0", + "google-cloud-batch-v1": "0.4.1", "google-cloud-batch-v1+FILLER": "0.0.0", "google-cloud-beyond_corp": "0.1.0", "google-cloud-beyond_corp+FILLER": "0.0.0", diff --git a/google-cloud-batch-v1/CHANGELOG.md b/google-cloud-batch-v1/CHANGELOG.md index b580080bb3d5..6d8d2a7de744 100644 --- a/google-cloud-batch-v1/CHANGELOG.md +++ b/google-cloud-batch-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.4.1 (2022-11-10) + +#### Documentation + +* Fixed a few formatting strings ([#19401](https://github.com/googleapis/google-cloud-ruby/issues/19401)) + ### 0.4.0 (2022-10-19) #### Features diff --git a/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb b/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb index 99ca3ce32b53..c69e2b82c16d 100644 --- a/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb +++ b/google-cloud-batch-v1/lib/google/cloud/batch/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Batch module V1 - VERSION = "0.4.0" + VERSION = "0.4.1" end end end diff --git a/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json b/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json index e130780b804d..49736672b54e 100644 --- a/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json +++ b/google-cloud-batch-v1/snippets/snippet_metadata_google.cloud.batch.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-batch-v1", - "version": "0.4.0", + "version": "0.4.1", "language": "RUBY", "apis": [ { From ac866ca81bf3d1685dbf6aeb67201abe70b3bc9b Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:17:25 -0800 Subject: [PATCH 057/112] chore(main): release google-cloud-channel-v1 0.14.0 (#19403) --- .release-please-manifest.json | 2 +- google-cloud-channel-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/channel/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.channel.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 857295f37106..6ed9327b62e7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -149,7 +149,7 @@ "google-cloud-certificate_manager-v1+FILLER": "0.0.0", "google-cloud-channel": "1.2.0", "google-cloud-channel+FILLER": "0.0.0", - "google-cloud-channel-v1": "0.13.0", + "google-cloud-channel-v1": "0.14.0", "google-cloud-channel-v1+FILLER": "0.0.0", "google-cloud-cloud_dms": "1.1.0", "google-cloud-cloud_dms+FILLER": "0.0.0", diff --git a/google-cloud-channel-v1/CHANGELOG.md b/google-cloud-channel-v1/CHANGELOG.md index 567755d05cb7..aab4e1021e74 100644 --- a/google-cloud-channel-v1/CHANGELOG.md +++ b/google-cloud-channel-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.14.0 (2022-11-10) + +#### Features + +* Added Offer#deal_code field ([#19400](https://github.com/googleapis/google-cloud-ruby/issues/19400)) + ### 0.13.0 (2022-10-19) #### Features diff --git a/google-cloud-channel-v1/lib/google/cloud/channel/v1/version.rb b/google-cloud-channel-v1/lib/google/cloud/channel/v1/version.rb index 587c61979fcc..b1f52567f635 100644 --- a/google-cloud-channel-v1/lib/google/cloud/channel/v1/version.rb +++ b/google-cloud-channel-v1/lib/google/cloud/channel/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Channel module V1 - VERSION = "0.13.0" + VERSION = "0.14.0" end end end diff --git a/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json b/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json index 462ea172ca20..3104a421c44f 100644 --- a/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json +++ b/google-cloud-channel-v1/snippets/snippet_metadata_google.cloud.channel.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-channel-v1", - "version": "0.13.0", + "version": "0.14.0", "language": "RUBY", "apis": [ { From 6a2f83bffa09f5e6cee231e733458ef21edd159b Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:17:41 -0800 Subject: [PATCH 058/112] chore(main): release google-cloud-network_connectivity 1.2.0 (#19404) --- .release-please-manifest.json | 2 +- google-cloud-network_connectivity/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/network_connectivity/version.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6ed9327b62e7..97ad00a39848 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -371,7 +371,7 @@ "google-cloud-monitoring-metrics_scope-v1+FILLER": "0.0.0", "google-cloud-monitoring-v3": "0.9.0", "google-cloud-monitoring-v3+FILLER": "0.0.0", - "google-cloud-network_connectivity": "1.1.0", + "google-cloud-network_connectivity": "1.2.0", "google-cloud-network_connectivity+FILLER": "0.0.0", "google-cloud-network_connectivity-v1": "0.4.0", "google-cloud-network_connectivity-v1+FILLER": "0.0.0", diff --git a/google-cloud-network_connectivity/CHANGELOG.md b/google-cloud-network_connectivity/CHANGELOG.md index c16564cebcbf..dd07fc99e9a2 100644 --- a/google-cloud-network_connectivity/CHANGELOG.md +++ b/google-cloud-network_connectivity/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 1.2.0 (2022-11-10) + +#### Features + +* Support for PolicyBasedRoutingService ([#19361](https://github.com/googleapis/google-cloud-ruby/issues/19361)) + ### 1.1.0 (2022-07-05) #### Features diff --git a/google-cloud-network_connectivity/lib/google/cloud/network_connectivity/version.rb b/google-cloud-network_connectivity/lib/google/cloud/network_connectivity/version.rb index 85cc2e205320..ca4bf2fcb009 100644 --- a/google-cloud-network_connectivity/lib/google/cloud/network_connectivity/version.rb +++ b/google-cloud-network_connectivity/lib/google/cloud/network_connectivity/version.rb @@ -20,7 +20,7 @@ module Google module Cloud module NetworkConnectivity - VERSION = "1.1.0" + VERSION = "1.2.0" end end end From 9e3682168c436a99b562861bff38824169063231 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:18:01 -0800 Subject: [PATCH 059/112] chore(main): release google-cloud-run-client 0.3.0 (#19405) --- .release-please-manifest.json | 2 +- google-cloud-run-client/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/run/client/version.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 97ad00a39848..dfae892ad81c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -467,7 +467,7 @@ "google-cloud-retail+FILLER": "0.0.0", "google-cloud-retail-v2": "0.11.0", "google-cloud-retail-v2+FILLER": "0.0.0", - "google-cloud-run-client": "0.2.0", + "google-cloud-run-client": "0.3.0", "google-cloud-run-client+FILLER": "0.0.0", "google-cloud-run-v2": "0.5.0", "google-cloud-run-v2+FILLER": "0.0.0", diff --git a/google-cloud-run-client/CHANGELOG.md b/google-cloud-run-client/CHANGELOG.md index ba650357c159..22846a099111 100644 --- a/google-cloud-run-client/CHANGELOG.md +++ b/google-cloud-run-client/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.3.0 (2022-11-10) + +#### Features + +* Support for Executions, Jobs, and Tasks services ([#19365](https://github.com/googleapis/google-cloud-ruby/issues/19365)) + ### 0.2.0 (2022-07-07) #### Features diff --git a/google-cloud-run-client/lib/google/cloud/run/client/version.rb b/google-cloud-run-client/lib/google/cloud/run/client/version.rb index 513cc1041c44..47b966642b2d 100644 --- a/google-cloud-run-client/lib/google/cloud/run/client/version.rb +++ b/google-cloud-run-client/lib/google/cloud/run/client/version.rb @@ -18,7 +18,7 @@ module Google module Cloud module Run module Client - VERSION = "0.2.0" + VERSION = "0.3.0" end end end From 556bc795816701445715b56f2305f76657658899 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 09:50:39 +0530 Subject: [PATCH 060/112] feat(dlp): support ExcludeByHotword and add :NEW_ZEALAND to LocationCategory --- .../google/cloud/dlp/v2/dlp_service/client.rb | 7 ++++ .../lib/google/privacy/dlp/v2/dlp_pb.rb | 7 ++++ .../proto_docs/google/privacy/dlp/v2/dlp.rb | 38 +++++++++++++++++-- .../google/privacy/dlp/v2/storage.rb | 2 +- 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb index 28bb0055e2ba..0c3f894460c0 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/dlp_service/client.rb @@ -571,6 +571,13 @@ def redact_image request, options = nil # inspect_template_name argument. # @param item [::Google::Cloud::Dlp::V2::ContentItem, ::Hash] # The item to de-identify. Will be treated as text. + # + # This value must be of type + # {::Google::Cloud::Dlp::V2::Table Table} if your + # {::Google::Cloud::Dlp::V2::DeidentifyContentRequest#deidentify_config deidentify_config} + # is a + # {::Google::Cloud::Dlp::V2::RecordTransformations RecordTransformations} + # object. # @param inspect_template_name [::String] # Template to use. Any configuration directly specified in # inspect_config will override those set in the template. Singular fields diff --git a/google-cloud-dlp-v2/lib/google/privacy/dlp/v2/dlp_pb.rb b/google-cloud-dlp-v2/lib/google/privacy/dlp/v2/dlp_pb.rb index 0df59aac3f1d..ff78a0986f7c 100644 --- a/google-cloud-dlp-v2/lib/google/privacy/dlp/v2/dlp_pb.rb +++ b/google-cloud-dlp-v2/lib/google/privacy/dlp/v2/dlp_pb.rb @@ -22,12 +22,17 @@ add_message "google.privacy.dlp.v2.ExcludeInfoTypes" do repeated :info_types, :message, 1, "google.privacy.dlp.v2.InfoType" end + add_message "google.privacy.dlp.v2.ExcludeByHotword" do + optional :hotword_regex, :message, 1, "google.privacy.dlp.v2.CustomInfoType.Regex" + optional :proximity, :message, 2, "google.privacy.dlp.v2.CustomInfoType.DetectionRule.Proximity" + end add_message "google.privacy.dlp.v2.ExclusionRule" do optional :matching_type, :enum, 4, "google.privacy.dlp.v2.MatchingType" oneof :type do optional :dictionary, :message, 1, "google.privacy.dlp.v2.CustomInfoType.Dictionary" optional :regex, :message, 2, "google.privacy.dlp.v2.CustomInfoType.Regex" optional :exclude_info_types, :message, 3, "google.privacy.dlp.v2.ExcludeInfoTypes" + optional :exclude_by_hotword, :message, 5, "google.privacy.dlp.v2.ExcludeByHotword" end end add_message "google.privacy.dlp.v2.InspectionRule" do @@ -326,6 +331,7 @@ value :URUGUAY, 38 value :VENEZUELA, 39 value :INTERNAL, 40 + value :NEW_ZEALAND, 41 end add_enum "google.privacy.dlp.v2.InfoTypeCategory.IndustryCategory" do value :INDUSTRY_UNSPECIFIED, 0 @@ -1349,6 +1355,7 @@ module Cloud module Dlp module V2 ExcludeInfoTypes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.privacy.dlp.v2.ExcludeInfoTypes").msgclass + ExcludeByHotword = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.privacy.dlp.v2.ExcludeByHotword").msgclass ExclusionRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.privacy.dlp.v2.ExclusionRule").msgclass InspectionRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.privacy.dlp.v2.InspectionRule").msgclass InspectionRuleSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.privacy.dlp.v2.InspectionRuleSet").msgclass diff --git a/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/dlp.rb b/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/dlp.rb index 0020b98802b3..4eb1f3a8a490 100644 --- a/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/dlp.rb +++ b/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/dlp.rb @@ -37,6 +37,23 @@ class ExcludeInfoTypes extend ::Google::Protobuf::MessageExts::ClassMethods end + # The rule to exclude findings based on a hotword. For record inspection of + # tables, column names are considered hotwords. An example of this is to + # exclude a finding if a BigQuery column matches a specific pattern. + # @!attribute [rw] hotword_regex + # @return [::Google::Cloud::Dlp::V2::CustomInfoType::Regex] + # Regular expression pattern defining what qualifies as a hotword. + # @!attribute [rw] proximity + # @return [::Google::Cloud::Dlp::V2::CustomInfoType::DetectionRule::Proximity] + # Range of characters within which the entire hotword must reside. + # The total length of the window cannot exceed 1000 characters. + # The windowBefore property in proximity should be set to 1 if the hotword + # needs to be included in a column header. + class ExcludeByHotword + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # The rule that specifies conditions when findings of infoTypes specified in # `InspectionRuleSet` are removed from results. # @!attribute [rw] dictionary @@ -48,6 +65,10 @@ class ExcludeInfoTypes # @!attribute [rw] exclude_info_types # @return [::Google::Cloud::Dlp::V2::ExcludeInfoTypes] # Set of infoTypes for which findings would affect this rule. + # @!attribute [rw] exclude_by_hotword + # @return [::Google::Cloud::Dlp::V2::ExcludeByHotword] + # Drop if the hotword rule is contained in the proximate context. For + # tabular data, the context includes the column name. # @!attribute [rw] matching_type # @return [::Google::Cloud::Dlp::V2::MatchingType] # How the rule is applied, see MatchingType documentation for details. @@ -241,7 +262,6 @@ module BytesType end end - # Container structure for the content to inspect. # @!attribute [rw] value # @return [::String] # String data to inspect or redact. @@ -710,6 +730,13 @@ class RedactImageResponse # @!attribute [rw] item # @return [::Google::Cloud::Dlp::V2::ContentItem] # The item to de-identify. Will be treated as text. + # + # This value must be of type + # {::Google::Cloud::Dlp::V2::Table Table} if your + # {::Google::Cloud::Dlp::V2::DeidentifyContentRequest#deidentify_config deidentify_config} + # is a + # {::Google::Cloud::Dlp::V2::RecordTransformations RecordTransformations} + # object. # @!attribute [rw] inspect_template_name # @return [::String] # Template to use. Any configuration directly specified in @@ -1167,6 +1194,9 @@ module LocationCategory # The infoType is typically used in Google internally. INTERNAL = 40 + + # The infoType is typically used in New Zealand. + NEW_ZEALAND = 41 end # Enum of the current industries in the category. @@ -3137,8 +3167,9 @@ module Status # Create a de-identified copy of the input data. # @!attribute [rw] job_notification_emails # @return [::Google::Cloud::Dlp::V2::Action::JobNotificationEmails] - # Enable email notification for project owners and editors on job's - # completion/failure. + # Sends an email when the job completes. The email goes to IAM project + # owners and technical [Essential + # Contacts](https://cloud.google.com/resource-manager/docs/managing-notification-contacts). # @!attribute [rw] publish_to_stackdriver # @return [::Google::Cloud::Dlp::V2::Action::PublishToStackdriver] # Enable Stackdriver metric dlp.googleapis.com/finding_count. @@ -4643,6 +4674,7 @@ class DataProfileConfigSnapshot # @!attribute [rw] row_count # @return [::Integer] # Number of rows in the table when the profile was generated. + # This will not be populated for BigLake tables. # @!attribute [rw] encryption_status # @return [::Google::Cloud::Dlp::V2::EncryptionStatus] # How the table is encrypted. diff --git a/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/storage.rb b/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/storage.rb index cb5e72af008d..c991ed3e0288 100644 --- a/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/storage.rb +++ b/google-cloud-dlp-v2/proto_docs/google/privacy/dlp/v2/storage.rb @@ -28,7 +28,7 @@ module V2 # creating a CustomInfoType, or one of the names listed # at https://cloud.google.com/dlp/docs/infotypes-reference when specifying # a built-in type. When sending Cloud DLP results to Data Catalog, infoType - # names should conform to the pattern `[A-Za-z0-9$-_]{1,64}`. + # names should conform to the pattern `[A-Za-z0-9$_-]{1,64}`. # @!attribute [rw] version # @return [::String] # Optional version name for this InfoType. From e8f240b58df86b433393e194a014da120f211a38 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Fri, 11 Nov 2022 00:14:59 -0800 Subject: [PATCH 061/112] chore(main): release google-cloud-dlp-v2 0.14.0 (#19409) --- .release-please-manifest.json | 2 +- google-cloud-dlp-v2/CHANGELOG.md | 6 ++++++ google-cloud-dlp-v2/lib/google/cloud/dlp/v2/version.rb | 2 +- .../snippets/snippet_metadata_google.privacy.dlp.v2.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index dfae892ad81c..0e84ab991698 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -239,7 +239,7 @@ "google-cloud-dialogflow-v2+FILLER": "0.0.0", "google-cloud-dlp": "1.3.0", "google-cloud-dlp+FILLER": "0.0.0", - "google-cloud-dlp-v2": "0.13.1", + "google-cloud-dlp-v2": "0.14.0", "google-cloud-dlp-v2+FILLER": "0.0.0", "google-cloud-dns": "0.36.0", "google-cloud-dns+FILLER": "0.0.0", diff --git a/google-cloud-dlp-v2/CHANGELOG.md b/google-cloud-dlp-v2/CHANGELOG.md index c78fb2b90a66..559066debcaf 100644 --- a/google-cloud-dlp-v2/CHANGELOG.md +++ b/google-cloud-dlp-v2/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.14.0 (2022-11-11) + +#### Features + +* support ExcludeByHotword and add :NEW_ZEALAND to LocationCategory + ### 0.13.1 (2022-10-03) #### Documentation diff --git a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/version.rb b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/version.rb index ef7c1964f0e9..6dae4682c844 100644 --- a/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/version.rb +++ b/google-cloud-dlp-v2/lib/google/cloud/dlp/v2/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Dlp module V2 - VERSION = "0.13.1" + VERSION = "0.14.0" end end end diff --git a/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json b/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json index c2a2e02fb2b2..724b14c08ca6 100644 --- a/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json +++ b/google-cloud-dlp-v2/snippets/snippet_metadata_google.privacy.dlp.v2.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-dlp-v2", - "version": "0.13.1", + "version": "0.14.0", "language": "RUBY", "apis": [ { From 20430905eedf2907ebf96c1b2234f7a13b1d761b Mon Sep 17 00:00:00 2001 From: Nivedha Date: Mon, 14 Nov 2022 07:45:06 +0530 Subject: [PATCH 062/112] chore: wait for server to start (#19408) * chore: add deterministic wait --- .../acceptance/create_assessment_test.rb | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/google-cloud-recaptcha_enterprise/samples/acceptance/create_assessment_test.rb b/google-cloud-recaptcha_enterprise/samples/acceptance/create_assessment_test.rb index e73e9c4b609f..1e1855770a2e 100644 --- a/google-cloud-recaptcha_enterprise/samples/acceptance/create_assessment_test.rb +++ b/google-cloud-recaptcha_enterprise/samples/acceptance/create_assessment_test.rb @@ -46,7 +46,7 @@ after :all do shutdown_server - @driver.close + @driver.quit FileUtils.rm_f html_file client.delete_key name: @key.name end @@ -71,6 +71,8 @@ def serve_page_with_recaptcha @pid = Process.fork do @server.start end + # wait for server to start + sleep 2 end def shutdown_server @@ -86,12 +88,15 @@ def get_token @driver.find_element(:id, "password").send_keys("password") @driver.find_element(:id, "recaptchabutton").click - sleep 5 + wait = Selenium::WebDriver::Wait.new timeout: 15 - element = @driver.find_element :css, "#assessment" - token = element.attribute "data-token" - action = element.attribute "data-action" - [token, action] + wait.until do + element = @driver.find_element :css, "#assessment" + token = element.attribute "data-token" + action = element.attribute "data-action" + raise Selenium::WebDriver::Error::NoSuchElementError if token.empty? || action.empty? + [token, action] + end end it "gives score for assessment with valid token" do From 8f70032dd6ade16dcf7789f85c6f6fc32b3f7202 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Tue, 15 Nov 2022 10:29:54 +0530 Subject: [PATCH 063/112] chore(firestore): use exponential backoff for wait (#19410) --- google-cloud-firestore/acceptance/firestore/watch_test.rb | 4 ++-- google-cloud-firestore/samples/query_watch.rb | 4 ++-- google-cloud-firestore/test/helper.rb | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/google-cloud-firestore/acceptance/firestore/watch_test.rb b/google-cloud-firestore/acceptance/firestore/watch_test.rb index b385f641847c..16c79939f3af 100644 --- a/google-cloud-firestore/acceptance/firestore/watch_test.rb +++ b/google-cloud-firestore/acceptance/firestore/watch_test.rb @@ -188,9 +188,9 @@ def wait_until &block wait_count = 0 until block.call - fail "wait_until criteria was not met" if wait_count > 200 + fail "wait_until criteria was not met" if wait_count > 6 wait_count += 1 - sleep 0.01 + sleep (2**wait_count) + rand(0..wait_count) end end end diff --git a/google-cloud-firestore/samples/query_watch.rb b/google-cloud-firestore/samples/query_watch.rb index 1dc7ed4784d2..624f9e1ee19a 100644 --- a/google-cloud-firestore/samples/query_watch.rb +++ b/google-cloud-firestore/samples/query_watch.rb @@ -177,9 +177,9 @@ def listen_multiple project_id:, collection_path: "cities" def wait_until &block wait_count = 0 until block.call - raise "wait_until criteria was not met." if wait_count > 200 + raise "wait_until criteria was not met." if wait_count > 6 wait_count += 1 - sleep 0.1 + sleep (2**wait_count) + rand(0..wait_count) end end diff --git a/google-cloud-firestore/test/helper.rb b/google-cloud-firestore/test/helper.rb index 14b169b0f723..aa9dcdd9444e 100644 --- a/google-cloud-firestore/test/helper.rb +++ b/google-cloud-firestore/test/helper.rb @@ -127,9 +127,9 @@ class MockFirestore < Minitest::Spec def wait_until &block wait_count = 0 until block.call - fail "wait_until criteria was not met" if wait_count > 100 + fail "wait_until criteria was not met" if wait_count > 6 wait_count += 1 - sleep 0.01 + sleep (2**wait_count) + rand(0..wait_count) end end From cba9090ad39a24e42d3ae023262f2015e7ebd63e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:53:12 +0530 Subject: [PATCH 064/112] feat(security_center): support service publishing and client libraries settings feat(security_center): add files to finding and :DEFAULT_ACCOUNT to mitre_attack technique --- .../.owlbot-manifest.json | 2 + .../v1/security_center/client.rb | 8 +- .../cloud/securitycenter/v1/finding_pb.rb | 2 + .../securitycenter/v1/mitre_attack_pb.rb | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../google/cloud/securitycenter/v1/finding.rb | 3 + .../cloud/securitycenter/v1/mitre_attack.rb | 3 + .../v1/securitycenter_service.rb | 10 +- 9 files changed, 409 insertions(+), 9 deletions(-) create mode 100644 google-cloud-security_center-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb diff --git a/google-cloud-security_center-v1/.owlbot-manifest.json b/google-cloud-security_center-v1/.owlbot-manifest.json index 388ae72f9972..823dcabac852 100644 --- a/google-cloud-security_center-v1/.owlbot-manifest.json +++ b/google-cloud-security_center-v1/.owlbot-manifest.json @@ -51,7 +51,9 @@ "lib/google/cloud/securitycenter/v1/source_pb.rb", "lib/google/cloud/securitycenter/v1/vulnerability_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/securitycenter/v1/access.rb", "proto_docs/google/cloud/securitycenter/v1/asset.rb", diff --git a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb index c57d5a616ce7..7d0dff8f2591 100644 --- a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb +++ b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/security_center/client.rb @@ -2745,7 +2745,7 @@ def run_asset_discovery request, options = nil # Required. The relative resource name of the finding. See: # https://cloud.google.com/apis/design/resource_names#relative_resource_name # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}". # @param state [::Google::Cloud::SecurityCenter::V1::Finding::State] # Required. The desired State of the finding. # @param start_time [::Google::Protobuf::Timestamp, ::Hash] @@ -2837,9 +2837,9 @@ def set_finding_state request, options = nil # Required. The relative resource name of the finding. See: # https://cloud.google.com/apis/design/resource_names#relative_resource_name # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}", - # "folders/\\{folder_id}/sources/\\{source_id}/finding/\\{finding_id}", - # "projects/\\{project_id}/sources/\\{source_id}/finding/\\{finding_id}". + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}". # @param mute [::Google::Cloud::SecurityCenter::V1::Finding::Mute] # Required. The desired state of the Mute. # diff --git a/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb b/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb index 6726a7faa7b1..5f0585bc1932 100644 --- a/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb +++ b/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/finding_pb.rb @@ -13,6 +13,7 @@ require 'google/cloud/securitycenter/v1/database_pb' require 'google/cloud/securitycenter/v1/exfiltration_pb' require 'google/cloud/securitycenter/v1/external_system_pb' +require 'google/cloud/securitycenter/v1/file_pb' require 'google/cloud/securitycenter/v1/iam_binding_pb' require 'google/cloud/securitycenter/v1/indicator_pb' require 'google/cloud/securitycenter/v1/kubernetes_pb' @@ -59,6 +60,7 @@ repeated :containers, :message, 42, "google.cloud.securitycenter.v1.Container" optional :kubernetes, :message, 43, "google.cloud.securitycenter.v1.Kubernetes" optional :database, :message, 44, "google.cloud.securitycenter.v1.Database" + repeated :files, :message, 46, "google.cloud.securitycenter.v1.File" end add_enum "google.cloud.securitycenter.v1.Finding.State" do value :STATE_UNSPECIFIED, 0 diff --git a/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb b/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb index 0455ded25d73..1b61b622f704 100644 --- a/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb +++ b/google-cloud-security_center-v1/lib/google/cloud/securitycenter/v1/mitre_attack_pb.rb @@ -65,6 +65,7 @@ value :NETWORK_SERVICE_DISCOVERY, 32 value :ACCESS_TOKEN_MANIPULATION, 33 value :ABUSE_ELEVATION_CONTROL_MECHANISM, 34 + value :DEFAULT_ACCOUNTS, 35 end end end diff --git a/google-cloud-security_center-v1/proto_docs/google/api/client.rb b/google-cloud-security_center-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-security_center-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-security_center-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb index 7b095e155093..6c0e2e024604 100644 --- a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb +++ b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/finding.rb @@ -193,6 +193,9 @@ module V1 # @!attribute [rw] database # @return [::Google::Cloud::SecurityCenter::V1::Database] # Database associated with the finding. + # @!attribute [rw] files + # @return [::Array<::Google::Cloud::SecurityCenter::V1::File>] + # File associated with the finding. class Finding include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb index 200c5ce5da3f..c5e914503b1d 100644 --- a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb +++ b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/mitre_attack.rb @@ -204,6 +204,9 @@ module Technique # T1548 ABUSE_ELEVATION_CONTROL_MECHANISM = 34 + + # T1078.001 + DEFAULT_ACCOUNTS = 35 end end end diff --git a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb index 369dd682febf..1b07afd4978d 100644 --- a/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb +++ b/google-cloud-security_center-v1/proto_docs/google/cloud/securitycenter/v1/securitycenter_service.rb @@ -1114,7 +1114,7 @@ module StateChange # Required. The relative resource name of the finding. See: # https://cloud.google.com/apis/design/resource_names#relative_resource_name # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}". + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}". # @!attribute [rw] state # @return [::Google::Cloud::SecurityCenter::V1::Finding::State] # Required. The desired State of the finding. @@ -1132,9 +1132,9 @@ class SetFindingStateRequest # Required. The relative resource name of the finding. See: # https://cloud.google.com/apis/design/resource_names#relative_resource_name # Example: - # "organizations/\\{organization_id}/sources/\\{source_id}/finding/\\{finding_id}", - # "folders/\\{folder_id}/sources/\\{source_id}/finding/\\{finding_id}", - # "projects/\\{project_id}/sources/\\{source_id}/finding/\\{finding_id}". + # "organizations/\\{organization_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "folders/\\{folder_id}/sources/\\{source_id}/findings/\\{finding_id}", + # "projects/\\{project_id}/sources/\\{source_id}/findings/\\{finding_id}". # @!attribute [rw] mute # @return [::Google::Cloud::SecurityCenter::V1::Finding::Mute] # Required. The desired state of the Mute. @@ -1300,7 +1300,7 @@ class UpdateBigQueryExportRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # Request message for listing BigQuery exports at a given scope e.g. + # Request message for listing BigQuery exports at a given scope e.g. # organization, folder or project. # @!attribute [rw] parent # @return [::String] From bd0a613ffc241030a530ad2bce86e0e887018343 Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Mon, 14 Nov 2022 22:06:14 -0800 Subject: [PATCH 065/112] samples(stitcher): Add Video Stitcher samples and tests (#19412) --- google-cloud-video-stitcher/samples/Gemfile | 2 +- .../acceptance/create_vod_session_test.rb | 27 +++++++++++ .../acceptance/get_vod_ad_tag_detail_test.rb | 37 ++++++++++++++ .../acceptance/get_vod_session_test.rb | 30 ++++++++++++ .../acceptance/get_vod_stitch_detail_test.rb | 37 ++++++++++++++ .../samples/acceptance/helper.rb | 14 ++++++ .../list_vod_ad_tag_details_test.rb | 28 +++++++++++ .../list_vod_stitch_details_test.rb | 28 +++++++++++ .../acceptance/vod_session_definition.rb | 8 ++++ .../samples/create_vod_session.rb | 48 +++++++++++++++++++ .../samples/get_vod_ad_tag_detail.rb | 39 +++++++++++++++ .../samples/get_vod_session.rb | 39 +++++++++++++++ .../samples/get_vod_stitch_detail.rb | 39 +++++++++++++++ .../samples/list_vod_ad_tag_details.rb | 41 ++++++++++++++++ .../samples/list_vod_stitch_details.rb | 41 ++++++++++++++++ 15 files changed, 457 insertions(+), 1 deletion(-) create mode 100644 google-cloud-video-stitcher/samples/acceptance/create_vod_session_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_vod_ad_tag_detail_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_vod_session_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_vod_stitch_detail_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/list_vod_ad_tag_details_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/list_vod_stitch_details_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/vod_session_definition.rb create mode 100644 google-cloud-video-stitcher/samples/create_vod_session.rb create mode 100644 google-cloud-video-stitcher/samples/get_vod_ad_tag_detail.rb create mode 100644 google-cloud-video-stitcher/samples/get_vod_session.rb create mode 100644 google-cloud-video-stitcher/samples/get_vod_stitch_detail.rb create mode 100644 google-cloud-video-stitcher/samples/list_vod_ad_tag_details.rb create mode 100644 google-cloud-video-stitcher/samples/list_vod_stitch_details.rb diff --git a/google-cloud-video-stitcher/samples/Gemfile b/google-cloud-video-stitcher/samples/Gemfile index 990c3804f97f..e28bd57bd9ec 100644 --- a/google-cloud-video-stitcher/samples/Gemfile +++ b/google-cloud-video-stitcher/samples/Gemfile @@ -15,7 +15,7 @@ source "https://rubygems.org" master = ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" - +gem "grpc", "1.47.0" gem "google-cloud-video-stitcher", path: master ? "../../google-cloud-video-stitcher" : nil gem "google-cloud-video-stitcher-v1", path: master ? "../../google-cloud-video-stitcher-v1" : nil diff --git a/google-cloud-video-stitcher/samples/acceptance/create_vod_session_test.rb b/google-cloud-video-stitcher/samples/acceptance/create_vod_session_test.rb new file mode 100644 index 000000000000..2f2959837a9e --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/create_vod_session_test.rb @@ -0,0 +1,27 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#create_vod_session", :stitcher_snippet do + it "creates a VOD session" do + sample = SampleLoader.load "create_vod_session.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, source_uri: vod_uri, ad_tag_uri: vod_ad_tag_uri + end + + assert_match %r{VOD session: projects/\S+/locations/#{location_id}/vodSessions/\S+}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_vod_ad_tag_detail_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_vod_ad_tag_detail_test.rb new file mode 100644 index 000000000000..a50fd60d330e --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_vod_ad_tag_detail_test.rb @@ -0,0 +1,37 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_vod_ad_tag_detail", :stitcher_snippet do + it "gets an ad tag detail for a VOD session" do + sample = SampleLoader.load "list_vod_ad_tag_details.rb" + + refute_nil vod_session + @session_id = vod_session.name.split("/").last + + output = capture_io { + sample.run project_id: project_id, location: location_id, session_id: @session_id + } + + @ad_tag_detail_id = output[0].to_s.split("/").last.strip + sample = SampleLoader.load "get_vod_ad_tag_detail.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, session_id: @session_id, ad_tag_detail_id: @ad_tag_detail_id + end + + assert_match %r{VOD ad tag detail: projects/\S+/locations/#{location_id}/vodSessions/#{@session_id}/vodAdTagDetails/#{@ad_tag_detail_id}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_vod_session_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_vod_session_test.rb new file mode 100644 index 000000000000..05aa88b9ceb0 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_vod_session_test.rb @@ -0,0 +1,30 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_vod_session", :stitcher_snippet do + it "gets the VOD session" do + sample = SampleLoader.load "get_vod_session.rb" + + refute_nil vod_session + @session_id = vod_session.name.split("/").last + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, session_id: @session_id + end + + assert_match %r{VOD session: projects/\S+/locations/#{location_id}/vodSessions/#{@session_id}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_vod_stitch_detail_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_vod_stitch_detail_test.rb new file mode 100644 index 000000000000..9e805da58826 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_vod_stitch_detail_test.rb @@ -0,0 +1,37 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_vod_stitch_detail", :stitcher_snippet do + it "gets a stitch detail for a VOD session" do + sample = SampleLoader.load "list_vod_stitch_details.rb" + + refute_nil vod_session + @session_id = vod_session.name.split("/").last + + output = capture_io { + sample.run project_id: project_id, location: location_id, session_id: @session_id + } + + @stitch_detail_id = output[0].to_s.split("/").last.strip + sample = SampleLoader.load "get_vod_stitch_detail.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, session_id: @session_id, stitch_detail_id: @stitch_detail_id + end + + assert_match %r{VOD stitch detail: projects/\S+/locations/#{location_id}/vodSessions/#{@session_id}/vodStitchDetails/#{@stitch_detail_id}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/helper.rb b/google-cloud-video-stitcher/samples/acceptance/helper.rb index c05e0a0078bd..ae6cbd59fc37 100644 --- a/google-cloud-video-stitcher/samples/acceptance/helper.rb +++ b/google-cloud-video-stitcher/samples/acceptance/helper.rb @@ -21,6 +21,7 @@ require_relative "akamai_cdn_key_definition" require_relative "cloud_cdn_key_definition" require_relative "slate_definition" +require_relative "vod_session_definition" require_relative "../../../.toys/.lib/sample_loader" @@ -51,6 +52,9 @@ class StitcherSnippetSpec < Minitest::Spec let(:akamai_token_key) { "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nLg==" } let(:updated_akamai_token_key) { "VGhpcyBpcyBhbiB1cGRhdGVkIHRlc3Qgc3RyaW5nLg==" } + let(:vod_uri) { "https://storage.googleapis.com/cloud-samples-data/media/hls-vod/manifest.m3u8" } + let(:vod_ad_tag_uri) { "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=" } + attr_writer :slate_created attr_writer :akamai_cdn_key_created attr_writer :cloud_cdn_key_created @@ -59,6 +63,9 @@ class StitcherSnippetSpec < Minitest::Spec @slate_created = false @akamai_cdn_key_created = false @cloud_cdn_key_created = false + @session_id = "" + @ad_tag_detail_id = "" + @stitch_detail_id = "" # Remove old slates in the test project if they exist response = client.list_slates parent: location_path response.each do |slate| @@ -96,6 +103,13 @@ class StitcherSnippetSpec < Minitest::Spec ) end + let :vod_session do + client.create_vod_session( + parent: location_path, + vod_session: vod_session_def(vod_uri, vod_ad_tag_uri) + ) + end + let :akamai_cdn_key do client.create_cdn_key( parent: location_path, diff --git a/google-cloud-video-stitcher/samples/acceptance/list_vod_ad_tag_details_test.rb b/google-cloud-video-stitcher/samples/acceptance/list_vod_ad_tag_details_test.rb new file mode 100644 index 000000000000..238425467450 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/list_vod_ad_tag_details_test.rb @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#list_vod_ad_tag_details", :stitcher_snippet do + it "lists the ad tag details for a VOD session" do + sample = SampleLoader.load "list_vod_ad_tag_details.rb" + + refute_nil vod_session + @session_id = vod_session.name.split("/").last + + assert_output %r{VOD ad tag details:\n#{vod_session.name}/vodAdTagDetails/\S+} do + sample.run project_id: project_id, location: location_id, session_id: @session_id + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/list_vod_stitch_details_test.rb b/google-cloud-video-stitcher/samples/acceptance/list_vod_stitch_details_test.rb new file mode 100644 index 000000000000..427951b45bf9 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/list_vod_stitch_details_test.rb @@ -0,0 +1,28 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#list_vod_stitch_details", :stitcher_snippet do + it "lists the stitch details for a VOD session" do + sample = SampleLoader.load "list_vod_stitch_details.rb" + + refute_nil vod_session + @session_id = vod_session.name.split("/").last + + assert_output %r{VOD stitch details:\n#{vod_session.name}/vodStitchDetails/\S+} do + sample.run project_id: project_id, location: location_id, session_id: @session_id + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/vod_session_definition.rb b/google-cloud-video-stitcher/samples/acceptance/vod_session_definition.rb new file mode 100644 index 000000000000..e7dffad1cb82 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/vod_session_definition.rb @@ -0,0 +1,8 @@ +require "google/cloud/video/stitcher" + +def vod_session_def source_uri, ad_tag_uri + { + source_uri: source_uri, + ad_tag_uri: ad_tag_uri + } +end diff --git a/google-cloud-video-stitcher/samples/create_vod_session.rb b/google-cloud-video-stitcher/samples/create_vod_session.rb new file mode 100644 index 000000000000..de3fa071d7ab --- /dev/null +++ b/google-cloud-video-stitcher/samples/create_vod_session.rb @@ -0,0 +1,48 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_create_vod_session] +require "google/cloud/video/stitcher" + +## +# Create a video on demand (VOD) session. VOD sessions are ephemeral resources +# that expire after a few hours. +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param source_uri [String] The URI of an MPEG-DASH manifest (.mpd) file or +# an M3U playlist manifest (.m3u8) file +# (e.g. "https://storage.googleapis.com/my-bucket/main.mpd") +# @param ad_tag_uri [String] The URI of the ad tag. See VMAP Pre-roll at +# https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags. +# +def create_vod_session project_id:, location:, source_uri:, ad_tag_uri: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + + # Set the session fields. + new_vod_session = { + source_uri: source_uri, + ad_tag_uri: ad_tag_uri + } + + response = client.create_vod_session parent: parent, vod_session: new_vod_session + + # Print the VOD session name. + puts "VOD session: #{response.name}" +end +# [END videostitcher_create_vod_session] diff --git a/google-cloud-video-stitcher/samples/get_vod_ad_tag_detail.rb b/google-cloud-video-stitcher/samples/get_vod_ad_tag_detail.rb new file mode 100644 index 000000000000..bd3471e4c441 --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_vod_ad_tag_detail.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_vod_ad_tag_detail] +require "google/cloud/video/stitcher" + +## +# Get the specified ad tag detail for a VOD session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The VOD session ID (e.g. "my-vod-session-id") +# @param ad_tag_detail_id [String] The ad tag detail ID (e.g. "my-ad-tag-id") +# +def get_vod_ad_tag_detail project_id:, location:, session_id:, ad_tag_detail_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the VOD ad tag detail. + name = client.vod_ad_tag_detail_path project: project_id, location: location, vod_session: session_id, vod_ad_tag_detail: ad_tag_detail_id + + # Get the VOD ad tag detail. + ad_tag_detail = client.get_vod_ad_tag_detail name: name + + # Print the VOD ad tag detail name. + puts "VOD ad tag detail: #{ad_tag_detail.name}" +end +# [END videostitcher_get_vod_ad_tag_detail] diff --git a/google-cloud-video-stitcher/samples/get_vod_session.rb b/google-cloud-video-stitcher/samples/get_vod_session.rb new file mode 100644 index 000000000000..5df0e46ebbd0 --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_vod_session.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_vod_session] +require "google/cloud/video/stitcher" + +## +# Get a VOD session. VOD sessions are ephemeral resources that expire +# after a few hours. +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The VOD session ID (e.g. "my-vod-session-id") +# +def get_vod_session project_id:, location:, session_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the VOD session. + name = client.vod_session_path project: project_id, location: location, vod_session: session_id + + # Get the VOD session. + session = client.get_vod_session name: name + + # Print the VOD session name. + puts "VOD session: #{session.name}" +end +# [END videostitcher_get_vod_session] diff --git a/google-cloud-video-stitcher/samples/get_vod_stitch_detail.rb b/google-cloud-video-stitcher/samples/get_vod_stitch_detail.rb new file mode 100644 index 000000000000..001d0391e5ac --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_vod_stitch_detail.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_vod_stitch_detail] +require "google/cloud/video/stitcher" + +## +# Get the specified stitch detail for a VOD session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The VOD session ID (e.g. "my-vod-session-id") +# @param stitch_detail_id [String] The stitch detail ID (e.g. "my-stitch-id") +# +def get_vod_stitch_detail project_id:, location:, session_id:, stitch_detail_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the VOD stitch detail. + name = client.vod_stitch_detail_path project: project_id, location: location, vod_session: session_id, vod_stitch_detail: stitch_detail_id + + # Get the VOD stitch detail. + stitch_detail = client.get_vod_stitch_detail name: name + + # Print the VOD stitch detail name. + puts "VOD stitch detail: #{stitch_detail.name}" +end +# [END videostitcher_get_vod_stitch_detail] diff --git a/google-cloud-video-stitcher/samples/list_vod_ad_tag_details.rb b/google-cloud-video-stitcher/samples/list_vod_ad_tag_details.rb new file mode 100644 index 000000000000..8ae76f9644a0 --- /dev/null +++ b/google-cloud-video-stitcher/samples/list_vod_ad_tag_details.rb @@ -0,0 +1,41 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_list_vod_ad_tag_details] +require "google/cloud/video/stitcher" + +## +# List the ad tag details for a VOD session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The VOD session ID (e.g. "my-vod-session-id") +# +def list_vod_ad_tag_details project_id:, location:, session_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.vod_session_path project: project_id, location: location, vod_session: session_id + + # List all ad tag details for the VOD session. + response = client.list_vod_ad_tag_details parent: parent + + puts "VOD ad tag details:" + # Print out all VOD ad tag details. + response.each do |vod_ad_tag_detail| + puts vod_ad_tag_detail.name.to_s + end +end +# [END videostitcher_list_vod_ad_tag_details] diff --git a/google-cloud-video-stitcher/samples/list_vod_stitch_details.rb b/google-cloud-video-stitcher/samples/list_vod_stitch_details.rb new file mode 100644 index 000000000000..e03684125843 --- /dev/null +++ b/google-cloud-video-stitcher/samples/list_vod_stitch_details.rb @@ -0,0 +1,41 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_list_vod_stitch_details] +require "google/cloud/video/stitcher" + +## +# List the stitch details for a VOD session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The VOD session ID (e.g. "my-vod-session-id") +# +def list_vod_stitch_details project_id:, location:, session_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.vod_session_path project: project_id, location: location, vod_session: session_id + + # List all stitch details for the VOD session. + response = client.list_vod_stitch_details parent: parent + + puts "VOD stitch details:" + # Print out all VOD stitch details. + response.each do |vod_stitch_detail| + puts vod_stitch_detail.name.to_s + end +end +# [END videostitcher_list_vod_stitch_details] From b43fcc0a8460ee0625afbc9dab71df7d9cadb1bb Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 11:59:39 +0530 Subject: [PATCH 066/112] chore(billing): update doc --- google-cloud-billing/.repo-metadata.json | 2 +- google-cloud-billing/lib/google/cloud/billing.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/google-cloud-billing/.repo-metadata.json b/google-cloud-billing/.repo-metadata.json index bc6613da99d4..682a2001757b 100644 --- a/google-cloud-billing/.repo-metadata.json +++ b/google-cloud-billing/.repo-metadata.json @@ -14,5 +14,5 @@ "ruby-cloud-description": "Allows developers to manage billing for their Google Cloud Platform projects programmatically.", "ruby-cloud-env-prefix": "BILLING", "ruby-cloud-product-url": "https://cloud.google.com/billing", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } diff --git a/google-cloud-billing/lib/google/cloud/billing.rb b/google-cloud-billing/lib/google/cloud/billing.rb index c6339eb76543..10464740d288 100644 --- a/google-cloud-billing/lib/google/cloud/billing.rb +++ b/google-cloud-billing/lib/google/cloud/billing.rb @@ -57,7 +57,8 @@ module Billing # # ## About CloudBilling # - # Retrieves GCP Console billing accounts and associates them with projects. + # Retrieves the Google Cloud Console billing accounts and associates them with + # projects. # # @param version [::String, ::Symbol] The API version to connect to. Optional. # Defaults to `:v1`. From 7d0b9f8f94fd7123aba94aa9f1bcb583acb80f22 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Tue, 15 Nov 2022 10:39:27 +0100 Subject: [PATCH 067/112] chore(deps): update dependency grpc to v1.50.0 (#19424) --- google-cloud-video-stitcher/samples/Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google-cloud-video-stitcher/samples/Gemfile b/google-cloud-video-stitcher/samples/Gemfile index e28bd57bd9ec..71657fbbe6e6 100644 --- a/google-cloud-video-stitcher/samples/Gemfile +++ b/google-cloud-video-stitcher/samples/Gemfile @@ -15,7 +15,7 @@ source "https://rubygems.org" master = ENV["GOOGLE_CLOUD_SAMPLES_TEST"] == "master" -gem "grpc", "1.47.0" +gem "grpc", "1.50.0" gem "google-cloud-video-stitcher", path: master ? "../../google-cloud-video-stitcher" : nil gem "google-cloud-video-stitcher-v1", path: master ? "../../google-cloud-video-stitcher-v1" : nil From 85ee6da3dbbd9659c8746e9460146ca73794dccf Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Tue, 15 Nov 2022 01:40:21 -0800 Subject: [PATCH 068/112] chore(main): release google-cloud-security_center-v1 0.23.0 (#19425) --- .release-please-manifest.json | 2 +- google-cloud-security_center-v1/CHANGELOG.md | 7 +++++++ .../lib/google/cloud/security_center/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.securitycenter.v1.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0e84ab991698..c09211ab268a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -495,7 +495,7 @@ "google-cloud-security-public_ca-v1beta1+FILLER": "0.0.0", "google-cloud-security_center": "1.3.0", "google-cloud-security_center+FILLER": "0.0.0", - "google-cloud-security_center-v1": "0.22.0", + "google-cloud-security_center-v1": "0.23.0", "google-cloud-security_center-v1+FILLER": "0.0.0", "google-cloud-security_center-v1p1beta1": "0.9.0", "google-cloud-security_center-v1p1beta1+FILLER": "0.0.0", diff --git a/google-cloud-security_center-v1/CHANGELOG.md b/google-cloud-security_center-v1/CHANGELOG.md index fad3c5eacc0e..f8a70051290d 100644 --- a/google-cloud-security_center-v1/CHANGELOG.md +++ b/google-cloud-security_center-v1/CHANGELOG.md @@ -1,5 +1,12 @@ # Release History +### 0.23.0 (2022-11-15) + +#### Features + +* add files to finding and :DEFAULT_ACCOUNT to mitre_attack technique +* support service publishing and client libraries settings + ### 0.22.0 (2022-10-19) #### Features diff --git a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb index 198b5df62353..b3a44d6f7d08 100644 --- a/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb +++ b/google-cloud-security_center-v1/lib/google/cloud/security_center/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module SecurityCenter module V1 - VERSION = "0.22.0" + VERSION = "0.23.0" end end end diff --git a/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json b/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json index 789e727d5e2f..441c2bf523c7 100644 --- a/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json +++ b/google-cloud-security_center-v1/snippets/snippet_metadata_google.cloud.securitycenter.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-security_center-v1", - "version": "0.22.0", + "version": "0.23.0", "language": "RUBY", "apis": [ { From ff822014718d83daaebd5584ef0212e1c9fd6363 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:12:58 +0530 Subject: [PATCH 069/112] feat(billing): support geo_taxonomy --- google-cloud-billing-v1/.owlbot-manifest.json | 3 + .../google/cloud/billing/v1/cloud_billing.rb | 3 +- .../cloud/billing/v1/cloud_billing/client.rb | 31 +- .../billing/v1/cloud_billing/credentials.rb | 2 + .../billing/v1/cloud_billing_services_pb.rb | 32 +- .../billing/v1/cloud_catalog/credentials.rb | 2 + .../cloud/billing/v1/cloud_catalog_pb.rb | 17 +- .../billing/v1/cloud_catalog_services_pb.rb | 3 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../google/cloud/billing/v1/cloud_billing.rb | 21 +- .../google/cloud/billing/v1/cloud_catalog.rb | 63 +++- .../proto_docs/google/protobuf/duration.rb | 98 ++++++ 13 files changed, 609 insertions(+), 55 deletions(-) create mode 100644 google-cloud-billing-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-billing-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-billing-v1/proto_docs/google/protobuf/duration.rb diff --git a/google-cloud-billing-v1/.owlbot-manifest.json b/google-cloud-billing-v1/.owlbot-manifest.json index f2a21927c846..40bd9ff0c90b 100644 --- a/google-cloud-billing-v1/.owlbot-manifest.json +++ b/google-cloud-billing-v1/.owlbot-manifest.json @@ -28,13 +28,16 @@ "lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb", "lib/google/cloud/billing/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/billing/v1/cloud_billing.rb", "proto_docs/google/cloud/billing/v1/cloud_catalog.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/type/expr.rb", diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing.rb index 6322ecc079cd..6dfe4751d46a 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing.rb @@ -31,7 +31,8 @@ module Cloud module Billing module V1 ## - # Retrieves GCP Console billing accounts and associates them with projects. + # Retrieves the Google Cloud Console billing accounts and associates them with + # projects. # # To load this service and instantiate a client: # diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/client.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/client.rb index f5f2486dc953..e4a563e11541 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/client.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/client.rb @@ -27,7 +27,8 @@ module CloudBilling ## # Client for the CloudBilling service. # - # Retrieves GCP Console billing accounts and associates them with projects. + # Retrieves the Google Cloud Console billing accounts and associates them with + # projects. # class Client include Paths @@ -473,15 +474,20 @@ def update_billing_account request, options = nil end ## - # Creates a billing account. - # This method can only be used to create - # [billing subaccounts](https://cloud.google.com/billing/docs/concepts) - # by GCP resellers. + # This method creates [billing + # subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts). + # + # Google Cloud resellers should use the + # Channel Services APIs, + # [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) + # and + # [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create). + # # When creating a subaccount, the current authenticated user must have the - # `billing.accounts.update` IAM permission on the master account, which is + # `billing.accounts.update` IAM permission on the parent account, which is # typically given to billing account # [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). - # This method will return an error if the master account has not been + # This method will return an error if the parent account has not been # provisioned as a reseller account. # # @overload create_billing_account(request, options = nil) @@ -502,7 +508,7 @@ def update_billing_account request, options = nil # @param billing_account [::Google::Cloud::Billing::V1::BillingAccount, ::Hash] # Required. The billing account resource to create. # Currently CreateBillingAccount only supports subaccount creation, so - # any created billing accounts must be under a provided master billing + # any created billing accounts must be under a provided parent billing # account. # # @yield [response, operation] Access the result along with the RPC operation @@ -666,9 +672,10 @@ def list_project_billing_info request, options = nil ## # Gets the billing information for a project. The current authenticated user - # must have [permission to view the - # project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo - # ). + # must have the `resourcemanager.projects.get` permission for the project, + # which can be granted by assigning the [Project + # Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles) + # role. # # @overload get_project_billing_info(request, options = nil) # Pass arguments to `get_project_billing_info` via a request object, either of type @@ -763,7 +770,7 @@ def get_project_billing_info request, options = nil # usage charges. # # *Note:* Incurred charges that have not yet been reported in the transaction - # history of the GCP Console might be billed to the new billing + # history of the Google Cloud Console might be billed to the new billing # account, even if the charge occurred before the new billing account was # assigned to the project. # diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/credentials.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/credentials.rb index 09f674c361b2..dbe31f1af3d5 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/credentials.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing/credentials.rb @@ -26,6 +26,8 @@ module CloudBilling # Credentials for the CloudBilling API. class Credentials < ::Google::Auth::Credentials self.scope = [ + "https://www.googleapis.com/auth/cloud-billing", + "https://www.googleapis.com/auth/cloud-billing.readonly", "https://www.googleapis.com/auth/cloud-platform" ] self.env_vars = [ diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb index f7727ef031c6..616fe7fd6c00 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_billing_services_pb.rb @@ -1,7 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/billing/v1/cloud_billing.proto for package 'google.cloud.billing.v1' # Original file comments: -# Copyright 2019 Google LLC. +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# require 'grpc' require 'google/cloud/billing/v1/cloud_billing_pb' @@ -25,7 +24,8 @@ module Cloud module Billing module V1 module CloudBilling - # Retrieves GCP Console billing accounts and associates them with projects. + # Retrieves the Google Cloud Console billing accounts and associates them with + # projects. class Service include ::GRPC::GenericService @@ -49,15 +49,20 @@ class Service # [administrator](https://cloud.google.com/billing/docs/how-to/billing-access) # of the billing account. rpc :UpdateBillingAccount, ::Google::Cloud::Billing::V1::UpdateBillingAccountRequest, ::Google::Cloud::Billing::V1::BillingAccount - # Creates a billing account. - # This method can only be used to create - # [billing subaccounts](https://cloud.google.com/billing/docs/concepts) - # by GCP resellers. + # This method creates [billing + # subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts). + # + # Google Cloud resellers should use the + # Channel Services APIs, + # [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) + # and + # [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers.entitlements/create). + # # When creating a subaccount, the current authenticated user must have the - # `billing.accounts.update` IAM permission on the master account, which is + # `billing.accounts.update` IAM permission on the parent account, which is # typically given to billing account # [administrators](https://cloud.google.com/billing/docs/how-to/billing-access). - # This method will return an error if the master account has not been + # This method will return an error if the parent account has not been # provisioned as a reseller account. rpc :CreateBillingAccount, ::Google::Cloud::Billing::V1::CreateBillingAccountRequest, ::Google::Cloud::Billing::V1::BillingAccount # Lists the projects associated with a billing account. The current @@ -66,9 +71,10 @@ class Service # [viewers](https://cloud.google.com/billing/docs/how-to/billing-access). rpc :ListProjectBillingInfo, ::Google::Cloud::Billing::V1::ListProjectBillingInfoRequest, ::Google::Cloud::Billing::V1::ListProjectBillingInfoResponse # Gets the billing information for a project. The current authenticated user - # must have [permission to view the - # project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo - # ). + # must have the `resourcemanager.projects.get` permission for the project, + # which can be granted by assigning the [Project + # Viewer](https://cloud.google.com/iam/docs/understanding-roles#predefined_roles) + # role. rpc :GetProjectBillingInfo, ::Google::Cloud::Billing::V1::GetProjectBillingInfoRequest, ::Google::Cloud::Billing::V1::ProjectBillingInfo # Sets or updates the billing account associated with a project. You specify # the new billing account by setting the `billing_account_name` in the @@ -79,7 +85,7 @@ class Service # usage charges. # # *Note:* Incurred charges that have not yet been reported in the transaction - # history of the GCP Console might be billed to the new billing + # history of the Google Cloud Console might be billed to the new billing # account, even if the charge occurred before the new billing account was # assigned to the project. # diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/credentials.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/credentials.rb index 29658d6c5853..5a6f9726094f 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/credentials.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog/credentials.rb @@ -26,6 +26,8 @@ module CloudCatalog # Credentials for the CloudCatalog API. class Credentials < ::Google::Auth::Credentials self.scope = [ + "https://www.googleapis.com/auth/cloud-billing", + "https://www.googleapis.com/auth/cloud-billing.readonly", "https://www.googleapis.com/auth/cloud-platform" ] self.env_vars = [ diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_pb.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_pb.rb index ec9f5723504a..5c5a0785d4f2 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_pb.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_pb.rb @@ -26,6 +26,7 @@ repeated :service_regions, :string, 5 repeated :pricing_info, :message, 6, "google.cloud.billing.v1.PricingInfo" optional :service_provider_name, :string, 7 + optional :geo_taxonomy, :message, 8, "google.cloud.billing.v1.GeoTaxonomy" end add_message "google.cloud.billing.v1.Category" do optional :service_display_name, :string, 1 @@ -42,12 +43,12 @@ end add_message "google.cloud.billing.v1.PricingExpression" do optional :usage_unit, :string, 1 + optional :display_quantity, :double, 2 + repeated :tiered_rates, :message, 3, "google.cloud.billing.v1.PricingExpression.TierRate" optional :usage_unit_description, :string, 4 optional :base_unit, :string, 5 optional :base_unit_description, :string, 6 optional :base_unit_conversion_factor, :double, 7 - optional :display_quantity, :double, 2 - repeated :tiered_rates, :message, 3, "google.cloud.billing.v1.PricingExpression.TierRate" end add_message "google.cloud.billing.v1.PricingExpression.TierRate" do optional :start_usage_amount, :double, 1 @@ -68,6 +69,16 @@ value :DAILY, 1 value :MONTHLY, 2 end + add_message "google.cloud.billing.v1.GeoTaxonomy" do + optional :type, :enum, 1, "google.cloud.billing.v1.GeoTaxonomy.Type" + repeated :regions, :string, 2 + end + add_enum "google.cloud.billing.v1.GeoTaxonomy.Type" do + value :TYPE_UNSPECIFIED, 0 + value :GLOBAL, 1 + value :REGIONAL, 2 + value :MULTI_REGIONAL, 3 + end add_message "google.cloud.billing.v1.ListServicesRequest" do optional :page_size, :int32, 1 optional :page_token, :string, 2 @@ -104,6 +115,8 @@ module V1 AggregationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.AggregationInfo").msgclass AggregationInfo::AggregationLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.AggregationInfo.AggregationLevel").enummodule AggregationInfo::AggregationInterval = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.AggregationInfo.AggregationInterval").enummodule + GeoTaxonomy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.GeoTaxonomy").msgclass + GeoTaxonomy::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.GeoTaxonomy.Type").enummodule ListServicesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.ListServicesRequest").msgclass ListServicesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.ListServicesResponse").msgclass ListSkusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.billing.v1.ListSkusRequest").msgclass diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb index 2b9760276723..b4e34eaca99d 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/cloud_catalog_services_pb.rb @@ -1,7 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/billing/v1/cloud_catalog.proto for package 'google.cloud.billing.v1' # Original file comments: -# Copyright 2019 Google LLC. +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# require 'grpc' require 'google/cloud/billing/v1/cloud_catalog_pb' diff --git a/google-cloud-billing-v1/proto_docs/google/api/client.rb b/google-cloud-billing-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-billing-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-billing-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-billing-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-billing-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_billing.rb b/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_billing.rb index 9b9203e10e71..5ad569286da7 100644 --- a/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_billing.rb +++ b/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_billing.rb @@ -21,11 +21,12 @@ module Google module Cloud module Billing module V1 - # A billing account in [GCP Console](https://console.cloud.google.com/). - # You can assign a billing account to one or more projects. - # @!attribute [rw] name + # A billing account in the + # [Google Cloud Console](https://console.cloud.google.com/). You can assign a + # billing account to one or more projects. + # @!attribute [r] name # @return [::String] - # The resource name of the billing account. The resource name has the form + # Output only. The resource name of the billing account. The resource name has the form # `billingAccounts/{billing_account_id}`. For example, # `billingAccounts/012345-567890-ABCDEF` would be the resource name for # billing account `012345-567890-ABCDEF`. @@ -37,12 +38,12 @@ module V1 # @!attribute [rw] display_name # @return [::String] # The display name given to the billing account, such as `My Billing - # Account`. This name is displayed in the GCP Console. + # Account`. This name is displayed in the Google Cloud Console. # @!attribute [rw] master_billing_account # @return [::String] # If this account is a # [subaccount](https://cloud.google.com/billing/docs/concepts), then this - # will be the resource name of the master billing account that it is being + # will be the resource name of the parent billing account that it is being # resold through. # Otherwise this will be empty. class BillingAccount @@ -50,9 +51,9 @@ class BillingAccount extend ::Google::Protobuf::MessageExts::ClassMethods end - # Encapsulation of billing information for a GCP Console project. A project - # has at most one associated billing account at a time (but a billing account - # can be assigned to multiple projects). + # Encapsulation of billing information for a Google Cloud Console project. A + # project has at most one associated billing account at a time (but a billing + # account can be assigned to multiple projects). # @!attribute [rw] name # @return [::String] # The resource name for the `ProjectBillingInfo`; has the form @@ -131,7 +132,7 @@ class ListBillingAccountsResponse # @return [::Google::Cloud::Billing::V1::BillingAccount] # Required. The billing account resource to create. # Currently CreateBillingAccount only supports subaccount creation, so - # any created billing accounts must be under a provided master billing + # any created billing accounts must be under a provided parent billing # account. class CreateBillingAccountRequest include ::Google::Protobuf::MessageExts diff --git a/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_catalog.rb b/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_catalog.rb index 4e218d602e44..0dc0064e47d7 100644 --- a/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_catalog.rb +++ b/google-cloud-billing-v1/proto_docs/google/cloud/billing/v1/cloud_catalog.rb @@ -70,6 +70,9 @@ class Service # @return [::String] # Identifies the service provider. # This is 'Google' for first party services in Google Cloud Platform. + # @!attribute [rw] geo_taxonomy + # @return [::Google::Cloud::Billing::V1::GeoTaxonomy] + # The geographic taxonomy for this sku. class Sku include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -142,6 +145,21 @@ class PricingInfo # @return [::String] # The short hand for unit of usage this pricing is specified in. # Example: usage_unit of "GiBy" means that usage is specified in "Gibi Byte". + # @!attribute [rw] display_quantity + # @return [::Float] + # The recommended quantity of units for displaying pricing info. When + # displaying pricing info it is recommended to display: + # (unit_price * display_quantity) per display_quantity usage_unit. + # This field does not affect the pricing formula and is for display purposes + # only. + # Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and + # the display_quantity is "1000" then the recommended way of displaying the + # pricing info is "0.10 USD per 1000 GB" + # @!attribute [rw] tiered_rates + # @return [::Array<::Google::Cloud::Billing::V1::PricingExpression::TierRate>] + # The list of tiered rates for this pricing. The total cost is computed by + # applying each of the tiered rates on usage. This repeated list is sorted + # by ascending order of start_usage_amount. # @!attribute [rw] usage_unit_description # @return [::String] # The unit of usage in human readable form. @@ -161,21 +179,6 @@ class PricingInfo # unit_price / base_unit_conversion_factor = price per base_unit. # start_usage_amount * base_unit_conversion_factor = start_usage_amount in # base_unit. - # @!attribute [rw] display_quantity - # @return [::Float] - # The recommended quantity of units for displaying pricing info. When - # displaying pricing info it is recommended to display: - # (unit_price * display_quantity) per display_quantity usage_unit. - # This field does not affect the pricing formula and is for display purposes - # only. - # Example: If the unit_price is "0.0001 USD", the usage_unit is "GB" and - # the display_quantity is "1000" then the recommended way of displaying the - # pricing info is "0.10 USD per 1000 GB" - # @!attribute [rw] tiered_rates - # @return [::Array<::Google::Cloud::Billing::V1::PricingExpression::TierRate>] - # The list of tiered rates for this pricing. The total cost is computed by - # applying each of the tiered rates on usage. This repeated list is sorted - # by ascending order of start_usage_amount. class PricingExpression include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -233,6 +236,36 @@ module AggregationInterval end end + # Encapsulates the geographic taxonomy data for a sku. + # @!attribute [rw] type + # @return [::Google::Cloud::Billing::V1::GeoTaxonomy::Type] + # The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL. + # @!attribute [rw] regions + # @return [::Array<::String>] + # The list of regions associated with a sku. Empty for Global skus, which are + # associated with all Google Cloud regions. + class GeoTaxonomy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of Geo Taxonomy: GLOBAL, REGIONAL, or MULTI_REGIONAL. + module Type + # The type is not specified. + TYPE_UNSPECIFIED = 0 + + # The sku is global in nature, e.g. a license sku. Global skus are + # available in all regions, and so have an empty region list. + GLOBAL = 1 + + # The sku is available in a specific region, e.g. "us-west2". + REGIONAL = 2 + + # The sku is associated with multiple regions, e.g. "us-west2" and + # "us-east1". + MULTI_REGIONAL = 3 + end + end + # Request message for `ListServices`. # @!attribute [rw] page_size # @return [::Integer] diff --git a/google-cloud-billing-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-billing-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-billing-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end From a0b10a14a724cf974bf051d6aa1dd1bdd24cac2c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:14:19 +0530 Subject: [PATCH 070/112] feat(container): support placement_policy --- .../.owlbot-manifest.json | 2 + .../google/container/v1/cluster_service_pb.rb | 10 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../google/container/v1/cluster_service.rb | 23 ++ 5 files changed, 424 insertions(+) create mode 100644 google-cloud-container-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-container-v1/proto_docs/google/api/launch_stage.rb diff --git a/google-cloud-container-v1/.owlbot-manifest.json b/google-cloud-container-v1/.owlbot-manifest.json index c212e129b710..ff77769bd75e 100644 --- a/google-cloud-container-v1/.owlbot-manifest.json +++ b/google-cloud-container-v1/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/container/v1/cluster_service_pb.rb", "lib/google/container/v1/cluster_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/container/v1/cluster_service.rb", "proto_docs/google/protobuf/any.rb", diff --git a/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb b/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb index fa41225375ab..9a46dea1f535 100644 --- a/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb +++ b/google-cloud-container-v1/lib/google/container/v1/cluster_service_pb.rb @@ -639,6 +639,7 @@ repeated :conditions, :message, 105, "google.container.v1.StatusCondition" optional :pod_ipv4_cidr_size, :int32, 7 optional :upgrade_settings, :message, 107, "google.container.v1.NodePool.UpgradeSettings" + optional :placement_policy, :message, 108, "google.container.v1.NodePool.PlacementPolicy" optional :update_info, :message, 109, "google.container.v1.NodePool.UpdateInfo" end add_message "google.container.v1.NodePool.UpgradeSettings" do @@ -667,6 +668,13 @@ value :DELETING_BLUE_POOL, 6 value :ROLLBACK_STARTED, 7 end + add_message "google.container.v1.NodePool.PlacementPolicy" do + optional :type, :enum, 1, "google.container.v1.NodePool.PlacementPolicy.Type" + end + add_enum "google.container.v1.NodePool.PlacementPolicy.Type" do + value :TYPE_UNSPECIFIED, 0 + value :COMPACT, 1 + end add_enum "google.container.v1.NodePool.Status" do value :STATUS_UNSPECIFIED, 0 value :PROVISIONING, 1 @@ -1246,6 +1254,8 @@ module V1 NodePool::UpdateInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.UpdateInfo").msgclass NodePool::UpdateInfo::BlueGreenInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.UpdateInfo.BlueGreenInfo").msgclass NodePool::UpdateInfo::BlueGreenInfo::Phase = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.UpdateInfo.BlueGreenInfo.Phase").enummodule + NodePool::PlacementPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.PlacementPolicy").msgclass + NodePool::PlacementPolicy::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.PlacementPolicy.Type").enummodule NodePool::Status = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodePool.Status").enummodule NodeManagement = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.NodeManagement").msgclass AutoUpgradeOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.container.v1.AutoUpgradeOptions").msgclass diff --git a/google-cloud-container-v1/proto_docs/google/api/client.rb b/google-cloud-container-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-container-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-container-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-container-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-container-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb b/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb index f3526c99fc91..7bba0be1644d 100644 --- a/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb +++ b/google-cloud-container-v1/proto_docs/google/container/v1/cluster_service.rb @@ -2707,6 +2707,9 @@ class StandardRolloutPolicy # @!attribute [rw] upgrade_settings # @return [::Google::Cloud::Container::V1::NodePool::UpgradeSettings] # Upgrade settings control disruption and speed of the upgrade. + # @!attribute [rw] placement_policy + # @return [::Google::Cloud::Container::V1::NodePool::PlacementPolicy] + # Specifies the node placement policy. # @!attribute [r] update_info # @return [::Google::Cloud::Container::V1::NodePool::UpdateInfo] # Output only. [Output only] Update info contains relevant information during a node @@ -2844,6 +2847,26 @@ module Phase end end + # PlacementPolicy defines the placement policy used by the node pool. + # @!attribute [rw] type + # @return [::Google::Cloud::Container::V1::NodePool::PlacementPolicy::Type] + # The type of placement. + class PlacementPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type defines the type of placement policy. + module Type + # TYPE_UNSPECIFIED specifies no requirements on nodes + # placement. + TYPE_UNSPECIFIED = 0 + + # COMPACT specifies node placement in the same availability domain to + # ensure low communication latency. + COMPACT = 1 + end + end + # The current status of the node pool instance. module Status # Not set. From 075ba18912454fb5ce079186457ec28a720d7554 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:18:35 +0530 Subject: [PATCH 071/112] feat(os_login): support create_ssh_public_key --- .../.owlbot-manifest.json | 4 + google-cloud-os_login-v1/README.md | 4 +- google-cloud-os_login-v1/gapic_metadata.json | 5 + .../os_login/v1/os_login_service/client.rb | 100 +++++- .../v1/os_login_service/credentials.rb | 4 +- .../lib/google/cloud/oslogin/v1/oslogin_pb.rb | 6 + .../cloud/oslogin/v1/oslogin_services_pb.rb | 5 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../google/cloud/oslogin/v1/oslogin.rb | 15 + .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../os_login_service/create_ssh_public_key.rb | 39 +++ ...ppet_metadata_google.cloud.oslogin.v1.json | 40 +++ .../os_login/v1/os_login_service_test.rb | 60 ++++ 14 files changed, 761 insertions(+), 8 deletions(-) create mode 100644 google-cloud-os_login-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-os_login-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-os_login-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-os_login-v1/snippets/os_login_service/create_ssh_public_key.rb diff --git a/google-cloud-os_login-v1/.owlbot-manifest.json b/google-cloud-os_login-v1/.owlbot-manifest.json index 433e6a17fdba..5d4c0e80d9b6 100644 --- a/google-cloud-os_login-v1/.owlbot-manifest.json +++ b/google-cloud-os_login-v1/.owlbot-manifest.json @@ -23,13 +23,17 @@ "lib/google/cloud/oslogin/v1/oslogin_pb.rb", "lib/google/cloud/oslogin/v1/oslogin_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/oslogin/common/common.rb", "proto_docs/google/cloud/oslogin/v1/oslogin.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "snippets/Gemfile", + "snippets/os_login_service/create_ssh_public_key.rb", "snippets/os_login_service/delete_posix_account.rb", "snippets/os_login_service/delete_ssh_public_key.rb", "snippets/os_login_service/get_login_profile.rb", diff --git a/google-cloud-os_login-v1/README.md b/google-cloud-os_login-v1/README.md index 1a8574bcb0c8..bd63c789ca51 100644 --- a/google-cloud-os_login-v1/README.md +++ b/google-cloud-os_login-v1/README.md @@ -33,8 +33,8 @@ In order to use this library, you first need to go through the following steps: require "google/cloud/os_login/v1" client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new -request = ::Google::Cloud::OsLogin::V1::DeletePosixAccountRequest.new # (request fields as keyword arguments...) -response = client.delete_posix_account request +request = ::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest.new # (request fields as keyword arguments...) +response = client.create_ssh_public_key request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-os_login-v1/latest) diff --git a/google-cloud-os_login-v1/gapic_metadata.json b/google-cloud-os_login-v1/gapic_metadata.json index 1b0c3688c77e..6d372f912994 100644 --- a/google-cloud-os_login-v1/gapic_metadata.json +++ b/google-cloud-os_login-v1/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "::Google::Cloud::OsLogin::V1::OsLoginService::Client", "rpcs": { + "CreateSshPublicKey": { + "methods": [ + "create_ssh_public_key" + ] + }, "DeletePosixAccount": { "methods": [ "delete_posix_account" diff --git a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/client.rb b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/client.rb index f2a89ea29ee7..ccb7ab3344a4 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/client.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/client.rb @@ -177,6 +177,93 @@ def initialize # Service calls + ## + # Create an SSH public key + # + # @overload create_ssh_public_key(request, options = nil) + # Pass arguments to `create_ssh_public_key` via a request object, either of type + # {::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_ssh_public_key(parent: nil, ssh_public_key: nil) + # Pass arguments to `create_ssh_public_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The unique ID for the user in format `users/{user}`. + # @param ssh_public_key [::Google::Cloud::OsLogin::Common::SshPublicKey, ::Hash] + # Required. The SSH public key and expiration time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::OsLogin::Common::SshPublicKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::OsLogin::Common::SshPublicKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/os_login/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest.new + # + # # Call the create_ssh_public_key method. + # result = client.create_ssh_public_key request + # + # # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + # p result + # + def create_ssh_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_ssh_public_key.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::OsLogin::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_ssh_public_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_ssh_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @os_login_service_stub.call_rpc :create_ssh_public_key, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Deletes a POSIX account. # @@ -727,17 +814,17 @@ def update_ssh_public_key request, options = nil # @example # # # Modify the global config, setting the timeout for - # # delete_posix_account to 20 seconds, + # # create_ssh_public_key to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::OsLogin::V1::OsLoginService::Client.configure do |config| # config.timeout = 10.0 - # config.rpcs.delete_posix_account.timeout = 20.0 + # config.rpcs.create_ssh_public_key.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| # config.timeout = 10.0 - # config.rpcs.delete_posix_account.timeout = 20.0 + # config.rpcs.create_ssh_public_key.timeout = 20.0 # end # # @!attribute [rw] endpoint @@ -846,6 +933,11 @@ def rpcs # trigger a retry. # class Rpcs + ## + # RPC-specific configuration for `create_ssh_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ssh_public_key ## # RPC-specific configuration for `delete_posix_account` # @return [::Gapic::Config::Method] @@ -879,6 +971,8 @@ class Rpcs # @private def initialize parent_rpcs = nil + create_ssh_public_key_config = parent_rpcs.create_ssh_public_key if parent_rpcs.respond_to? :create_ssh_public_key + @create_ssh_public_key = ::Gapic::Config::Method.new create_ssh_public_key_config delete_posix_account_config = parent_rpcs.delete_posix_account if parent_rpcs.respond_to? :delete_posix_account @delete_posix_account = ::Gapic::Config::Method.new delete_posix_account_config delete_ssh_public_key_config = parent_rpcs.delete_ssh_public_key if parent_rpcs.respond_to? :delete_ssh_public_key diff --git a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/credentials.rb b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/credentials.rb index c3149ce963ce..01f43b5deca9 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/credentials.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/os_login_service/credentials.rb @@ -27,7 +27,9 @@ module OsLoginService class Credentials < ::Google::Auth::Credentials self.scope = [ "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/compute" + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/compute", + "https://www.googleapis.com/auth/compute.readonly" ] self.env_vars = [ "OS_LOGIN_CREDENTIALS", diff --git a/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_pb.rb b/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_pb.rb index ea5d5a09756e..94bdd485fbbe 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_pb.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_pb.rb @@ -18,6 +18,10 @@ repeated :posix_accounts, :message, 2, "google.cloud.oslogin.common.PosixAccount" map :ssh_public_keys, :string, :message, 3, "google.cloud.oslogin.common.SshPublicKey" end + add_message "google.cloud.oslogin.v1.CreateSshPublicKeyRequest" do + optional :parent, :string, 1 + optional :ssh_public_key, :message, 2, "google.cloud.oslogin.common.SshPublicKey" + end add_message "google.cloud.oslogin.v1.DeletePosixAccountRequest" do optional :name, :string, 1 end @@ -39,6 +43,7 @@ end add_message "google.cloud.oslogin.v1.ImportSshPublicKeyResponse" do optional :login_profile, :message, 1, "google.cloud.oslogin.v1.LoginProfile" + optional :details, :string, 2 end add_message "google.cloud.oslogin.v1.UpdateSshPublicKeyRequest" do optional :name, :string, 1 @@ -53,6 +58,7 @@ module Cloud module OsLogin module V1 LoginProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1.LoginProfile").msgclass + CreateSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1.CreateSshPublicKeyRequest").msgclass DeletePosixAccountRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1.DeletePosixAccountRequest").msgclass DeleteSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1.DeleteSshPublicKeyRequest").msgclass GetLoginProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1.GetLoginProfileRequest").msgclass diff --git a/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_services_pb.rb b/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_services_pb.rb index 9558a02300b2..f0e3ab0f7e17 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_services_pb.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/oslogin/v1/oslogin_services_pb.rb @@ -1,7 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/oslogin/v1/oslogin.proto for package 'Google.Cloud.OsLogin.V1' # Original file comments: -# Copyright 2019 Google LLC. +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# require 'grpc' require 'google/cloud/oslogin/v1/oslogin_pb' @@ -37,6 +36,8 @@ class Service self.unmarshal_class_method = :decode self.service_name = 'google.cloud.oslogin.v1.OsLoginService' + # Create an SSH public key + rpc :CreateSshPublicKey, ::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest, ::Google::Cloud::OsLogin::Common::SshPublicKey # Deletes a POSIX account. rpc :DeletePosixAccount, ::Google::Cloud::OsLogin::V1::DeletePosixAccountRequest, ::Google::Protobuf::Empty # Deletes an SSH public key. diff --git a/google-cloud-os_login-v1/proto_docs/google/api/client.rb b/google-cloud-os_login-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-os_login-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-os_login-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-os_login-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-os_login-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-os_login-v1/proto_docs/google/cloud/oslogin/v1/oslogin.rb b/google-cloud-os_login-v1/proto_docs/google/cloud/oslogin/v1/oslogin.rb index 80b93d71b600..0b2b06263349 100644 --- a/google-cloud-os_login-v1/proto_docs/google/cloud/oslogin/v1/oslogin.rb +++ b/google-cloud-os_login-v1/proto_docs/google/cloud/oslogin/v1/oslogin.rb @@ -46,6 +46,18 @@ class SshPublicKeysEntry end end + # A request message for creating an SSH public key. + # @!attribute [rw] parent + # @return [::String] + # Required. The unique ID for the user in format `users/{user}`. + # @!attribute [rw] ssh_public_key + # @return [::Google::Cloud::OsLogin::Common::SshPublicKey] + # Required. The SSH public key and expiration time. + class CreateSshPublicKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # A request message for deleting a POSIX account entry. # @!attribute [rw] name # @return [::String] @@ -113,6 +125,9 @@ class ImportSshPublicKeyRequest # @!attribute [rw] login_profile # @return [::Google::Cloud::OsLogin::V1::LoginProfile] # The login profile information for the user. + # @!attribute [rw] details + # @return [::String] + # Detailed information about import results. class ImportSshPublicKeyResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-os_login-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-os_login-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-os_login-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-os_login-v1/snippets/os_login_service/create_ssh_public_key.rb b/google-cloud-os_login-v1/snippets/os_login_service/create_ssh_public_key.rb new file mode 100644 index 000000000000..25367add4760 --- /dev/null +++ b/google-cloud-os_login-v1/snippets/os_login_service/create_ssh_public_key.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START oslogin_v1_generated_OsLoginService_CreateSshPublicKey_sync] +require "google/cloud/os_login/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1::OsLoginService::Client#create_ssh_public_key +# +def create_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1::OsLoginService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest.new + + # Call the create_ssh_public_key method. + result = client.create_ssh_public_key request + + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end +# [END oslogin_v1_generated_OsLoginService_CreateSshPublicKey_sync] diff --git a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json index 3e444844773d..1df79f3c51be 100644 --- a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json +++ b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json @@ -11,6 +11,46 @@ ] }, "snippets": [ + { + "region_tag": "oslogin_v1_generated_OsLoginService_CreateSshPublicKey_sync", + "title": "Snippet for create_ssh_public_key in OsLoginService", + "description": "Basic snippet for create_ssh_public_key in OsLoginService", + "file": "os_login_service/create_ssh_public_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_ssh_public_key", + "full_name": "::Google::Cloud::OsLogin::V1::OsLoginService::Client#create_ssh_public_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::OsLogin::Common::SshPublicKey", + "client": { + "short_name": "OsLoginService::Client", + "full_name": "::Google::Cloud::OsLogin::V1::OsLoginService::Client" + }, + "method": { + "short_name": "CreateSshPublicKey", + "full_name": "google.cloud.oslogin.v1.OsLoginService.CreateSshPublicKey", + "service": { + "short_name": "OsLoginService", + "full_name": "google.cloud.oslogin.v1.OsLoginService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, { "region_tag": "oslogin_v1_generated_OsLoginService_DeletePosixAccount_sync", "title": "Snippet for delete_posix_account in OsLoginService", diff --git a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb index 869794f16d23..95048648ef37 100644 --- a/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb +++ b/google-cloud-os_login-v1/test/google/cloud/os_login/v1/os_login_service_test.rb @@ -47,6 +47,66 @@ def call_rpc *args, **kwargs end end + def test_create_ssh_public_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::OsLogin::Common::SshPublicKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + ssh_public_key = {} + + create_ssh_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_ssh_public_key, name + assert_kind_of ::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OsLogin::Common::SshPublicKey), request["ssh_public_key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_ssh_public_key_client_stub do + # Create client + client = ::Google::Cloud::OsLogin::V1::OsLoginService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_ssh_public_key parent: parent, ssh_public_key: ssh_public_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_ssh_public_key ::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_ssh_public_key(::Google::Cloud::OsLogin::V1::CreateSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_ssh_public_key_client_stub.call_rpc_count + end + end + def test_delete_posix_account # Create GRPC objects. grpc_response = ::Google::Protobuf::Empty.new From d20df85b1c41adad0abb2504841df6c30e76c881 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:19:49 +0530 Subject: [PATCH 072/112] feat(os_login): support create_ssh_public_key --- .../.owlbot-manifest.json | 4 + google-cloud-os_login-v1beta/README.md | 4 +- .../gapic_metadata.json | 5 + .../v1beta/os_login_service/client.rb | 108 +++++- .../google/cloud/oslogin/v1beta/oslogin_pb.rb | 32 ++ .../oslogin/v1beta/oslogin_services_pb.rb | 5 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../google/cloud/oslogin/v1beta/oslogin.rb | 73 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../os_login_service/create_ssh_public_key.rb | 39 +++ ..._metadata_google.cloud.oslogin.v1beta.json | 40 +++ .../os_login/v1beta/os_login_service_test.rb | 84 ++++- 13 files changed, 862 insertions(+), 19 deletions(-) create mode 100644 google-cloud-os_login-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-os_login-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-os_login-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-os_login-v1beta/snippets/os_login_service/create_ssh_public_key.rb diff --git a/google-cloud-os_login-v1beta/.owlbot-manifest.json b/google-cloud-os_login-v1beta/.owlbot-manifest.json index 8ab052caf231..883c40e4cb4b 100644 --- a/google-cloud-os_login-v1beta/.owlbot-manifest.json +++ b/google-cloud-os_login-v1beta/.owlbot-manifest.json @@ -23,13 +23,17 @@ "lib/google/cloud/oslogin/v1beta/oslogin_pb.rb", "lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/oslogin/common/common.rb", "proto_docs/google/cloud/oslogin/v1beta/oslogin.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "snippets/Gemfile", + "snippets/os_login_service/create_ssh_public_key.rb", "snippets/os_login_service/delete_posix_account.rb", "snippets/os_login_service/delete_ssh_public_key.rb", "snippets/os_login_service/get_login_profile.rb", diff --git a/google-cloud-os_login-v1beta/README.md b/google-cloud-os_login-v1beta/README.md index bd463ea812b4..68c162aa7f38 100644 --- a/google-cloud-os_login-v1beta/README.md +++ b/google-cloud-os_login-v1beta/README.md @@ -33,8 +33,8 @@ In order to use this library, you first need to go through the following steps: require "google/cloud/os_login/v1beta" client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new -request = ::Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest.new # (request fields as keyword arguments...) -response = client.delete_posix_account request +request = ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new # (request fields as keyword arguments...) +response = client.create_ssh_public_key request ``` View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-os_login-v1beta/latest) diff --git a/google-cloud-os_login-v1beta/gapic_metadata.json b/google-cloud-os_login-v1beta/gapic_metadata.json index 1e92b163ae68..e7c5cc12a8d9 100644 --- a/google-cloud-os_login-v1beta/gapic_metadata.json +++ b/google-cloud-os_login-v1beta/gapic_metadata.json @@ -10,6 +10,11 @@ "grpc": { "libraryClient": "::Google::Cloud::OsLogin::V1beta::OsLoginService::Client", "rpcs": { + "CreateSshPublicKey": { + "methods": [ + "create_ssh_public_key" + ] + }, "DeletePosixAccount": { "methods": [ "delete_posix_account" diff --git a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/client.rb b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/client.rb index c0d7af6a0859..f6eb0e178ed6 100644 --- a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/client.rb +++ b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/os_login_service/client.rb @@ -177,6 +177,93 @@ def initialize # Service calls + ## + # Create an SSH public key + # + # @overload create_ssh_public_key(request, options = nil) + # Pass arguments to `create_ssh_public_key` via a request object, either of type + # {::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload create_ssh_public_key(parent: nil, ssh_public_key: nil) + # Pass arguments to `create_ssh_public_key` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The unique ID for the user in format `users/{user}`. + # @param ssh_public_key [::Google::Cloud::OsLogin::Common::SshPublicKey, ::Hash] + # Required. The SSH public key and expiration time. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::OsLogin::Common::SshPublicKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::OsLogin::Common::SshPublicKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/os_login/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new + # + # # Call the create_ssh_public_key method. + # result = client.create_ssh_public_key request + # + # # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + # p result + # + def create_ssh_public_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.create_ssh_public_key.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::OsLogin::V1beta::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.create_ssh_public_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_ssh_public_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @os_login_service_stub.call_rpc :create_ssh_public_key, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Deletes a POSIX account. # @@ -365,7 +452,7 @@ def delete_ssh_public_key request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload get_login_profile(name: nil, project_id: nil, system_id: nil) + # @overload get_login_profile(name: nil, project_id: nil, system_id: nil, view: nil) # Pass arguments to `get_login_profile` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -376,6 +463,8 @@ def delete_ssh_public_key request, options = nil # The project ID of the Google Cloud Platform project. # @param system_id [::String] # A system ID for filtering the results of the request. + # @param view [::Google::Cloud::OsLogin::V1beta::LoginProfileView] + # The view configures whether to retrieve security keys information. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::OsLogin::V1beta::LoginProfile] @@ -543,7 +632,7 @@ def get_ssh_public_key request, options = nil # @param options [::Gapic::CallOptions, ::Hash] # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. # - # @overload import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil) + # @overload import_ssh_public_key(parent: nil, ssh_public_key: nil, project_id: nil, view: nil) # Pass arguments to `import_ssh_public_key` via keyword arguments. Note that at # least one keyword argument is required. To specify no parameters, or to keep all # the default parameter values, pass an empty Hash as a request object (see above). @@ -554,6 +643,8 @@ def get_ssh_public_key request, options = nil # Required. The SSH public key and expiration time. # @param project_id [::String] # The project ID of the Google Cloud Platform project. + # @param view [::Google::Cloud::OsLogin::V1beta::LoginProfileView] + # The view configures whether to retrieve security keys information. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyResponse] @@ -727,17 +818,17 @@ def update_ssh_public_key request, options = nil # @example # # # Modify the global config, setting the timeout for - # # delete_posix_account to 20 seconds, + # # create_ssh_public_key to 20 seconds, # # and all remaining timeouts to 10 seconds. # ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.configure do |config| # config.timeout = 10.0 - # config.rpcs.delete_posix_account.timeout = 20.0 + # config.rpcs.create_ssh_public_key.timeout = 20.0 # end # # # Apply the above configuration only to a new client. # client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| # config.timeout = 10.0 - # config.rpcs.delete_posix_account.timeout = 20.0 + # config.rpcs.create_ssh_public_key.timeout = 20.0 # end # # @!attribute [rw] endpoint @@ -846,6 +937,11 @@ def rpcs # trigger a retry. # class Rpcs + ## + # RPC-specific configuration for `create_ssh_public_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_ssh_public_key ## # RPC-specific configuration for `delete_posix_account` # @return [::Gapic::Config::Method] @@ -879,6 +975,8 @@ class Rpcs # @private def initialize parent_rpcs = nil + create_ssh_public_key_config = parent_rpcs.create_ssh_public_key if parent_rpcs.respond_to? :create_ssh_public_key + @create_ssh_public_key = ::Gapic::Config::Method.new create_ssh_public_key_config delete_posix_account_config = parent_rpcs.delete_posix_account if parent_rpcs.respond_to? :delete_posix_account @delete_posix_account = ::Gapic::Config::Method.new delete_posix_account_config delete_ssh_public_key_config = parent_rpcs.delete_ssh_public_key if parent_rpcs.respond_to? :delete_ssh_public_key diff --git a/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_pb.rb b/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_pb.rb index 216649549917..8649c1ee6b7a 100644 --- a/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_pb.rb +++ b/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_pb.rb @@ -17,6 +17,11 @@ optional :name, :string, 1 repeated :posix_accounts, :message, 2, "google.cloud.oslogin.common.PosixAccount" map :ssh_public_keys, :string, :message, 3, "google.cloud.oslogin.common.SshPublicKey" + repeated :security_keys, :message, 5, "google.cloud.oslogin.v1beta.SecurityKey" + end + add_message "google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest" do + optional :parent, :string, 1 + optional :ssh_public_key, :message, 2, "google.cloud.oslogin.common.SshPublicKey" end add_message "google.cloud.oslogin.v1beta.DeletePosixAccountRequest" do optional :name, :string, 1 @@ -28,6 +33,7 @@ optional :name, :string, 1 optional :project_id, :string, 2 optional :system_id, :string, 3 + optional :view, :enum, 4, "google.cloud.oslogin.v1beta.LoginProfileView" end add_message "google.cloud.oslogin.v1beta.GetSshPublicKeyRequest" do optional :name, :string, 1 @@ -36,15 +42,36 @@ optional :parent, :string, 1 optional :ssh_public_key, :message, 2, "google.cloud.oslogin.common.SshPublicKey" optional :project_id, :string, 3 + optional :view, :enum, 4, "google.cloud.oslogin.v1beta.LoginProfileView" end add_message "google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse" do optional :login_profile, :message, 1, "google.cloud.oslogin.v1beta.LoginProfile" + optional :details, :string, 2 end add_message "google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest" do optional :name, :string, 1 optional :ssh_public_key, :message, 2, "google.cloud.oslogin.common.SshPublicKey" optional :update_mask, :message, 3, "google.protobuf.FieldMask" end + add_message "google.cloud.oslogin.v1beta.SecurityKey" do + optional :public_key, :string, 1 + optional :private_key, :string, 2 + oneof :protocol_type do + optional :universal_two_factor, :message, 3, "google.cloud.oslogin.v1beta.UniversalTwoFactor" + optional :web_authn, :message, 4, "google.cloud.oslogin.v1beta.WebAuthn" + end + end + add_message "google.cloud.oslogin.v1beta.UniversalTwoFactor" do + optional :app_id, :string, 1 + end + add_message "google.cloud.oslogin.v1beta.WebAuthn" do + optional :rp_id, :string, 1 + end + add_enum "google.cloud.oslogin.v1beta.LoginProfileView" do + value :LOGIN_PROFILE_VIEW_UNSPECIFIED, 0 + value :BASIC, 1 + value :SECURITY_KEY, 2 + end end end @@ -53,6 +80,7 @@ module Cloud module OsLogin module V1beta LoginProfile = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.LoginProfile").msgclass + CreateSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.CreateSshPublicKeyRequest").msgclass DeletePosixAccountRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.DeletePosixAccountRequest").msgclass DeleteSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.DeleteSshPublicKeyRequest").msgclass GetLoginProfileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.GetLoginProfileRequest").msgclass @@ -60,6 +88,10 @@ module V1beta ImportSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.ImportSshPublicKeyRequest").msgclass ImportSshPublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.ImportSshPublicKeyResponse").msgclass UpdateSshPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.UpdateSshPublicKeyRequest").msgclass + SecurityKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.SecurityKey").msgclass + UniversalTwoFactor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.UniversalTwoFactor").msgclass + WebAuthn = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.WebAuthn").msgclass + LoginProfileView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.oslogin.v1beta.LoginProfileView").enummodule end end end diff --git a/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb b/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb index 32ea8c3fa231..8c533b220ca0 100644 --- a/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb +++ b/google-cloud-os_login-v1beta/lib/google/cloud/oslogin/v1beta/oslogin_services_pb.rb @@ -1,7 +1,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # Source: google/cloud/oslogin/v1beta/oslogin.proto for package 'Google.Cloud.OsLogin.V1beta' # Original file comments: -# Copyright 2019 Google LLC. +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# require 'grpc' require 'google/cloud/oslogin/v1beta/oslogin_pb' @@ -37,6 +36,8 @@ class Service self.unmarshal_class_method = :decode self.service_name = 'google.cloud.oslogin.v1beta.OsLoginService' + # Create an SSH public key + rpc :CreateSshPublicKey, ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest, ::Google::Cloud::OsLogin::Common::SshPublicKey # Deletes a POSIX account. rpc :DeletePosixAccount, ::Google::Cloud::OsLogin::V1beta::DeletePosixAccountRequest, ::Google::Protobuf::Empty # Deletes an SSH public key. diff --git a/google-cloud-os_login-v1beta/proto_docs/google/api/client.rb b/google-cloud-os_login-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-os_login-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-os_login-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-os_login-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-os_login-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-os_login-v1beta/proto_docs/google/cloud/oslogin/v1beta/oslogin.rb b/google-cloud-os_login-v1beta/proto_docs/google/cloud/oslogin/v1beta/oslogin.rb index 4a8da344b8c4..e8034f929b48 100644 --- a/google-cloud-os_login-v1beta/proto_docs/google/cloud/oslogin/v1beta/oslogin.rb +++ b/google-cloud-os_login-v1beta/proto_docs/google/cloud/oslogin/v1beta/oslogin.rb @@ -32,6 +32,9 @@ module V1beta # @!attribute [rw] ssh_public_keys # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::OsLogin::Common::SshPublicKey}] # A map from SSH public key fingerprint to the associated key object. + # @!attribute [rw] security_keys + # @return [::Array<::Google::Cloud::OsLogin::V1beta::SecurityKey>] + # The registered security key credentials for a user. class LoginProfile include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -46,6 +49,18 @@ class SshPublicKeysEntry end end + # A request message for creating an SSH public key. + # @!attribute [rw] parent + # @return [::String] + # Required. The unique ID for the user in format `users/{user}`. + # @!attribute [rw] ssh_public_key + # @return [::Google::Cloud::OsLogin::Common::SshPublicKey] + # Required. The SSH public key and expiration time. + class CreateSshPublicKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # A request message for deleting a POSIX account entry. # @!attribute [rw] name # @return [::String] @@ -78,6 +93,9 @@ class DeleteSshPublicKeyRequest # @!attribute [rw] system_id # @return [::String] # A system ID for filtering the results of the request. + # @!attribute [rw] view + # @return [::Google::Cloud::OsLogin::V1beta::LoginProfileView] + # The view configures whether to retrieve security keys information. class GetLoginProfileRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -104,6 +122,9 @@ class GetSshPublicKeyRequest # @!attribute [rw] project_id # @return [::String] # The project ID of the Google Cloud Platform project. + # @!attribute [rw] view + # @return [::Google::Cloud::OsLogin::V1beta::LoginProfileView] + # The view configures whether to retrieve security keys information. class ImportSshPublicKeyRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -113,6 +134,9 @@ class ImportSshPublicKeyRequest # @!attribute [rw] login_profile # @return [::Google::Cloud::OsLogin::V1beta::LoginProfile] # The login profile information for the user. + # @!attribute [rw] details + # @return [::String] + # Detailed information about import results. class ImportSshPublicKeyResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -134,6 +158,55 @@ class UpdateSshPublicKeyRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # The credential information for a Google registered security key. + # @!attribute [rw] public_key + # @return [::String] + # Public key text in SSH format, defined by + # [RFC4253]("https://www.ietf.org/rfc/rfc4253.txt") section 6.6. + # @!attribute [rw] private_key + # @return [::String] + # Hardware-backed private key text in SSH format. + # @!attribute [rw] universal_two_factor + # @return [::Google::Cloud::OsLogin::V1beta::UniversalTwoFactor] + # The U2F protocol type. + # @!attribute [rw] web_authn + # @return [::Google::Cloud::OsLogin::V1beta::WebAuthn] + # The Web Authentication protocol type. + class SecurityKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Security key information specific to the U2F protocol. + # @!attribute [rw] app_id + # @return [::String] + # Application ID for the U2F protocol. + class UniversalTwoFactor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Security key information specific to the Web Authentication protocol. + # @!attribute [rw] rp_id + # @return [::String] + # Relying party ID for Web Authentication. + class WebAuthn + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The login profile view limits the user content retrieved. + module LoginProfileView + # The default login profile view. The API defaults to the BASIC view. + LOGIN_PROFILE_VIEW_UNSPECIFIED = 0 + + # Includes POSIX and SSH key information. + BASIC = 1 + + # Include security key information for the user. + SECURITY_KEY = 2 + end end end end diff --git a/google-cloud-os_login-v1beta/proto_docs/google/protobuf/duration.rb b/google-cloud-os_login-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-os_login-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-os_login-v1beta/snippets/os_login_service/create_ssh_public_key.rb b/google-cloud-os_login-v1beta/snippets/os_login_service/create_ssh_public_key.rb new file mode 100644 index 000000000000..739a90b66ca9 --- /dev/null +++ b/google-cloud-os_login-v1beta/snippets/os_login_service/create_ssh_public_key.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START oslogin_v1beta_generated_OsLoginService_CreateSshPublicKey_sync] +require "google/cloud/os_login/v1beta" + +## +# Example demonstrating basic usage of +# Google::Cloud::OsLogin::V1beta::OsLoginService::Client#create_ssh_public_key +# +def create_ssh_public_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new + + # Call the create_ssh_public_key method. + result = client.create_ssh_public_key request + + # The returned object is of type Google::Cloud::OsLogin::Common::SshPublicKey. + p result +end +# [END oslogin_v1beta_generated_OsLoginService_CreateSshPublicKey_sync] diff --git a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json index 65eda8abbd6e..d70f29c7b9f8 100644 --- a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json +++ b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json @@ -11,6 +11,46 @@ ] }, "snippets": [ + { + "region_tag": "oslogin_v1beta_generated_OsLoginService_CreateSshPublicKey_sync", + "title": "Snippet for create_ssh_public_key in OsLoginService", + "description": "Basic snippet for create_ssh_public_key in OsLoginService", + "file": "os_login_service/create_ssh_public_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_ssh_public_key", + "full_name": "::Google::Cloud::OsLogin::V1beta::OsLoginService::Client#create_ssh_public_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::OsLogin::Common::SshPublicKey", + "client": { + "short_name": "OsLoginService::Client", + "full_name": "::Google::Cloud::OsLogin::V1beta::OsLoginService::Client" + }, + "method": { + "short_name": "CreateSshPublicKey", + "full_name": "google.cloud.oslogin.v1beta.OsLoginService.CreateSshPublicKey", + "service": { + "short_name": "OsLoginService", + "full_name": "google.cloud.oslogin.v1beta.OsLoginService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, { "region_tag": "oslogin_v1beta_generated_OsLoginService_DeletePosixAccount_sync", "title": "Snippet for delete_posix_account in OsLoginService", diff --git a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb index e9d9a72100eb..ad5619a96c6d 100644 --- a/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb +++ b/google-cloud-os_login-v1beta/test/google/cloud/os_login/v1beta/os_login_service_test.rb @@ -47,6 +47,66 @@ def call_rpc *args, **kwargs end end + def test_create_ssh_public_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::OsLogin::Common::SshPublicKey.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + ssh_public_key = {} + + create_ssh_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_ssh_public_key, name + assert_kind_of ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OsLogin::Common::SshPublicKey), request["ssh_public_key"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_ssh_public_key_client_stub do + # Create client + client = ::Google::Cloud::OsLogin::V1beta::OsLoginService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_ssh_public_key parent: parent, ssh_public_key: ssh_public_key do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_ssh_public_key ::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_ssh_public_key(::Google::Cloud::OsLogin::V1beta::CreateSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_ssh_public_key_client_stub.call_rpc_count + end + end + def test_delete_posix_account # Create GRPC objects. grpc_response = ::Google::Protobuf::Empty.new @@ -174,6 +234,7 @@ def test_get_login_profile name = "hello world" project_id = "hello world" system_id = "hello world" + view = :LOGIN_PROFILE_VIEW_UNSPECIFIED get_login_profile_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :get_login_profile, name @@ -181,6 +242,7 @@ def test_get_login_profile assert_equal "hello world", request["name"] assert_equal "hello world", request["project_id"] assert_equal "hello world", request["system_id"] + assert_equal :LOGIN_PROFILE_VIEW_UNSPECIFIED, request["view"] refute_nil options end @@ -191,31 +253,31 @@ def test_get_login_profile end # Use hash object - client.get_login_profile({ name: name, project_id: project_id, system_id: system_id }) do |response, operation| + client.get_login_profile({ name: name, project_id: project_id, system_id: system_id, view: view }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.get_login_profile name: name, project_id: project_id, system_id: system_id do |response, operation| + client.get_login_profile name: name, project_id: project_id, system_id: system_id, view: view do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.get_login_profile ::Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new(name: name, project_id: project_id, system_id: system_id) do |response, operation| + client.get_login_profile ::Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new(name: name, project_id: project_id, system_id: system_id, view: view) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.get_login_profile({ name: name, project_id: project_id, system_id: system_id }, grpc_options) do |response, operation| + client.get_login_profile({ name: name, project_id: project_id, system_id: system_id, view: view }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.get_login_profile(::Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new(name: name, project_id: project_id, system_id: system_id), grpc_options) do |response, operation| + client.get_login_profile(::Google::Cloud::OsLogin::V1beta::GetLoginProfileRequest.new(name: name, project_id: project_id, system_id: system_id, view: view), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end @@ -294,6 +356,7 @@ def test_import_ssh_public_key parent = "hello world" ssh_public_key = {} project_id = "hello world" + view = :LOGIN_PROFILE_VIEW_UNSPECIFIED import_ssh_public_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| assert_equal :import_ssh_public_key, name @@ -301,6 +364,7 @@ def test_import_ssh_public_key assert_equal "hello world", request["parent"] assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::OsLogin::Common::SshPublicKey), request["ssh_public_key"] assert_equal "hello world", request["project_id"] + assert_equal :LOGIN_PROFILE_VIEW_UNSPECIFIED, request["view"] refute_nil options end @@ -311,31 +375,31 @@ def test_import_ssh_public_key end # Use hash object - client.import_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key, project_id: project_id }) do |response, operation| + client.import_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key, project_id: project_id, view: view }) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use named arguments - client.import_ssh_public_key parent: parent, ssh_public_key: ssh_public_key, project_id: project_id do |response, operation| + client.import_ssh_public_key parent: parent, ssh_public_key: ssh_public_key, project_id: project_id, view: view do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object - client.import_ssh_public_key ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key, project_id: project_id) do |response, operation| + client.import_ssh_public_key ::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key, project_id: project_id, view: view) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use hash object with options - client.import_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key, project_id: project_id }, grpc_options) do |response, operation| + client.import_ssh_public_key({ parent: parent, ssh_public_key: ssh_public_key, project_id: project_id, view: view }, grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end # Use protobuf object with options - client.import_ssh_public_key(::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key, project_id: project_id), grpc_options) do |response, operation| + client.import_ssh_public_key(::Google::Cloud::OsLogin::V1beta::ImportSshPublicKeyRequest.new(parent: parent, ssh_public_key: ssh_public_key, project_id: project_id, view: view), grpc_options) do |response, operation| assert_equal grpc_response, response assert_equal grpc_operation, operation end From 0925bf883889081920c92cc19a2e7c9cb1a05170 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:24:03 +0530 Subject: [PATCH 073/112] feat(life_sciences): add encrypted_environment to pipeline and Action feat(life_sciences): add reservation to VirtualMachine and support location client --- .../.owlbot-manifest.json | 2 + .../google-cloud-life_sciences-v2beta.gemspec | 1 + .../v2beta/workflows_service/client.rb | 14 + .../cloud/lifesciences/v2beta/workflows_pb.rb | 5 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../cloud/lifesciences/v2beta/workflows.rb | 24 ++ 7 files changed, 434 insertions(+), 1 deletion(-) create mode 100644 google-cloud-life_sciences-v2beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-life_sciences-v2beta/proto_docs/google/api/launch_stage.rb diff --git a/google-cloud-life_sciences-v2beta/.owlbot-manifest.json b/google-cloud-life_sciences-v2beta/.owlbot-manifest.json index 8a1e113667da..c84cc248c003 100644 --- a/google-cloud-life_sciences-v2beta/.owlbot-manifest.json +++ b/google-cloud-life_sciences-v2beta/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/cloud/lifesciences/v2beta/workflows_pb.rb", "lib/google/cloud/lifesciences/v2beta/workflows_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/lifesciences/v2beta/workflows.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-life_sciences-v2beta/google-cloud-life_sciences-v2beta.gemspec b/google-cloud-life_sciences-v2beta/google-cloud-life_sciences-v2beta.gemspec index 5b1eb950d8dc..4fa61124b99f 100644 --- a/google-cloud-life_sciences-v2beta/google-cloud-life_sciences-v2beta.gemspec +++ b/google-cloud-life_sciences-v2beta/google-cloud-life_sciences-v2beta.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb index 1c0584afeb06..926df6788127 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/workflows_service/client.rb @@ -18,6 +18,7 @@ require "google/cloud/errors" require "google/cloud/lifesciences/v2beta/workflows_pb" +require "google/cloud/location" module Google module Cloud @@ -140,6 +141,12 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @workflows_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::LifeSciences::V2beta::WorkflowsServiceV2Beta::Stub, credentials: credentials, @@ -156,6 +163,13 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + # Service calls ## diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/lifesciences/v2beta/workflows_pb.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/lifesciences/v2beta/workflows_pb.rb index 3e4563590ab0..ad68331c90f8 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/lifesciences/v2beta/workflows_pb.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/lifesciences/v2beta/workflows_pb.rb @@ -4,12 +4,12 @@ require 'google/protobuf' require 'google/api/annotations_pb' +require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/duration_pb' require 'google/protobuf/timestamp_pb' require 'google/rpc/code_pb' -require 'google/api/client_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/lifesciences/v2beta/workflows.proto", :syntax => :proto3) do @@ -25,6 +25,7 @@ repeated :actions, :message, 1, "google.cloud.lifesciences.v2beta.Action" optional :resources, :message, 2, "google.cloud.lifesciences.v2beta.Resources" map :environment, :string, :string, 3 + optional :encrypted_environment, :message, 5, "google.cloud.lifesciences.v2beta.Secret" optional :timeout, :message, 4, "google.protobuf.Duration" end add_message "google.cloud.lifesciences.v2beta.Action" do @@ -33,6 +34,7 @@ repeated :commands, :string, 3 optional :entrypoint, :string, 4 map :environment, :string, :string, 5 + optional :encrypted_environment, :message, 21, "google.cloud.lifesciences.v2beta.Secret" optional :pid_namespace, :string, 6 map :port_mappings, :int32, :int32, 8 repeated :mounts, :message, 9, "google.cloud.lifesciences.v2beta.Mount" @@ -77,6 +79,7 @@ optional :enable_stackdriver_monitoring, :bool, 12 repeated :docker_cache_images, :string, 13 repeated :volumes, :message, 14, "google.cloud.lifesciences.v2beta.Volume" + optional :reservation, :string, 15 end add_message "google.cloud.lifesciences.v2beta.ServiceAccount" do optional :email, :string, 1 diff --git a/google-cloud-life_sciences-v2beta/proto_docs/google/api/client.rb b/google-cloud-life_sciences-v2beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-life_sciences-v2beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-life_sciences-v2beta/proto_docs/google/api/launch_stage.rb b/google-cloud-life_sciences-v2beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-life_sciences-v2beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-life_sciences-v2beta/proto_docs/google/cloud/lifesciences/v2beta/workflows.rb b/google-cloud-life_sciences-v2beta/proto_docs/google/cloud/lifesciences/v2beta/workflows.rb index ecf8055ae6e0..54443acdd35c 100644 --- a/google-cloud-life_sciences-v2beta/proto_docs/google/cloud/lifesciences/v2beta/workflows.rb +++ b/google-cloud-life_sciences-v2beta/proto_docs/google/cloud/lifesciences/v2beta/workflows.rb @@ -77,6 +77,15 @@ class RunPipelineResponse # The environment to pass into every action. Each action can also specify # additional environment variables but cannot delete an entry from this map # (though they can overwrite it with a different value). + # @!attribute [rw] encrypted_environment + # @return [::Google::Cloud::LifeSciences::V2beta::Secret] + # The encrypted environment to pass into every action. Each action can also + # specify its own encrypted environment. + # + # The secret must decrypt to a JSON-encoded dictionary where key-value pairs + # serve as environment variable names and their values. The decoded + # environment variables can overwrite the values specified by the + # `environment` field. # @!attribute [rw] timeout # @return [::Google::Protobuf::Duration] # The maximum amount of time to give the pipeline to complete. This includes @@ -149,6 +158,17 @@ class EnvironmentEntry # `GOOGLE_LAST_EXIT_STATUS` will be set to the exit status of the last # non-background action that executed. This can be used by workflow engine # authors to determine whether an individual action has succeeded or failed. + # @!attribute [rw] encrypted_environment + # @return [::Google::Cloud::LifeSciences::V2beta::Secret] + # The encrypted environment to pass into the container. This environment is + # merged with values specified in the + # {::Google::Cloud::LifeSciences::V2beta::Pipeline google.cloud.lifesciences.v2beta.Pipeline} message, overwriting any + # duplicate values. + # + # The secret must decrypt to a JSON-encoded dictionary where key-value pairs + # serve as environment variable names and their values. The decoded + # environment variables can overwrite the values specified by the + # `environment` field. # @!attribute [rw] pid_namespace # @return [::String] # An optional identifier for a PID namespace to run the action inside. @@ -425,6 +445,10 @@ class Resources # The list of disks and other storage to create or attach to the VM. # # Specify either the `volumes[]` field or the `disks[]` field, but not both. + # @!attribute [rw] reservation + # @return [::String] + # If specified, the VM will only be allocated inside the matching + # reservation. It will fail if the VM parameters don't match the reservation. class VirtualMachine include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods From bc73a4d7423655e388dd9c736b5a7f3f300d532d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:37:16 +0530 Subject: [PATCH 074/112] feat(document_ai): support train_processor_version, evaluate_processor_version and evaluations api feat(document_ai): add image_quality_scores to Font_size and Provenance to Dimension feat(document_ai): add documentSchema to ProcessorVersion --- .../.owlbot-manifest.json | 7 + .../gapic_metadata.json | 20 + .../document_processor_service/client.rb | 420 ++++++++++++++++++ .../document_processor_service/paths.rb | 23 + .../cloud/documentai/v1beta3/document_pb.rb | 13 + .../v1beta3/document_processor_service_pb.rb | 59 +++ .../document_processor_service_services_pb.rb | 11 + .../cloud/documentai/v1beta3/evaluation_pb.rb | 72 +++ .../cloud/documentai/v1beta3/processor_pb.rb | 2 + .../proto_docs/google/api/client.rb | 318 +++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- .../cloud/documentai/v1beta3/barcode.rb | 56 +-- .../cloud/documentai/v1beta3/document.rb | 66 ++- .../cloud/documentai/v1beta3/document_io.rb | 4 +- .../v1beta3/document_processor_service.rb | 159 +++++++ .../documentai/v1beta3/document_schema.rb | 7 +- .../cloud/documentai/v1beta3/evaluation.rb | 181 ++++++++ .../cloud/documentai/v1beta3/processor.rb | 13 +- .../documentai/v1beta3/processor_type.rb | 4 +- .../evaluate_processor_version.rb | 46 ++ .../get_evaluation.rb | 39 ++ .../list_evaluations.rb | 45 ++ .../train_processor_version.rb | 46 ++ ...adata_google.cloud.documentai.v1beta3.json | 160 +++++++ .../document_processor_service_paths_test.rb | 12 + .../document_processor_service_test.rb | 261 +++++++++++ 26 files changed, 1997 insertions(+), 53 deletions(-) create mode 100644 google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb create mode 100644 google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb create mode 100644 google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb create mode 100644 google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb create mode 100644 google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb create mode 100644 google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb create mode 100644 google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb diff --git a/google-cloud-document_ai-v1beta3/.owlbot-manifest.json b/google-cloud-document_ai-v1beta3/.owlbot-manifest.json index d421129b5930..bd2af2fa8708 100644 --- a/google-cloud-document_ai-v1beta3/.owlbot-manifest.json +++ b/google-cloud-document_ai-v1beta3/.owlbot-manifest.json @@ -26,11 +26,13 @@ "lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb", "lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb", "lib/google/cloud/documentai/v1beta3/document_schema_pb.rb", + "lib/google/cloud/documentai/v1beta3/evaluation_pb.rb", "lib/google/cloud/documentai/v1beta3/geometry_pb.rb", "lib/google/cloud/documentai/v1beta3/operation_metadata_pb.rb", "lib/google/cloud/documentai/v1beta3/processor_pb.rb", "lib/google/cloud/documentai/v1beta3/processor_type_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", @@ -39,6 +41,7 @@ "proto_docs/google/cloud/documentai/v1beta3/document_io.rb", "proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb", "proto_docs/google/cloud/documentai/v1beta3/document_schema.rb", + "proto_docs/google/cloud/documentai/v1beta3/evaluation.rb", "proto_docs/google/cloud/documentai/v1beta3/geometry.rb", "proto_docs/google/cloud/documentai/v1beta3/operation_metadata.rb", "proto_docs/google/cloud/documentai/v1beta3/processor.rb", @@ -64,15 +67,19 @@ "snippets/document_processor_service/deploy_processor_version.rb", "snippets/document_processor_service/disable_processor.rb", "snippets/document_processor_service/enable_processor.rb", + "snippets/document_processor_service/evaluate_processor_version.rb", "snippets/document_processor_service/fetch_processor_types.rb", + "snippets/document_processor_service/get_evaluation.rb", "snippets/document_processor_service/get_processor.rb", "snippets/document_processor_service/get_processor_version.rb", + "snippets/document_processor_service/list_evaluations.rb", "snippets/document_processor_service/list_processor_types.rb", "snippets/document_processor_service/list_processor_versions.rb", "snippets/document_processor_service/list_processors.rb", "snippets/document_processor_service/process_document.rb", "snippets/document_processor_service/review_document.rb", "snippets/document_processor_service/set_default_processor_version.rb", + "snippets/document_processor_service/train_processor_version.rb", "snippets/document_processor_service/undeploy_processor_version.rb", "snippets/snippet_metadata_google.cloud.documentai.v1beta3.json", "test/google/cloud/document_ai/v1beta3/document_processor_service_operations_test.rb", diff --git a/google-cloud-document_ai-v1beta3/gapic_metadata.json b/google-cloud-document_ai-v1beta3/gapic_metadata.json index 6bceccef85bb..09e2145154fc 100644 --- a/google-cloud-document_ai-v1beta3/gapic_metadata.json +++ b/google-cloud-document_ai-v1beta3/gapic_metadata.json @@ -40,6 +40,11 @@ "get_processor" ] }, + "TrainProcessorVersion": { + "methods": [ + "train_processor_version" + ] + }, "GetProcessorVersion": { "methods": [ "get_processor_version" @@ -94,6 +99,21 @@ "methods": [ "review_document" ] + }, + "EvaluateProcessorVersion": { + "methods": [ + "evaluate_processor_version" + ] + }, + "GetEvaluation": { + "methods": [ + "get_evaluation" + ] + }, + "ListEvaluations": { + "methods": [ + "list_evaluations" + ] } } } diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb index 59413aa83fa4..9f1a13d00530 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/client.rb @@ -225,6 +225,8 @@ def initialize # false. # @param field_mask [::Google::Protobuf::FieldMask, ::Hash] # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::ProcessResponse] @@ -772,6 +774,112 @@ def get_processor request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Trains a new processor version. + # Operation metadata is returned as + # cloud_documentai_core.TrainProcessorVersionMetadata. + # + # @overload train_processor_version(request, options = nil) + # Pass arguments to `train_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload train_processor_version(parent: nil, processor_version: nil, document_schema: nil, input_data: nil, base_processor_version: nil) + # Pass arguments to `train_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The parent (project, location and processor) to create the new version for. + # Format: `projects/{project}/locations/{location}/processors/{processor}`. + # @param processor_version [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion, ::Hash] + # Required. The processor version to be created. + # @param document_schema [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema, ::Hash] + # Optional. The schema the processor version will be trained with. + # @param input_data [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData, ::Hash] + # Optional. The input data used to train the `ProcessorVersion`. + # @param base_processor_version [::String] + # Optional. The processor version to use as a base for training. This processor version + # must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + # + # # Call the train_processor_version method. + # result = client.train_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def train_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.train_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.train_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.train_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :train_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Gets a processor version detail. # @@ -1811,6 +1919,290 @@ def review_document request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + # + # @overload evaluate_processor_version(request, options = nil) + # Pass arguments to `evaluate_processor_version` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload evaluate_processor_version(processor_version: nil, evaluation_documents: nil) + # Pass arguments to `evaluate_processor_version` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param processor_version [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param evaluation_documents [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig, ::Hash] + # Optional. The documents used in the evaluation. If unspecified, use the processor's + # dataset as evaluation input. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + # + # # Call the evaluate_processor_version method. + # result = client.evaluate_processor_version request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def evaluate_processor_version request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.evaluate_processor_version.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.processor_version + header_params["processor_version"] = request.processor_version + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.evaluate_processor_version.timeout, + metadata: metadata, + retry_policy: @config.rpcs.evaluate_processor_version.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :evaluate_processor_version, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a specific evaluation. + # + # @overload get_evaluation(request, options = nil) + # Pass arguments to `get_evaluation` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload get_evaluation(name: nil) + # Pass arguments to `get_evaluation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + # + # # Call the get_evaluation method. + # result = client.get_evaluation request + # + # # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p result + # + def get_evaluation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.get_evaluation.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.get_evaluation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_evaluation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :get_evaluation, request, options: options do |response, operation| + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Retrieves a set of evaluations for a given processor version. + # + # @overload list_evaluations(request, options = nil) + # Pass arguments to `list_evaluations` via a request object, either of type + # {::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload list_evaluations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_evaluations` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param parent [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @param page_size [::Integer] + # The standard list page size. + # If unspecified, at most 5 evaluations will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @param page_token [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/document_ai/v1beta3" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + # + # # Call the list_evaluations method. + # result = client.list_evaluations request + # + # # The returned object is of type Gapic::PagedEnumerable. You can + # # iterate over all elements by calling #each, and the enumerable + # # will lazily make API calls to fetch subsequent pages. Other + # # methods are also available for managing paging directly. + # result.each do |response| + # # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + # p response + # end + # + def list_evaluations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.list_evaluations.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::DocumentAI::V1beta3::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.parent + header_params["parent"] = request.parent + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.list_evaluations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_evaluations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @document_processor_service_stub.call_rpc :list_evaluations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @document_processor_service_stub, :list_evaluations, request, response, operation, options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the DocumentProcessorService API. # @@ -1977,6 +2369,11 @@ class Rpcs # attr_reader :get_processor ## + # RPC-specific configuration for `train_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :train_processor_version + ## # RPC-specific configuration for `get_processor_version` # @return [::Gapic::Config::Method] # @@ -2031,6 +2428,21 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :review_document + ## + # RPC-specific configuration for `evaluate_processor_version` + # @return [::Gapic::Config::Method] + # + attr_reader :evaluate_processor_version + ## + # RPC-specific configuration for `get_evaluation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_evaluation + ## + # RPC-specific configuration for `list_evaluations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_evaluations # @private def initialize parent_rpcs = nil @@ -2046,6 +2458,8 @@ def initialize parent_rpcs = nil @list_processors = ::Gapic::Config::Method.new list_processors_config get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor @get_processor = ::Gapic::Config::Method.new get_processor_config + train_processor_version_config = parent_rpcs.train_processor_version if parent_rpcs.respond_to? :train_processor_version + @train_processor_version = ::Gapic::Config::Method.new train_processor_version_config get_processor_version_config = parent_rpcs.get_processor_version if parent_rpcs.respond_to? :get_processor_version @get_processor_version = ::Gapic::Config::Method.new get_processor_version_config list_processor_versions_config = parent_rpcs.list_processor_versions if parent_rpcs.respond_to? :list_processor_versions @@ -2068,6 +2482,12 @@ def initialize parent_rpcs = nil @set_default_processor_version = ::Gapic::Config::Method.new set_default_processor_version_config review_document_config = parent_rpcs.review_document if parent_rpcs.respond_to? :review_document @review_document = ::Gapic::Config::Method.new review_document_config + evaluate_processor_version_config = parent_rpcs.evaluate_processor_version if parent_rpcs.respond_to? :evaluate_processor_version + @evaluate_processor_version = ::Gapic::Config::Method.new evaluate_processor_version_config + get_evaluation_config = parent_rpcs.get_evaluation if parent_rpcs.respond_to? :get_evaluation + @get_evaluation = ::Gapic::Config::Method.new get_evaluation_config + list_evaluations_config = parent_rpcs.list_evaluations if parent_rpcs.respond_to? :list_evaluations + @list_evaluations = ::Gapic::Config::Method.new list_evaluations_config yield self if block_given? end diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb index 3165a316e80a..e65639f8099a 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/document_processor_service/paths.rb @@ -24,6 +24,29 @@ module V1beta3 module DocumentProcessorService # Path helper methods for the DocumentProcessorService API. module Paths + ## + # Create a fully-qualified Evaluation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # @param processor_version [String] + # @param evaluation [String] + # + # @return [::String] + def evaluation_path project:, location:, processor:, processor_version:, evaluation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "processor cannot contain /" if processor.to_s.include? "/" + raise ::ArgumentError, "processor_version cannot contain /" if processor_version.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}/processorVersions/#{processor_version}/evaluations/#{evaluation}" + end + ## # Create a fully-qualified HumanReviewConfig resource string. # diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb index 9d1c12263c1e..daeabd9479e9 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_pb.rb @@ -45,6 +45,7 @@ optional :text_style, :string, 5 optional :text_decoration, :string, 6 optional :font_size, :message, 7, "google.cloud.documentai.v1beta3.Document.Style.FontSize" + optional :font_family, :string, 8 end add_message "google.cloud.documentai.v1beta3.Document.Style.FontSize" do optional :size, :float, 1 @@ -66,6 +67,7 @@ repeated :form_fields, :message, 11, "google.cloud.documentai.v1beta3.Document.Page.FormField" repeated :symbols, :message, 12, "google.cloud.documentai.v1beta3.Document.Page.Symbol" repeated :detected_barcodes, :message, 15, "google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode" + optional :image_quality_scores, :message, 17, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" optional :provenance, :message, 16, "google.cloud.documentai.v1beta3.Document.Provenance" end add_message "google.cloud.documentai.v1beta3.Document.Page.Dimension" do @@ -142,6 +144,7 @@ repeated :header_rows, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" repeated :body_rows, :message, 3, "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" repeated :detected_languages, :message, 4, "google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage" + optional :provenance, :message, 5, "google.cloud.documentai.v1beta3.Document.Provenance" end add_message "google.cloud.documentai.v1beta3.Document.Page.Table.TableRow" do repeated :cells, :message, 1, "google.cloud.documentai.v1beta3.Document.Page.Table.TableCell" @@ -170,6 +173,14 @@ optional :language_code, :string, 1 optional :confidence, :float, 2 end + add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores" do + optional :quality_score, :float, 1 + repeated :detected_defects, :message, 2, "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" + end + add_message "google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect" do + optional :type, :string, 1 + optional :confidence, :float, 2 + end add_message "google.cloud.documentai.v1beta3.Document.Entity" do optional :text_anchor, :message, 1, "google.cloud.documentai.v1beta3.Document.TextAnchor" optional :type, :string, 2 @@ -299,6 +310,8 @@ module V1beta3 Document::Page::FormField = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.FormField").msgclass Document::Page::DetectedBarcode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode").msgclass Document::Page::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.DetectedLanguage").msgclass + Document::Page::ImageQualityScores = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores").msgclass + Document::Page::ImageQualityScores::DetectedDefect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Page.ImageQualityScores.DetectedDefect").msgclass Document::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity").msgclass Document::Entity::NormalizedValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.Entity.NormalizedValue").msgclass Document::EntityRelation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Document.EntityRelation").msgclass diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb index 44dcc4d46caa..03f160ffe660 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_pb.rb @@ -10,6 +10,7 @@ require 'google/cloud/documentai/v1beta3/document_pb' require 'google/cloud/documentai/v1beta3/document_io_pb' require 'google/cloud/documentai/v1beta3/document_schema_pb' +require 'google/cloud/documentai/v1beta3/evaluation_pb' require 'google/cloud/documentai/v1beta3/operation_metadata_pb' require 'google/cloud/documentai/v1beta3/processor_pb' require 'google/cloud/documentai/v1beta3/processor_type_pb' @@ -183,6 +184,31 @@ add_message "google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata" do optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest" do + optional :parent, :string, 1 + optional :processor_version, :message, 2, "google.cloud.documentai.v1beta3.ProcessorVersion" + optional :document_schema, :message, 10, "google.cloud.documentai.v1beta3.DocumentSchema" + optional :input_data, :message, 4, "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" + optional :base_processor_version, :string, 8 + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData" do + optional :training_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + optional :test_documents, :message, 4, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionResponse" do + optional :processor_version, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + optional :training_dataset_validation, :message, 2, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" + optional :test_dataset_validation, :message, 3, "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" + end + add_message "google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation" do + optional :document_error_count, :int32, 3 + optional :dataset_error_count, :int32, 4 + repeated :document_errors, :message, 1, "google.rpc.Status" + repeated :dataset_errors, :message, 2, "google.rpc.Status" + end add_message "google.cloud.documentai.v1beta3.ReviewDocumentRequest" do optional :human_review_config, :string, 1 optional :document, :message, 2, "google.cloud.documentai.v1beta3.Document" @@ -223,6 +249,28 @@ value :FAILED, 4 value :CANCELLED, 5 end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest" do + optional :processor_version, :string, 1 + optional :evaluation_documents, :message, 3, "google.cloud.documentai.v1beta3.BatchDocumentsInputConfig" + end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata" do + optional :common_metadata, :message, 1, "google.cloud.documentai.v1beta3.CommonOperationMetadata" + end + add_message "google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse" do + optional :evaluation, :string, 2 + end + add_message "google.cloud.documentai.v1beta3.GetEvaluationRequest" do + optional :name, :string, 1 + end + add_message "google.cloud.documentai.v1beta3.ListEvaluationsRequest" do + optional :parent, :string, 1 + optional :page_size, :int32, 2 + optional :page_token, :string, 3 + end + add_message "google.cloud.documentai.v1beta3.ListEvaluationsResponse" do + repeated :evaluations, :message, 1, "google.cloud.documentai.v1beta3.Evaluation" + optional :next_page_token, :string, 2 + end end end @@ -271,12 +319,23 @@ module V1beta3 SetDefaultProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionRequest").msgclass SetDefaultProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionResponse").msgclass SetDefaultProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.SetDefaultProcessorVersionMetadata").msgclass + TrainProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest").msgclass + TrainProcessorVersionRequest::InputData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionRequest.InputData").msgclass + TrainProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionResponse").msgclass + TrainProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata").msgclass + TrainProcessorVersionMetadata::DatasetValidation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata.DatasetValidation").msgclass ReviewDocumentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest").msgclass ReviewDocumentRequest::Priority = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentRequest.Priority").enummodule ReviewDocumentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse").msgclass ReviewDocumentResponse::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentResponse.State").enummodule ReviewDocumentOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata").msgclass ReviewDocumentOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ReviewDocumentOperationMetadata.State").enummodule + EvaluateProcessorVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionRequest").msgclass + EvaluateProcessorVersionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionMetadata").msgclass + EvaluateProcessorVersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.EvaluateProcessorVersionResponse").msgclass + GetEvaluationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.GetEvaluationRequest").msgclass + ListEvaluationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsRequest").msgclass + ListEvaluationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.ListEvaluationsResponse").msgclass end end end diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb index 7107486ec0cd..87795a720ce5 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_processor_service_services_pb.rb @@ -50,6 +50,10 @@ class Service rpc :ListProcessors, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListProcessorsResponse # Gets a processor detail. rpc :GetProcessor, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorRequest, ::Google::Cloud::DocumentAI::V1beta3::Processor + # Trains a new processor version. + # Operation metadata is returned as + # cloud_documentai_core.TrainProcessorVersionMetadata. + rpc :TrainProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, ::Google::Longrunning::Operation # Gets a processor version detail. rpc :GetProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::GetProcessorVersionRequest, ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion # Lists all versions of a processor. @@ -78,6 +82,13 @@ class Service # Send a document for Human Review. The input document should be processed by # the specified processor. rpc :ReviewDocument, ::Google::Cloud::DocumentAI::V1beta3::ReviewDocumentRequest, ::Google::Longrunning::Operation + # Evaluates a ProcessorVersion against annotated documents, producing an + # Evaluation. + rpc :EvaluateProcessorVersion, ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, ::Google::Longrunning::Operation + # Retrieves a specific evaluation. + rpc :GetEvaluation, ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, ::Google::Cloud::DocumentAI::V1beta3::Evaluation + # Retrieves a set of evaluations for a given processor version. + rpc :ListEvaluations, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse end Stub = Service.rpc_stub_class diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb new file mode 100644 index 000000000000..a0aacac71687 --- /dev/null +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/evaluation_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/documentai/v1beta3/evaluation.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/documentai/v1beta3/evaluation.proto", :syntax => :proto3) do + add_message "google.cloud.documentai.v1beta3.Evaluation" do + optional :name, :string, 1 + optional :create_time, :message, 2, "google.protobuf.Timestamp" + optional :document_counters, :message, 5, "google.cloud.documentai.v1beta3.Evaluation.Counters" + optional :all_entities_metrics, :message, 3, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" + map :entity_metrics, :string, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" + optional :kms_key_name, :string, 6 + optional :kms_key_version_name, :string, 7 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.Counters" do + optional :input_documents_count, :int32, 1 + optional :invalid_documents_count, :int32, 2 + optional :failed_documents_count, :int32, 3 + optional :evaluated_documents_count, :int32, 4 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.Metrics" do + optional :precision, :float, 1 + optional :recall, :float, 2 + optional :f1_score, :float, 3 + optional :predicted_occurrences_count, :int32, 4 + optional :ground_truth_occurrences_count, :int32, 5 + optional :predicted_document_count, :int32, 10 + optional :ground_truth_document_count, :int32, 11 + optional :true_positives_count, :int32, 6 + optional :false_positives_count, :int32, 7 + optional :false_negatives_count, :int32, 8 + optional :total_documents_count, :int32, 9 + end + add_message "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" do + optional :confidence_level, :float, 1 + optional :metrics, :message, 2, "google.cloud.documentai.v1beta3.Evaluation.Metrics" + end + add_message "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics" do + repeated :confidence_level_metrics, :message, 1, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" + repeated :confidence_level_metrics_exact, :message, 4, "google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics" + optional :auprc, :float, 2 + optional :estimated_calibration_error, :float, 3 + optional :auprc_exact, :float, 5 + optional :estimated_calibration_error_exact, :float, 6 + optional :metrics_type, :enum, 7, "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" + end + add_enum "google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType" do + value :METRICS_TYPE_UNSPECIFIED, 0 + value :AGGREGATE, 1 + end + end +end + +module Google + module Cloud + module DocumentAI + module V1beta3 + Evaluation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation").msgclass + Evaluation::Counters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Counters").msgclass + Evaluation::Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.Metrics").msgclass + Evaluation::ConfidenceLevelMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.ConfidenceLevelMetrics").msgclass + Evaluation::MultiConfidenceMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics").msgclass + Evaluation::MultiConfidenceMetrics::MetricsType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.documentai.v1beta3.Evaluation.MultiConfidenceMetrics.MetricsType").enummodule + end + end + end +end diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb index 3a7a160a7d60..4989e6d25e9a 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/processor_pb.rb @@ -5,6 +5,7 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/cloud/documentai/v1beta3/document_schema_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do @@ -12,6 +13,7 @@ add_message "google.cloud.documentai.v1beta3.ProcessorVersion" do optional :name, :string, 1 optional :display_name, :string, 2 + optional :document_schema, :message, 12, "google.cloud.documentai.v1beta3.DocumentSchema" optional :state, :enum, 6, "google.cloud.documentai.v1beta3.ProcessorVersion.State" optional :create_time, :message, 7, "google.protobuf.Timestamp" optional :kms_key_name, :string, 9 diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb index 815ad6fd1e93..ce75038366ae 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb index c12f1fff0afd..f508aeb8ef7f 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/barcode.rb @@ -26,41 +26,43 @@ module V1beta3 # @return [::String] # Format of a barcode. # The supported formats are: - # CODE_128: Code 128 type. - # CODE_39: Code 39 type. - # CODE_93: Code 93 type. - # CODABAR: Codabar type. - # DATA_MATRIX: 2D Data Matrix type. - # ITF: ITF type. - # EAN_13: EAN-13 type. - # EAN_8: EAN-8 type. - # QR_CODE: 2D QR code type. - # UPC_A: UPC-A type. - # UPC_E: UPC-E type. - # PDF417: PDF417 type. - # AZTEC: 2D Aztec code type. - # DATABAR: GS1 DataBar code type. + # + # - `CODE_128`: Code 128 type. + # - `CODE_39`: Code 39 type. + # - `CODE_93`: Code 93 type. + # - `CODABAR`: Codabar type. + # - `DATA_MATRIX`: 2D Data Matrix type. + # - `ITF`: ITF type. + # - `EAN_13`: EAN-13 type. + # - `EAN_8`: EAN-8 type. + # - `QR_CODE`: 2D QR code type. + # - `UPC_A`: UPC-A type. + # - `UPC_E`: UPC-E type. + # - `PDF417`: PDF417 type. + # - `AZTEC`: 2D Aztec code type. + # - `DATABAR`: GS1 DataBar code type. # @!attribute [rw] value_format # @return [::String] # Value format describes the format of the value that a barcode # encodes. # The supported formats are: - # CONTACT_INFO: Contact information. - # EMAIL: Email address. - # ISBN: ISBN identifier. - # PHONE: Phone number. - # PRODUCT: Product. - # SMS: SMS message. - # TEXT: Text string. - # URL: URL address. - # WIFI: Wifi information. - # GEO: Geo-localization. - # CALENDAR_EVENT: Calendar event. - # DRIVER_LICENSE: Driver's license. + # + # - `CONTACT_INFO`: Contact information. + # - `EMAIL`: Email address. + # - `ISBN`: ISBN identifier. + # - `PHONE`: Phone number. + # - `PRODUCT`: Product. + # - `SMS`: SMS message. + # - `TEXT`: Text string. + # - `URL`: URL address. + # - `WIFI`: Wifi information. + # - `GEO`: Geo-localization. + # - `CALENDAR_EVENT`: Calendar event. + # - `DRIVER_LICENSE`: Driver's license. # @!attribute [rw] raw_value # @return [::String] # Raw value encoded in the barcode. - # For example, 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. + # For example: `'MEBKM:TITLE:Google;URL:https://www.google.com;;'`. class Barcode include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb index f6930ab17782..2531bed97be7 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document.rb @@ -60,9 +60,9 @@ module V1beta3 # Placeholder. Relationship among {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}. # @!attribute [rw] text_changes # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>] - # Placeholder. A list of text corrections made to [Document.text]. This is - # usually used for annotating corrections to OCR mistakes. Text changes for - # a given revision may not overlap with each other. + # Placeholder. A list of text corrections made to {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. This + # is usually used for annotating corrections to OCR mistakes. Text changes + # for a given revision may not overlap with each other. # @!attribute [rw] shard_info # @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo] # Information about the sharding if this document is sharded part of a larger @@ -122,6 +122,10 @@ class ShardInfo # @!attribute [rw] font_size # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize] # Font size. + # @!attribute [rw] font_family + # @return [::String] + # Font family such as `Arial`, `Times New Roman`. + # https://www.w3schools.com/cssref/pr_font_font-family.asp class Style include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -195,6 +199,9 @@ class FontSize # @!attribute [rw] detected_barcodes # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedBarcode>] # A list of detected barcodes. + # @!attribute [rw] image_quality_scores + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores] + # Image Quality Scores. # @!attribute [rw] provenance # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] # The history of this page. @@ -265,7 +272,7 @@ class Matrix # @return [::Float] # Confidence of the current {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} within context of the object this # layout is for. e.g. confidence can be for a single token, a table, - # a visual element, etc. depending on context. Range [0, 1]. + # a visual element, etc. depending on context. Range `[0, 1]`. # @!attribute [rw] bounding_poly # @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly] # The bounding polygon for the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}. @@ -357,7 +364,7 @@ class Line # A list of detected languages together with confidence. # @!attribute [rw] provenance # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] - # The history of this annotation. + # The history of this annotation. class Token include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -428,6 +435,9 @@ class VisualElement # @!attribute [rw] detected_languages # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>] # A list of detected languages together with confidence. + # @!attribute [rw] provenance + # @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance] + # The history of this table. class Table include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -514,16 +524,50 @@ class DetectedBarcode # Detected language for a structural component. # @!attribute [rw] language_code # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # The BCP-47 language code, such as `en-US` or `sr-Latn`. For more # information, see # https://www.unicode.org/reports/tr35/#Unicode_locale_identifier. # @!attribute [rw] confidence # @return [::Float] - # Confidence of detected language. Range [0, 1]. + # Confidence of detected language. Range `[0, 1]`. class DetectedLanguage include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Image Quality Scores for the page image + # @!attribute [rw] quality_score + # @return [::Float] + # The overall quality score. Range `[0, 1]` where 1 is perfect quality. + # @!attribute [rw] detected_defects + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::ImageQualityScores::DetectedDefect>] + # A list of detected defects. + class ImageQualityScores + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Image Quality Defects + # @!attribute [rw] type + # @return [::String] + # Name of the defect type. Supported values are: + # + # - `quality/defect_blurry` + # - `quality/defect_noisy` + # - `quality/defect_dark` + # - `quality/defect_faint` + # - `quality/defect_text_too_small` + # - `quality/defect_document_cutoff` + # - `quality/defect_text_cutoff` + # - `quality/defect_glare` + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected defect. Range `[0, 1]` where 1 indicates + # strong confidence of that the defect exists. + class DetectedDefect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end end # An entity that could be a phrase in the text or a property that belongs to @@ -538,14 +582,13 @@ class DetectedLanguage # Required. Entity type from a schema e.g. `Address`. # @!attribute [rw] mention_text # @return [::String] - # Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`. If the entity - # is not present in the document, this field will be empty. + # Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`. # @!attribute [rw] mention_id # @return [::String] # Optional. Deprecated. Use `id` field instead. # @!attribute [rw] confidence # @return [::Float] - # Optional. Confidence of detected Schema entity. Range [0, 1]. + # Optional. Confidence of detected Schema entity. Range `[0, 1]`. # @!attribute [rw] page_anchor # @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor] # Optional. Represents the provenance of this entity wrt. the location on the @@ -610,6 +653,7 @@ class Entity # or int normalized text by default. # # Below are sample formats mapped to structured values. + # # - Money/Currency type (`money_value`) is in the ISO 4217 text format. # - Date type (`date_value`) is in the ISO 8601 text format. # - Datetime type (`datetime_value`) is in the ISO 8601 text format. @@ -691,7 +735,7 @@ class PageAnchor # Optional. Identifies the bounding polygon of a layout element on the page. # @!attribute [rw] confidence # @return [::Float] - # Optional. Confidence of detected page element, if applicable. Range [0, 1]. + # Optional. Confidence of detected page element, if applicable. Range `[0, 1]`. class PageRef include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb index bb8bbb00c1b7..19fed486cb77 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -28,7 +28,7 @@ module V1beta3 # @!attribute [rw] mime_type # @return [::String] # An IANA MIME type (RFC6838) indicating the nature and format of the - # [content]. + # {::Google::Cloud::DocumentAI::V1beta3::RawDocument#content content}. class RawDocument include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -67,7 +67,7 @@ class GcsPrefix # The common config to specify a set of documents used as input. # @!attribute [rw] gcs_prefix # @return [::Google::Cloud::DocumentAI::V1beta3::GcsPrefix] - # The set of documents that match the specified Cloud Storage [gcs_prefix]. + # The set of documents that match the specified Cloud Storage `gcs_prefix`. # @!attribute [rw] gcs_documents # @return [::Google::Cloud::DocumentAI::V1beta3::GcsDocuments] # The set of documents individually specified on Cloud Storage. diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb index de373163e714..9855fc1c6655 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_processor_service.rb @@ -46,6 +46,8 @@ module V1beta3 # @!attribute [rw] field_mask # @return [::Google::Protobuf::FieldMask] # Specifies which fields to include in ProcessResponse's document. + # Only supports top level document and pages field so it must be in the form + # of `{document_field_name}` or `pages.{page_field_name}`. class ProcessRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -553,6 +555,89 @@ class SetDefaultProcessorVersionMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request message for the create processor version method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent (project, location and processor) to create the new version for. + # Format: `projects/{project}/locations/{location}/processors/{processor}`. + # @!attribute [rw] processor_version + # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion] + # Required. The processor version to be created. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # Optional. The schema the processor version will be trained with. + # @!attribute [rw] input_data + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData] + # Optional. The input data used to train the `ProcessorVersion`. + # @!attribute [rw] base_processor_version + # @return [::String] + # Optional. The processor version to use as a base for training. This processor version + # must be a child of `parent`. Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`. + class TrainProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The input data used to train a new `ProcessorVersion`. + # @!attribute [rw] training_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for training the new version. + # @!attribute [rw] test_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # The documents used for testing the trained version. + class InputData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The response for the TrainProcessorVersion method. + # @!attribute [rw] processor_version + # @return [::String] + # The resource name of the processor version produced by training. + class TrainProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata that represents a processor version being created. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + # @!attribute [rw] training_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The training dataset validation information. + # @!attribute [rw] test_dataset_validation + # @return [::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionMetadata::DatasetValidation] + # The test dataset validation information. + class TrainProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The dataset validation information. + # This includes any and all errors with documents and the dataset. + # @!attribute [rw] document_error_count + # @return [::Integer] + # The total number of document errors. + # @!attribute [rw] dataset_error_count + # @return [::Integer] + # The total number of dataset errors. + # @!attribute [rw] document_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information pertaining to specific documents. A maximum of 10 + # document errors will be returned. + # Any document with errors will not be used throughout training. + # @!attribute [rw] dataset_errors + # @return [::Array<::Google::Rpc::Status>] + # Error information for the dataset as a whole. A maximum of 10 dataset + # errors will be returned. + # A single dataset error is terminal for training. + class DatasetValidation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + # Request message for review document method. # @!attribute [rw] inline_document # @return [::Google::Cloud::DocumentAI::V1beta3::Document] @@ -661,6 +746,80 @@ module State CANCELLED = 5 end end + + # Evaluates the given ProcessorVersion against the supplied documents. + # @!attribute [rw] processor_version + # @return [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to evaluate. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] evaluation_documents + # @return [::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig] + # Optional. The documents used in the evaluation. If unspecified, use the processor's + # dataset as evaluation input. + class EvaluateProcessorVersionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the EvaluateProcessorVersion method. + # @!attribute [rw] common_metadata + # @return [::Google::Cloud::DocumentAI::V1beta3::CommonOperationMetadata] + # The basic metadata of the long running operation. + class EvaluateProcessorVersionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata of the EvaluateProcessorVersion method. + # @!attribute [rw] evaluation + # @return [::String] + # The resource name of the created evaluation. + class EvaluateProcessorVersionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a specific Evaluation. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::Evaluation Evaluation} to get. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}` + class GetEvaluationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Retrieves a list of evaluations for a given ProcessorVersion. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the {::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion ProcessorVersion} to list evaluations for. + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}` + # @!attribute [rw] page_size + # @return [::Integer] + # The standard list page size. + # If unspecified, at most 5 evaluations will be returned. + # The maximum value is 100; values above 100 will be coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListEvaluations` call. + # Provide this to retrieve the subsequent page. + class ListEvaluationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response from ListEvaluations. + # @!attribute [rw] evaluations + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation>] + # The evaluations requested. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListEvaluationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb index dfad28dc5ca3..21c8695f94f1 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_schema.rb @@ -56,15 +56,16 @@ class DocumentSchema # Name of the type. It must be unique within the schema file and # cannot be a 'Common Type'. Besides that we use the following naming # conventions: - # - *use snake_casing* + # + # - *use `snake_casing`* # - name matching is case-insensitive # - Maximum 64 characters. # - Must start with a letter. # - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward # compatibility internal infrastructure and tooling can handle any ascii # character) - # - The '/' is sometimes used to denote a property of a type. For example - # line_item/amount. This convention is deprecated, but will still be + # - The `/` is sometimes used to denote a property of a type. For example + # `line_item/amount`. This convention is deprecated, but will still be # honored for backward compatibility. # @!attribute [rw] base_types # @return [::Array<::String>] diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb new file mode 100644 index 000000000000..2c5551bca5be --- /dev/null +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/evaluation.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module DocumentAI + module V1beta3 + # An evaluation of a ProcessorVersion's performance. + # @!attribute [rw] name + # @return [::String] + # The resource name of the evaluation. + # Format: + # `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}` + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time that the evaluation was created. + # @!attribute [rw] document_counters + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Counters] + # Counters for the documents used in the evaluation. + # @!attribute [rw] all_entities_metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + # Metrics for all the entities in aggregate. + # @!attribute [rw] entity_metrics + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics}] + # Metrics across confidence levels, for different entities. + # @!attribute [rw] kms_key_name + # @return [::String] + # The KMS key name used for encryption. + # @!attribute [rw] kms_key_version_name + # @return [::String] + # The KMS key version with which data is encrypted. + class Evaluation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Evaluation counters for the documents that were used. + # @!attribute [rw] input_documents_count + # @return [::Integer] + # How many documents were sent for evaluation. + # @!attribute [rw] invalid_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as they didn't + # pass validation. + # @!attribute [rw] failed_documents_count + # @return [::Integer] + # How many documents were not included in the evaluation as Document AI + # failed to process them. + # @!attribute [rw] evaluated_documents_count + # @return [::Integer] + # How many documents were used in the evaluation. + class Counters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluation metrics, either in aggregate or about a specific entity. + # @!attribute [rw] precision + # @return [::Float] + # The calculated precision. + # @!attribute [rw] recall + # @return [::Float] + # The calculated recall. + # @!attribute [rw] f1_score + # @return [::Float] + # The calculated f1 score. + # @!attribute [rw] predicted_occurrences_count + # @return [::Integer] + # The amount of occurrences in predicted documents. + # @!attribute [rw] ground_truth_occurrences_count + # @return [::Integer] + # The amount of occurrences in ground truth documents. + # @!attribute [rw] predicted_document_count + # @return [::Integer] + # The amount of documents with a predicted occurrence. + # @!attribute [rw] ground_truth_document_count + # @return [::Integer] + # The amount of documents with a ground truth occurrence. + # @!attribute [rw] true_positives_count + # @return [::Integer] + # The amount of true positives. + # @!attribute [rw] false_positives_count + # @return [::Integer] + # The amount of false positives. + # @!attribute [rw] false_negatives_count + # @return [::Integer] + # The amount of false negatives. + # @!attribute [rw] total_documents_count + # @return [::Integer] + # The amount of documents that had an occurrence of this label. + class Metrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Evaluations metrics, at a specific confidence level. + # @!attribute [rw] confidence_level + # @return [::Float] + # The confidence level. + # @!attribute [rw] metrics + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::Metrics] + # The metrics at the specific confidence level. + class ConfidenceLevelMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metrics across multiple confidence levels. + # @!attribute [rw] confidence_level_metrics + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with fuzzy matching enabled. + # @!attribute [rw] confidence_level_metrics_exact + # @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Evaluation::ConfidenceLevelMetrics>] + # Metrics across confidence levels with only exact matching. + # @!attribute [rw] auprc + # @return [::Float] + # The calculated area under the precision recall curve (AUPRC), computed by + # integrating over all confidence thresholds. + # @!attribute [rw] estimated_calibration_error + # @return [::Float] + # The Estimated Calibration Error (ECE) of the confidence of the predicted + # entities. + # @!attribute [rw] auprc_exact + # @return [::Float] + # The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching + # only. + # @!attribute [rw] estimated_calibration_error_exact + # @return [::Float] + # The ECE for the predicted entities with fuzzy matching disabled, i.e., + # exact matching only. + # @!attribute [rw] metrics_type + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics::MetricsType] + # The metrics type for the label. + class MultiConfidenceMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A type that determines how metrics should be interpreted. + module MetricsType + # The metrics type is unspecified. By default, metrics without a + # particular specification are for leaf entity types (i.e., top-level + # entity types without child types, or child types which are not + # parent types themselves). + METRICS_TYPE_UNSPECIFIED = 0 + + # Indicates whether metrics for this particular label type represent an + # aggregate of metrics for other types instead of being based on actual + # TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf) + # entity types are an aggregate of metrics for their children. + AGGREGATE = 1 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::DocumentAI::V1beta3::Evaluation::MultiConfidenceMetrics] + class EntityMetricsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb index 1ab693f1752a..a46ddb322865 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor.rb @@ -34,6 +34,9 @@ module V1beta3 # @!attribute [rw] display_name # @return [::String] # The display name of the processor version. + # @!attribute [rw] document_schema + # @return [::Google::Cloud::DocumentAI::V1beta3::DocumentSchema] + # The schema of the processor version. Describes the output. # @!attribute [rw] state # @return [::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion::State] # The state of the processor version. @@ -104,7 +107,7 @@ module State # Format: `projects/{project}/locations/{location}/processors/{processor}` # @!attribute [rw] type # @return [::String] - # The processor type, e.g., OCR_PROCESSOR, INVOICE_PROCESSOR, etc. + # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. # To get a list of processors types, see # {::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#fetch_processor_types FetchProcessorTypes}. # @!attribute [rw] display_name @@ -143,14 +146,14 @@ module State # The processor is disabled. DISABLED = 2 - # The processor is being enabled, will become ENABLED if successful. + # The processor is being enabled, will become `ENABLED` if successful. ENABLING = 3 - # The processor is being disabled, will become DISABLED if successful. + # The processor is being disabled, will become `DISABLED` if successful. DISABLING = 4 - # The processor is being created, will become either ENABLED (for - # successful creation) or FAILED (for failed ones). + # The processor is being created, will become either `ENABLED` (for + # successful creation) or `FAILED` (for failed ones). # Once a processor is in this state, it can then be used for document # processing, but the feature dependencies of the processor might not be # fully created yet. diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb index c4c96a5ba246..552e63b79b52 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/processor_type.rb @@ -26,10 +26,10 @@ module V1beta3 # @!attribute [rw] name # @return [::String] # The resource name of the processor type. - # Format: projects/\\{project}/processorTypes/\\{processor_type} + # Format: `projects/{project}/processorTypes/{processor_type}` # @!attribute [rw] type # @return [::String] - # The type of the processor, e.g., "invoice_parsing". + # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc. # @!attribute [rw] category # @return [::String] # The processor category, used by UI to group processor types. diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb new file mode 100644 index 000000000000..840ed914ed5d --- /dev/null +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/evaluate_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version +# +def evaluate_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new + + # Call the evaluate_processor_version method. + result = client.evaluate_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb new file mode 100644 index 000000000000..fa72c8f5e9d5 --- /dev/null +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/get_evaluation.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation +# +def get_evaluation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new + + # Call the get_evaluation method. + result = client.get_evaluation request + + # The returned object is of type Google::Cloud::DocumentAI::V1beta3::Evaluation. + p result +end +# [END documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb new file mode 100644 index 000000000000..94e6d699608e --- /dev/null +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/list_evaluations.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations +# +def list_evaluations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new + + # Call the list_evaluations method. + result = client.list_evaluations request + + # The returned object is of type Gapic::PagedEnumerable. You can + # iterate over all elements by calling #each, and the enumerable + # will lazily make API calls to fetch subsequent pages. Other + # methods are also available for managing paging directly. + result.each do |response| + # Each element is of type ::Google::Cloud::DocumentAI::V1beta3::Evaluation. + p response + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb new file mode 100644 index 000000000000..f65801114545 --- /dev/null +++ b/google-cloud-document_ai-v1beta3/snippets/document_processor_service/train_processor_version.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] +require "google/cloud/document_ai/v1beta3" + +## +# Example demonstrating basic usage of +# Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version +# +def train_processor_version + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new + + # Call the train_processor_version method. + result = client.train_processor_version request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync] diff --git a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json index 417b1497b0d1..34b49a09e1bb 100644 --- a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json +++ b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -251,6 +251,46 @@ } ] }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_TrainProcessorVersion_sync", + "title": "Snippet for train_processor_version in DocumentProcessorService", + "description": "Basic snippet for train_processor_version in DocumentProcessorService", + "file": "document_processor_service/train_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "train_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#train_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "TrainProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, { "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetProcessorVersion_sync", "title": "Snippet for get_processor_version in DocumentProcessorService", @@ -690,6 +730,126 @@ "type": "FULL" } ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_EvaluateProcessorVersion_sync", + "title": "Snippet for evaluate_processor_version in DocumentProcessorService", + "description": "Basic snippet for evaluate_processor_version in DocumentProcessorService", + "file": "document_processor_service/evaluate_processor_version.rb", + "language": "RUBY", + "client_method": { + "short_name": "evaluate_processor_version", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#evaluate_processor_version", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "EvaluateProcessorVersion", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_GetEvaluation_sync", + "title": "Snippet for get_evaluation in DocumentProcessorService", + "description": "Basic snippet for get_evaluation in DocumentProcessorService", + "file": "document_processor_service/get_evaluation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_evaluation", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#get_evaluation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::Evaluation", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "GetEvaluation", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.GetEvaluation", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 38, + "type": "FULL" + } + ] + }, + { + "region_tag": "documentai_v1beta3_generated_DocumentProcessorService_ListEvaluations_sync", + "title": "Snippet for list_evaluations in DocumentProcessorService", + "description": "Basic snippet for list_evaluations in DocumentProcessorService", + "file": "document_processor_service/list_evaluations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_evaluations", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client#list_evaluations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse", + "client": { + "short_name": "DocumentProcessorService::Client", + "full_name": "::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client" + }, + "method": { + "short_name": "ListEvaluations", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService.ListEvaluations", + "service": { + "short_name": "DocumentProcessorService", + "full_name": "google.cloud.documentai.v1beta3.DocumentProcessorService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 44, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb index 630b8b6bb0c7..50cf06b53295 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_paths_test.rb @@ -23,6 +23,18 @@ require "google/cloud/document_ai/v1beta3/document_processor_service" class ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::ClientPathsTest < Minitest::Test + def test_evaluation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.evaluation_path project: "value0", location: "value1", processor: "value2", processor_version: "value3", evaluation: "value4" + assert_equal "projects/value0/locations/value1/processors/value2/processorVersions/value3/evaluations/value4", path + end + end + def test_human_review_config_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, nil do diff --git a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb index 1617f956ad49..e506be2a58ce 100644 --- a/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb +++ b/google-cloud-document_ai-v1beta3/test/google/cloud/document_ai/v1beta3/document_processor_service_test.rb @@ -437,6 +437,77 @@ def test_get_processor end end + def test_train_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + processor_version = {} + document_schema = {} + input_data = {} + base_processor_version = "hello world" + + train_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :train_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion), request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::DocumentSchema), request["document_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest::InputData), request["input_data"] + assert_equal "hello world", request["base_processor_version"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, train_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.train_processor_version({ parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.train_processor_version parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.train_processor_version ::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.train_processor_version({ parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.train_processor_version(::Google::Cloud::DocumentAI::V1beta3::TrainProcessorVersionRequest.new(parent: parent, processor_version: processor_version, document_schema: document_schema, input_data: input_data, base_processor_version: base_processor_version), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, train_processor_version_client_stub.call_rpc_count + end + end + def test_get_processor_version # Create GRPC objects. grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ProcessorVersion.new @@ -1139,6 +1210,196 @@ def test_review_document end end + def test_evaluate_processor_version + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + processor_version = "hello world" + evaluation_documents = {} + + evaluate_processor_version_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :evaluate_processor_version, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest, request + assert_equal "hello world", request["processor_version"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::DocumentAI::V1beta3::BatchDocumentsInputConfig), request["evaluation_documents"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, evaluate_processor_version_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.evaluate_processor_version processor_version: processor_version, evaluation_documents: evaluation_documents do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.evaluate_processor_version ::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.evaluate_processor_version({ processor_version: processor_version, evaluation_documents: evaluation_documents }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.evaluate_processor_version(::Google::Cloud::DocumentAI::V1beta3::EvaluateProcessorVersionRequest.new(processor_version: processor_version, evaluation_documents: evaluation_documents), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, evaluate_processor_version_client_stub.call_rpc_count + end + end + + def test_get_evaluation + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::Evaluation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_evaluation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_evaluation, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_evaluation_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_evaluation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_evaluation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_evaluation ::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_evaluation({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_evaluation(::Google::Cloud::DocumentAI::V1beta3::GetEvaluationRequest.new(name: name), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_evaluation_client_stub.call_rpc_count + end + end + + def test_list_evaluations + # Create GRPC objects. + grpc_response = ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsResponse.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_size = 42 + page_token = "hello world" + + list_evaluations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_evaluations, name + assert_kind_of ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_evaluations_client_stub do + # Create client + client = ::Google::Cloud::DocumentAI::V1beta3::DocumentProcessorService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_evaluations parent: parent, page_size: page_size, page_token: page_token do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_evaluations ::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_evaluations({ parent: parent, page_size: page_size, page_token: page_token }, grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_evaluations(::Google::Cloud::DocumentAI::V1beta3::ListEvaluationsRequest.new(parent: parent, page_size: page_size, page_token: page_token), grpc_options) do |response, operation| + assert_kind_of Gapic::PagedEnumerable, response + assert_equal grpc_response, response.response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, list_evaluations_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure From 669f68f8191706a414e378126bd1ffbe80cd4829 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:38:52 +0530 Subject: [PATCH 075/112] feat(aiplatform): add service_account to BatchPredictionJob --- .../.owlbot-manifest.json | 2 + .../aiplatform/v1/batch_prediction_job_pb.rb | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../aiplatform/v1/batch_prediction_job.rb | 9 + 5 files changed, 401 insertions(+) create mode 100644 google-cloud-ai_platform-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb diff --git a/google-cloud-ai_platform-v1/.owlbot-manifest.json b/google-cloud-ai_platform-v1/.owlbot-manifest.json index 3f113e83e613..326bb82850f3 100644 --- a/google-cloud-ai_platform-v1/.owlbot-manifest.json +++ b/google-cloud-ai_platform-v1/.owlbot-manifest.json @@ -178,8 +178,10 @@ "lib/google/cloud/aiplatform/v1/vizier_service_pb.rb", "lib/google/cloud/aiplatform/v1/vizier_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb", "proto_docs/google/cloud/aiplatform/v1/annotation.rb", diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb index a8917135c096..ff117c01ca23 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/aiplatform/v1/batch_prediction_job_pb.rb @@ -29,6 +29,7 @@ optional :model_parameters, :message, 5, "google.protobuf.Value" optional :output_config, :message, 6, "google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig" optional :dedicated_resources, :message, 7, "google.cloud.aiplatform.v1.BatchDedicatedResources" + optional :service_account, :string, 29 optional :manual_batch_tuning_parameters, :message, 8, "google.cloud.aiplatform.v1.ManualBatchTuningParameters" optional :generate_explanation, :bool, 23 optional :explanation_spec, :message, 25, "google.cloud.aiplatform.v1.ExplanationSpec" diff --git a/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb b/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-ai_platform-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb index 8e9d5407d803..4ae8a4fb5dfc 100644 --- a/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb +++ b/google-cloud-ai_platform-v1/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb @@ -79,6 +79,15 @@ module V1 # DEDICATED_RESOURCES this config may be provided (and the job will use these # resources), if the Model doesn't support AUTOMATIC_RESOURCES, this config # must be provided. + # @!attribute [rw] service_account + # @return [::String] + # The service account that the DeployedModel's container runs as. If not + # specified, a system generated one will be used, which + # has minimal permissions and the custom container, if used, may not have + # enough permission to access other GCP resources. + # + # Users deploying the Model must have the `iam.serviceAccounts.actAs` + # permission on this service account. # @!attribute [rw] manual_batch_tuning_parameters # @return [::Google::Cloud::AIPlatform::V1::ManualBatchTuningParameters] # Immutable. Parameters configuring the batch behavior. Currently only applicable when From 659cc6a8d3f6d7a3083331e475866ddb1d905f47 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 15:58:00 +0530 Subject: [PATCH 076/112] chore: add docs for client library settings --- .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-asset-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-automl-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-batch-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-build-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-channel-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-compute-v1/.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-deploy-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-dlp-v2/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- google-cloud-domains-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-gaming-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-gke_hub-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-iap-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-ids-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-iot-v1/.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-kms-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-location/.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-logging-v2/.owlbot-manifest.json | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- .../google/api/monitored_resource.rb | 11 +- .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- .../google/api/monitored_resource.rb | 11 +- .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-pubsub-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-redis-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-retail-v2/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-run-v2/.owlbot-manifest.json | 1 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 6 +- .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 1 + .../proto_docs/google/api/auth.rb | 12 +- .../proto_docs/google/api/backend.rb | 3 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/control.rb | 14 +- .../proto_docs/google/api/documentation.rb | 26 +- .../proto_docs/google/api/endpoint.rb | 23 +- .../proto_docs/google/api/launch_stage.rb | 6 +- .../google/api/monitored_resource.rb | 11 +- .../proto_docs/google/api/quota.rb | 12 +- .../proto_docs/google/api/service.rb | 45 ++- .../.owlbot-manifest.json | 1 + .../proto_docs/google/api/auth.rb | 12 +- .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/documentation.rb | 26 +- .../proto_docs/google/api/endpoint.rb | 23 +- .../proto_docs/google/api/launch_stage.rb | 6 +- .../google/api/monitored_resource.rb | 11 +- .../proto_docs/google/api/quota.rb | 12 +- google-cloud-shell-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-spanner-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-speech-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-speech-v2/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-talent-v4/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-tasks-v2/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-tpu-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-trace-v1/.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-cloud-trace-v2/.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-cloud-vision-v1/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 3 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-iam-v1/.owlbot-manifest.json | 3 + google-iam-v1/proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ google-iam-v1beta/.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ google-iam-v2/.owlbot-manifest.json | 2 + google-iam-v2/proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../.owlbot-manifest.json | 2 + .../proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ grafeas-v1/.owlbot-manifest.json | 3 + grafeas-v1/proto_docs/google/api/client.rb | 318 ++++++++++++++++++ .../proto_docs/google/api/launch_stage.rb | 71 ++++ .../proto_docs/google/protobuf/duration.rb | 98 ++++++ 612 files changed, 75893 insertions(+), 108 deletions(-) create mode 100644 google-analytics-admin-v1alpha/proto_docs/google/api/client.rb create mode 100644 google-analytics-admin-v1alpha/proto_docs/google/api/launch_stage.rb create mode 100644 google-analytics-data-v1beta/proto_docs/google/api/client.rb create mode 100644 google-analytics-data-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-analytics-data-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 google-area120-tables-v1alpha1/proto_docs/google/api/client.rb create mode 100644 google-area120-tables-v1alpha1/proto_docs/google/api/launch_stage.rb create mode 100644 google-area120-tables-v1alpha1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-access_approval-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-access_approval-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-access_approval-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-api_gateway-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-api_gateway-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-api_keys-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-api_keys-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-apigee_connect-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-apigee_connect-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-apigee_registry-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-apigee_registry-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-app_engine-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-app_engine-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-artifact_registry-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-artifact_registry-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-artifact_registry-v1beta2/proto_docs/google/api/client.rb create mode 100644 google-cloud-artifact_registry-v1beta2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-asset-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-asset-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-assured_workloads-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-assured_workloads-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-assured_workloads-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-assured_workloads-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-automl-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-automl-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-automl-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bare_metal_solution-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-bare_metal_solution-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-batch-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-analytics_hub-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigquery-connection-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-connection-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-connection-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-migration-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigquery-storage-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigquery-storage-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigquery-storage-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-bigtable-admin-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigtable-admin-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-bigtable-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-bigtable-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-billing-budgets-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-billing-budgets-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-billing-budgets-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-billing-budgets-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-billing-budgets-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-billing-budgets-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-binary_authorization-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-binary_authorization-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-binary_authorization-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-binary_authorization-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-binary_authorization-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-binary_authorization-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-build-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-build-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-certificate_manager-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-certificate_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-channel-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-channel-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-cloud_dms-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-cloud_dms-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-compute-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-compute-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-compute-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-contact_center_insights-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-contact_center_insights-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-container-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-container-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-container_analysis-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-container_analysis-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-container_analysis-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-data_catalog-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-data_fusion-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-data_fusion-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-data_labeling-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-data_labeling-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataflow-v1beta3/proto_docs/google/api/client.rb create mode 100644 google-cloud-dataflow-v1beta3/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataform-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-dataform-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataform-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-dataplex-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-dataplex-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataproc-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataqna-v1alpha/proto_docs/google/api/client.rb create mode 100644 google-cloud-dataqna-v1alpha/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dataqna-v1alpha/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-datastore-admin-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-datastore-admin-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-datastore-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-datastream-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-datastream-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-datastream-v1alpha1/proto_docs/google/api/client.rb create mode 100644 google-cloud-datastream-v1alpha1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-debugger-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-debugger-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-debugger-v2/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-deploy-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-deploy-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb create mode 100644 google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dialogflow-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-dlp-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-dlp-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-document_ai-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-domains-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-domains-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-domains-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-domains-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-error_reporting-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-error_reporting-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-essential_contacts-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-essential_contacts-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-essential_contacts-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-eventarc-publishing-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-eventarc-publishing-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-eventarc-publishing-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-eventarc-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-eventarc-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-filestore-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-filestore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-firestore-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-functions-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-functions-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-functions-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-functions-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gaming-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gaming-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gke_backup-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gke_backup-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-gke_hub-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gke_hub-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gke_hub-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gke_hub-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-gke_multi_cloud-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-gke_multi_cloud-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-iap-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-iap-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-ids-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-ids-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-iot-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-iot-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-iot-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-kms-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-language-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-language-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-language-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-language-v1beta2/proto_docs/google/api/client.rb create mode 100644 google-cloud-language-v1beta2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-language-v1beta2/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-location/proto_docs/google/api/client.rb create mode 100644 google-cloud-location/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-location/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-logging-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-managed_identities-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-managed_identities-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-media_translation-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-media_translation-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-media_translation-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-memcache-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-memcache-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-memcache-v1beta2/proto_docs/google/api/client.rb create mode 100644 google-cloud-memcache-v1beta2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-metastore-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-metastore-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-metastore-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-metastore-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-monitoring-dashboard-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-monitoring-dashboard-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-monitoring-v3/proto_docs/google/api/client.rb create mode 100644 google-cloud-network_connectivity-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-network_connectivity-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/client.rb create mode 100644 google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-network_management-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-network_management-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-network_security-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-network_security-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-notebooks-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-notebooks-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-notebooks-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-notebooks-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-optimization-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-optimization-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-org_policy-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-org_policy-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-org_policy-v2/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-os_config-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-os_config-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-os_config-v1alpha/proto_docs/google/api/client.rb create mode 100644 google-cloud-os_config-v1alpha/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-phishing_protection-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-phishing_protection-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-phishing_protection-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-profiler-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-pubsub-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-recommender-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-redis-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-redis-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-resource_manager-v3/proto_docs/google/api/client.rb create mode 100644 google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-resource_settings-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-resource_settings-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-resource_settings-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-retail-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-run-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-scheduler-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-secret_manager-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-service_control-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-service_directory-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-service_management-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-service_usage-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-shell-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-spanner-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-speech-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-speech-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-talent-v4/proto_docs/google/api/client.rb create mode 100644 google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-talent-v4beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-tasks-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb create mode 100644 google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb create mode 100644 google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-tpu-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-trace-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-trace-v2/proto_docs/google/api/client.rb create mode 100644 google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-translate-v3/proto_docs/google/api/client.rb create mode 100644 google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video-stitcher-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video-stitcher-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video-transcoder-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video-transcoder-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video_intelligence-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video_intelligence-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video_intelligence-v1beta2/proto_docs/google/api/client.rb create mode 100644 google-cloud-video_intelligence-v1beta2/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-vision-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-vision-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-vm_migration-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-vpc_access-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-web_risk-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb create mode 100644 google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 google-cloud-workflows-v1/proto_docs/google/api/client.rb create mode 100644 google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-cloud-workflows-v1beta/proto_docs/google/api/client.rb create mode 100644 google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-iam-credentials-v1/proto_docs/google/api/client.rb create mode 100644 google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-iam-v1/proto_docs/google/api/client.rb create mode 100644 google-iam-v1/proto_docs/google/api/launch_stage.rb create mode 100644 google-iam-v1/proto_docs/google/protobuf/duration.rb create mode 100644 google-iam-v1beta/proto_docs/google/api/client.rb create mode 100644 google-iam-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 google-iam-v2/proto_docs/google/api/client.rb create mode 100644 google-iam-v2/proto_docs/google/api/launch_stage.rb create mode 100644 google-identity-access_context_manager-v1/proto_docs/google/api/client.rb create mode 100644 google-identity-access_context_manager-v1/proto_docs/google/api/launch_stage.rb create mode 100644 grafeas-v1/proto_docs/google/api/client.rb create mode 100644 grafeas-v1/proto_docs/google/api/launch_stage.rb create mode 100644 grafeas-v1/proto_docs/google/protobuf/duration.rb diff --git a/google-analytics-admin-v1alpha/.owlbot-manifest.json b/google-analytics-admin-v1alpha/.owlbot-manifest.json index b23fe9237844..9a168e08e80e 100644 --- a/google-analytics-admin-v1alpha/.owlbot-manifest.json +++ b/google-analytics-admin-v1alpha/.owlbot-manifest.json @@ -29,7 +29,9 @@ "proto_docs/google/analytics/admin/v1alpha/analytics_admin.rb", "proto_docs/google/analytics/admin/v1alpha/audience.rb", "proto_docs/google/analytics/admin/v1alpha/resources.rb", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", diff --git a/google-analytics-admin-v1alpha/proto_docs/google/api/client.rb b/google-analytics-admin-v1alpha/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-analytics-admin-v1alpha/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-analytics-admin-v1alpha/proto_docs/google/api/launch_stage.rb b/google-analytics-admin-v1alpha/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-analytics-admin-v1alpha/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-analytics-data-v1beta/.owlbot-manifest.json b/google-analytics-data-v1beta/.owlbot-manifest.json index 85f199de6226..ebae42727f69 100644 --- a/google-analytics-data-v1beta/.owlbot-manifest.json +++ b/google-analytics-data-v1beta/.owlbot-manifest.json @@ -25,8 +25,11 @@ "proto_docs/README.md", "proto_docs/google/analytics/data/v1beta/analytics_data_api.rb", "proto_docs/google/analytics/data/v1beta/data.rb", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/analytics_data/batch_run_pivot_reports.rb", "snippets/analytics_data/batch_run_reports.rb", diff --git a/google-analytics-data-v1beta/proto_docs/google/api/client.rb b/google-analytics-data-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-analytics-data-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-analytics-data-v1beta/proto_docs/google/api/launch_stage.rb b/google-analytics-data-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-analytics-data-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-analytics-data-v1beta/proto_docs/google/protobuf/duration.rb b/google-analytics-data-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-analytics-data-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-area120-tables-v1alpha1/.owlbot-manifest.json b/google-area120-tables-v1alpha1/.owlbot-manifest.json index 2c90e6e8f973..489719e5c4cf 100644 --- a/google-area120-tables-v1alpha1/.owlbot-manifest.json +++ b/google-area120-tables-v1alpha1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/area120/tables/v1alpha1/tables_services_pb.rb", "lib/google/area120/tables/v1alpha1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/area120/tables/v1alpha1/tables.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/struct.rb", diff --git a/google-area120-tables-v1alpha1/proto_docs/google/api/client.rb b/google-area120-tables-v1alpha1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-area120-tables-v1alpha1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-area120-tables-v1alpha1/proto_docs/google/api/launch_stage.rb b/google-area120-tables-v1alpha1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-area120-tables-v1alpha1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-area120-tables-v1alpha1/proto_docs/google/protobuf/duration.rb b/google-area120-tables-v1alpha1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-area120-tables-v1alpha1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-access_approval-v1/.owlbot-manifest.json b/google-cloud-access_approval-v1/.owlbot-manifest.json index e320fa48e0fe..91ca56959b3f 100644 --- a/google-cloud-access_approval-v1/.owlbot-manifest.json +++ b/google-cloud-access_approval-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/accessapproval/v1/accessapproval_pb.rb", "lib/google/cloud/accessapproval/v1/accessapproval_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/accessapproval/v1/accessapproval.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-access_approval-v1/proto_docs/google/api/client.rb b/google-cloud-access_approval-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-access_approval-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-access_approval-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-access_approval-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-access_approval-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-access_approval-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-access_approval-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-access_approval-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-api_gateway-v1/.owlbot-manifest.json b/google-cloud-api_gateway-v1/.owlbot-manifest.json index 8bdecbadb3af..eb5723b1da9f 100644 --- a/google-cloud-api_gateway-v1/.owlbot-manifest.json +++ b/google-cloud-api_gateway-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/apigateway/v1/apigateway_service_pb.rb", "lib/google/cloud/apigateway/v1/apigateway_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/apigateway/v1/apigateway.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-api_gateway-v1/proto_docs/google/api/client.rb b/google-cloud-api_gateway-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-api_gateway-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-api_gateway-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-api_gateway-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-api_gateway-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-api_keys-v2/.owlbot-manifest.json b/google-cloud-api_keys-v2/.owlbot-manifest.json index ecd1e77a8c2a..2548627cb6d5 100644 --- a/google-cloud-api_keys-v2/.owlbot-manifest.json +++ b/google-cloud-api_keys-v2/.owlbot-manifest.json @@ -26,7 +26,9 @@ "proto_docs/README.md", "proto_docs/google/api/apikeys/v2/apikeys.rb", "proto_docs/google/api/apikeys/v2/resources.rb", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/protobuf/any.rb", diff --git a/google-cloud-api_keys-v2/proto_docs/google/api/client.rb b/google-cloud-api_keys-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-api_keys-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-api_keys-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-api_keys-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-api_keys-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-apigee_connect-v1/.owlbot-manifest.json b/google-cloud-apigee_connect-v1/.owlbot-manifest.json index 7614fe3db8e3..de3059b8837a 100644 --- a/google-cloud-apigee_connect-v1/.owlbot-manifest.json +++ b/google-cloud-apigee_connect-v1/.owlbot-manifest.json @@ -27,7 +27,9 @@ "lib/google/cloud/apigeeconnect/v1/tether_pb.rb", "lib/google/cloud/apigeeconnect/v1/tether_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/apigeeconnect/v1/connection.rb", "proto_docs/google/cloud/apigeeconnect/v1/tether.rb", diff --git a/google-cloud-apigee_connect-v1/proto_docs/google/api/client.rb b/google-cloud-apigee_connect-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-apigee_connect-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-apigee_connect-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-apigee_connect-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-apigee_connect-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-apigee_registry-v1/.owlbot-manifest.json b/google-cloud-apigee_registry-v1/.owlbot-manifest.json index 36935e61047a..0e1069cc050d 100644 --- a/google-cloud-apigee_registry-v1/.owlbot-manifest.json +++ b/google-cloud-apigee_registry-v1/.owlbot-manifest.json @@ -30,8 +30,10 @@ "lib/google/cloud/apigeeregistry/v1/registry_service_pb.rb", "lib/google/cloud/apigeeregistry/v1/registry_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/apigeeregistry/v1/provisioning_service.rb", "proto_docs/google/cloud/apigeeregistry/v1/registry_models.rb", diff --git a/google-cloud-apigee_registry-v1/proto_docs/google/api/client.rb b/google-cloud-apigee_registry-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-apigee_registry-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-apigee_registry-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-apigee_registry-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-apigee_registry-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-app_engine-v1/.owlbot-manifest.json b/google-cloud-app_engine-v1/.owlbot-manifest.json index a5eee6367f1d..c8d71edb366f 100644 --- a/google-cloud-app_engine-v1/.owlbot-manifest.json +++ b/google-cloud-app_engine-v1/.owlbot-manifest.json @@ -62,7 +62,9 @@ "lib/google/cloud/app_engine/v1/versions/credentials.rb", "lib/google/cloud/app_engine/v1/versions/operations.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/appengine/v1/app_yaml.rb", "proto_docs/google/appengine/v1/appengine.rb", diff --git a/google-cloud-app_engine-v1/proto_docs/google/api/client.rb b/google-cloud-app_engine-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-app_engine-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-app_engine-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-app_engine-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-app_engine-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-artifact_registry-v1/.owlbot-manifest.json b/google-cloud-artifact_registry-v1/.owlbot-manifest.json index d4a932e61fc7..96b590baf26e 100644 --- a/google-cloud-artifact_registry-v1/.owlbot-manifest.json +++ b/google-cloud-artifact_registry-v1/.owlbot-manifest.json @@ -32,7 +32,9 @@ "lib/google/devtools/artifactregistry/v1/version_pb.rb", "lib/google/devtools/artifactregistry/v1/yum_artifact_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/artifactregistry/v1/apt_artifact.rb", "proto_docs/google/devtools/artifactregistry/v1/artifact.rb", diff --git a/google-cloud-artifact_registry-v1/proto_docs/google/api/client.rb b/google-cloud-artifact_registry-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-artifact_registry-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-artifact_registry-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-artifact_registry-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-artifact_registry-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-artifact_registry-v1beta2/.owlbot-manifest.json b/google-cloud-artifact_registry-v1beta2/.owlbot-manifest.json index e3d2a2c0e329..acd529caeb74 100644 --- a/google-cloud-artifact_registry-v1beta2/.owlbot-manifest.json +++ b/google-cloud-artifact_registry-v1beta2/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/devtools/artifactregistry/v1beta2/version_pb.rb", "lib/google/devtools/artifactregistry/v1beta2/yum_artifact_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/artifactregistry/v1beta2/apt_artifact.rb", "proto_docs/google/devtools/artifactregistry/v1beta2/file.rb", diff --git a/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/client.rb b/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/launch_stage.rb b/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-artifact_registry-v1beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-asset-v1/.owlbot-manifest.json b/google-cloud-asset-v1/.owlbot-manifest.json index 6291c6e2bdba..c13d9bcc814b 100644 --- a/google-cloud-asset-v1/.owlbot-manifest.json +++ b/google-cloud-asset-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/asset/v1/version.rb", "lib/google/cloud/orgpolicy/v1/orgpolicy_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/asset/v1/asset_service.rb", "proto_docs/google/cloud/asset/v1/assets.rb", diff --git a/google-cloud-asset-v1/proto_docs/google/api/client.rb b/google-cloud-asset-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-asset-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-asset-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-asset-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-asset-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-assured_workloads-v1/.owlbot-manifest.json b/google-cloud-assured_workloads-v1/.owlbot-manifest.json index 7069687608b9..784299a31998 100644 --- a/google-cloud-assured_workloads-v1/.owlbot-manifest.json +++ b/google-cloud-assured_workloads-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/assuredworkloads/v1/assuredworkloads_pb.rb", "lib/google/cloud/assuredworkloads/v1/assuredworkloads_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/assuredworkloads/v1/assuredworkloads.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-assured_workloads-v1/proto_docs/google/api/client.rb b/google-cloud-assured_workloads-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-assured_workloads-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-assured_workloads-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-assured_workloads-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-assured_workloads-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-assured_workloads-v1beta1/.owlbot-manifest.json b/google-cloud-assured_workloads-v1beta1/.owlbot-manifest.json index 4b066f768487..9d5a9f2bd042 100644 --- a/google-cloud-assured_workloads-v1beta1/.owlbot-manifest.json +++ b/google-cloud-assured_workloads-v1beta1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service_pb.rb", "lib/google/cloud/assuredworkloads/v1beta1/assuredworkloads_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/assuredworkloads/v1beta1/assuredworkloads.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/client.rb b/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-assured_workloads-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-automl-v1/.owlbot-manifest.json b/google-cloud-automl-v1/.owlbot-manifest.json index f876008efc11..400c33129e18 100644 --- a/google-cloud-automl-v1/.owlbot-manifest.json +++ b/google-cloud-automl-v1/.owlbot-manifest.json @@ -47,7 +47,9 @@ "lib/google/cloud/automl/v1/translation_pb.rb", "lib/google/cloud/automl/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/automl/v1/annotation_payload.rb", "proto_docs/google/cloud/automl/v1/annotation_spec.rb", diff --git a/google-cloud-automl-v1/proto_docs/google/api/client.rb b/google-cloud-automl-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-automl-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-automl-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-automl-v1beta1/.owlbot-manifest.json b/google-cloud-automl-v1beta1/.owlbot-manifest.json index c859ff6e06d0..9653d2e8866f 100644 --- a/google-cloud-automl-v1beta1/.owlbot-manifest.json +++ b/google-cloud-automl-v1beta1/.owlbot-manifest.json @@ -56,7 +56,9 @@ "lib/google/cloud/automl/v1beta1/version.rb", "lib/google/cloud/automl/v1beta1/video_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/automl/v1beta1/annotation_payload.rb", "proto_docs/google/cloud/automl/v1beta1/annotation_spec.rb", diff --git a/google-cloud-automl-v1beta1/proto_docs/google/api/client.rb b/google-cloud-automl-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-automl-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-automl-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-automl-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-automl-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bare_metal_solution-v2/.owlbot-manifest.json b/google-cloud-bare_metal_solution-v2/.owlbot-manifest.json index 06619bc3770e..21e71d35e6ef 100644 --- a/google-cloud-bare_metal_solution-v2/.owlbot-manifest.json +++ b/google-cloud-bare_metal_solution-v2/.owlbot-manifest.json @@ -28,7 +28,9 @@ "lib/google/cloud/baremetalsolution/v2/nfs_share_pb.rb", "lib/google/cloud/baremetalsolution/v2/volume_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/baremetalsolution/v2/baremetalsolution.rb", "proto_docs/google/cloud/baremetalsolution/v2/instance.rb", diff --git a/google-cloud-bare_metal_solution-v2/proto_docs/google/api/client.rb b/google-cloud-bare_metal_solution-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bare_metal_solution-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bare_metal_solution-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-bare_metal_solution-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bare_metal_solution-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-batch-v1/.owlbot-manifest.json b/google-cloud-batch-v1/.owlbot-manifest.json index 7b93a2446965..8a4c7029cca2 100644 --- a/google-cloud-batch-v1/.owlbot-manifest.json +++ b/google-cloud-batch-v1/.owlbot-manifest.json @@ -26,7 +26,9 @@ "lib/google/cloud/batch/v1/version.rb", "lib/google/cloud/batch/v1/volume_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/batch/v1/batch.rb", "proto_docs/google/cloud/batch/v1/job.rb", diff --git a/google-cloud-batch-v1/proto_docs/google/api/client.rb b/google-cloud-batch-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-batch-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-batch-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-beyond_corp-app_connections-v1/.owlbot-manifest.json b/google-cloud-beyond_corp-app_connections-v1/.owlbot-manifest.json index 057eaab5da84..0cd743f05417 100644 --- a/google-cloud-beyond_corp-app_connections-v1/.owlbot-manifest.json +++ b/google-cloud-beyond_corp-app_connections-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_pb.rb", "lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/beyondcorp/appconnections/v1/app_connections_service.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/client.rb b/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-beyond_corp-app_connections-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-beyond_corp-app_connectors-v1/.owlbot-manifest.json b/google-cloud-beyond_corp-app_connectors-v1/.owlbot-manifest.json index 52359b39e937..e1a6e5621066 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/.owlbot-manifest.json +++ b/google-cloud-beyond_corp-app_connectors-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service_services_pb.rb", "lib/google/cloud/beyondcorp/appconnectors/v1/resource_info_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/beyondcorp/appconnectors/v1/app_connector_instance_config.rb", "proto_docs/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service.rb", diff --git a/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/client.rb b/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-beyond_corp-app_connectors-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-beyond_corp-app_gateways-v1/.owlbot-manifest.json b/google-cloud-beyond_corp-app_gateways-v1/.owlbot-manifest.json index 1d12104a32b6..b3e108c83b4c 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/.owlbot-manifest.json +++ b/google-cloud-beyond_corp-app_gateways-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_pb.rb", "lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/beyondcorp/appgateways/v1/app_gateways_service.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/client.rb b/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-beyond_corp-app_gateways-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/.owlbot-manifest.json b/google-cloud-beyond_corp-client_connector_services-v1/.owlbot-manifest.json index 8bd88c27402b..ee87b25bceec 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/.owlbot-manifest.json +++ b/google-cloud-beyond_corp-client_connector_services-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_pb.rb", "lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/client.rb b/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-beyond_corp-client_connector_services-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-beyond_corp-client_gateways-v1/.owlbot-manifest.json b/google-cloud-beyond_corp-client_gateways-v1/.owlbot-manifest.json index cc832075fe3f..0aacebbfeaaa 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/.owlbot-manifest.json +++ b/google-cloud-beyond_corp-client_gateways-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_pb.rb", "lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/client.rb b/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-beyond_corp-client_gateways-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-analytics_hub-v1/.owlbot-manifest.json b/google-cloud-bigquery-analytics_hub-v1/.owlbot-manifest.json index 11f7bb22f044..21a711fade83 100644 --- a/google-cloud-bigquery-analytics_hub-v1/.owlbot-manifest.json +++ b/google-cloud-bigquery-analytics_hub-v1/.owlbot-manifest.json @@ -22,12 +22,15 @@ "lib/google/cloud/bigquery/analyticshub/v1/analyticshub_pb.rb", "lib/google/cloud/bigquery/analyticshub/v1/analyticshub_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/analyticshub/v1/analyticshub.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/wrappers.rb", diff --git a/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/client.rb b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-analytics_hub-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigquery-connection-v1/.owlbot-manifest.json b/google-cloud-bigquery-connection-v1/.owlbot-manifest.json index 72d9b93dcd89..e3dd693a551e 100644 --- a/google-cloud-bigquery-connection-v1/.owlbot-manifest.json +++ b/google-cloud-bigquery-connection-v1/.owlbot-manifest.json @@ -22,12 +22,15 @@ "lib/google/cloud/bigquery/connection/v1/connection_services_pb.rb", "lib/google/cloud/bigquery/connection/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/connection/v1/connection.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/type/expr.rb", diff --git a/google-cloud-bigquery-connection-v1/proto_docs/google/api/client.rb b/google-cloud-bigquery-connection-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-connection-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-connection-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-connection-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-connection-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-connection-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-connection-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-connection-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/.owlbot-manifest.json b/google-cloud-bigquery-data_exchange-v1beta1/.owlbot-manifest.json index d7a0a697c8d1..7618f21ffe47 100644 --- a/google-cloud-bigquery-data_exchange-v1beta1/.owlbot-manifest.json +++ b/google-cloud-bigquery-data_exchange-v1beta1/.owlbot-manifest.json @@ -22,13 +22,16 @@ "lib/google/cloud/bigquery/dataexchange/v1beta1/dataexchange_pb.rb", "lib/google/cloud/bigquery/dataexchange/v1beta1/dataexchange_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/dataexchange/v1beta1/dataexchange.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/wrappers.rb", diff --git a/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/client.rb b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-data_exchange-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigquery-data_policies-v1beta1/.owlbot-manifest.json b/google-cloud-bigquery-data_policies-v1beta1/.owlbot-manifest.json index f3b58757e9de..051d8dabb416 100644 --- a/google-cloud-bigquery-data_policies-v1beta1/.owlbot-manifest.json +++ b/google-cloud-bigquery-data_policies-v1beta1/.owlbot-manifest.json @@ -22,12 +22,15 @@ "lib/google/cloud/bigquery/datapolicies/v1beta1/datapolicy_pb.rb", "lib/google/cloud/bigquery/datapolicies/v1beta1/datapolicy_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/datapolicies/v1beta1/datapolicy.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/type/expr.rb", diff --git a/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/client.rb b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-data_policies-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigquery-data_transfer-v1/.owlbot-manifest.json b/google-cloud-bigquery-data_transfer-v1/.owlbot-manifest.json index 9cf3dd95c0b0..435ab9588dda 100644 --- a/google-cloud-bigquery-data_transfer-v1/.owlbot-manifest.json +++ b/google-cloud-bigquery-data_transfer-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb", "lib/google/cloud/bigquery/datatransfer/v1/transfer_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/datatransfer/v1/datatransfer.rb", "proto_docs/google/cloud/bigquery/datatransfer/v1/transfer.rb", diff --git a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/client.rb b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-migration-v2/.owlbot-manifest.json b/google-cloud-bigquery-migration-v2/.owlbot-manifest.json index 0440c4684317..67f568057c7c 100644 --- a/google-cloud-bigquery-migration-v2/.owlbot-manifest.json +++ b/google-cloud-bigquery-migration-v2/.owlbot-manifest.json @@ -26,6 +26,7 @@ "lib/google/cloud/bigquery/migration/v2/translation_config_pb.rb", "lib/google/cloud/bigquery/migration/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/distribution.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/label.rb", diff --git a/google-cloud-bigquery-migration-v2/proto_docs/google/api/client.rb b/google-cloud-bigquery-migration-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-migration-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-migration-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-migration-v2/proto_docs/google/api/launch_stage.rb index 815ad6fd1e93..ce75038366ae 100644 --- a/google-cloud-bigquery-migration-v2/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-bigquery-migration-v2/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-bigquery-reservation-v1/.owlbot-manifest.json b/google-cloud-bigquery-reservation-v1/.owlbot-manifest.json index 07827561625a..b82b3205009d 100644 --- a/google-cloud-bigquery-reservation-v1/.owlbot-manifest.json +++ b/google-cloud-bigquery-reservation-v1/.owlbot-manifest.json @@ -22,10 +22,13 @@ "lib/google/cloud/bigquery/reservation/v1/reservation_services_pb.rb", "lib/google/cloud/bigquery/reservation/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/reservation/v1/reservation.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb b/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-reservation-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-reservation-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-reservation-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigquery-storage-v1/.owlbot-manifest.json b/google-cloud-bigquery-storage-v1/.owlbot-manifest.json index 0fd0f5180013..6171aacf338e 100644 --- a/google-cloud-bigquery-storage-v1/.owlbot-manifest.json +++ b/google-cloud-bigquery-storage-v1/.owlbot-manifest.json @@ -32,7 +32,9 @@ "lib/google/cloud/bigquery/storage/v1/table_pb.rb", "lib/google/cloud/bigquery/storage/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/bigquery/storage/v1/arrow.rb", "proto_docs/google/cloud/bigquery/storage/v1/avro.rb", @@ -41,6 +43,7 @@ "proto_docs/google/cloud/bigquery/storage/v1/stream.rb", "proto_docs/google/cloud/bigquery/storage/v1/table.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/protobuf/wrappers.rb", "proto_docs/google/rpc/status.rb", diff --git a/google-cloud-bigquery-storage-v1/proto_docs/google/api/client.rb b/google-cloud-bigquery-storage-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigquery-storage-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigquery-storage-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-bigquery-storage-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigquery-storage-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigquery-storage-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-bigquery-storage-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-bigquery-storage-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-bigtable-admin-v2/.owlbot-manifest.json b/google-cloud-bigtable-admin-v2/.owlbot-manifest.json index 4341be0e1992..aa2b2a19d5df 100644 --- a/google-cloud-bigtable-admin-v2/.owlbot-manifest.json +++ b/google-cloud-bigtable-admin-v2/.owlbot-manifest.json @@ -33,7 +33,9 @@ "lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb", "lib/google/cloud/bigtable/admin/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/bigtable/admin/v2/bigtable_instance_admin.rb", "proto_docs/google/bigtable/admin/v2/bigtable_table_admin.rb", diff --git a/google-cloud-bigtable-admin-v2/proto_docs/google/api/client.rb b/google-cloud-bigtable-admin-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigtable-admin-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigtable-admin-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-bigtable-admin-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigtable-admin-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-bigtable-v2/.owlbot-manifest.json b/google-cloud-bigtable-v2/.owlbot-manifest.json index cf2093800265..40706e3fe7d9 100644 --- a/google-cloud-bigtable-v2/.owlbot-manifest.json +++ b/google-cloud-bigtable-v2/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/bigtable/v2/bigtable/paths.rb", "lib/google/cloud/bigtable/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/api/routing.rb", "proto_docs/google/bigtable/v2/bigtable.rb", diff --git a/google-cloud-bigtable-v2/proto_docs/google/api/client.rb b/google-cloud-bigtable-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-bigtable-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-bigtable-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-bigtable-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-bigtable-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-billing-budgets-v1/.owlbot-manifest.json b/google-cloud-billing-budgets-v1/.owlbot-manifest.json index fb2b668c36ff..1fed8ceb86ca 100644 --- a/google-cloud-billing-budgets-v1/.owlbot-manifest.json +++ b/google-cloud-billing-budgets-v1/.owlbot-manifest.json @@ -23,10 +23,13 @@ "lib/google/cloud/billing/budgets/v1/budget_service_services_pb.rb", "lib/google/cloud/billing/budgets/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/billing/budgets/v1/budget_model.rb", "proto_docs/google/cloud/billing/budgets/v1/budget_service.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/struct.rb", diff --git a/google-cloud-billing-budgets-v1/proto_docs/google/api/client.rb b/google-cloud-billing-budgets-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-billing-budgets-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-billing-budgets-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-billing-budgets-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-billing-budgets-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-billing-budgets-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-billing-budgets-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-billing-budgets-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-billing-budgets-v1beta1/.owlbot-manifest.json b/google-cloud-billing-budgets-v1beta1/.owlbot-manifest.json index faf78c762fd9..97cadac24d49 100644 --- a/google-cloud-billing-budgets-v1beta1/.owlbot-manifest.json +++ b/google-cloud-billing-budgets-v1beta1/.owlbot-manifest.json @@ -23,10 +23,13 @@ "lib/google/cloud/billing/budgets/v1beta1/budget_service_services_pb.rb", "lib/google/cloud/billing/budgets/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/billing/budgets/v1beta1/budget_model.rb", "proto_docs/google/cloud/billing/budgets/v1beta1/budget_service.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/struct.rb", diff --git a/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/client.rb b/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-billing-budgets-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-billing-budgets-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-billing-budgets-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-billing-budgets-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-binary_authorization-v1/.owlbot-manifest.json b/google-cloud-binary_authorization-v1/.owlbot-manifest.json index dc13437a0524..de368b434193 100644 --- a/google-cloud-binary_authorization-v1/.owlbot-manifest.json +++ b/google-cloud-binary_authorization-v1/.owlbot-manifest.json @@ -30,10 +30,13 @@ "lib/google/cloud/binaryauthorization/v1/service_pb.rb", "lib/google/cloud/binaryauthorization/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/binaryauthorization/v1/resources.rb", "proto_docs/google/cloud/binaryauthorization/v1/service.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/grafeas/v1/attestation.rb", diff --git a/google-cloud-binary_authorization-v1/proto_docs/google/api/client.rb b/google-cloud-binary_authorization-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-binary_authorization-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-binary_authorization-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-binary_authorization-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-binary_authorization-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-binary_authorization-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-binary_authorization-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-binary_authorization-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-binary_authorization-v1beta1/.owlbot-manifest.json b/google-cloud-binary_authorization-v1beta1/.owlbot-manifest.json index f7b2307c92b5..7766234d5376 100644 --- a/google-cloud-binary_authorization-v1beta1/.owlbot-manifest.json +++ b/google-cloud-binary_authorization-v1beta1/.owlbot-manifest.json @@ -28,11 +28,14 @@ "lib/google/cloud/binaryauthorization/v1beta1/service_pb.rb", "lib/google/cloud/binaryauthorization/v1beta1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/binaryauthorization/v1beta1/continuous_validation_logging.rb", "proto_docs/google/cloud/binaryauthorization/v1beta1/resources.rb", "proto_docs/google/cloud/binaryauthorization/v1beta1/service.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", diff --git a/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/client.rb b/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-binary_authorization-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-binary_authorization-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-binary_authorization-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-binary_authorization-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-build-v1/.owlbot-manifest.json b/google-cloud-build-v1/.owlbot-manifest.json index 690d06cb0848..35f4dffc34bf 100644 --- a/google-cloud-build-v1/.owlbot-manifest.json +++ b/google-cloud-build-v1/.owlbot-manifest.json @@ -23,8 +23,10 @@ "lib/google/devtools/cloudbuild/v1/cloudbuild_pb.rb", "lib/google/devtools/cloudbuild/v1/cloudbuild_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/cloudbuild/v1/cloudbuild.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-build-v1/proto_docs/google/api/client.rb b/google-cloud-build-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-build-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-build-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-build-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-build-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-certificate_manager-v1/.owlbot-manifest.json b/google-cloud-certificate_manager-v1/.owlbot-manifest.json index bb2e896b9d66..1c88da7c65d6 100644 --- a/google-cloud-certificate_manager-v1/.owlbot-manifest.json +++ b/google-cloud-certificate_manager-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/certificatemanager/v1/certificate_manager_pb.rb", "lib/google/cloud/certificatemanager/v1/certificate_manager_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/certificatemanager/v1/certificate_issuance_config.rb", "proto_docs/google/cloud/certificatemanager/v1/certificate_manager.rb", diff --git a/google-cloud-certificate_manager-v1/proto_docs/google/api/client.rb b/google-cloud-certificate_manager-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-certificate_manager-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-certificate_manager-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-certificate_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-certificate_manager-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-channel-v1/.owlbot-manifest.json b/google-cloud-channel-v1/.owlbot-manifest.json index 69f51aa5411a..8ba08b92c348 100644 --- a/google-cloud-channel-v1/.owlbot-manifest.json +++ b/google-cloud-channel-v1/.owlbot-manifest.json @@ -39,7 +39,9 @@ "lib/google/cloud/channel/v1/subscriber_event_pb.rb", "lib/google/cloud/channel/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/channel/v1/channel_partner_links.rb", "proto_docs/google/cloud/channel/v1/common.rb", diff --git a/google-cloud-channel-v1/proto_docs/google/api/client.rb b/google-cloud-channel-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-channel-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-channel-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-channel-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-channel-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-cloud_dms-v1/.owlbot-manifest.json b/google-cloud-cloud_dms-v1/.owlbot-manifest.json index 66e7aded1af3..d78a9d74e2d8 100644 --- a/google-cloud-cloud_dms-v1/.owlbot-manifest.json +++ b/google-cloud-cloud_dms-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/clouddms/v1/clouddms_resources_pb.rb", "lib/google/cloud/clouddms/v1/clouddms_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/clouddms/v1/clouddms.rb", "proto_docs/google/cloud/clouddms/v1/clouddms_resources.rb", diff --git a/google-cloud-cloud_dms-v1/proto_docs/google/api/client.rb b/google-cloud-cloud_dms-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-cloud_dms-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-cloud_dms-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-cloud_dms-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-cloud_dms-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-compute-v1/.owlbot-manifest.json b/google-cloud-compute-v1/.owlbot-manifest.json index bd7466527252..eeeb05485b7b 100644 --- a/google-cloud-compute-v1/.owlbot-manifest.json +++ b/google-cloud-compute-v1/.owlbot-manifest.json @@ -455,10 +455,13 @@ "lib/google/cloud/compute/v1/zones/rest/client.rb", "lib/google/cloud/compute/v1/zones/rest/service_stub.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/compute/v1/compute.rb", "proto_docs/google/cloud/extended_operations.rb", + "proto_docs/google/protobuf/duration.rb", "test/google/cloud/compute/v1/accelerator_types_rest_test.rb", "test/google/cloud/compute/v1/addresses_rest_test.rb", "test/google/cloud/compute/v1/autoscalers_rest_test.rb", diff --git a/google-cloud-compute-v1/proto_docs/google/api/client.rb b/google-cloud-compute-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-compute-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-compute-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-compute-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-compute-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-compute-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-compute-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-compute-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-contact_center_insights-v1/.owlbot-manifest.json b/google-cloud-contact_center_insights-v1/.owlbot-manifest.json index c724b39da9ba..c60b284d5c62 100644 --- a/google-cloud-contact_center_insights-v1/.owlbot-manifest.json +++ b/google-cloud-contact_center_insights-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/contactcenterinsights/v1/contact_center_insights_services_pb.rb", "lib/google/cloud/contactcenterinsights/v1/resources_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/contactcenterinsights/v1/contact_center_insights.rb", "proto_docs/google/cloud/contactcenterinsights/v1/resources.rb", diff --git a/google-cloud-contact_center_insights-v1/proto_docs/google/api/client.rb b/google-cloud-contact_center_insights-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-contact_center_insights-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-contact_center_insights-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-contact_center_insights-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-contact_center_insights-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-container-v1beta1/.owlbot-manifest.json b/google-cloud-container-v1beta1/.owlbot-manifest.json index 809450d5cefa..97e020b7dbd0 100644 --- a/google-cloud-container-v1beta1/.owlbot-manifest.json +++ b/google-cloud-container-v1beta1/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/container/v1beta1/cluster_service_pb.rb", "lib/google/container/v1beta1/cluster_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/container/v1beta1/cluster_service.rb", "proto_docs/google/protobuf/any.rb", diff --git a/google-cloud-container-v1beta1/proto_docs/google/api/client.rb b/google-cloud-container-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-container-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-container-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-container-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-container-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-container_analysis-v1/.owlbot-manifest.json b/google-cloud-container_analysis-v1/.owlbot-manifest.json index 44555b8f5a1c..179ce39eff6d 100644 --- a/google-cloud-container_analysis-v1/.owlbot-manifest.json +++ b/google-cloud-container_analysis-v1/.owlbot-manifest.json @@ -22,12 +22,15 @@ "lib/google/devtools/containeranalysis/v1/containeranalysis_pb.rb", "lib/google/devtools/containeranalysis/v1/containeranalysis_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/containeranalysis/v1/containeranalysis.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/type/expr.rb", "proto_docs/grafeas/v1/severity.rb", diff --git a/google-cloud-container_analysis-v1/proto_docs/google/api/client.rb b/google-cloud-container_analysis-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-container_analysis-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-container_analysis-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-container_analysis-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-container_analysis-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-container_analysis-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-container_analysis-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-container_analysis-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-data_catalog-v1/.owlbot-manifest.json b/google-cloud-data_catalog-v1/.owlbot-manifest.json index 0ef5612f5964..c36ca25c7484 100644 --- a/google-cloud-data_catalog-v1/.owlbot-manifest.json +++ b/google-cloud-data_catalog-v1/.owlbot-manifest.json @@ -46,7 +46,9 @@ "lib/google/cloud/datacatalog/v1/timestamps_pb.rb", "lib/google/cloud/datacatalog/v1/usage_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/datacatalog/v1/bigquery.rb", "proto_docs/google/cloud/datacatalog/v1/common.rb", @@ -66,6 +68,7 @@ "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-data_catalog-v1/proto_docs/google/api/client.rb b/google-cloud-data_catalog-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-data_catalog-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-data_catalog-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-data_catalog-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-data_fusion-v1/.owlbot-manifest.json b/google-cloud-data_fusion-v1/.owlbot-manifest.json index ef0484da3aa3..c73ae77bb024 100644 --- a/google-cloud-data_fusion-v1/.owlbot-manifest.json +++ b/google-cloud-data_fusion-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/datafusion/v1/datafusion_pb.rb", "lib/google/cloud/datafusion/v1/datafusion_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/datafusion/v1/datafusion.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-data_fusion-v1/proto_docs/google/api/client.rb b/google-cloud-data_fusion-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-data_fusion-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-data_fusion-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-data_fusion-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-data_fusion-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-data_labeling-v1beta1/.owlbot-manifest.json b/google-cloud-data_labeling-v1beta1/.owlbot-manifest.json index 422540e37add..e9431c674e7d 100644 --- a/google-cloud-data_labeling-v1beta1/.owlbot-manifest.json +++ b/google-cloud-data_labeling-v1beta1/.owlbot-manifest.json @@ -32,7 +32,9 @@ "lib/google/cloud/datalabeling/v1beta1/instruction_pb.rb", "lib/google/cloud/datalabeling/v1beta1/operations_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/datalabeling/v1beta1/annotation.rb", "proto_docs/google/cloud/datalabeling/v1beta1/annotation_spec_set.rb", diff --git a/google-cloud-data_labeling-v1beta1/proto_docs/google/api/client.rb b/google-cloud-data_labeling-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-data_labeling-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-data_labeling-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-data_labeling-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-data_labeling-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataflow-v1beta3/.owlbot-manifest.json b/google-cloud-dataflow-v1beta3/.owlbot-manifest.json index 496db68b0f97..79d31b3c0799 100644 --- a/google-cloud-dataflow-v1beta3/.owlbot-manifest.json +++ b/google-cloud-dataflow-v1beta3/.owlbot-manifest.json @@ -46,7 +46,9 @@ "lib/google/dataflow/v1beta3/templates_pb.rb", "lib/google/dataflow/v1beta3/templates_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/dataflow/v1beta3/environment.rb", "proto_docs/google/dataflow/v1beta3/jobs.rb", diff --git a/google-cloud-dataflow-v1beta3/proto_docs/google/api/client.rb b/google-cloud-dataflow-v1beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dataflow-v1beta3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dataflow-v1beta3/proto_docs/google/api/launch_stage.rb b/google-cloud-dataflow-v1beta3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dataflow-v1beta3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataform-v1beta1/.owlbot-manifest.json b/google-cloud-dataform-v1beta1/.owlbot-manifest.json index 4b6b7e2ce729..54076b15379c 100644 --- a/google-cloud-dataform-v1beta1/.owlbot-manifest.json +++ b/google-cloud-dataform-v1beta1/.owlbot-manifest.json @@ -22,10 +22,13 @@ "lib/google/cloud/dataform/v1beta1/dataform_services_pb.rb", "lib/google/cloud/dataform/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dataform/v1beta1/dataform.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-dataform-v1beta1/proto_docs/google/api/client.rb b/google-cloud-dataform-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dataform-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dataform-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-dataform-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dataform-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataform-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-dataform-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-dataform-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-dataplex-v1/.owlbot-manifest.json b/google-cloud-dataplex-v1/.owlbot-manifest.json index 287ceffd7ce8..ecc2905e8387 100644 --- a/google-cloud-dataplex-v1/.owlbot-manifest.json +++ b/google-cloud-dataplex-v1/.owlbot-manifest.json @@ -39,7 +39,9 @@ "lib/google/cloud/dataplex/v1/tasks_pb.rb", "lib/google/cloud/dataplex/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dataplex/v1/analyze.rb", "proto_docs/google/cloud/dataplex/v1/content.rb", diff --git a/google-cloud-dataplex-v1/proto_docs/google/api/client.rb b/google-cloud-dataplex-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dataplex-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dataplex-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-dataplex-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dataplex-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataproc-v1/.owlbot-manifest.json b/google-cloud-dataproc-v1/.owlbot-manifest.json index f29d39c7f6ba..67d59ebb5f18 100644 --- a/google-cloud-dataproc-v1/.owlbot-manifest.json +++ b/google-cloud-dataproc-v1/.owlbot-manifest.json @@ -51,7 +51,9 @@ "lib/google/cloud/dataproc/v1/workflow_templates_pb.rb", "lib/google/cloud/dataproc/v1/workflow_templates_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dataproc/v1/autoscaling_policies.rb", "proto_docs/google/cloud/dataproc/v1/batches.rb", diff --git a/google-cloud-dataproc-v1/proto_docs/google/api/client.rb b/google-cloud-dataproc-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dataproc-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dataproc-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataqna-v1alpha/.owlbot-manifest.json b/google-cloud-dataqna-v1alpha/.owlbot-manifest.json index 225297742eea..b9e839af8efc 100644 --- a/google-cloud-dataqna-v1alpha/.owlbot-manifest.json +++ b/google-cloud-dataqna-v1alpha/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/dataqna/v1alpha/user_feedback_pb.rb", "lib/google/cloud/dataqna/v1alpha/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dataqna/v1alpha/annotated_string.rb", "proto_docs/google/cloud/dataqna/v1alpha/auto_suggestion_service.rb", @@ -39,6 +41,7 @@ "proto_docs/google/cloud/dataqna/v1alpha/question_service.rb", "proto_docs/google/cloud/dataqna/v1alpha/user_feedback.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", diff --git a/google-cloud-dataqna-v1alpha/proto_docs/google/api/client.rb b/google-cloud-dataqna-v1alpha/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dataqna-v1alpha/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dataqna-v1alpha/proto_docs/google/api/launch_stage.rb b/google-cloud-dataqna-v1alpha/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dataqna-v1alpha/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dataqna-v1alpha/proto_docs/google/protobuf/duration.rb b/google-cloud-dataqna-v1alpha/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-dataqna-v1alpha/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-datastore-admin-v1/.owlbot-manifest.json b/google-cloud-datastore-admin-v1/.owlbot-manifest.json index 91e6e389d3a4..46eb598b8efc 100644 --- a/google-cloud-datastore-admin-v1/.owlbot-manifest.json +++ b/google-cloud-datastore-admin-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/datastore/admin/v1/index_pb.rb", "lib/google/datastore/admin/v1/migration_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/datastore/admin/v1/datastore_admin.rb", "proto_docs/google/datastore/admin/v1/index.rb", diff --git a/google-cloud-datastore-admin-v1/proto_docs/google/api/client.rb b/google-cloud-datastore-admin-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-datastore-admin-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-datastore-admin-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-datastore-admin-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-datastore-admin-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-datastore-v1/.owlbot-manifest.json b/google-cloud-datastore-v1/.owlbot-manifest.json index 6a09d7749c74..4116214decc4 100644 --- a/google-cloud-datastore-v1/.owlbot-manifest.json +++ b/google-cloud-datastore-v1/.owlbot-manifest.json @@ -24,12 +24,15 @@ "lib/google/datastore/v1/entity_pb.rb", "lib/google/datastore/v1/query_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/datastore/v1/aggregation_result.rb", "proto_docs/google/datastore/v1/datastore.rb", "proto_docs/google/datastore/v1/entity.rb", "proto_docs/google/datastore/v1/query.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/struct.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/protobuf/wrappers.rb", diff --git a/google-cloud-datastore-v1/proto_docs/google/api/client.rb b/google-cloud-datastore-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-datastore-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-datastore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-datastore-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-datastream-v1/.owlbot-manifest.json b/google-cloud-datastream-v1/.owlbot-manifest.json index d7165efd34ca..f9967e6c50fd 100644 --- a/google-cloud-datastream-v1/.owlbot-manifest.json +++ b/google-cloud-datastream-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/datastream/v1/datastream_services_pb.rb", "lib/google/cloud/datastream/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/datastream/v1/datastream.rb", "proto_docs/google/cloud/datastream/v1/datastream_resources.rb", diff --git a/google-cloud-datastream-v1/proto_docs/google/api/client.rb b/google-cloud-datastream-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-datastream-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-datastream-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-datastream-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-datastream-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-datastream-v1alpha1/.owlbot-manifest.json b/google-cloud-datastream-v1alpha1/.owlbot-manifest.json index efbe2d903bd9..510674efdd48 100644 --- a/google-cloud-datastream-v1alpha1/.owlbot-manifest.json +++ b/google-cloud-datastream-v1alpha1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/datastream/v1alpha1/datastream_services_pb.rb", "lib/google/cloud/datastream/v1alpha1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/datastream/v1alpha1/datastream.rb", "proto_docs/google/cloud/datastream/v1alpha1/datastream_resources.rb", diff --git a/google-cloud-datastream-v1alpha1/proto_docs/google/api/client.rb b/google-cloud-datastream-v1alpha1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-datastream-v1alpha1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-datastream-v1alpha1/proto_docs/google/api/launch_stage.rb b/google-cloud-datastream-v1alpha1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-datastream-v1alpha1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-debugger-v2/.owlbot-manifest.json b/google-cloud-debugger-v2/.owlbot-manifest.json index 562245193082..33d31a7a3359 100644 --- a/google-cloud-debugger-v2/.owlbot-manifest.json +++ b/google-cloud-debugger-v2/.owlbot-manifest.json @@ -28,12 +28,15 @@ "lib/google/devtools/clouddebugger/v2/debugger_services_pb.rb", "lib/google/devtools/source/v1/source_context_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/clouddebugger/v2/controller.rb", "proto_docs/google/devtools/clouddebugger/v2/data.rb", "proto_docs/google/devtools/clouddebugger/v2/debugger.rb", "proto_docs/google/devtools/source/v1/source_context.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/protobuf/wrappers.rb", diff --git a/google-cloud-debugger-v2/proto_docs/google/api/client.rb b/google-cloud-debugger-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-debugger-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-debugger-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-debugger-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-debugger-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-debugger-v2/proto_docs/google/protobuf/duration.rb b/google-cloud-debugger-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-debugger-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-deploy-v1/.owlbot-manifest.json b/google-cloud-deploy-v1/.owlbot-manifest.json index dfab4eaeae13..bdfebe2378ad 100644 --- a/google-cloud-deploy-v1/.owlbot-manifest.json +++ b/google-cloud-deploy-v1/.owlbot-manifest.json @@ -30,7 +30,9 @@ "lib/google/cloud/deploy/v1/target_notification_payload_pb.rb", "lib/google/cloud/deploy/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/deploy/v1/cloud_deploy.rb", "proto_docs/google/cloud/deploy/v1/deliverypipeline_notification_payload.rb", diff --git a/google-cloud-deploy-v1/proto_docs/google/api/client.rb b/google-cloud-deploy-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-deploy-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-deploy-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-deploy-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-deploy-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json b/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json index 16527f9f871b..f37eb27b6c5b 100644 --- a/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json +++ b/google-cloud-dialogflow-cx-v3/.owlbot-manifest.json @@ -122,7 +122,9 @@ "lib/google/cloud/dialogflow/cx/v3/webhooks/credentials.rb", "lib/google/cloud/dialogflow/cx/v3/webhooks/paths.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dialogflow/cx/v3/advanced_settings.rb", "proto_docs/google/cloud/dialogflow/cx/v3/agent.rb", diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dialogflow-v2/.owlbot-manifest.json b/google-cloud-dialogflow-v2/.owlbot-manifest.json index 85667e83e7f8..e30ea18a736f 100644 --- a/google-cloud-dialogflow-v2/.owlbot-manifest.json +++ b/google-cloud-dialogflow-v2/.owlbot-manifest.json @@ -131,7 +131,9 @@ "lib/google/cloud/dialogflow/v2/versions/paths.rb", "lib/google/cloud/dialogflow/v2/webhook_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/dialogflow/v2/agent.rb", "proto_docs/google/cloud/dialogflow/v2/answer_record.rb", diff --git a/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb b/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dialogflow-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dialogflow-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-dlp-v2/.owlbot-manifest.json b/google-cloud-dlp-v2/.owlbot-manifest.json index 76f90b3a2714..479978a9d332 100644 --- a/google-cloud-dlp-v2/.owlbot-manifest.json +++ b/google-cloud-dlp-v2/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/privacy/dlp/v2/dlp_services_pb.rb", "lib/google/privacy/dlp/v2/storage_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/privacy/dlp/v2/dlp.rb", "proto_docs/google/privacy/dlp/v2/storage.rb", diff --git a/google-cloud-dlp-v2/proto_docs/google/api/client.rb b/google-cloud-dlp-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-dlp-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-dlp-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-dlp-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-dlp-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-document_ai-v1/.owlbot-manifest.json b/google-cloud-document_ai-v1/.owlbot-manifest.json index 4c8ea36e4ebb..2c8dd138ef8a 100644 --- a/google-cloud-document_ai-v1/.owlbot-manifest.json +++ b/google-cloud-document_ai-v1/.owlbot-manifest.json @@ -31,6 +31,7 @@ "lib/google/cloud/documentai/v1/processor_pb.rb", "lib/google/cloud/documentai/v1/processor_type_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", diff --git a/google-cloud-document_ai-v1/proto_docs/google/api/client.rb b/google-cloud-document_ai-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-document_ai-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb index 815ad6fd1e93..ce75038366ae 100644 --- a/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-document_ai-v1/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-domains-v1/.owlbot-manifest.json b/google-cloud-domains-v1/.owlbot-manifest.json index fe274f8f7704..7129786ab078 100644 --- a/google-cloud-domains-v1/.owlbot-manifest.json +++ b/google-cloud-domains-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/domains/v1/domains_services_pb.rb", "lib/google/cloud/domains/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/domains/v1/domains.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-domains-v1/proto_docs/google/api/client.rb b/google-cloud-domains-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-domains-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-domains-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-domains-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-domains-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-domains-v1beta1/.owlbot-manifest.json b/google-cloud-domains-v1beta1/.owlbot-manifest.json index b48defa79e06..77f94e9e100a 100644 --- a/google-cloud-domains-v1beta1/.owlbot-manifest.json +++ b/google-cloud-domains-v1beta1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/domains/v1beta1/domains_services_pb.rb", "lib/google/cloud/domains/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/domains/v1beta1/domains.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-domains-v1beta1/proto_docs/google/api/client.rb b/google-cloud-domains-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-domains-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-domains-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-domains-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-domains-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-error_reporting-v1beta1/.owlbot-manifest.json b/google-cloud-error_reporting-v1beta1/.owlbot-manifest.json index aa5fa7f53422..77e8edeb6208 100644 --- a/google-cloud-error_reporting-v1beta1/.owlbot-manifest.json +++ b/google-cloud-error_reporting-v1beta1/.owlbot-manifest.json @@ -35,7 +35,9 @@ "lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb", "lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/clouderrorreporting/v1beta1/common.rb", "proto_docs/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb", diff --git a/google-cloud-error_reporting-v1beta1/proto_docs/google/api/client.rb b/google-cloud-error_reporting-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-error_reporting-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-error_reporting-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-error_reporting-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-error_reporting-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-essential_contacts-v1/.owlbot-manifest.json b/google-cloud-essential_contacts-v1/.owlbot-manifest.json index c21a72eb4685..0233b0434d29 100644 --- a/google-cloud-essential_contacts-v1/.owlbot-manifest.json +++ b/google-cloud-essential_contacts-v1/.owlbot-manifest.json @@ -23,10 +23,13 @@ "lib/google/cloud/essentialcontacts/v1/service_pb.rb", "lib/google/cloud/essentialcontacts/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/essentialcontacts/v1/enums.rb", "proto_docs/google/cloud/essentialcontacts/v1/service.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-essential_contacts-v1/proto_docs/google/api/client.rb b/google-cloud-essential_contacts-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-essential_contacts-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-essential_contacts-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-essential_contacts-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-essential_contacts-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-essential_contacts-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-essential_contacts-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-essential_contacts-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-eventarc-publishing-v1/.owlbot-manifest.json b/google-cloud-eventarc-publishing-v1/.owlbot-manifest.json index 4186fc27f4e4..2330ae907112 100644 --- a/google-cloud-eventarc-publishing-v1/.owlbot-manifest.json +++ b/google-cloud-eventarc-publishing-v1/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/eventarc/publishing/v1/publisher_services_pb.rb", "lib/google/cloud/eventarc/publishing/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/eventarc/publishing/v1/publisher.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/publisher/publish_channel_connection_events.rb", "snippets/publisher/publish_events.rb", diff --git a/google-cloud-eventarc-publishing-v1/proto_docs/google/api/client.rb b/google-cloud-eventarc-publishing-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-eventarc-publishing-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-eventarc-publishing-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-eventarc-publishing-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-eventarc-publishing-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-eventarc-publishing-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-eventarc-publishing-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-eventarc-publishing-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-eventarc-v1/.owlbot-manifest.json b/google-cloud-eventarc-v1/.owlbot-manifest.json index 1397acb34d3a..5ca02651dd99 100644 --- a/google-cloud-eventarc-v1/.owlbot-manifest.json +++ b/google-cloud-eventarc-v1/.owlbot-manifest.json @@ -28,7 +28,9 @@ "lib/google/cloud/eventarc/v1/trigger_pb.rb", "lib/google/cloud/eventarc/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/eventarc/v1/channel.rb", "proto_docs/google/cloud/eventarc/v1/channel_connection.rb", diff --git a/google-cloud-eventarc-v1/proto_docs/google/api/client.rb b/google-cloud-eventarc-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-eventarc-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-eventarc-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-eventarc-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-eventarc-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-filestore-v1/.owlbot-manifest.json b/google-cloud-filestore-v1/.owlbot-manifest.json index 48463440b32a..c9587c19c1d3 100644 --- a/google-cloud-filestore-v1/.owlbot-manifest.json +++ b/google-cloud-filestore-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/filestore/v1/cloud_filestore_service_services_pb.rb", "lib/google/cloud/filestore/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/common/operation_metadata.rb", "proto_docs/google/cloud/filestore/v1/cloud_filestore_service.rb", diff --git a/google-cloud-filestore-v1/proto_docs/google/api/client.rb b/google-cloud-filestore-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-filestore-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-filestore-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-filestore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-filestore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-firestore-admin-v1/.owlbot-manifest.json b/google-cloud-firestore-admin-v1/.owlbot-manifest.json index 46e461d1e303..7cba461042b9 100644 --- a/google-cloud-firestore-admin-v1/.owlbot-manifest.json +++ b/google-cloud-firestore-admin-v1/.owlbot-manifest.json @@ -28,7 +28,9 @@ "lib/google/firestore/admin/v1/location_pb.rb", "lib/google/firestore/admin/v1/operation_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/firestore/admin/v1/database.rb", "proto_docs/google/firestore/admin/v1/field.rb", diff --git a/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb b/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-firestore-admin-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-firestore-admin-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-firestore-v1/.owlbot-manifest.json b/google-cloud-firestore-v1/.owlbot-manifest.json index 6189267e6ec2..b8c8ccba73d8 100644 --- a/google-cloud-firestore-v1/.owlbot-manifest.json +++ b/google-cloud-firestore-v1/.owlbot-manifest.json @@ -26,7 +26,9 @@ "lib/google/firestore/v1/query_pb.rb", "lib/google/firestore/v1/write_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/firestore/v1/aggregation_result.rb", "proto_docs/google/firestore/v1/common.rb", @@ -35,6 +37,7 @@ "proto_docs/google/firestore/v1/query.rb", "proto_docs/google/firestore/v1/write.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/struct.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-firestore-v1/proto_docs/google/api/client.rb b/google-cloud-firestore-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-firestore-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-firestore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-firestore-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-functions-v1/.owlbot-manifest.json b/google-cloud-functions-v1/.owlbot-manifest.json index e4c9e79edc3a..0e6f1649e86c 100644 --- a/google-cloud-functions-v1/.owlbot-manifest.json +++ b/google-cloud-functions-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/functions/v1/operations_pb.rb", "lib/google/cloud/functions/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/functions/v1/functions.rb", "proto_docs/google/cloud/functions/v1/operations.rb", diff --git a/google-cloud-functions-v1/proto_docs/google/api/client.rb b/google-cloud-functions-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-functions-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-functions-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-functions-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-functions-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-functions-v2/.owlbot-manifest.json b/google-cloud-functions-v2/.owlbot-manifest.json index c41076e71b44..226364e0ef11 100644 --- a/google-cloud-functions-v2/.owlbot-manifest.json +++ b/google-cloud-functions-v2/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/functions/v2/functions_services_pb.rb", "lib/google/cloud/functions/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/functions/v2/functions.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-functions-v2/proto_docs/google/api/client.rb b/google-cloud-functions-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-functions-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-functions-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-functions-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-functions-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gaming-v1/.owlbot-manifest.json b/google-cloud-gaming-v1/.owlbot-manifest.json index 4e0e41c8e1ea..0f2387251ec5 100644 --- a/google-cloud-gaming-v1/.owlbot-manifest.json +++ b/google-cloud-gaming-v1/.owlbot-manifest.json @@ -49,7 +49,9 @@ "lib/google/cloud/gaming/v1/realms_service_services_pb.rb", "lib/google/cloud/gaming/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gaming/v1/common.rb", "proto_docs/google/cloud/gaming/v1/game_server_clusters.rb", diff --git a/google-cloud-gaming-v1/proto_docs/google/api/client.rb b/google-cloud-gaming-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gaming-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gaming-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-gaming-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gaming-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gke_backup-v1/.owlbot-manifest.json b/google-cloud-gke_backup-v1/.owlbot-manifest.json index ed28f5ec1032..1d83100b192e 100644 --- a/google-cloud-gke_backup-v1/.owlbot-manifest.json +++ b/google-cloud-gke_backup-v1/.owlbot-manifest.json @@ -29,7 +29,9 @@ "lib/google/cloud/gkebackup/v1/restore_plan_pb.rb", "lib/google/cloud/gkebackup/v1/volume_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gkebackup/v1/backup.rb", "proto_docs/google/cloud/gkebackup/v1/backup_plan.rb", diff --git a/google-cloud-gke_backup-v1/proto_docs/google/api/client.rb b/google-cloud-gke_backup-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gke_backup-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gke_backup-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-gke_backup-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gke_backup-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gke_connect-gateway-v1beta1/.owlbot-manifest.json b/google-cloud-gke_connect-gateway-v1beta1/.owlbot-manifest.json index 4d5324ac8d05..91757606b240 100644 --- a/google-cloud-gke_connect-gateway-v1beta1/.owlbot-manifest.json +++ b/google-cloud-gke_connect-gateway-v1beta1/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/gkeconnect/gateway/v1beta1/gateway_pb.rb", "lib/google/cloud/gkeconnect/gateway/v1beta1/gateway_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/gateway_service/delete_resource.rb", "snippets/gateway_service/get_resource.rb", diff --git a/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/client.rb b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-gke_connect-gateway-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-gke_hub-v1/.owlbot-manifest.json b/google-cloud-gke_hub-v1/.owlbot-manifest.json index 07082b06a349..e1ff2743bcb1 100644 --- a/google-cloud-gke_hub-v1/.owlbot-manifest.json +++ b/google-cloud-gke_hub-v1/.owlbot-manifest.json @@ -27,7 +27,9 @@ "lib/google/cloud/gkehub/v1/service_pb.rb", "lib/google/cloud/gkehub/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gkehub/v1/configmanagement/configmanagement.rb", "proto_docs/google/cloud/gkehub/v1/feature.rb", diff --git a/google-cloud-gke_hub-v1/proto_docs/google/api/client.rb b/google-cloud-gke_hub-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gke_hub-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gke_hub-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-gke_hub-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gke_hub-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gke_hub-v1beta1/.owlbot-manifest.json b/google-cloud-gke_hub-v1beta1/.owlbot-manifest.json index 7966ecff7fe0..cef7047f20ba 100644 --- a/google-cloud-gke_hub-v1beta1/.owlbot-manifest.json +++ b/google-cloud-gke_hub-v1beta1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/gkehub/v1beta1/membership_pb.rb", "lib/google/cloud/gkehub/v1beta1/membership_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gkehub/v1beta1/membership.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-gke_hub-v1beta1/proto_docs/google/api/client.rb b/google-cloud-gke_hub-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gke_hub-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gke_hub-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-gke_hub-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gke_hub-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-gke_multi_cloud-v1/.owlbot-manifest.json b/google-cloud-gke_multi_cloud-v1/.owlbot-manifest.json index e03ced85468d..69f5c336ebfd 100644 --- a/google-cloud-gke_multi_cloud-v1/.owlbot-manifest.json +++ b/google-cloud-gke_multi_cloud-v1/.owlbot-manifest.json @@ -33,7 +33,9 @@ "lib/google/cloud/gkemulticloud/v1/azure_service_services_pb.rb", "lib/google/cloud/gkemulticloud/v1/common_resources_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/gkemulticloud/v1/aws_resources.rb", "proto_docs/google/cloud/gkemulticloud/v1/aws_service.rb", diff --git a/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/client.rb b/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-gke_multi_cloud-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-iap-v1/.owlbot-manifest.json b/google-cloud-iap-v1/.owlbot-manifest.json index 07430b183af0..bce025328089 100644 --- a/google-cloud-iap-v1/.owlbot-manifest.json +++ b/google-cloud-iap-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/iap/v1/service_services_pb.rb", "lib/google/cloud/iap/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/iap/v1/service.rb", "proto_docs/google/iam/v1/iam_policy.rb", diff --git a/google-cloud-iap-v1/proto_docs/google/api/client.rb b/google-cloud-iap-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-iap-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-iap-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-iap-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-iap-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-ids-v1/.owlbot-manifest.json b/google-cloud-ids-v1/.owlbot-manifest.json index 02eb050a086e..4aed60ad4117 100644 --- a/google-cloud-ids-v1/.owlbot-manifest.json +++ b/google-cloud-ids-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/ids/v1/ids_services_pb.rb", "lib/google/cloud/ids/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/ids/v1/ids.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-ids-v1/proto_docs/google/api/client.rb b/google-cloud-ids-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-ids-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-ids-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-ids-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-ids-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-iot-v1/.owlbot-manifest.json b/google-cloud-iot-v1/.owlbot-manifest.json index 4c73791e3b58..ed23277c0675 100644 --- a/google-cloud-iot-v1/.owlbot-manifest.json +++ b/google-cloud-iot-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/iot/v1/resources_pb.rb", "lib/google/cloud/iot/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/iot/v1/device_manager.rb", "proto_docs/google/cloud/iot/v1/resources.rb", @@ -31,6 +33,7 @@ "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-iot-v1/proto_docs/google/api/client.rb b/google-cloud-iot-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-iot-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-iot-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-iot-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-iot-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-iot-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-iot-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-iot-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-kms-v1/.owlbot-manifest.json b/google-cloud-kms-v1/.owlbot-manifest.json index 713cd66d8614..ea02db2a5122 100644 --- a/google-cloud-kms-v1/.owlbot-manifest.json +++ b/google-cloud-kms-v1/.owlbot-manifest.json @@ -29,7 +29,9 @@ "lib/google/cloud/kms/v1/service_services_pb.rb", "lib/google/cloud/kms/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/kms/v1/ekm_service.rb", "proto_docs/google/cloud/kms/v1/resources.rb", diff --git a/google-cloud-kms-v1/proto_docs/google/api/client.rb b/google-cloud-kms-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-kms-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-kms-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-language-v1/.owlbot-manifest.json b/google-cloud-language-v1/.owlbot-manifest.json index 68f9eff851a7..c4e7d26fdefa 100644 --- a/google-cloud-language-v1/.owlbot-manifest.json +++ b/google-cloud-language-v1/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/language/v1/language_service_services_pb.rb", "lib/google/cloud/language/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/language/v1/language_service.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/language_service/analyze_entities.rb", "snippets/language_service/analyze_entity_sentiment.rb", diff --git a/google-cloud-language-v1/proto_docs/google/api/client.rb b/google-cloud-language-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-language-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-language-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-language-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-language-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-language-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-language-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-language-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-language-v1beta2/.owlbot-manifest.json b/google-cloud-language-v1beta2/.owlbot-manifest.json index 2ad92b9f42fa..975ecee88072 100644 --- a/google-cloud-language-v1beta2/.owlbot-manifest.json +++ b/google-cloud-language-v1beta2/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/language/v1beta2/language_service_services_pb.rb", "lib/google/cloud/language/v1beta2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/language/v1beta2/language_service.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/language_service/analyze_entities.rb", "snippets/language_service/analyze_entity_sentiment.rb", diff --git a/google-cloud-language-v1beta2/proto_docs/google/api/client.rb b/google-cloud-language-v1beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-language-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-language-v1beta2/proto_docs/google/api/launch_stage.rb b/google-cloud-language-v1beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-language-v1beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-language-v1beta2/proto_docs/google/protobuf/duration.rb b/google-cloud-language-v1beta2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-language-v1beta2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-location/.owlbot-manifest.json b/google-cloud-location/.owlbot-manifest.json index ba41fa69a17d..1c0a0d9c0f81 100644 --- a/google-cloud-location/.owlbot-manifest.json +++ b/google-cloud-location/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/location/locations_services_pb.rb", "lib/google/cloud/location/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/location/locations.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/locations/get_location.rb", "snippets/locations/list_locations.rb", diff --git a/google-cloud-location/proto_docs/google/api/client.rb b/google-cloud-location/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-location/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-location/proto_docs/google/api/launch_stage.rb b/google-cloud-location/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-location/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-location/proto_docs/google/protobuf/duration.rb b/google-cloud-location/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-location/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-logging-v2/.owlbot-manifest.json b/google-cloud-logging-v2/.owlbot-manifest.json index e6ef94599568..1243986cc17a 100644 --- a/google-cloud-logging-v2/.owlbot-manifest.json +++ b/google-cloud-logging-v2/.owlbot-manifest.json @@ -36,6 +36,7 @@ "lib/google/logging/v2/logging_pb.rb", "lib/google/logging/v2/logging_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/distribution.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/label.rb", diff --git a/google-cloud-logging-v2/proto_docs/google/api/client.rb b/google-cloud-logging-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-logging-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-logging-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-logging-v2/proto_docs/google/api/launch_stage.rb index 3f6f1bb2fcc7..3de0fb4e6b40 100644 --- a/google-cloud-logging-v2/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-logging-v2/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-logging-v2/proto_docs/google/api/monitored_resource.rb b/google-cloud-logging-v2/proto_docs/google/api/monitored_resource.rb index 904ba8362466..0603928cbdc9 100644 --- a/google-cloud-logging-v2/proto_docs/google/api/monitored_resource.rb +++ b/google-cloud-logging-v2/proto_docs/google/api/monitored_resource.rb @@ -40,6 +40,10 @@ module Api # @return [::String] # Required. The monitored resource type. For example, the type # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitoring resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). # @!attribute [rw] display_name # @return [::String] # Optional. A concise name for the monitored resource type that might be @@ -71,16 +75,19 @@ class MonitoredResourceDescriptor # its attributes according to the schema. For example, a particular Compute # Engine VM instance could be represented by the following object, because the # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for `"gce_instance"` has labels - # `"instance_id"` and `"zone"`: + # `"project_id"`, `"instance_id"` and `"zone"`: # # { "type": "gce_instance", - # "labels": { "instance_id": "12345678901234", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", # "zone": "us-central1-a" }} # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. This field must match # the `type` field of a {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object. For # example, the type of a Compute Engine VM instance is `gce_instance`. + # Some descriptors include the service name in the type; for example, + # the type of a Datastream stream is `datastream.googleapis.com/Stream`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Required. Values for all of the labels listed in the associated monitored diff --git a/google-cloud-managed_identities-v1/.owlbot-manifest.json b/google-cloud-managed_identities-v1/.owlbot-manifest.json index fdc7d9c8ba66..13a60a7f86ac 100644 --- a/google-cloud-managed_identities-v1/.owlbot-manifest.json +++ b/google-cloud-managed_identities-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/managedidentities/v1/managed_identities_service_services_pb.rb", "lib/google/cloud/managedidentities/v1/resource_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/managedidentities/v1/managed_identities_service.rb", "proto_docs/google/cloud/managedidentities/v1/resource.rb", diff --git a/google-cloud-managed_identities-v1/proto_docs/google/api/client.rb b/google-cloud-managed_identities-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-managed_identities-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-managed_identities-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-managed_identities-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-managed_identities-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-media_translation-v1beta1/.owlbot-manifest.json b/google-cloud-media_translation-v1beta1/.owlbot-manifest.json index 691606e4b88c..f7c175e9bff1 100644 --- a/google-cloud-media_translation-v1beta1/.owlbot-manifest.json +++ b/google-cloud-media_translation-v1beta1/.owlbot-manifest.json @@ -21,10 +21,13 @@ "lib/google/cloud/mediatranslation/v1beta1/media_translation_pb.rb", "lib/google/cloud/mediatranslation/v1beta1/media_translation_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/mediatranslation/v1beta1/media_translation.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/rpc/status.rb", "snippets/Gemfile", "snippets/snippet_metadata_google.cloud.mediatranslation.v1beta1.json", diff --git a/google-cloud-media_translation-v1beta1/proto_docs/google/api/client.rb b/google-cloud-media_translation-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-media_translation-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-media_translation-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-media_translation-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-media_translation-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-media_translation-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-media_translation-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-media_translation-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-memcache-v1/.owlbot-manifest.json b/google-cloud-memcache-v1/.owlbot-manifest.json index 1829ae357b3a..d8cbfa2ba7cd 100644 --- a/google-cloud-memcache-v1/.owlbot-manifest.json +++ b/google-cloud-memcache-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/memcache/v1/cloud_memcache_services_pb.rb", "lib/google/cloud/memcache/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/memcache/v1/cloud_memcache.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-memcache-v1/proto_docs/google/api/client.rb b/google-cloud-memcache-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-memcache-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-memcache-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-memcache-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-memcache-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-memcache-v1beta2/.owlbot-manifest.json b/google-cloud-memcache-v1beta2/.owlbot-manifest.json index 1c980a690e2a..1d3c515b6286 100644 --- a/google-cloud-memcache-v1beta2/.owlbot-manifest.json +++ b/google-cloud-memcache-v1beta2/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/memcache/v1beta2/cloud_memcache_services_pb.rb", "lib/google/cloud/memcache/v1beta2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-memcache-v1beta2/proto_docs/google/api/client.rb b/google-cloud-memcache-v1beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-memcache-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-memcache-v1beta2/proto_docs/google/api/launch_stage.rb b/google-cloud-memcache-v1beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-memcache-v1beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-metastore-v1/.owlbot-manifest.json b/google-cloud-metastore-v1/.owlbot-manifest.json index 242f9ce5dd27..a55c5ddbb936 100644 --- a/google-cloud-metastore-v1/.owlbot-manifest.json +++ b/google-cloud-metastore-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/metastore/v1/metastore_services_pb.rb", "lib/google/cloud/metastore/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/metastore/v1/metastore.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-metastore-v1/proto_docs/google/api/client.rb b/google-cloud-metastore-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-metastore-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-metastore-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-metastore-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-metastore-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-metastore-v1beta/.owlbot-manifest.json b/google-cloud-metastore-v1beta/.owlbot-manifest.json index 4581caf4e108..6ab61a948b68 100644 --- a/google-cloud-metastore-v1beta/.owlbot-manifest.json +++ b/google-cloud-metastore-v1beta/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/metastore/v1beta/metastore_services_pb.rb", "lib/google/cloud/metastore/v1beta/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/metastore/v1beta/metastore.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-metastore-v1beta/proto_docs/google/api/client.rb b/google-cloud-metastore-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-metastore-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-metastore-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-metastore-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-metastore-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-monitoring-dashboard-v1/.owlbot-manifest.json b/google-cloud-monitoring-dashboard-v1/.owlbot-manifest.json index 4fdec273ad69..4d8d81ea430c 100644 --- a/google-cloud-monitoring-dashboard-v1/.owlbot-manifest.json +++ b/google-cloud-monitoring-dashboard-v1/.owlbot-manifest.json @@ -38,7 +38,9 @@ "lib/google/monitoring/dashboard/v1/widget_pb.rb", "lib/google/monitoring/dashboard/v1/xychart_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/monitoring/dashboard/v1/alertchart.rb", "proto_docs/google/monitoring/dashboard/v1/collapsible_group.rb", diff --git a/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/client.rb b/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-monitoring-dashboard-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-monitoring-metrics_scope-v1/.owlbot-manifest.json b/google-cloud-monitoring-metrics_scope-v1/.owlbot-manifest.json index 6922b02a5bcb..71fcfe9b8146 100644 --- a/google-cloud-monitoring-metrics_scope-v1/.owlbot-manifest.json +++ b/google-cloud-monitoring-metrics_scope-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/monitoring/metricsscope/v1/metrics_scopes_pb.rb", "lib/google/monitoring/metricsscope/v1/metrics_scopes_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/monitoring/metricsscope/v1/metrics_scope.rb", diff --git a/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/client.rb b/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-monitoring-metrics_scope-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-monitoring-v3/.owlbot-manifest.json b/google-cloud-monitoring-v3/.owlbot-manifest.json index 05c1fe5273f6..2e745bd88328 100644 --- a/google-cloud-monitoring-v3/.owlbot-manifest.json +++ b/google-cloud-monitoring-v3/.owlbot-manifest.json @@ -67,6 +67,7 @@ "lib/google/monitoring/v3/uptime_service_pb.rb", "lib/google/monitoring/v3/uptime_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/distribution.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/label.rb", diff --git a/google-cloud-monitoring-v3/proto_docs/google/api/client.rb b/google-cloud-monitoring-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-monitoring-v3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-monitoring-v3/proto_docs/google/api/launch_stage.rb b/google-cloud-monitoring-v3/proto_docs/google/api/launch_stage.rb index b752e23a6cfc..1a590d84d783 100644 --- a/google-cloud-monitoring-v3/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-monitoring-v3/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-monitoring-v3/proto_docs/google/api/monitored_resource.rb b/google-cloud-monitoring-v3/proto_docs/google/api/monitored_resource.rb index 904ba8362466..0603928cbdc9 100644 --- a/google-cloud-monitoring-v3/proto_docs/google/api/monitored_resource.rb +++ b/google-cloud-monitoring-v3/proto_docs/google/api/monitored_resource.rb @@ -40,6 +40,10 @@ module Api # @return [::String] # Required. The monitored resource type. For example, the type # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitoring resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). # @!attribute [rw] display_name # @return [::String] # Optional. A concise name for the monitored resource type that might be @@ -71,16 +75,19 @@ class MonitoredResourceDescriptor # its attributes according to the schema. For example, a particular Compute # Engine VM instance could be represented by the following object, because the # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for `"gce_instance"` has labels - # `"instance_id"` and `"zone"`: + # `"project_id"`, `"instance_id"` and `"zone"`: # # { "type": "gce_instance", - # "labels": { "instance_id": "12345678901234", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", # "zone": "us-central1-a" }} # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. This field must match # the `type` field of a {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object. For # example, the type of a Compute Engine VM instance is `gce_instance`. + # Some descriptors include the service name in the type; for example, + # the type of a Datastream stream is `datastream.googleapis.com/Stream`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Required. Values for all of the labels listed in the associated monitored diff --git a/google-cloud-network_connectivity-v1/.owlbot-manifest.json b/google-cloud-network_connectivity-v1/.owlbot-manifest.json index ccc085f71eee..cb4dd16c125b 100644 --- a/google-cloud-network_connectivity-v1/.owlbot-manifest.json +++ b/google-cloud-network_connectivity-v1/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/networkconnectivity/v1/policy_based_routing_pb.rb", "lib/google/cloud/networkconnectivity/v1/policy_based_routing_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/networkconnectivity/v1/common.rb", "proto_docs/google/cloud/networkconnectivity/v1/hub.rb", diff --git a/google-cloud-network_connectivity-v1/proto_docs/google/api/client.rb b/google-cloud-network_connectivity-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-network_connectivity-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-network_connectivity-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-network_connectivity-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-network_connectivity-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-network_connectivity-v1alpha1/.owlbot-manifest.json b/google-cloud-network_connectivity-v1alpha1/.owlbot-manifest.json index d5c997e29379..11cbd7356af3 100644 --- a/google-cloud-network_connectivity-v1alpha1/.owlbot-manifest.json +++ b/google-cloud-network_connectivity-v1alpha1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/networkconnectivity/v1alpha1/hub_pb.rb", "lib/google/cloud/networkconnectivity/v1alpha1/hub_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/networkconnectivity/v1alpha1/common.rb", "proto_docs/google/cloud/networkconnectivity/v1alpha1/hub.rb", diff --git a/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/client.rb b/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/launch_stage.rb b/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-network_connectivity-v1alpha1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-network_management-v1/.owlbot-manifest.json b/google-cloud-network_management-v1/.owlbot-manifest.json index 60c8fc08a554..b04cce767cc2 100644 --- a/google-cloud-network_management-v1/.owlbot-manifest.json +++ b/google-cloud-network_management-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/networkmanagement/v1/reachability_services_pb.rb", "lib/google/cloud/networkmanagement/v1/trace_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/networkmanagement/v1/connectivity_test.rb", "proto_docs/google/cloud/networkmanagement/v1/reachability.rb", diff --git a/google-cloud-network_management-v1/proto_docs/google/api/client.rb b/google-cloud-network_management-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-network_management-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-network_management-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-network_management-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-network_management-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-network_security-v1beta1/.owlbot-manifest.json b/google-cloud-network_security-v1beta1/.owlbot-manifest.json index 6e496747905a..aa1295344d53 100644 --- a/google-cloud-network_security-v1beta1/.owlbot-manifest.json +++ b/google-cloud-network_security-v1beta1/.owlbot-manifest.json @@ -28,7 +28,9 @@ "lib/google/cloud/networksecurity/v1beta1/server_tls_policy_pb.rb", "lib/google/cloud/networksecurity/v1beta1/tls_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/networksecurity/v1beta1/authorization_policy.rb", "proto_docs/google/cloud/networksecurity/v1beta1/client_tls_policy.rb", diff --git a/google-cloud-network_security-v1beta1/proto_docs/google/api/client.rb b/google-cloud-network_security-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-network_security-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-network_security-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-network_security-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-network_security-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-notebooks-v1/.owlbot-manifest.json b/google-cloud-notebooks-v1/.owlbot-manifest.json index 4c7358dc0f0f..0b4fdfd89bbf 100644 --- a/google-cloud-notebooks-v1/.owlbot-manifest.json +++ b/google-cloud-notebooks-v1/.owlbot-manifest.json @@ -37,7 +37,9 @@ "lib/google/cloud/notebooks/v1/service_services_pb.rb", "lib/google/cloud/notebooks/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/notebooks/v1/environment.rb", "proto_docs/google/cloud/notebooks/v1/event.rb", diff --git a/google-cloud-notebooks-v1/proto_docs/google/api/client.rb b/google-cloud-notebooks-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-notebooks-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-notebooks-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-notebooks-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-notebooks-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-notebooks-v1beta1/.owlbot-manifest.json b/google-cloud-notebooks-v1beta1/.owlbot-manifest.json index 714743339aa0..88176aaca8f0 100644 --- a/google-cloud-notebooks-v1beta1/.owlbot-manifest.json +++ b/google-cloud-notebooks-v1beta1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/notebooks/v1beta1/service_services_pb.rb", "lib/google/cloud/notebooks/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/notebooks/v1beta1/environment.rb", "proto_docs/google/cloud/notebooks/v1beta1/instance.rb", diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/api/client.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-optimization-v1/.owlbot-manifest.json b/google-cloud-optimization-v1/.owlbot-manifest.json index f7252cb5e29e..2fe03ee08515 100644 --- a/google-cloud-optimization-v1/.owlbot-manifest.json +++ b/google-cloud-optimization-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/optimization/v1/fleet_routing_services_pb.rb", "lib/google/cloud/optimization/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/optimization/v1/async_model.rb", "proto_docs/google/cloud/optimization/v1/fleet_routing.rb", diff --git a/google-cloud-optimization-v1/proto_docs/google/api/client.rb b/google-cloud-optimization-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-optimization-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-optimization-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-optimization-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-optimization-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-orchestration-airflow-service-v1/.owlbot-manifest.json b/google-cloud-orchestration-airflow-service-v1/.owlbot-manifest.json index 137ce183751b..b7330eeb96d1 100644 --- a/google-cloud-orchestration-airflow-service-v1/.owlbot-manifest.json +++ b/google-cloud-orchestration-airflow-service-v1/.owlbot-manifest.json @@ -29,7 +29,9 @@ "lib/google/cloud/orchestration/airflow/service/v1/operations_pb.rb", "lib/google/cloud/orchestration/airflow/service/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/orchestration/airflow/service/v1/environments.rb", "proto_docs/google/cloud/orchestration/airflow/service/v1/image_versions.rb", diff --git a/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/client.rb b/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-orchestration-airflow-service-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-org_policy-v2/.owlbot-manifest.json b/google-cloud-org_policy-v2/.owlbot-manifest.json index 4a8d021011a1..49e937642f96 100644 --- a/google-cloud-org_policy-v2/.owlbot-manifest.json +++ b/google-cloud-org_policy-v2/.owlbot-manifest.json @@ -23,10 +23,13 @@ "lib/google/cloud/orgpolicy/v2/orgpolicy_pb.rb", "lib/google/cloud/orgpolicy/v2/orgpolicy_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/orgpolicy/v2/constraint.rb", "proto_docs/google/cloud/orgpolicy/v2/orgpolicy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/type/expr.rb", diff --git a/google-cloud-org_policy-v2/proto_docs/google/api/client.rb b/google-cloud-org_policy-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-org_policy-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-org_policy-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-org_policy-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-org_policy-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-org_policy-v2/proto_docs/google/protobuf/duration.rb b/google-cloud-org_policy-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-org_policy-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-os_config-v1/.owlbot-manifest.json b/google-cloud-os_config-v1/.owlbot-manifest.json index a60e781a2b6c..99ccd567587b 100644 --- a/google-cloud-os_config-v1/.owlbot-manifest.json +++ b/google-cloud-os_config-v1/.owlbot-manifest.json @@ -37,7 +37,9 @@ "lib/google/cloud/osconfig/v1/patch_jobs_pb.rb", "lib/google/cloud/osconfig/v1/vulnerability_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/osconfig/v1/inventory.rb", "proto_docs/google/cloud/osconfig/v1/os_policy.rb", diff --git a/google-cloud-os_config-v1/proto_docs/google/api/client.rb b/google-cloud-os_config-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-os_config-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-os_config-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-os_config-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-os_config-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-os_config-v1alpha/.owlbot-manifest.json b/google-cloud-os_config-v1alpha/.owlbot-manifest.json index 39f063f2fa6b..77b46a6e4c55 100644 --- a/google-cloud-os_config-v1alpha/.owlbot-manifest.json +++ b/google-cloud-os_config-v1alpha/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/osconfig/v1alpha/osconfig_zonal_service_services_pb.rb", "lib/google/cloud/osconfig/v1alpha/vulnerability_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/osconfig/v1alpha/config_common.rb", "proto_docs/google/cloud/osconfig/v1alpha/instance_os_policies_compliance.rb", diff --git a/google-cloud-os_config-v1alpha/proto_docs/google/api/client.rb b/google-cloud-os_config-v1alpha/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-os_config-v1alpha/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-os_config-v1alpha/proto_docs/google/api/launch_stage.rb b/google-cloud-os_config-v1alpha/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-os_config-v1alpha/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-phishing_protection-v1beta1/.owlbot-manifest.json b/google-cloud-phishing_protection-v1beta1/.owlbot-manifest.json index 240bbf6f9242..a00e4fe0f58d 100644 --- a/google-cloud-phishing_protection-v1beta1/.owlbot-manifest.json +++ b/google-cloud-phishing_protection-v1beta1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/phishingprotection/v1beta1/phishingprotection_pb.rb", "lib/google/cloud/phishingprotection/v1beta1/phishingprotection_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/phishingprotection/v1beta1/phishingprotection.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/phishing_protection_service/report_phishing.rb", "snippets/snippet_metadata_google.cloud.phishingprotection.v1beta1.json", diff --git a/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/client.rb b/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-phishing_protection-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-phishing_protection-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-phishing_protection-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-phishing_protection-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-policy_troubleshooter-v1/.owlbot-manifest.json b/google-cloud-policy_troubleshooter-v1/.owlbot-manifest.json index 949e5b0ef649..e25f1af10218 100644 --- a/google-cloud-policy_troubleshooter-v1/.owlbot-manifest.json +++ b/google-cloud-policy_troubleshooter-v1/.owlbot-manifest.json @@ -22,11 +22,14 @@ "lib/google/cloud/policytroubleshooter/v1/checker_services_pb.rb", "lib/google/cloud/policytroubleshooter/v1/explanations_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/policytroubleshooter/v1/checker.rb", "proto_docs/google/cloud/policytroubleshooter/v1/explanations.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", "snippets/iam_checker/troubleshoot_iam_policy.rb", diff --git a/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb b/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-policy_troubleshooter-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-policy_troubleshooter-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-private_catalog-v1beta1/.owlbot-manifest.json b/google-cloud-private_catalog-v1beta1/.owlbot-manifest.json index a4fdc3c8fa9e..752169b16910 100644 --- a/google-cloud-private_catalog-v1beta1/.owlbot-manifest.json +++ b/google-cloud-private_catalog-v1beta1/.owlbot-manifest.json @@ -21,7 +21,9 @@ "lib/google/cloud/privatecatalog/v1beta1/private_catalog_pb.rb", "lib/google/cloud/privatecatalog/v1beta1/private_catalog_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/privatecatalog/v1beta1/private_catalog.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb b/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-private_catalog-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-private_catalog-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-profiler-v2/.owlbot-manifest.json b/google-cloud-profiler-v2/.owlbot-manifest.json index c56e1150f523..fc4c6289b32d 100644 --- a/google-cloud-profiler-v2/.owlbot-manifest.json +++ b/google-cloud-profiler-v2/.owlbot-manifest.json @@ -21,6 +21,8 @@ "lib/google/devtools/cloudprofiler/v2/profiler_pb.rb", "lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/cloudprofiler/v2/profiler.rb", "proto_docs/google/protobuf/duration.rb", diff --git a/google-cloud-profiler-v2/proto_docs/google/api/client.rb b/google-cloud-profiler-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-profiler-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-profiler-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-pubsub-v1/.owlbot-manifest.json b/google-cloud-pubsub-v1/.owlbot-manifest.json index 5c05686ff38c..e5a29bad4d41 100644 --- a/google-cloud-pubsub-v1/.owlbot-manifest.json +++ b/google-cloud-pubsub-v1/.owlbot-manifest.json @@ -32,7 +32,9 @@ "lib/google/pubsub/v1/schema_pb.rb", "lib/google/pubsub/v1/schema_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", diff --git a/google-cloud-pubsub-v1/proto_docs/google/api/client.rb b/google-cloud-pubsub-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-pubsub-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-pubsub-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1/.owlbot-manifest.json b/google-cloud-recaptcha_enterprise-v1/.owlbot-manifest.json index fc23e60234f2..e3736ff689d4 100644 --- a/google-cloud-recaptcha_enterprise-v1/.owlbot-manifest.json +++ b/google-cloud-recaptcha_enterprise-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_pb.rb", "lib/google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/recaptchaenterprise/v1/recaptchaenterprise.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/.owlbot-manifest.json b/google-cloud-recaptcha_enterprise-v1beta1/.owlbot-manifest.json index 4898734ba865..b7d5285db7fe 100644 --- a/google-cloud-recaptcha_enterprise-v1beta1/.owlbot-manifest.json +++ b/google-cloud-recaptcha_enterprise-v1beta1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb", "lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", "snippets/recaptcha_enterprise_service/annotate_assessment.rb", diff --git a/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-recaptcha_enterprise-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-recommendation_engine-v1beta1/.owlbot-manifest.json b/google-cloud-recommendation_engine-v1beta1/.owlbot-manifest.json index 4166536a1a4f..9dad02f170b1 100644 --- a/google-cloud-recommendation_engine-v1beta1/.owlbot-manifest.json +++ b/google-cloud-recommendation_engine-v1beta1/.owlbot-manifest.json @@ -47,8 +47,10 @@ "lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb", "lib/google/cloud/recommendationengine/v1beta1/user_event_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/recommendationengine/v1beta1/catalog.rb", "proto_docs/google/cloud/recommendationengine/v1beta1/catalog_service.rb", diff --git a/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb b/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-recommendation_engine-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-recommender-v1/.owlbot-manifest.json b/google-cloud-recommender-v1/.owlbot-manifest.json index 5f72a7e857e0..3667a6856258 100644 --- a/google-cloud-recommender-v1/.owlbot-manifest.json +++ b/google-cloud-recommender-v1/.owlbot-manifest.json @@ -26,7 +26,9 @@ "lib/google/cloud/recommender/v1/recommender_service_services_pb.rb", "lib/google/cloud/recommender/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/recommender/v1/insight.rb", "proto_docs/google/cloud/recommender/v1/insight_type_config.rb", diff --git a/google-cloud-recommender-v1/proto_docs/google/api/client.rb b/google-cloud-recommender-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-recommender-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-recommender-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-redis-v1/.owlbot-manifest.json b/google-cloud-redis-v1/.owlbot-manifest.json index e2bf8065bc54..9b40080adb91 100644 --- a/google-cloud-redis-v1/.owlbot-manifest.json +++ b/google-cloud-redis-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/redis/v1/cloud_redis_services_pb.rb", "lib/google/cloud/redis/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/redis/v1/cloud_redis.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-redis-v1/proto_docs/google/api/client.rb b/google-cloud-redis-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-redis-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-redis-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-redis-v1beta1/.owlbot-manifest.json b/google-cloud-redis-v1beta1/.owlbot-manifest.json index f399c9f3e301..30a2f48efccf 100644 --- a/google-cloud-redis-v1beta1/.owlbot-manifest.json +++ b/google-cloud-redis-v1beta1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/redis/v1beta1/cloud_redis_services_pb.rb", "lib/google/cloud/redis/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/redis/v1beta1/cloud_redis.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb b/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-redis-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-redis-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-resource_manager-v3/.owlbot-manifest.json b/google-cloud-resource_manager-v3/.owlbot-manifest.json index 4ea3e6776910..8238601b8f77 100644 --- a/google-cloud-resource_manager-v3/.owlbot-manifest.json +++ b/google-cloud-resource_manager-v3/.owlbot-manifest.json @@ -57,7 +57,9 @@ "lib/google/cloud/resourcemanager/v3/tag_values_pb.rb", "lib/google/cloud/resourcemanager/v3/tag_values_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/resourcemanager/v3/folders.rb", "proto_docs/google/cloud/resourcemanager/v3/organizations.rb", diff --git a/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb b/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-resource_manager-v3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb b/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-resource_manager-v3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-resource_settings-v1/.owlbot-manifest.json b/google-cloud-resource_settings-v1/.owlbot-manifest.json index 7cc33756bee4..3227aac4ea48 100644 --- a/google-cloud-resource_settings-v1/.owlbot-manifest.json +++ b/google-cloud-resource_settings-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/resourcesettings/v1/resource_settings_pb.rb", "lib/google/cloud/resourcesettings/v1/resource_settings_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/resourcesettings/v1/resource_settings.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/resource_settings_service/get_setting.rb", "snippets/resource_settings_service/list_settings.rb", diff --git a/google-cloud-resource_settings-v1/proto_docs/google/api/client.rb b/google-cloud-resource_settings-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-resource_settings-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-resource_settings-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-resource_settings-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-resource_settings-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-resource_settings-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-resource_settings-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-resource_settings-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-retail-v2/.owlbot-manifest.json b/google-cloud-retail-v2/.owlbot-manifest.json index 7468baee98fe..92ab405db087 100644 --- a/google-cloud-retail-v2/.owlbot-manifest.json +++ b/google-cloud-retail-v2/.owlbot-manifest.json @@ -76,8 +76,10 @@ "lib/google/cloud/retail/v2/user_event_service_services_pb.rb", "lib/google/cloud/retail/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/httpbody.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/retail/v2/catalog.rb", "proto_docs/google/cloud/retail/v2/catalog_service.rb", diff --git a/google-cloud-retail-v2/proto_docs/google/api/client.rb b/google-cloud-retail-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-retail-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-retail-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-run-v2/.owlbot-manifest.json b/google-cloud-run-v2/.owlbot-manifest.json index fa3fceff56e8..90c63f7152db 100644 --- a/google-cloud-run-v2/.owlbot-manifest.json +++ b/google-cloud-run-v2/.owlbot-manifest.json @@ -57,6 +57,7 @@ "lib/google/cloud/run/v2/vendor_settings_pb.rb", "lib/google/cloud/run/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", diff --git a/google-cloud-run-v2/proto_docs/google/api/client.rb b/google-cloud-run-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-run-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-run-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-run-v2/proto_docs/google/api/launch_stage.rb index 815ad6fd1e93..ce75038366ae 100644 --- a/google-cloud-run-v2/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-run-v2/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-scheduler-v1/.owlbot-manifest.json b/google-cloud-scheduler-v1/.owlbot-manifest.json index 489427d0579e..2bbd5d43f3f6 100644 --- a/google-cloud-scheduler-v1/.owlbot-manifest.json +++ b/google-cloud-scheduler-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/scheduler/v1/target_pb.rb", "lib/google/cloud/scheduler/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/scheduler/v1/cloudscheduler.rb", "proto_docs/google/cloud/scheduler/v1/job.rb", diff --git a/google-cloud-scheduler-v1/proto_docs/google/api/client.rb b/google-cloud-scheduler-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-scheduler-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-scheduler-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-scheduler-v1beta1/.owlbot-manifest.json b/google-cloud-scheduler-v1beta1/.owlbot-manifest.json index 0a58d245e5dc..81b9957a004e 100644 --- a/google-cloud-scheduler-v1beta1/.owlbot-manifest.json +++ b/google-cloud-scheduler-v1beta1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/scheduler/v1beta1/target_pb.rb", "lib/google/cloud/scheduler/v1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/scheduler/v1beta1/cloudscheduler.rb", "proto_docs/google/cloud/scheduler/v1beta1/job.rb", diff --git a/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb b/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-scheduler-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-scheduler-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-secret_manager-v1/.owlbot-manifest.json b/google-cloud-secret_manager-v1/.owlbot-manifest.json index 2eac29357723..47df18ff20b4 100644 --- a/google-cloud-secret_manager-v1/.owlbot-manifest.json +++ b/google-cloud-secret_manager-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/secretmanager/v1/service_pb.rb", "lib/google/cloud/secretmanager/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/secretmanager/v1/resources.rb", "proto_docs/google/cloud/secretmanager/v1/service.rb", diff --git a/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb b/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-secret_manager-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-secret_manager-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-secret_manager-v1beta1/.owlbot-manifest.json b/google-cloud-secret_manager-v1beta1/.owlbot-manifest.json index f7f1c20da25a..e3a6fbee6911 100644 --- a/google-cloud-secret_manager-v1beta1/.owlbot-manifest.json +++ b/google-cloud-secret_manager-v1beta1/.owlbot-manifest.json @@ -23,13 +23,16 @@ "lib/google/cloud/secrets/v1beta1/service_pb.rb", "lib/google/cloud/secrets/v1beta1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/secrets/v1beta1/resources.rb", "proto_docs/google/cloud/secrets/v1beta1/service.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-secret_manager-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-secret_manager-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-security-private_ca-v1/.owlbot-manifest.json b/google-cloud-security-private_ca-v1/.owlbot-manifest.json index 4d5ac87b739d..7df0b5ae82a8 100644 --- a/google-cloud-security-private_ca-v1/.owlbot-manifest.json +++ b/google-cloud-security-private_ca-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/security/privateca/v1/service_pb.rb", "lib/google/cloud/security/privateca/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/security/privateca/v1/resources.rb", "proto_docs/google/cloud/security/privateca/v1/service.rb", diff --git a/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb b/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-security-private_ca-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-security-private_ca-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-security-private_ca-v1beta1/.owlbot-manifest.json b/google-cloud-security-private_ca-v1beta1/.owlbot-manifest.json index 180ebf05c962..ff95773f8b25 100644 --- a/google-cloud-security-private_ca-v1beta1/.owlbot-manifest.json +++ b/google-cloud-security-private_ca-v1beta1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/cloud/security/privateca/v1beta1/service_pb.rb", "lib/google/cloud/security/privateca/v1beta1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/security/privateca/v1beta1/resources.rb", "proto_docs/google/cloud/security/privateca/v1beta1/service.rb", diff --git a/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-security-private_ca-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-security-public_ca-v1beta1/.owlbot-manifest.json b/google-cloud-security-public_ca-v1beta1/.owlbot-manifest.json index bdda2a6da11b..1c7cda1d3a48 100644 --- a/google-cloud-security-public_ca-v1beta1/.owlbot-manifest.json +++ b/google-cloud-security-public_ca-v1beta1/.owlbot-manifest.json @@ -23,10 +23,13 @@ "lib/google/cloud/security/publicca/v1beta1/service_pb.rb", "lib/google/cloud/security/publicca/v1beta1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/security/publicca/v1beta1/resources.rb", "proto_docs/google/cloud/security/publicca/v1beta1/service.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/public_certificate_authority_service/create_external_account_key.rb", "snippets/snippet_metadata_google.cloud.security.publicca.v1beta1.json", diff --git a/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-security-public_ca-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-security-public_ca-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-security_center-v1p1beta1/.owlbot-manifest.json b/google-cloud-security_center-v1p1beta1/.owlbot-manifest.json index dbaed837e184..e0837b46a04d 100644 --- a/google-cloud-security_center-v1p1beta1/.owlbot-manifest.json +++ b/google-cloud-security_center-v1p1beta1/.owlbot-manifest.json @@ -33,7 +33,9 @@ "lib/google/cloud/securitycenter/v1p1beta1/securitycenter_service_services_pb.rb", "lib/google/cloud/securitycenter/v1p1beta1/source_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/securitycenter/v1p1beta1/asset.rb", "proto_docs/google/cloud/securitycenter/v1p1beta1/finding.rb", diff --git a/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-security_center-v1p1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-service_control-v1/.owlbot-manifest.json b/google-cloud-service_control-v1/.owlbot-manifest.json index 442032f93280..b72c62765fe9 100644 --- a/google-cloud-service_control-v1/.owlbot-manifest.json +++ b/google-cloud-service_control-v1/.owlbot-manifest.json @@ -32,7 +32,9 @@ "lib/google/cloud/service_control/v1/service_controller/credentials.rb", "lib/google/cloud/service_control/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/distribution.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/api/servicecontrol/v1/check_error.rb", "proto_docs/google/api/servicecontrol/v1/distribution.rb", diff --git a/google-cloud-service_control-v1/proto_docs/google/api/client.rb b/google-cloud-service_control-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-service_control-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-service_control-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-service_directory-v1/.owlbot-manifest.json b/google-cloud-service_directory-v1/.owlbot-manifest.json index 2e72082b85a8..9227e0567e97 100644 --- a/google-cloud-service_directory-v1/.owlbot-manifest.json +++ b/google-cloud-service_directory-v1/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/servicedirectory/v1/registration_service_services_pb.rb", "lib/google/cloud/servicedirectory/v1/service_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/servicedirectory/v1/endpoint.rb", "proto_docs/google/cloud/servicedirectory/v1/lookup_service.rb", @@ -41,6 +43,7 @@ "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/type/expr.rb", diff --git a/google-cloud-service_directory-v1/proto_docs/google/api/client.rb b/google-cloud-service_directory-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-service_directory-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-service_directory-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-service_directory-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-service_directory-v1beta1/.owlbot-manifest.json b/google-cloud-service_directory-v1beta1/.owlbot-manifest.json index 50bad4750405..c474dfcfe721 100644 --- a/google-cloud-service_directory-v1beta1/.owlbot-manifest.json +++ b/google-cloud-service_directory-v1beta1/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/servicedirectory/v1beta1/registration_service_services_pb.rb", "lib/google/cloud/servicedirectory/v1beta1/service_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/servicedirectory/v1beta1/endpoint.rb", "proto_docs/google/cloud/servicedirectory/v1beta1/lookup_service.rb", @@ -41,6 +43,7 @@ "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb b/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-service_directory-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-service_directory-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-service_directory-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-service_management-v1/.owlbot-manifest.json b/google-cloud-service_management-v1/.owlbot-manifest.json index 199253b891e5..2bb537be5067 100644 --- a/google-cloud-service_management-v1/.owlbot-manifest.json +++ b/google-cloud-service_management-v1/.owlbot-manifest.json @@ -26,6 +26,7 @@ "proto_docs/google/api/auth.rb", "proto_docs/google/api/backend.rb", "proto_docs/google/api/billing.rb", + "proto_docs/google/api/client.rb", "proto_docs/google/api/config_change.rb", "proto_docs/google/api/context.rb", "proto_docs/google/api/control.rb", diff --git a/google-cloud-service_management-v1/proto_docs/google/api/auth.rb b/google-cloud-service_management-v1/proto_docs/google/api/auth.rb index b311fd851e32..2588fb926295 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/auth.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/auth.rb @@ -86,6 +86,9 @@ class AuthenticationRule # @!attribute [rw] query # @return [::String] # Specifies URL query parameter name to extract JWT token. + # @!attribute [rw] cookie + # @return [::String] + # Specifies cookie name to extract JWT token. # @!attribute [rw] value_prefix # @return [::String] # The value prefix. The value format is "value_prefix\\{token}" @@ -157,11 +160,12 @@ class JwtLocation # Implement authorizationUrl of securityDefinitions in OpenAPI spec. # @!attribute [rw] jwt_locations # @return [::Array<::Google::Api::JwtLocation>] - # Defines the locations to extract the JWT. + # Defines the locations to extract the JWT. For now it is only used by the + # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) # - # JWT locations can be either from HTTP headers or URL query parameters. - # The rule is that the first match wins. The checking order is: checking - # all headers first, then URL query parameters. + # JWT locations can be one of HTTP headers, URL query parameters or + # cookies. The rule is that the first match wins. # # If not specified, default to use following 3 locations: # 1) Authorization: Bearer diff --git a/google-cloud-service_management-v1/proto_docs/google/api/backend.rb b/google-cloud-service_management-v1/proto_docs/google/api/backend.rb index ea58309856ee..23f414c426d0 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/backend.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/backend.rb @@ -64,8 +64,7 @@ class Backend # varies based on the request protocol and deployment environment. # @!attribute [rw] min_deadline # @return [::Float] - # Minimum deadline in seconds needed for this method. Calls having deadline - # value lower than this will be rejected. + # Deprecated, do not use. # @!attribute [rw] operation_deadline # @return [::Float] # The number of seconds to wait for the completion of a long running diff --git a/google-cloud-service_management-v1/proto_docs/google/api/client.rb b/google-cloud-service_management-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-service_management-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-service_management-v1/proto_docs/google/api/control.rb b/google-cloud-service_management-v1/proto_docs/google/api/control.rb index e08a203878c3..5429024e930c 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/control.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/control.rb @@ -19,13 +19,17 @@ module Google module Api - # Selects and configures the service controller used by the service. The - # service controller handles features like abuse, quota, billing, logging, - # monitoring, etc. + # Selects and configures the service controller used by the service. + # + # Example: + # + # control: + # environment: servicecontrol.googleapis.com # @!attribute [rw] environment # @return [::String] - # The service control environment to use. If empty, no control plane - # feature (like quota and billing) will be enabled. + # The service controller environment to use. If empty, no control plane + # feature (like quota and billing) will be enabled. The recommended value for + # most services is servicecontrol.googleapis.com class Control include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods diff --git a/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb b/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb index fa3ad14ee596..359e4ee26268 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/documentation.rb @@ -76,8 +76,10 @@ module Api # and is documented together with service config validation. # @!attribute [rw] summary # @return [::String] - # A short summary of what the service does. Can only be provided by - # plain text. + # A short description of what the service does. The summary must be plain + # text. It becomes the overview of the service displayed in Google Cloud + # Console. + # NOTE: This field is equivalent to the standard field `description`. # @!attribute [rw] pages # @return [::Array<::Google::Api::Page>] # The top level pages for the documentation set. @@ -118,15 +120,18 @@ class Documentation # A documentation rule provides information about individual API elements. # @!attribute [rw] selector # @return [::String] - # The selector is a comma-separated list of patterns. Each pattern is a - # qualified name of the element which may end in "*", indicating a wildcard. - # Wildcards are only allowed at the end and for a whole component of the - # qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A - # wildcard will match one or more components. To specify a default for all - # applicable elements, the whole pattern "*" is used. + # The selector is a comma-separated list of patterns for any element such as + # a method, a field, an enum value. Each pattern is a qualified name of the + # element which may end in "*", indicating a wildcard. Wildcards are only + # allowed at the end and for a whole component of the qualified name, + # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + # one or more components. To specify a default for all applicable elements, + # the whole pattern "*" is used. # @!attribute [rw] description # @return [::String] - # Description of the selected API(s). + # Description of the selected proto element (e.g. a message, a method, a + # 'service' definition, or a field). Defaults to leading & trailing comments + # taken from the proto source definition of the proto element. # @!attribute [rw] deprecation_description # @return [::String] # Deprecation description of the selected element(s). It can be provided if @@ -157,7 +162,8 @@ class DocumentationRule # @!attribute [rw] content # @return [::String] # The Markdown content of the page. You can use (== include \\{path} - # ==) to include content from a Markdown file. + # ==) to include content from a Markdown file. The content can be + # used to produce the documentation page such as HTML format page. # @!attribute [rw] subpages # @return [::Array<::Google::Api::Page>] # Subpages of this page. The order of subpages specified here will be diff --git a/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb b/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb index 68ac1e9347e8..584a3ed68638 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/endpoint.rb @@ -19,21 +19,26 @@ module Google module Api - # `Endpoint` describes a network endpoint of a service that serves a set of + # `Endpoint` describes a network address of a service that serves a set of # APIs. It is commonly known as a service endpoint. A service may expose # any number of service endpoints, and all service endpoints share the same # service definition, such as quota limits and monitoring metrics. # - # Example service configuration: + # Example: # + # type: google.api.Service # name: library-example.googleapis.com # endpoints: - # # Below entry makes 'google.example.library.v1.Library' - # # API be served from endpoint address library-example.googleapis.com. - # # It also allows HTTP OPTIONS calls to be passed to the backend, for - # # it to decide whether the subsequent cross-origin request is - # # allowed to proceed. + # # Declares network address `https://library-example.googleapis.com` + # # for service `library-example.googleapis.com`. The `https` scheme + # # is implicit for all service endpoints. Other schemes may be + # # supported in the future. # - name: library-example.googleapis.com + # allow_cors: false + # - name: content-staging-library-example.googleapis.com + # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + # # to decide whether the subsequent cross-origin request is allowed + # # to proceed. # allow_cors: true # @!attribute [rw] name # @return [::String] @@ -43,8 +48,8 @@ module Api # Unimplemented. Dot not use. # # DEPRECATED: This field is no longer supported. Instead of using aliases, - # please specify multiple {::Google::Api::Endpoint google.api.Endpoint} for each of the intended - # aliases. + # please specify multiple {::Google::Api::Endpoint google.api.Endpoint} for each + # of the intended aliases. # # Additional names that this endpoint will be hosted on. # @!attribute [rw] target diff --git a/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb index 3f6f1bb2fcc7..3de0fb4e6b40 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb b/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb index 904ba8362466..0603928cbdc9 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/monitored_resource.rb @@ -40,6 +40,10 @@ module Api # @return [::String] # Required. The monitored resource type. For example, the type # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitoring resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). # @!attribute [rw] display_name # @return [::String] # Optional. A concise name for the monitored resource type that might be @@ -71,16 +75,19 @@ class MonitoredResourceDescriptor # its attributes according to the schema. For example, a particular Compute # Engine VM instance could be represented by the following object, because the # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for `"gce_instance"` has labels - # `"instance_id"` and `"zone"`: + # `"project_id"`, `"instance_id"` and `"zone"`: # # { "type": "gce_instance", - # "labels": { "instance_id": "12345678901234", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", # "zone": "us-central1-a" }} # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. This field must match # the `type` field of a {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object. For # example, the type of a Compute Engine VM instance is `gce_instance`. + # Some descriptors include the service name in the type; for example, + # the type of a Datastream stream is `datastream.googleapis.com/Stream`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Required. Values for all of the labels listed in the associated monitored diff --git a/google-cloud-service_management-v1/proto_docs/google/api/quota.rb b/google-cloud-service_management-v1/proto_docs/google/api/quota.rb index 6b396ae2f915..509b3eef4efe 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/quota.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/quota.rb @@ -41,10 +41,10 @@ module Api # STANDARD: 10000 # # - # # The metric rules bind all methods to the read_calls metric, - # # except for the UpdateBook and DeleteBook methods. These two methods - # # are mapped to the write_calls metric, with the UpdateBook method - # # consuming at twice rate as the DeleteBook method. + # (The metric rules bind all methods to the read_calls metric, + # except for the UpdateBook and DeleteBook methods. These two methods + # are mapped to the write_calls metric, with the UpdateBook method + # consuming at twice rate as the DeleteBook method.) # metric_rules: # - selector: "*" # metric_costs: @@ -70,10 +70,10 @@ module Api # value_type: INT64 # @!attribute [rw] limits # @return [::Array<::Google::Api::QuotaLimit>] - # List of `QuotaLimit` definitions for the service. + # List of QuotaLimit definitions for the service. # @!attribute [rw] metric_rules # @return [::Array<::Google::Api::MetricRule>] - # List of `MetricRule` definitions, each one mapping a selected method to one + # List of MetricRule definitions, each one mapping a selected method to one # or more metrics. class Quota include ::Google::Protobuf::MessageExts diff --git a/google-cloud-service_management-v1/proto_docs/google/api/service.rb b/google-cloud-service_management-v1/proto_docs/google/api/service.rb index ff1967beb511..6b08a2da7a5f 100644 --- a/google-cloud-service_management-v1/proto_docs/google/api/service.rb +++ b/google-cloud-service_management-v1/proto_docs/google/api/service.rb @@ -19,11 +19,12 @@ module Google module Api - # `Service` is the root object of Google service configuration schema. It - # describes basic information about a service, such as the name and the - # title, and delegates other aspects to sub-sections. Each sub-section is - # either a proto message or a repeated proto message that configures a - # specific aspect, such as auth. See each proto message definition for details. + # `Service` is the root object of Google API service configuration (service + # config). It describes the basic information about a logical service, + # such as the service name and the user-facing title, and delegates other + # aspects to sub-sections. Each sub-section is either a proto message or a + # repeated proto message that configures a specific aspect, such as auth. + # For more information, see each proto message definition. # # Example: # @@ -32,6 +33,16 @@ module Api # title: Google Calendar API # apis: # - name: google.calendar.v3.Calendar + # + # visibility: + # rules: + # - selector: "google.calendar.v3.*" + # restriction: PREVIEW + # backend: + # rules: + # - selector: "google.calendar.v3.*" + # address: calendar.example.com + # # authentication: # providers: # - id: google_calendar_auth @@ -49,7 +60,8 @@ module Api # of the service also owns the DNS name. # @!attribute [rw] title # @return [::String] - # The product title for this service. + # The product title for this service, it is the name displayed in Google + # Cloud Console. # @!attribute [rw] producer_project_id # @return [::String] # The Google project that owns this service. @@ -69,19 +81,19 @@ module Api # @!attribute [rw] types # @return [::Array<::Google::Protobuf::Type>] # A list of all proto message types included in this API service. - # Types referenced directly or indirectly by the `apis` are - # automatically included. Messages which are not referenced but - # shall be included, such as types used by the `google.protobuf.Any` type, - # should be listed here by name. Example: + # Types referenced directly or indirectly by the `apis` are automatically + # included. Messages which are not referenced but shall be included, such as + # types used by the `google.protobuf.Any` type, should be listed here by + # name by the configuration author. Example: # # types: # - name: google.protobuf.Int32 # @!attribute [rw] enums # @return [::Array<::Google::Protobuf::Enum>] - # A list of all enum types included in this API service. Enums - # referenced directly or indirectly by the `apis` are automatically - # included. Enums which are not referenced but shall be included - # should be listed here by name. Example: + # A list of all enum types included in this API service. Enums referenced + # directly or indirectly by the `apis` are automatically included. Enums + # which are not referenced but shall be included should be listed here by + # name by the configuration author. Example: # # enums: # - name: google.someapi.v1.SomeEnum @@ -139,6 +151,11 @@ module Api # @!attribute [rw] source_info # @return [::Google::Api::SourceInfo] # Output only. The source information for this configuration if available. + # @!attribute [rw] publishing + # @return [::Google::Api::Publishing] + # Settings for [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from APIs defined as protocol buffers. # @!attribute [rw] config_version # @return [::Google::Protobuf::UInt32Value] # Obsolete. Do not use. diff --git a/google-cloud-service_usage-v1/.owlbot-manifest.json b/google-cloud-service_usage-v1/.owlbot-manifest.json index 46ffa091cf2c..345902175b1e 100644 --- a/google-cloud-service_usage-v1/.owlbot-manifest.json +++ b/google-cloud-service_usage-v1/.owlbot-manifest.json @@ -24,6 +24,7 @@ "lib/google/cloud/service_usage/v1/version.rb", "proto_docs/README.md", "proto_docs/google/api/auth.rb", + "proto_docs/google/api/client.rb", "proto_docs/google/api/documentation.rb", "proto_docs/google/api/endpoint.rb", "proto_docs/google/api/label.rb", diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb b/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb index 2d83ca74462a..829327eb4ca7 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/auth.rb @@ -86,6 +86,9 @@ class AuthenticationRule # @!attribute [rw] query # @return [::String] # Specifies URL query parameter name to extract JWT token. + # @!attribute [rw] cookie + # @return [::String] + # Specifies cookie name to extract JWT token. # @!attribute [rw] value_prefix # @return [::String] # The value prefix. The value format is "value_prefix\\{token}" @@ -157,11 +160,12 @@ class JwtLocation # Implement authorizationUrl of securityDefinitions in OpenAPI spec. # @!attribute [rw] jwt_locations # @return [::Array<::Google::Api::JwtLocation>] - # Defines the locations to extract the JWT. + # Defines the locations to extract the JWT. For now it is only used by the + # Cloud Endpoints to store the OpenAPI extension [x-google-jwt-locations] + # (https://cloud.google.com/endpoints/docs/openapi/openapi-extensions#x-google-jwt-locations) # - # JWT locations can be either from HTTP headers or URL query parameters. - # The rule is that the first match wins. The checking order is: checking - # all headers first, then URL query parameters. + # JWT locations can be one of HTTP headers, URL query parameters or + # cookies. The rule is that the first match wins. # # If not specified, default to use following 3 locations: # 1) Authorization: Bearer diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/client.rb b/google-cloud-service_usage-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-service_usage-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb b/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb index 24746794fd57..1b7ef6f0381c 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/documentation.rb @@ -76,8 +76,10 @@ module Api # and is documented together with service config validation. # @!attribute [rw] summary # @return [::String] - # A short summary of what the service does. Can only be provided by - # plain text. + # A short description of what the service does. The summary must be plain + # text. It becomes the overview of the service displayed in Google Cloud + # Console. + # NOTE: This field is equivalent to the standard field `description`. # @!attribute [rw] pages # @return [::Array<::Google::Api::Page>] # The top level pages for the documentation set. @@ -118,15 +120,18 @@ class Documentation # A documentation rule provides information about individual API elements. # @!attribute [rw] selector # @return [::String] - # The selector is a comma-separated list of patterns. Each pattern is a - # qualified name of the element which may end in "*", indicating a wildcard. - # Wildcards are only allowed at the end and for a whole component of the - # qualified name, i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A - # wildcard will match one or more components. To specify a default for all - # applicable elements, the whole pattern "*" is used. + # The selector is a comma-separated list of patterns for any element such as + # a method, a field, an enum value. Each pattern is a qualified name of the + # element which may end in "*", indicating a wildcard. Wildcards are only + # allowed at the end and for a whole component of the qualified name, + # i.e. "foo.*" is ok, but not "foo.b*" or "foo.*.bar". A wildcard will match + # one or more components. To specify a default for all applicable elements, + # the whole pattern "*" is used. # @!attribute [rw] description # @return [::String] - # Description of the selected API(s). + # Description of the selected proto element (e.g. a message, a method, a + # 'service' definition, or a field). Defaults to leading & trailing comments + # taken from the proto source definition of the proto element. # @!attribute [rw] deprecation_description # @return [::String] # Deprecation description of the selected element(s). It can be provided if @@ -157,7 +162,8 @@ class DocumentationRule # @!attribute [rw] content # @return [::String] # The Markdown content of the page. You can use (== include \\{path} - # ==) to include content from a Markdown file. + # ==) to include content from a Markdown file. The content can be + # used to produce the documentation page such as HTML format page. # @!attribute [rw] subpages # @return [::Array<::Google::Api::Page>] # Subpages of this page. The order of subpages specified here will be diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb b/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb index e809f4865048..9c0444d15745 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/endpoint.rb @@ -19,21 +19,26 @@ module Google module Api - # `Endpoint` describes a network endpoint of a service that serves a set of + # `Endpoint` describes a network address of a service that serves a set of # APIs. It is commonly known as a service endpoint. A service may expose # any number of service endpoints, and all service endpoints share the same # service definition, such as quota limits and monitoring metrics. # - # Example service configuration: + # Example: # + # type: google.api.Service # name: library-example.googleapis.com # endpoints: - # # Below entry makes 'google.example.library.v1.Library' - # # API be served from endpoint address library-example.googleapis.com. - # # It also allows HTTP OPTIONS calls to be passed to the backend, for - # # it to decide whether the subsequent cross-origin request is - # # allowed to proceed. + # # Declares network address `https://library-example.googleapis.com` + # # for service `library-example.googleapis.com`. The `https` scheme + # # is implicit for all service endpoints. Other schemes may be + # # supported in the future. # - name: library-example.googleapis.com + # allow_cors: false + # - name: content-staging-library-example.googleapis.com + # # Allows HTTP OPTIONS calls to be passed to the API frontend, for it + # # to decide whether the subsequent cross-origin request is allowed + # # to proceed. # allow_cors: true # @!attribute [rw] name # @return [::String] @@ -43,8 +48,8 @@ module Api # Unimplemented. Dot not use. # # DEPRECATED: This field is no longer supported. Instead of using aliases, - # please specify multiple {::Google::Api::Endpoint google.api.Endpoint} for each of the intended - # aliases. + # please specify multiple {::Google::Api::Endpoint google.api.Endpoint} for each + # of the intended aliases. # # Additional names that this endpoint will be hosted on. # @!attribute [rw] target diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb index 3f6f1bb2fcc7..3de0fb4e6b40 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/launch_stage.rb @@ -20,7 +20,7 @@ module Google module Api # The launch stage as defined by [Google Cloud Platform - # Launch Stages](http://cloud.google.com/terms/launch-stages). + # Launch Stages](https://cloud.google.com/terms/launch-stages). module LaunchStage # Do not use this default value. LAUNCH_STAGE_UNSPECIFIED = 0 @@ -42,7 +42,7 @@ module LaunchStage # for widespread use. By Alpha, all significant design issues are resolved # and we are in the process of verifying functionality. Alpha customers # need to apply for access, agree to applicable terms, and have their - # projects allowlisted. Alpha releases don’t have to be feature complete, + # projects allowlisted. Alpha releases don't have to be feature complete, # no SLAs are provided, and there are no technical support obligations, but # they will be far enough along that customers can actually use them in # test environments or for limited-use tests -- just like they would in @@ -61,7 +61,7 @@ module LaunchStage GA = 4 # Deprecated features are scheduled to be shut down and removed. For more - # information, see the “Deprecation Policy” section of our [Terms of + # information, see the "Deprecation Policy" section of our [Terms of # Service](https://cloud.google.com/terms/) # and the [Google Cloud Platform Subject to the Deprecation # Policy](https://cloud.google.com/terms/deprecation) documentation. diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb b/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb index bdd006c90b70..3a8d47808979 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/monitored_resource.rb @@ -40,6 +40,10 @@ module Api # @return [::String] # Required. The monitored resource type. For example, the type # `"cloudsql_database"` represents databases in Google Cloud SQL. + # For a list of types, see [Monitoring resource + # types](https://cloud.google.com/monitoring/api/resources) + # and [Logging resource + # types](https://cloud.google.com/logging/docs/api/v2/resource-list). # @!attribute [rw] display_name # @return [::String] # Optional. A concise name for the monitored resource type that might be @@ -71,16 +75,19 @@ class MonitoredResourceDescriptor # its attributes according to the schema. For example, a particular Compute # Engine VM instance could be represented by the following object, because the # {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} for `"gce_instance"` has labels - # `"instance_id"` and `"zone"`: + # `"project_id"`, `"instance_id"` and `"zone"`: # # { "type": "gce_instance", - # "labels": { "instance_id": "12345678901234", + # "labels": { "project_id": "my-project", + # "instance_id": "12345678901234", # "zone": "us-central1-a" }} # @!attribute [rw] type # @return [::String] # Required. The monitored resource type. This field must match # the `type` field of a {::Google::Api::MonitoredResourceDescriptor MonitoredResourceDescriptor} object. For # example, the type of a Compute Engine VM instance is `gce_instance`. + # Some descriptors include the service name in the type; for example, + # the type of a Datastream stream is `datastream.googleapis.com/Stream`. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] # Required. Values for all of the labels listed in the associated monitored diff --git a/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb b/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb index 65bd60270718..b9e8b13d5c96 100644 --- a/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb +++ b/google-cloud-service_usage-v1/proto_docs/google/api/quota.rb @@ -41,10 +41,10 @@ module Api # STANDARD: 10000 # # - # # The metric rules bind all methods to the read_calls metric, - # # except for the UpdateBook and DeleteBook methods. These two methods - # # are mapped to the write_calls metric, with the UpdateBook method - # # consuming at twice rate as the DeleteBook method. + # (The metric rules bind all methods to the read_calls metric, + # except for the UpdateBook and DeleteBook methods. These two methods + # are mapped to the write_calls metric, with the UpdateBook method + # consuming at twice rate as the DeleteBook method.) # metric_rules: # - selector: "*" # metric_costs: @@ -70,10 +70,10 @@ module Api # value_type: INT64 # @!attribute [rw] limits # @return [::Array<::Google::Api::QuotaLimit>] - # List of `QuotaLimit` definitions for the service. + # List of QuotaLimit definitions for the service. # @!attribute [rw] metric_rules # @return [::Array<::Google::Api::MetricRule>] - # List of `MetricRule` definitions, each one mapping a selected method to one + # List of MetricRule definitions, each one mapping a selected method to one # or more metrics. class Quota include ::Google::Protobuf::MessageExts diff --git a/google-cloud-shell-v1/.owlbot-manifest.json b/google-cloud-shell-v1/.owlbot-manifest.json index 496fbbb56034..0942c6aa88cf 100644 --- a/google-cloud-shell-v1/.owlbot-manifest.json +++ b/google-cloud-shell-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/shell/v1/cloudshell_services_pb.rb", "lib/google/cloud/shell/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/shell/v1/cloudshell.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-shell-v1/proto_docs/google/api/client.rb b/google-cloud-shell-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-shell-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-shell-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-spanner-admin-database-v1/.owlbot-manifest.json b/google-cloud-spanner-admin-database-v1/.owlbot-manifest.json index 04e31457ac95..f17388558e8a 100644 --- a/google-cloud-spanner-admin-database-v1/.owlbot-manifest.json +++ b/google-cloud-spanner-admin-database-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb", "lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", diff --git a/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-spanner-admin-database-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-spanner-admin-instance-v1/.owlbot-manifest.json b/google-cloud-spanner-admin-instance-v1/.owlbot-manifest.json index 331943774ad6..0bf442cceeb4 100644 --- a/google-cloud-spanner-admin-instance-v1/.owlbot-manifest.json +++ b/google-cloud-spanner-admin-instance-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb", "lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", diff --git a/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-spanner-admin-instance-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-spanner-v1/.owlbot-manifest.json b/google-cloud-spanner-v1/.owlbot-manifest.json index d005d5c0b4ca..ee33f77d3cad 100644 --- a/google-cloud-spanner-v1/.owlbot-manifest.json +++ b/google-cloud-spanner-v1/.owlbot-manifest.json @@ -29,7 +29,9 @@ "lib/google/spanner/v1/transaction_pb.rb", "lib/google/spanner/v1/type_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/protobuf/any.rb", "proto_docs/google/protobuf/duration.rb", diff --git a/google-cloud-spanner-v1/proto_docs/google/api/client.rb b/google-cloud-spanner-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-spanner-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-spanner-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-speech-v1/.owlbot-manifest.json b/google-cloud-speech-v1/.owlbot-manifest.json index 1a6c06ce41db..568b9d062fa8 100644 --- a/google-cloud-speech-v1/.owlbot-manifest.json +++ b/google-cloud-speech-v1/.owlbot-manifest.json @@ -30,7 +30,9 @@ "lib/google/cloud/speech/v1/speech/paths.rb", "lib/google/cloud/speech/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/speech/v1/cloud_speech.rb", "proto_docs/google/cloud/speech/v1/cloud_speech_adaptation.rb", diff --git a/google-cloud-speech-v1/proto_docs/google/api/client.rb b/google-cloud-speech-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-speech-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-speech-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-speech-v1p1beta1/.owlbot-manifest.json b/google-cloud-speech-v1p1beta1/.owlbot-manifest.json index 693574b4340e..0b8f428b7c25 100644 --- a/google-cloud-speech-v1p1beta1/.owlbot-manifest.json +++ b/google-cloud-speech-v1p1beta1/.owlbot-manifest.json @@ -30,7 +30,9 @@ "lib/google/cloud/speech/v1p1beta1/speech/paths.rb", "lib/google/cloud/speech/v1p1beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/speech/v1p1beta1/cloud_speech.rb", "proto_docs/google/cloud/speech/v1p1beta1/cloud_speech_adaptation.rb", diff --git a/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb b/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-speech-v1p1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-speech-v1p1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-speech-v2/.owlbot-manifest.json b/google-cloud-speech-v2/.owlbot-manifest.json index 8b4c5ea086f8..d7852f002804 100644 --- a/google-cloud-speech-v2/.owlbot-manifest.json +++ b/google-cloud-speech-v2/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/speech/v2/speech/paths.rb", "lib/google/cloud/speech/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/speech/v2/cloud_speech.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-speech-v2/proto_docs/google/api/client.rb b/google-cloud-speech-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-speech-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-speech-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-storage_transfer-v1/.owlbot-manifest.json b/google-cloud-storage_transfer-v1/.owlbot-manifest.json index 140d9b72f1c4..95e5ee2c754e 100644 --- a/google-cloud-storage_transfer-v1/.owlbot-manifest.json +++ b/google-cloud-storage_transfer-v1/.owlbot-manifest.json @@ -24,7 +24,9 @@ "lib/google/storagetransfer/v1/transfer_services_pb.rb", "lib/google/storagetransfer/v1/transfer_types_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/longrunning/operations.rb", "proto_docs/google/protobuf/any.rb", diff --git a/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb b/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-storage_transfer-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-storage_transfer-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-talent-v4/.owlbot-manifest.json b/google-cloud-talent-v4/.owlbot-manifest.json index 7f6ddab8df09..2bbdf9e2bb19 100644 --- a/google-cloud-talent-v4/.owlbot-manifest.json +++ b/google-cloud-talent-v4/.owlbot-manifest.json @@ -54,7 +54,9 @@ "lib/google/cloud/talent/v4/tenant_service_services_pb.rb", "lib/google/cloud/talent/v4/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/talent/v4/common.rb", "proto_docs/google/cloud/talent/v4/company.rb", diff --git a/google-cloud-talent-v4/proto_docs/google/api/client.rb b/google-cloud-talent-v4/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-talent-v4/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb b/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-talent-v4/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-talent-v4beta1/.owlbot-manifest.json b/google-cloud-talent-v4beta1/.owlbot-manifest.json index 903652b2e900..5a538532357e 100644 --- a/google-cloud-talent-v4beta1/.owlbot-manifest.json +++ b/google-cloud-talent-v4beta1/.owlbot-manifest.json @@ -55,7 +55,9 @@ "lib/google/cloud/talent/v4beta1/tenant_service_services_pb.rb", "lib/google/cloud/talent/v4beta1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/talent/v4beta1/common.rb", "proto_docs/google/cloud/talent/v4beta1/company.rb", diff --git a/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb b/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-talent-v4beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-talent-v4beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-tasks-v2/.owlbot-manifest.json b/google-cloud-tasks-v2/.owlbot-manifest.json index 655d96df7f4f..d06a29947cf6 100644 --- a/google-cloud-tasks-v2/.owlbot-manifest.json +++ b/google-cloud-tasks-v2/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/tasks/v2/task_pb.rb", "lib/google/cloud/tasks/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/tasks/v2/cloudtasks.rb", "proto_docs/google/cloud/tasks/v2/queue.rb", diff --git a/google-cloud-tasks-v2/proto_docs/google/api/client.rb b/google-cloud-tasks-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-tasks-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-tasks-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-tasks-v2beta2/.owlbot-manifest.json b/google-cloud-tasks-v2beta2/.owlbot-manifest.json index fb0432986e7d..2de84438f378 100644 --- a/google-cloud-tasks-v2beta2/.owlbot-manifest.json +++ b/google-cloud-tasks-v2beta2/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/tasks/v2beta2/task_pb.rb", "lib/google/cloud/tasks/v2beta2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/tasks/v2beta2/cloudtasks.rb", "proto_docs/google/cloud/tasks/v2beta2/queue.rb", diff --git a/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb b/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-tasks-v2beta2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb b/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-tasks-v2beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-tasks-v2beta3/.owlbot-manifest.json b/google-cloud-tasks-v2beta3/.owlbot-manifest.json index 9780151bc31a..248be727d0b6 100644 --- a/google-cloud-tasks-v2beta3/.owlbot-manifest.json +++ b/google-cloud-tasks-v2beta3/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/tasks/v2beta3/task_pb.rb", "lib/google/cloud/tasks/v2beta3/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/tasks/v2beta3/cloudtasks.rb", "proto_docs/google/cloud/tasks/v2beta3/queue.rb", diff --git a/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb b/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-tasks-v2beta3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb b/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-tasks-v2beta3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-text_to_speech-v1/.owlbot-manifest.json b/google-cloud-text_to_speech-v1/.owlbot-manifest.json index 62e88cacaf88..75f175a49ed7 100644 --- a/google-cloud-text_to_speech-v1/.owlbot-manifest.json +++ b/google-cloud-text_to_speech-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/texttospeech/v1/cloud_tts_pb.rb", "lib/google/cloud/texttospeech/v1/cloud_tts_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/texttospeech/v1/cloud_tts.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/snippet_metadata_google.cloud.texttospeech.v1.json", "snippets/text_to_speech/list_voices.rb", diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb b/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-text_to_speech-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-text_to_speech-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-text_to_speech-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json b/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json index 5ee0a1643fc3..4ff9e859d5ce 100644 --- a/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json +++ b/google-cloud-text_to_speech-v1beta1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb", "lib/google/cloud/texttospeech/v1beta1/cloud_tts_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb", + "proto_docs/google/protobuf/duration.rb", "snippets/Gemfile", "snippets/snippet_metadata_google.cloud.texttospeech.v1beta1.json", "snippets/text_to_speech/list_voices.rb", diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-text_to_speech-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-tpu-v1/.owlbot-manifest.json b/google-cloud-tpu-v1/.owlbot-manifest.json index 15393f85fc96..66790713cf45 100644 --- a/google-cloud-tpu-v1/.owlbot-manifest.json +++ b/google-cloud-tpu-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/tpu/v1/tpu/paths.rb", "lib/google/cloud/tpu/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/tpu/v1/cloud_tpu.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-tpu-v1/proto_docs/google/api/client.rb b/google-cloud-tpu-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-tpu-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-tpu-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-trace-v1/.owlbot-manifest.json b/google-cloud-trace-v1/.owlbot-manifest.json index 8560fa0ce21e..86027c538de6 100644 --- a/google-cloud-trace-v1/.owlbot-manifest.json +++ b/google-cloud-trace-v1/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/devtools/cloudtrace/v1/trace_pb.rb", "lib/google/devtools/cloudtrace/v1/trace_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/cloudtrace/v1/trace.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", diff --git a/google-cloud-trace-v1/proto_docs/google/api/client.rb b/google-cloud-trace-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-trace-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-trace-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-trace-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-trace-v2/.owlbot-manifest.json b/google-cloud-trace-v2/.owlbot-manifest.json index aa117f62907e..eaa21384c803 100644 --- a/google-cloud-trace-v2/.owlbot-manifest.json +++ b/google-cloud-trace-v2/.owlbot-manifest.json @@ -23,11 +23,14 @@ "lib/google/devtools/cloudtrace/v2/tracing_pb.rb", "lib/google/devtools/cloudtrace/v2/tracing_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/devtools/cloudtrace/v2/trace.rb", "proto_docs/google/devtools/cloudtrace/v2/tracing.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/protobuf/wrappers.rb", diff --git a/google-cloud-trace-v2/proto_docs/google/api/client.rb b/google-cloud-trace-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-trace-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb b/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-trace-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb b/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-trace-v2/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-translate-v3/.owlbot-manifest.json b/google-cloud-translate-v3/.owlbot-manifest.json index 14b4721424d7..97ada768b1ed 100644 --- a/google-cloud-translate-v3/.owlbot-manifest.json +++ b/google-cloud-translate-v3/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/translate/v3/translation_service_services_pb.rb", "lib/google/cloud/translate/v3/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/translate/v3/translation_service.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-translate-v3/proto_docs/google/api/client.rb b/google-cloud-translate-v3/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-translate-v3/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb b/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-translate-v3/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video-live_stream-v1/.owlbot-manifest.json b/google-cloud-video-live_stream-v1/.owlbot-manifest.json index e807786f5237..0fe35584dee4 100644 --- a/google-cloud-video-live_stream-v1/.owlbot-manifest.json +++ b/google-cloud-video-live_stream-v1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/video/livestream/v1/service_pb.rb", "lib/google/cloud/video/livestream/v1/service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/video/livestream/v1/outputs.rb", "proto_docs/google/cloud/video/livestream/v1/resources.rb", diff --git a/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb b/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video-live_stream-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video-live_stream-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video-stitcher-v1/.owlbot-manifest.json b/google-cloud-video-stitcher-v1/.owlbot-manifest.json index 5983b68f3e74..a265079ec651 100644 --- a/google-cloud-video-stitcher-v1/.owlbot-manifest.json +++ b/google-cloud-video-stitcher-v1/.owlbot-manifest.json @@ -29,7 +29,9 @@ "lib/google/cloud/video/stitcher/v1/video_stitcher_service_pb.rb", "lib/google/cloud/video/stitcher/v1/video_stitcher_service_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/video/stitcher/v1/ad_tag_details.rb", "proto_docs/google/cloud/video/stitcher/v1/cdn_keys.rb", diff --git a/google-cloud-video-stitcher-v1/proto_docs/google/api/client.rb b/google-cloud-video-stitcher-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video-stitcher-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video-stitcher-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-video-stitcher-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video-stitcher-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video-transcoder-v1/.owlbot-manifest.json b/google-cloud-video-transcoder-v1/.owlbot-manifest.json index 1aecd5ce316d..bb83953172ac 100644 --- a/google-cloud-video-transcoder-v1/.owlbot-manifest.json +++ b/google-cloud-video-transcoder-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/video/transcoder/v1/transcoder_service/paths.rb", "lib/google/cloud/video/transcoder/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/video/transcoder/v1/resources.rb", "proto_docs/google/cloud/video/transcoder/v1/services.rb", diff --git a/google-cloud-video-transcoder-v1/proto_docs/google/api/client.rb b/google-cloud-video-transcoder-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video-transcoder-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video-transcoder-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-video-transcoder-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video-transcoder-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video_intelligence-v1/.owlbot-manifest.json b/google-cloud-video_intelligence-v1/.owlbot-manifest.json index fb9f7509fd69..6fc5228fffec 100644 --- a/google-cloud-video_intelligence-v1/.owlbot-manifest.json +++ b/google-cloud-video_intelligence-v1/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/cloud/videointelligence/v1/video_intelligence_pb.rb", "lib/google/cloud/videointelligence/v1/video_intelligence_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/videointelligence/v1/video_intelligence.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-video_intelligence-v1/proto_docs/google/api/client.rb b/google-cloud-video_intelligence-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video_intelligence-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video_intelligence-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-video_intelligence-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video_intelligence-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video_intelligence-v1beta2/.owlbot-manifest.json b/google-cloud-video_intelligence-v1beta2/.owlbot-manifest.json index 49386cf4dd03..a579423875ea 100644 --- a/google-cloud-video_intelligence-v1beta2/.owlbot-manifest.json +++ b/google-cloud-video_intelligence-v1beta2/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/cloud/videointelligence/v1beta2/video_intelligence_pb.rb", "lib/google/cloud/videointelligence/v1beta2/video_intelligence_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/videointelligence/v1beta2/video_intelligence.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/client.rb b/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/launch_stage.rb b/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video_intelligence-v1beta2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video_intelligence-v1p1beta1/.owlbot-manifest.json b/google-cloud-video_intelligence-v1p1beta1/.owlbot-manifest.json index 4c90456b23dd..7196f5f8f37e 100644 --- a/google-cloud-video_intelligence-v1p1beta1/.owlbot-manifest.json +++ b/google-cloud-video_intelligence-v1p1beta1/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/cloud/videointelligence/v1p1beta1/video_intelligence_pb.rb", "lib/google/cloud/videointelligence/v1p1beta1/video_intelligence_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/videointelligence/v1p1beta1/video_intelligence.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/client.rb b/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video_intelligence-v1p1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video_intelligence-v1p2beta1/.owlbot-manifest.json b/google-cloud-video_intelligence-v1p2beta1/.owlbot-manifest.json index d78f7aeeb38a..ccc5b88bd3fd 100644 --- a/google-cloud-video_intelligence-v1p2beta1/.owlbot-manifest.json +++ b/google-cloud-video_intelligence-v1p2beta1/.owlbot-manifest.json @@ -22,7 +22,9 @@ "lib/google/cloud/videointelligence/v1p2beta1/video_intelligence_pb.rb", "lib/google/cloud/videointelligence/v1p2beta1/video_intelligence_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/videointelligence/v1p2beta1/video_intelligence.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/client.rb b/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video_intelligence-v1p2beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-video_intelligence-v1p3beta1/.owlbot-manifest.json b/google-cloud-video_intelligence-v1p3beta1/.owlbot-manifest.json index 8fd4bef86aa7..321a9f4fdb44 100644 --- a/google-cloud-video_intelligence-v1p3beta1/.owlbot-manifest.json +++ b/google-cloud-video_intelligence-v1p3beta1/.owlbot-manifest.json @@ -25,7 +25,9 @@ "lib/google/cloud/videointelligence/v1p3beta1/video_intelligence_pb.rb", "lib/google/cloud/videointelligence/v1p3beta1/video_intelligence_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/videointelligence/v1p3beta1/video_intelligence.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/client.rb b/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-video_intelligence-v1p3beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-vision-v1/.owlbot-manifest.json b/google-cloud-vision-v1/.owlbot-manifest.json index cead30fb9115..5f1231953827 100644 --- a/google-cloud-vision-v1/.owlbot-manifest.json +++ b/google-cloud-vision-v1/.owlbot-manifest.json @@ -34,7 +34,9 @@ "lib/google/cloud/vision/v1/version.rb", "lib/google/cloud/vision/v1/web_detection_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/vision/v1/geometry.rb", "proto_docs/google/cloud/vision/v1/image_annotator.rb", diff --git a/google-cloud-vision-v1/proto_docs/google/api/client.rb b/google-cloud-vision-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-vision-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-vision-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-vision-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-vision-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-vision-v1p3beta1/.owlbot-manifest.json b/google-cloud-vision-v1p3beta1/.owlbot-manifest.json index 15419847606e..7ca8edd44009 100644 --- a/google-cloud-vision-v1p3beta1/.owlbot-manifest.json +++ b/google-cloud-vision-v1p3beta1/.owlbot-manifest.json @@ -34,7 +34,9 @@ "lib/google/cloud/vision/v1p3beta1/version.rb", "lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/vision/v1p3beta1/geometry.rb", "proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb", diff --git a/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb b/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-vision-v1p4beta1/.owlbot-manifest.json b/google-cloud-vision-v1p4beta1/.owlbot-manifest.json index c8c0e25d81ea..bcffa471bbae 100644 --- a/google-cloud-vision-v1p4beta1/.owlbot-manifest.json +++ b/google-cloud-vision-v1p4beta1/.owlbot-manifest.json @@ -35,7 +35,9 @@ "lib/google/cloud/vision/v1p4beta1/version.rb", "lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/vision/v1p4beta1/face.rb", "proto_docs/google/cloud/vision/v1p4beta1/geometry.rb", diff --git a/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb b/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-vm_migration-v1/.owlbot-manifest.json b/google-cloud-vm_migration-v1/.owlbot-manifest.json index b6582fdb9d7f..268a0055e61d 100644 --- a/google-cloud-vm_migration-v1/.owlbot-manifest.json +++ b/google-cloud-vm_migration-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/vmmigration/v1/vmmigration_pb.rb", "lib/google/cloud/vmmigration/v1/vmmigration_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/vmmigration/v1/vmmigration.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb b/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-vpc_access-v1/.owlbot-manifest.json b/google-cloud-vpc_access-v1/.owlbot-manifest.json index efb0d2a75926..7f6c7ef1f936 100644 --- a/google-cloud-vpc_access-v1/.owlbot-manifest.json +++ b/google-cloud-vpc_access-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb", "lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb b/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-web_risk-v1/.owlbot-manifest.json b/google-cloud-web_risk-v1/.owlbot-manifest.json index a9dd54deb60f..53bba22fa6dc 100644 --- a/google-cloud-web_risk-v1/.owlbot-manifest.json +++ b/google-cloud-web_risk-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/webrisk/v1/webrisk_pb.rb", "lib/google/cloud/webrisk/v1/webrisk_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/webrisk/v1/webrisk.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", "snippets/snippet_metadata_google.cloud.webrisk.v1.json", diff --git a/google-cloud-web_risk-v1/proto_docs/google/api/client.rb b/google-cloud-web_risk-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-web_risk-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-web_risk-v1beta1/.owlbot-manifest.json b/google-cloud-web_risk-v1beta1/.owlbot-manifest.json index 17011975a2cb..266778396bcb 100644 --- a/google-cloud-web_risk-v1beta1/.owlbot-manifest.json +++ b/google-cloud-web_risk-v1beta1/.owlbot-manifest.json @@ -21,9 +21,12 @@ "lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb", "lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", "snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json", diff --git a/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb b/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb b/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb b/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-web_security_scanner-v1/.owlbot-manifest.json b/google-cloud-web_security_scanner-v1/.owlbot-manifest.json index 99ef0142c745..d68415673dcf 100644 --- a/google-cloud-web_security_scanner-v1/.owlbot-manifest.json +++ b/google-cloud-web_security_scanner-v1/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb", "lib/google/cloud/websecurityscanner/v1/web_security_scanner_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb", "proto_docs/google/cloud/websecurityscanner/v1/finding.rb", @@ -44,6 +46,7 @@ "proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb", "proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb", "proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb b/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-web_security_scanner-v1beta/.owlbot-manifest.json b/google-cloud-web_security_scanner-v1beta/.owlbot-manifest.json index 83478159b734..87809666fd55 100644 --- a/google-cloud-web_security_scanner-v1beta/.owlbot-manifest.json +++ b/google-cloud-web_security_scanner-v1beta/.owlbot-manifest.json @@ -31,7 +31,9 @@ "lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb", "lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb", "proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb", @@ -43,6 +45,7 @@ "proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb", "proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb", "proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", diff --git a/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb b/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-workflows-executions-v1/.owlbot-manifest.json b/google-cloud-workflows-executions-v1/.owlbot-manifest.json index 26e249ae156c..86d3c38f0d32 100644 --- a/google-cloud-workflows-executions-v1/.owlbot-manifest.json +++ b/google-cloud-workflows-executions-v1/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/workflows/executions/v1/executions_services_pb.rb", "lib/google/cloud/workflows/executions/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/workflows/executions/v1/executions.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", "snippets/executions/cancel_execution.rb", diff --git a/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb b/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb b/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-workflows-executions-v1beta/.owlbot-manifest.json b/google-cloud-workflows-executions-v1beta/.owlbot-manifest.json index a3ff2a3a521f..7e9e7b7c6109 100644 --- a/google-cloud-workflows-executions-v1beta/.owlbot-manifest.json +++ b/google-cloud-workflows-executions-v1beta/.owlbot-manifest.json @@ -22,9 +22,12 @@ "lib/google/cloud/workflows/executions/v1beta/executions_services_pb.rb", "lib/google/cloud/workflows/executions/v1beta/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/workflows/executions/v1beta/executions.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/timestamp.rb", "snippets/Gemfile", "snippets/executions/cancel_execution.rb", diff --git a/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb b/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-workflows-v1/.owlbot-manifest.json b/google-cloud-workflows-v1/.owlbot-manifest.json index c63b503a966f..154e16868dc2 100644 --- a/google-cloud-workflows-v1/.owlbot-manifest.json +++ b/google-cloud-workflows-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/workflows/v1/workflows_pb.rb", "lib/google/cloud/workflows/v1/workflows_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/workflows/v1/workflows.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-workflows-v1/proto_docs/google/api/client.rb b/google-cloud-workflows-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-workflows-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb b/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-cloud-workflows-v1beta/.owlbot-manifest.json b/google-cloud-workflows-v1beta/.owlbot-manifest.json index dcf64cc5b38b..5ed668f73474 100644 --- a/google-cloud-workflows-v1beta/.owlbot-manifest.json +++ b/google-cloud-workflows-v1beta/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/cloud/workflows/v1beta/workflows_pb.rb", "lib/google/cloud/workflows/v1beta/workflows_services_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/cloud/workflows/v1beta/workflows.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb b/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb b/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-iam-credentials-v1/.owlbot-manifest.json b/google-iam-credentials-v1/.owlbot-manifest.json index 6a70c394efee..393cb6312558 100644 --- a/google-iam-credentials-v1/.owlbot-manifest.json +++ b/google-iam-credentials-v1/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/iam/credentials/v1/iamcredentials_services_pb.rb", "lib/google/iam/credentials/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/credentials/v1/common.rb", "proto_docs/google/protobuf/duration.rb", diff --git a/google-iam-credentials-v1/proto_docs/google/api/client.rb b/google-iam-credentials-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-iam-credentials-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb b/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-iam-v1/.owlbot-manifest.json b/google-iam-v1/.owlbot-manifest.json index 3ce248f9152b..c38d5109718a 100644 --- a/google-iam-v1/.owlbot-manifest.json +++ b/google-iam-v1/.owlbot-manifest.json @@ -23,11 +23,14 @@ "lib/google/iam/v1/policy_pb.rb", "lib/google/iam/v1/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", "proto_docs/google/iam/v1/policy.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/type/expr.rb", "snippets/Gemfile", diff --git a/google-iam-v1/proto_docs/google/api/client.rb b/google-iam-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-iam-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-iam-v1/proto_docs/google/api/launch_stage.rb b/google-iam-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-iam-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-iam-v1/proto_docs/google/protobuf/duration.rb b/google-iam-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/google-iam-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-iam-v1beta/.owlbot-manifest.json b/google-iam-v1beta/.owlbot-manifest.json index cb6721d095fd..ac7608c29779 100644 --- a/google-iam-v1beta/.owlbot-manifest.json +++ b/google-iam-v1beta/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/iam/v1beta/workload_identity_pools/operations.rb", "lib/google/iam/v1beta/workload_identity_pools/paths.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v1beta/workload_identity_pool.rb", "proto_docs/google/longrunning/operations.rb", diff --git a/google-iam-v1beta/proto_docs/google/api/client.rb b/google-iam-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-iam-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-iam-v1beta/proto_docs/google/api/launch_stage.rb b/google-iam-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-iam-v1beta/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-iam-v2/.owlbot-manifest.json b/google-iam-v2/.owlbot-manifest.json index 89e7efba0c06..0054e0484462 100644 --- a/google-iam-v2/.owlbot-manifest.json +++ b/google-iam-v2/.owlbot-manifest.json @@ -23,7 +23,9 @@ "lib/google/iam/v2/policy_services_pb.rb", "lib/google/iam/v2/version.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v2/deny.rb", "proto_docs/google/iam/v2/policy.rb", diff --git a/google-iam-v2/proto_docs/google/api/client.rb b/google-iam-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-iam-v2/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-iam-v2/proto_docs/google/api/launch_stage.rb b/google-iam-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-iam-v2/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/google-identity-access_context_manager-v1/.owlbot-manifest.json b/google-identity-access_context_manager-v1/.owlbot-manifest.json index 14b045f9bc8b..2fb9423b9eb7 100644 --- a/google-identity-access_context_manager-v1/.owlbot-manifest.json +++ b/google-identity-access_context_manager-v1/.owlbot-manifest.json @@ -28,7 +28,9 @@ "lib/google/identity/accesscontextmanager/v1/gcp_user_access_binding_pb.rb", "lib/google/identity/accesscontextmanager/v1/service_perimeter_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/iam/v1/iam_policy.rb", "proto_docs/google/iam/v1/options.rb", diff --git a/google-identity-access_context_manager-v1/proto_docs/google/api/client.rb b/google-identity-access_context_manager-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/google-identity-access_context_manager-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/google-identity-access_context_manager-v1/proto_docs/google/api/launch_stage.rb b/google-identity-access_context_manager-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/google-identity-access_context_manager-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/grafeas-v1/.owlbot-manifest.json b/grafeas-v1/.owlbot-manifest.json index 30f773b07c29..42f5e3f1291f 100644 --- a/grafeas-v1/.owlbot-manifest.json +++ b/grafeas-v1/.owlbot-manifest.json @@ -38,9 +38,12 @@ "lib/grafeas/v1/version.rb", "lib/grafeas/v1/vulnerability_pb.rb", "proto_docs/README.md", + "proto_docs/google/api/client.rb", "proto_docs/google/api/field_behavior.rb", + "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", "proto_docs/google/protobuf/any.rb", + "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/struct.rb", diff --git a/grafeas-v1/proto_docs/google/api/client.rb b/grafeas-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..ec79d18d82f8 --- /dev/null +++ b/grafeas-v1/proto_docs/google/api/client.rb @@ -0,0 +1,318 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # Required information for every language. + # @!attribute [rw] reference_docs_uri + # @return [::String] + # Link to automatically generated reference documentation. Example: + # https://cloud.google.com/nodejs/docs/reference/asset/latest + # @!attribute [rw] destinations + # @return [::Array<::Google::Api::ClientLibraryDestination>] + # The destination where API teams want this client library to be published. + class CommonLanguageSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details about how and where to publish client libraries. + # @!attribute [rw] version + # @return [::String] + # Version of the API to apply these settings to. + # @!attribute [rw] launch_stage + # @return [::Google::Api::LaunchStage] + # Launch stage of this version of the API. + # @!attribute [rw] rest_numeric_enums + # @return [::Boolean] + # When using transport=rest, the client request will encode enums as + # numbers rather than strings. + # @!attribute [rw] java_settings + # @return [::Google::Api::JavaSettings] + # Settings for legacy Java features, supported in the Service YAML. + # @!attribute [rw] cpp_settings + # @return [::Google::Api::CppSettings] + # Settings for C++ client libraries. + # @!attribute [rw] php_settings + # @return [::Google::Api::PhpSettings] + # Settings for PHP client libraries. + # @!attribute [rw] python_settings + # @return [::Google::Api::PythonSettings] + # Settings for Python client libraries. + # @!attribute [rw] node_settings + # @return [::Google::Api::NodeSettings] + # Settings for Node client libraries. + # @!attribute [rw] dotnet_settings + # @return [::Google::Api::DotnetSettings] + # Settings for .NET client libraries. + # @!attribute [rw] ruby_settings + # @return [::Google::Api::RubySettings] + # Settings for Ruby client libraries. + # @!attribute [rw] go_settings + # @return [::Google::Api::GoSettings] + # Settings for Go client libraries. + class ClientLibrarySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # This message configures the settings for publishing [Google Cloud Client + # libraries](https://cloud.google.com/apis/docs/cloud-client-libraries) + # generated from the service config. + # @!attribute [rw] method_settings + # @return [::Array<::Google::Api::MethodSettings>] + # A list of API method settings, e.g. the behavior for methods that use the + # long-running operation pattern. + # @!attribute [rw] new_issue_uri + # @return [::String] + # Link to a place that API users can report issues. Example: + # https://issuetracker.google.com/issues/new?component=190865&template=1161103 + # @!attribute [rw] documentation_uri + # @return [::String] + # Link to product home page. Example: + # https://cloud.google.com/asset-inventory/docs/overview + # @!attribute [rw] api_short_name + # @return [::String] + # Used as a tracking tag when collecting data about the APIs developer + # relations artifacts like docs, packages delivered to package managers, + # etc. Example: "speech". + # @!attribute [rw] github_label + # @return [::String] + # GitHub label to apply to issues and pull requests opened for this API. + # @!attribute [rw] codeowner_github_teams + # @return [::Array<::String>] + # GitHub teams to be added to CODEOWNERS in the directory in GitHub + # containing source code for the client libraries for this API. + # @!attribute [rw] doc_tag_prefix + # @return [::String] + # A prefix used in sample code when demarking regions to be included in + # documentation. + # @!attribute [rw] organization + # @return [::Google::Api::ClientLibraryOrganization] + # For whom the client library is being published. + # @!attribute [rw] library_settings + # @return [::Array<::Google::Api::ClientLibrarySettings>] + # Client library settings. If the same version string appears multiple + # times in this list, then the last one wins. Settings from earlier + # settings with the same version string are discarded. + class Publishing + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Java client libraries. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Java. Clobbers the java_package option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.java.package_name" field + # in gapic.yaml. API teams should use the protobuf java_package option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # library_package: com.google.cloud.pubsub.v1 + # @!attribute [rw] service_class_names + # @return [::Google::Protobuf::Map{::String => ::String}] + # Configure the Java class name to use instead of the service's for its + # corresponding generated GAPIC client. Keys are fully-qualified + # service names as they appear in the protobuf (including the full + # the language_settings.java.interface_names" field in gapic.yaml. API + # teams should otherwise use the service name as it appears in the + # protobuf. + # + # Example of a YAML configuration:: + # + # publishing: + # java_settings: + # service_class_names: + # - google.pubsub.v1.Publisher: TopicAdmin + # - google.pubsub.v1.Subscriber: SubscriptionAdmin + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class JavaSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class ServiceClassNamesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Settings for C++ client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class CppSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Php client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PhpSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Python client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class PythonSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Node client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class NodeSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Dotnet client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class DotnetSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Ruby client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class RubySettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Settings for Go client libraries. + # @!attribute [rw] common + # @return [::Google::Api::CommonLanguageSettings] + # Some settings. + class GoSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the generator configuration for a method. + # @!attribute [rw] selector + # @return [::String] + # The fully qualified name of the method, for which the options below apply. + # This is used to find the method to apply the options. + # @!attribute [rw] long_running + # @return [::Google::Api::MethodSettings::LongRunning] + # Describes settings to use for long-running operations when generating + # API methods for RPCs. Complements RPCs that use the annotations in + # google/longrunning/operations.proto. + # + # Example of a YAML configuration:: + # + # publishing: + # method_behavior: + # - selector: CreateAdDomain + # long_running: + # initial_poll_delay: + # seconds: 60 # 1 minute + # poll_delay_multiplier: 1.5 + # max_poll_delay: + # seconds: 360 # 6 minutes + # total_poll_timeout: + # seconds: 54000 # 90 minutes + class MethodSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes settings to use when generating API methods that use the + # long-running operation pattern. + # All default values below are from those used in the client library + # generators (e.g. + # [Java](https://github.com/googleapis/gapic-generator-java/blob/04c2faa191a9b5a10b92392fe8482279c4404803/src/main/java/com/google/api/generator/gapic/composer/common/RetrySettingsComposer.java)). + # @!attribute [rw] initial_poll_delay + # @return [::Google::Protobuf::Duration] + # Initial delay after which the first poll request will be made. + # Default value: 5 seconds. + # @!attribute [rw] poll_delay_multiplier + # @return [::Float] + # Multiplier to gradually increase delay between subsequent polls until it + # reaches max_poll_delay. + # Default value: 1.5. + # @!attribute [rw] max_poll_delay + # @return [::Google::Protobuf::Duration] + # Maximum time between two subsequent poll requests. + # Default value: 45 seconds. + # @!attribute [rw] total_poll_timeout + # @return [::Google::Protobuf::Duration] + # Total polling timeout. + # Default value: 5 minutes. + class LongRunning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The organization for which the client libraries are being published. + # Affects the url where generated docs are published, etc. + module ClientLibraryOrganization + # Not useful. + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0 + + # Google Cloud Platform Org. + CLOUD = 1 + + # Ads (Advertising) Org. + ADS = 2 + + # Photos Org. + PHOTOS = 3 + + # Street View Org. + STREET_VIEW = 4 + end + + # To where should client libraries be published? + module ClientLibraryDestination + # Client libraries will neither be generated nor published to package + # managers. + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0 + + # Generate the client library in a repo under github.com/googleapis, + # but don't publish it to package managers. + GITHUB = 10 + + # Publish the library to package managers like nuget.org and npmjs.com. + PACKAGE_MANAGER = 20 + end + end +end diff --git a/grafeas-v1/proto_docs/google/api/launch_stage.rb b/grafeas-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..ce75038366ae --- /dev/null +++ b/grafeas-v1/proto_docs/google/api/launch_stage.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Api + # The launch stage as defined by [Google Cloud Platform + # Launch Stages](https://cloud.google.com/terms/launch-stages). + module LaunchStage + # Do not use this default value. + LAUNCH_STAGE_UNSPECIFIED = 0 + + # The feature is not yet implemented. Users can not use it. + UNIMPLEMENTED = 6 + + # Prelaunch features are hidden from users and are only visible internally. + PRELAUNCH = 7 + + # Early Access features are limited to a closed group of testers. To use + # these features, you must sign up in advance and sign a Trusted Tester + # agreement (which includes confidentiality provisions). These features may + # be unstable, changed in backward-incompatible ways, and are not + # guaranteed to be released. + EARLY_ACCESS = 1 + + # Alpha is a limited availability test for releases before they are cleared + # for widespread use. By Alpha, all significant design issues are resolved + # and we are in the process of verifying functionality. Alpha customers + # need to apply for access, agree to applicable terms, and have their + # projects allowlisted. Alpha releases don't have to be feature complete, + # no SLAs are provided, and there are no technical support obligations, but + # they will be far enough along that customers can actually use them in + # test environments or for limited-use tests -- just like they would in + # normal production cases. + ALPHA = 2 + + # Beta is the point at which we are ready to open a release for any + # customer to use. There are no SLA or technical support obligations in a + # Beta release. Products will be complete from a feature perspective, but + # may have some open outstanding issues. Beta releases are suitable for + # limited production use cases. + BETA = 3 + + # GA features are open to all developers and are considered stable and + # fully qualified for production use. + GA = 4 + + # Deprecated features are scheduled to be shut down and removed. For more + # information, see the "Deprecation Policy" section of our [Terms of + # Service](https://cloud.google.com/terms/) + # and the [Google Cloud Platform Subject to the Deprecation + # Policy](https://cloud.google.com/terms/deprecation) documentation. + DEPRECATED = 5 + end + end +end diff --git a/grafeas-v1/proto_docs/google/protobuf/duration.rb b/grafeas-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ca97d06a00ef --- /dev/null +++ b/grafeas-v1/proto_docs/google/protobuf/duration.rb @@ -0,0 +1,98 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # A Duration represents a signed, fixed-length span of time represented + # as a count of seconds and fractions of seconds at nanosecond + # resolution. It is independent of any calendar and concepts like "day" + # or "month". It is related to Timestamp in that the difference between + # two Timestamp values is a Duration and it can be added or subtracted + # from a Timestamp. Range is approximately +-10,000 years. + # + # # Examples + # + # Example 1: Compute Duration from two Timestamps in pseudo code. + # + # Timestamp start = ...; + # Timestamp end = ...; + # Duration duration = ...; + # + # duration.seconds = end.seconds - start.seconds; + # duration.nanos = end.nanos - start.nanos; + # + # if (duration.seconds < 0 && duration.nanos > 0) { + # duration.seconds += 1; + # duration.nanos -= 1000000000; + # } else if (duration.seconds > 0 && duration.nanos < 0) { + # duration.seconds -= 1; + # duration.nanos += 1000000000; + # } + # + # Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. + # + # Timestamp start = ...; + # Duration duration = ...; + # Timestamp end = ...; + # + # end.seconds = start.seconds + duration.seconds; + # end.nanos = start.nanos + duration.nanos; + # + # if (end.nanos < 0) { + # end.seconds -= 1; + # end.nanos += 1000000000; + # } else if (end.nanos >= 1000000000) { + # end.seconds += 1; + # end.nanos -= 1000000000; + # } + # + # Example 3: Compute Duration from datetime.timedelta in Python. + # + # td = datetime.timedelta(days=3, minutes=10) + # duration = Duration() + # duration.FromTimedelta(td) + # + # # JSON Mapping + # + # In JSON format, the Duration type is encoded as a string rather than an + # object, where the string ends in the suffix "s" (indicating seconds) and + # is preceded by the number of seconds, with nanoseconds expressed as + # fractional seconds. For example, 3 seconds with 0 nanoseconds should be + # encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should + # be expressed in JSON format as "3.000000001s", and 3 seconds and 1 + # microsecond should be expressed in JSON format as "3.000001s". + # @!attribute [rw] seconds + # @return [::Integer] + # Signed seconds of the span of time. Must be from -315,576,000,000 + # to +315,576,000,000 inclusive. Note: these bounds are computed from: + # 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + # @!attribute [rw] nanos + # @return [::Integer] + # Signed fractions of a second at nanosecond resolution of the span + # of time. Durations less than one second are represented with a 0 + # `seconds` field and a positive or negative `nanos` field. For durations + # of one second or more, a non-zero value for the `nanos` field must be + # of the same sign as the `seconds` field. Must be from -999,999,999 + # to +999,999,999 inclusive. + class Duration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end From f1620235802f6c1b307ed759770b5b061a828db3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:46:42 +0530 Subject: [PATCH 077/112] feat(kms): add support for additional HMAC algorithms --- .../lib/google/cloud/kms/v1/resources_pb.rb | 4 ++++ .../proto_docs/google/cloud/kms/v1/resources.rb | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb index 894ccc04de17..e13185cb3ff3 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/resources_pb.rb @@ -97,6 +97,10 @@ value :EC_SIGN_P384_SHA384, 13 value :EC_SIGN_SECP256K1_SHA256, 31 value :HMAC_SHA256, 32 + value :HMAC_SHA1, 33 + value :HMAC_SHA384, 34 + value :HMAC_SHA512, 35 + value :HMAC_SHA224, 36 value :EXTERNAL_SYMMETRIC_ENCRYPTION, 18 end add_enum "google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionState" do diff --git a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb index d6aa489d3010..c8e1440bec71 100644 --- a/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb +++ b/google-cloud-kms-v1/proto_docs/google/cloud/kms/v1/resources.rb @@ -474,6 +474,18 @@ module CryptoKeyVersionAlgorithm # HMAC-SHA256 signing with a 256 bit key. HMAC_SHA256 = 32 + # HMAC-SHA1 signing with a 160 bit key. + HMAC_SHA1 = 33 + + # HMAC-SHA384 signing with a 384 bit key. + HMAC_SHA384 = 34 + + # HMAC-SHA512 signing with a 512 bit key. + HMAC_SHA512 = 35 + + # HMAC-SHA224 signing with a 224 bit key. + HMAC_SHA224 = 36 + # Algorithm representing symmetric encryption by an external key manager. EXTERNAL_SYMMETRIC_ENCRYPTION = 18 end From 26f7be648d78848372d0f5ab6b46bdc448ddd6a4 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:48:17 +0530 Subject: [PATCH 078/112] feat(document_ai): add field_mask to GcsOutputConfig --- .../lib/google/cloud/documentai/v1beta3/document_io_pb.rb | 3 +++ .../google/cloud/documentai/v1beta3/document_io.rb | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb index b2cab692e97a..6677437f1350 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/documentai/v1beta3/document_io_pb.rb @@ -3,6 +3,8 @@ require 'google/protobuf' +require 'google/protobuf/field_mask_pb' + Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/documentai/v1beta3/document_io.proto", :syntax => :proto3) do add_message "google.cloud.documentai.v1beta3.RawDocument" do @@ -32,6 +34,7 @@ end add_message "google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig" do optional :gcs_uri, :string, 1 + optional :field_mask, :message, 2, "google.protobuf.FieldMask" end end end diff --git a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb index 19fed486cb77..d0f7f41244c3 100644 --- a/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb +++ b/google-cloud-document_ai-v1beta3/proto_docs/google/cloud/documentai/v1beta3/document_io.rb @@ -89,6 +89,11 @@ class DocumentOutputConfig # @!attribute [rw] gcs_uri # @return [::String] # The Cloud Storage uri (a directory) of the output. + # @!attribute [rw] field_mask + # @return [::Google::Protobuf::FieldMask] + # Specifies which fields to include in the output documents. + # Only supports top level document and pages field so it must be in the + # form of `{document_field_name}` or `pages.{page_field_name}`. class GcsOutputConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods From ab0dacc438b99c9eb763d716fcd6fc75c320c82b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 09:49:35 +0530 Subject: [PATCH 079/112] feat(bigquery-storage): add missing_value_interpretations to AppendRowsRequest --- .../cloud/bigquery/storage/v1/storage_pb.rb | 7 +++ .../cloud/bigquery/storage/v1/storage.rb | 46 +++++++++++++++++++ .../storage/v1/big_query_write_test.rb | 18 ++++---- 3 files changed, 63 insertions(+), 8 deletions(-) diff --git a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_pb.rb b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_pb.rb index 54651eda06a5..83f54f7a8afd 100644 --- a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_pb.rb +++ b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/storage_pb.rb @@ -67,6 +67,7 @@ optional :write_stream, :string, 1 optional :offset, :message, 2, "google.protobuf.Int64Value" optional :trace_id, :string, 6 + map :missing_value_interpretations, :string, :enum, 7, "google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation" oneof :rows do optional :proto_rows, :message, 4, "google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData" end @@ -75,6 +76,11 @@ optional :writer_schema, :message, 1, "google.cloud.bigquery.storage.v1.ProtoSchema" optional :rows, :message, 2, "google.cloud.bigquery.storage.v1.ProtoRows" end + add_enum "google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation" do + value :MISSING_VALUE_INTERPRETATION_UNSPECIFIED, 0 + value :NULL_VALUE, 1 + value :DEFAULT_VALUE, 2 + end add_message "google.cloud.bigquery.storage.v1.AppendRowsResponse" do optional :updated_schema, :message, 3, "google.cloud.bigquery.storage.v1.TableSchema" repeated :row_errors, :message, 4, "google.cloud.bigquery.storage.v1.RowError" @@ -157,6 +163,7 @@ module V1 CreateWriteStreamRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.CreateWriteStreamRequest").msgclass AppendRowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.AppendRowsRequest").msgclass AppendRowsRequest::ProtoData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.AppendRowsRequest.ProtoData").msgclass + AppendRowsRequest::MissingValueInterpretation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.AppendRowsRequest.MissingValueInterpretation").enummodule AppendRowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.AppendRowsResponse").msgclass AppendRowsResponse::AppendResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.AppendRowsResponse.AppendResult").msgclass GetWriteStreamRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.bigquery.storage.v1.GetWriteStreamRequest").msgclass diff --git a/google-cloud-bigquery-storage-v1/proto_docs/google/cloud/bigquery/storage/v1/storage.rb b/google-cloud-bigquery-storage-v1/proto_docs/google/cloud/bigquery/storage/v1/storage.rb index e9433cce7be7..a7913624b0e7 100644 --- a/google-cloud-bigquery-storage-v1/proto_docs/google/cloud/bigquery/storage/v1/storage.rb +++ b/google-cloud-bigquery-storage-v1/proto_docs/google/cloud/bigquery/storage/v1/storage.rb @@ -223,6 +223,26 @@ class CreateWriteStreamRequest # @return [::String] # Id set by client to annotate its identity. Only initial request setting is # respected. + # @!attribute [rw] missing_value_interpretations + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest::MissingValueInterpretation}] + # A map to indicate how to interpret missing value for some fields. Missing + # values are fields present in user schema but missing in rows. The key is + # the field name. The value is the interpretation of missing values for the + # field. + # + # For example, a map \\{'foo': NULL_VALUE, 'bar': DEFAULT_VALUE} means all + # missing values in field foo are interpreted as NULL, all missing values in + # field bar are interpreted as the default value of field bar in table + # schema. + # + # If a field is not in this map and has missing values, the missing values + # in this field are interpreted as NULL. + # + # This field only applies to the current request, it won't affect other + # requests on the connection. + # + # Currently, field name can only be top-level column name, can't be a struct + # field path like 'foo.bar'. class AppendRowsRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -244,6 +264,32 @@ class ProtoData include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest::MissingValueInterpretation] + class MissingValueInterpretationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An enum to indicate how to interpret missing values. Missing values are + # fields present in user schema but missing in rows. A missing value can + # represent a NULL or a column default value defined in BigQuery table + # schema. + module MissingValueInterpretation + # Invalid missing value interpretation. Requests with this value will be + # rejected. + MISSING_VALUE_INTERPRETATION_UNSPECIFIED = 0 + + # Missing value is interpreted as NULL. + NULL_VALUE = 1 + + # Missing value is interpreted as column default value if declared in the + # table schema, NULL otherwise. + DEFAULT_VALUE = 2 + end end # Response message for `AppendRows`. diff --git a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb index d051edf9e7eb..d041b13c6b04 100644 --- a/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb +++ b/google-cloud-bigquery-storage-v1/test/google/cloud/bigquery/storage/v1/big_query_write_test.rb @@ -119,6 +119,7 @@ def test_append_rows offset = {} proto_rows = {} trace_id = "hello world" + missing_value_interpretations = {} append_rows_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| assert_equal :append_rows, name @@ -134,8 +135,8 @@ def test_append_rows end # Use enumerable object with hash and protobuf object. - request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id } - request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id + request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations } + request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations enum_input = [request_hash, request_proto].to_enum client.append_rows enum_input do |response, operation| assert_kind_of Enumerable, response @@ -146,8 +147,8 @@ def test_append_rows end # Use stream input object (from gapic-common). - request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id } - request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id + request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations } + request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations stream_input = Gapic::StreamInput.new client.append_rows stream_input do |response, operation| assert_kind_of Enumerable, response @@ -161,8 +162,8 @@ def test_append_rows stream_input.close # Use enumerable object with hash and protobuf object with options. - request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id } - request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id + request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations } + request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations enum_input = [request_hash, request_proto].to_enum client.append_rows enum_input, grpc_options do |response, operation| assert_kind_of Enumerable, response @@ -173,8 +174,8 @@ def test_append_rows end # Use stream input object (from gapic-common) with options. - request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id } - request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id + request_hash = { write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations } + request_proto = ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest.new write_stream: write_stream, offset: offset, proto_rows: proto_rows, trace_id: trace_id, missing_value_interpretations: missing_value_interpretations stream_input = Gapic::StreamInput.new client.append_rows stream_input, grpc_options do |response, operation| assert_kind_of Enumerable, response @@ -197,6 +198,7 @@ def test_append_rows assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Bigquery::Storage::V1::AppendRowsRequest::ProtoData), r["proto_rows"] assert_equal :proto_rows, r.rows assert_equal "hello world", r["trace_id"] + assert_equal({}, r["missing_value_interpretations"].to_h) end end end From 684427070f164b1292b9849de1fec92c1c968696 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 10:59:01 +0530 Subject: [PATCH 080/112] chore(beyond_corp): fix minor docstring formatting --- .../beyond_corp/app_connections/v1/app_connections_service.rb | 4 ++-- .../app_connections/v1/app_connections_service/client.rb | 4 ++-- .../appconnections/v1/app_connections_service_services_pb.rb | 4 ++-- .../beyond_corp/app_connectors/v1/app_connectors_service.rb | 4 ++-- .../app_connectors/v1/app_connectors_service/client.rb | 4 ++-- .../appconnectors/v1/app_connectors_service_services_pb.rb | 4 ++-- .../cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb | 4 ++-- .../app_gateways/v1/app_gateways_service/client.rb | 4 ++-- .../appgateways/v1/app_gateways_service_services_pb.rb | 4 ++-- .../v1/client_connector_services_service.rb | 4 ++-- .../v1/client_connector_services_service/client.rb | 4 ++-- .../v1/client_connector_services_service_services_pb.rb | 4 ++-- .../beyond_corp/client_gateways/v1/client_gateways_service.rb | 4 ++-- .../client_gateways/v1/client_gateways_service/client.rb | 4 ++-- .../clientgateways/v1/client_gateways_service_services_pb.rb | 4 ++-- google-cloud-beyond_corp/.repo-metadata.json | 2 +- .../lib/google/cloud/beyond_corp/app_connections.rb | 4 ++-- .../lib/google/cloud/beyond_corp/app_connectors.rb | 4 ++-- .../lib/google/cloud/beyond_corp/app_gateways.rb | 4 ++-- .../lib/google/cloud/beyond_corp/client_connector_services.rb | 4 ++-- .../lib/google/cloud/beyond_corp/client_gateways.rb | 4 ++-- 21 files changed, 41 insertions(+), 41 deletions(-) diff --git a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service.rb b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service.rb index 07e6d560c294..a721aa12e3e1 100644 --- a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service.rb +++ b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service.rb @@ -33,12 +33,12 @@ module BeyondCorp module AppConnections module V1 ## - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectionsService exposes the following resources: # diff --git a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb index 56662e127183..6547ace8aa90 100644 --- a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb +++ b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyond_corp/app_connections/v1/app_connections_service/client.rb @@ -30,12 +30,12 @@ module AppConnectionsService ## # Client for the AppConnectionsService service. # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectionsService exposes the following resources: # diff --git a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_services_pb.rb b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_services_pb.rb index a277f9e7f4a2..8cfb93516fad 100644 --- a/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_services_pb.rb +++ b/google-cloud-beyond_corp-app_connections-v1/lib/google/cloud/beyondcorp/appconnections/v1/app_connections_service_services_pb.rb @@ -25,12 +25,12 @@ module BeyondCorp module AppConnections module V1 module AppConnectionsService - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectionsService exposes the following resources: # diff --git a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service.rb b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service.rb index 4a2b2fbb593d..e13bafff9911 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service.rb @@ -33,12 +33,12 @@ module BeyondCorp module AppConnectors module V1 ## - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectorsService exposes the following resource: # diff --git a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb index 8b666a2ecd02..f7af207d745f 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyond_corp/app_connectors/v1/app_connectors_service/client.rb @@ -30,12 +30,12 @@ module AppConnectorsService ## # Client for the AppConnectorsService service. # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectorsService exposes the following resource: # diff --git a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service_services_pb.rb b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service_services_pb.rb index c1273461016e..f0b610800a88 100644 --- a/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service_services_pb.rb +++ b/google-cloud-beyond_corp-app_connectors-v1/lib/google/cloud/beyondcorp/appconnectors/v1/app_connectors_service_services_pb.rb @@ -25,12 +25,12 @@ module BeyondCorp module AppConnectors module V1 module AppConnectorsService - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectorsService exposes the following resource: # diff --git a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb index e9300c765035..9d4eba90426c 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service.rb @@ -33,12 +33,12 @@ module BeyondCorp module AppGateways module V1 ## - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb index e55f9431be61..c8f03e1afab5 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyond_corp/app_gateways/v1/app_gateways_service/client.rb @@ -30,12 +30,12 @@ module AppGatewaysService ## # Client for the AppGatewaysService service. # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb index 65b533f8fbf3..d5e8a62185d8 100644 --- a/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb +++ b/google-cloud-beyond_corp-app_gateways-v1/lib/google/cloud/beyondcorp/appgateways/v1/app_gateways_service_services_pb.rb @@ -25,12 +25,12 @@ module BeyondCorp module AppGateways module V1 module AppGatewaysService - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service.rb b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service.rb index f82d78395984..c3a43aa9b66e 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service.rb @@ -33,12 +33,12 @@ module BeyondCorp module ClientConnectorServices module V1 ## - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientConnectorServicesService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb index f24c97bed052..5598bef235d1 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyond_corp/client_connector_services/v1/client_connector_services_service/client.rb @@ -30,12 +30,12 @@ module ClientConnectorServicesService ## # Client for the ClientConnectorServicesService service. # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientConnectorServicesService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb index 036d12baf0ab..0eb71553cd02 100644 --- a/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb +++ b/google-cloud-beyond_corp-client_connector_services-v1/lib/google/cloud/beyondcorp/clientconnectorservices/v1/client_connector_services_service_services_pb.rb @@ -25,12 +25,12 @@ module BeyondCorp module ClientConnectorServices module V1 module ClientConnectorServicesService - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientConnectorServicesService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service.rb b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service.rb index 7ae9030cba13..71a707a0e2b8 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service.rb @@ -33,12 +33,12 @@ module BeyondCorp module ClientGateways module V1 ## - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb index 8ba36dfc4dd8..396c79659868 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyond_corp/client_gateways/v1/client_gateways_service/client.rb @@ -30,12 +30,12 @@ module ClientGatewaysService ## # Client for the ClientGatewaysService service. # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_services_pb.rb b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_services_pb.rb index a6904a321753..730c19895952 100644 --- a/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_services_pb.rb +++ b/google-cloud-beyond_corp-client_gateways-v1/lib/google/cloud/beyondcorp/clientgateways/v1/client_gateways_service_services_pb.rb @@ -25,12 +25,12 @@ module BeyondCorp module ClientGateways module V1 module ClientGatewaysService - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp/.repo-metadata.json b/google-cloud-beyond_corp/.repo-metadata.json index 37294bc278bf..c8dde9efa76e 100644 --- a/google-cloud-beyond_corp/.repo-metadata.json +++ b/google-cloud-beyond_corp/.repo-metadata.json @@ -13,5 +13,5 @@ "requires_billing": true, "ruby-cloud-description": "Beyondcorp Enterprise provides identity and context aware access controls for enterprise resources and enables zero-trust access. Using the Beyondcorp Enterprise APIs, enterprises can set up multi-cloud and on-prem connectivity using the App Connector hybrid connectivity solution.", "ruby-cloud-product-url": "https://cloud.google.com/beyondcorp/", - "library_type": "GAPIC_AUTO" + "library_type": "GAPIC_MANUAL" } \ No newline at end of file diff --git a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connections.rb b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connections.rb index 3692569feaa8..522796550a08 100644 --- a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connections.rb +++ b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connections.rb @@ -58,12 +58,12 @@ module AppConnections # # ## About AppConnectionsService # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectionsService exposes the following resources: # diff --git a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connectors.rb b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connectors.rb index 59608bff5386..60063d4df1e2 100644 --- a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connectors.rb +++ b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_connectors.rb @@ -58,12 +58,12 @@ module AppConnectors # # ## About AppConnectorsService # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppConnectorsService exposes the following resource: # diff --git a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_gateways.rb b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_gateways.rb index 5dd746ec3199..6717cf9de880 100644 --- a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_gateways.rb +++ b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/app_gateways.rb @@ -58,12 +58,12 @@ module AppGateways # # ## About AppGatewaysService # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The AppGatewaysService exposes the following resources: # diff --git a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_connector_services.rb b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_connector_services.rb index d64cc3e930c3..dc294e12c6f6 100644 --- a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_connector_services.rb +++ b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_connector_services.rb @@ -58,12 +58,12 @@ module ClientConnectorServices # # ## About ClientConnectorServicesService # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientConnectorServicesService exposes the following resources: # diff --git a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_gateways.rb b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_gateways.rb index 8d06aa910907..93cd8d967779 100644 --- a/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_gateways.rb +++ b/google-cloud-beyond_corp/lib/google/cloud/beyond_corp/client_gateways.rb @@ -58,12 +58,12 @@ module ClientGateways # # ## About ClientGatewaysService # - # ## API Overview + # API Overview: # # The `beyondcorp.googleapis.com` service implements the Google Cloud # BeyondCorp API. # - # ## Data Model + # Data Model: # # The ClientGatewaysService exposes the following resources: # From ff56117982b4a8c95dc0e5b6107c0adcb7c51dfa Mon Sep 17 00:00:00 2001 From: Nicholas Cook Date: Tue, 15 Nov 2022 21:34:46 -0800 Subject: [PATCH 081/112] samples(stitcher): Add Video Stitcher samples and tests (#19429) --- .../acceptance/create_live_session_test.rb | 30 ++++++++++ .../acceptance/get_live_ad_tag_detail_test.rb | 45 +++++++++++++++ .../acceptance/get_live_session_test.rb | 33 +++++++++++ .../samples/acceptance/helper.rb | 27 +++++++++ .../list_live_ad_tag_details_test.rb | 36 ++++++++++++ .../acceptance/live_session_definition.rb | 13 +++++ .../samples/create_live_session.rb | 55 +++++++++++++++++++ .../samples/get_live_ad_tag_detail.rb | 39 +++++++++++++ .../samples/get_live_session.rb | 39 +++++++++++++ .../samples/list_live_ad_tag_details.rb | 41 ++++++++++++++ 10 files changed, 358 insertions(+) create mode 100644 google-cloud-video-stitcher/samples/acceptance/create_live_session_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_live_ad_tag_detail_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/get_live_session_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/list_live_ad_tag_details_test.rb create mode 100644 google-cloud-video-stitcher/samples/acceptance/live_session_definition.rb create mode 100644 google-cloud-video-stitcher/samples/create_live_session.rb create mode 100644 google-cloud-video-stitcher/samples/get_live_ad_tag_detail.rb create mode 100644 google-cloud-video-stitcher/samples/get_live_session.rb create mode 100644 google-cloud-video-stitcher/samples/list_live_ad_tag_details.rb diff --git a/google-cloud-video-stitcher/samples/acceptance/create_live_session_test.rb b/google-cloud-video-stitcher/samples/acceptance/create_live_session_test.rb new file mode 100644 index 000000000000..c9d620dfd1ab --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/create_live_session_test.rb @@ -0,0 +1,30 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#create_live_session", :stitcher_snippet do + it "creates a live session" do + sample = SampleLoader.load "create_live_session.rb" + + refute_nil slate + @slate_created = true + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, source_uri: live_uri, ad_tag_uri: live_ad_tag_uri, slate_id: slate_id + end + + assert_match %r{Live session: projects/\S+/locations/#{location_id}/liveSessions/\S+}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_live_ad_tag_detail_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_live_ad_tag_detail_test.rb new file mode 100644 index 000000000000..a5ea59e1fdc3 --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_live_ad_tag_detail_test.rb @@ -0,0 +1,45 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_live_ad_tag_detail", :stitcher_snippet do + it "gets an ad tag detail for a live session" do + sample = SampleLoader.load "list_live_ad_tag_details.rb" + + refute_nil slate + @slate_created = true + + refute_nil live_session + @session_id = live_session.name.split("/").last + + # Ad tag details + # To get ad tag details, you need to curl the main manifest and + # a rendition first. This supplies media player information to the API. + get_renditions live_session.play_uri + + output = capture_io { + sample.run project_id: project_id, location: location_id, session_id: @session_id + } + + @ad_tag_detail_id = output[0].to_s.split("/").last.strip + sample = SampleLoader.load "get_live_ad_tag_detail.rb" + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, session_id: @session_id, ad_tag_detail_id: @ad_tag_detail_id + end + + assert_match %r{Live ad tag detail: projects/\S+/locations/#{location_id}/liveSessions/#{@session_id}/liveAdTagDetails/#{@ad_tag_detail_id}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/get_live_session_test.rb b/google-cloud-video-stitcher/samples/acceptance/get_live_session_test.rb new file mode 100644 index 000000000000..aaf381669c2c --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/get_live_session_test.rb @@ -0,0 +1,33 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#get_live_session", :stitcher_snippet do + it "gets the live session" do + sample = SampleLoader.load "get_live_session.rb" + + refute_nil slate + @slate_created = true + + refute_nil live_session + @session_id = live_session.name.split("/").last + + out, _err = capture_io do + sample.run project_id: project_id, location: location_id, session_id: @session_id + end + + assert_match %r{Live session: projects/\S+/locations/#{location_id}/liveSessions/#{@session_id}}, out + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/helper.rb b/google-cloud-video-stitcher/samples/acceptance/helper.rb index ae6cbd59fc37..7011ef70c807 100644 --- a/google-cloud-video-stitcher/samples/acceptance/helper.rb +++ b/google-cloud-video-stitcher/samples/acceptance/helper.rb @@ -15,11 +15,13 @@ require "minitest/autorun" require "minitest/focus" require "minitest/rg" +require "net/http" require "google/cloud/video/stitcher" require_relative "akamai_cdn_key_definition" require_relative "cloud_cdn_key_definition" +require_relative "live_session_definition" require_relative "slate_definition" require_relative "vod_session_definition" require_relative "../../../.toys/.lib/sample_loader" @@ -55,6 +57,9 @@ class StitcherSnippetSpec < Minitest::Spec let(:vod_uri) { "https://storage.googleapis.com/cloud-samples-data/media/hls-vod/manifest.m3u8" } let(:vod_ad_tag_uri) { "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpreonly&ciu_szs=300x250%2C728x90&gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=" } + let(:live_uri) { "https://storage.googleapis.com/cloud-samples-data/media/hls-live/manifest.m3u8" } + let(:live_ad_tag_uri) { "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=" } + attr_writer :slate_created attr_writer :akamai_cdn_key_created attr_writer :cloud_cdn_key_created @@ -110,6 +115,13 @@ class StitcherSnippetSpec < Minitest::Spec ) end + let :live_session do + client.create_live_session( + parent: location_path, + live_session: live_session_def(live_uri, live_ad_tag_uri, slate_id) + ) + end + let :akamai_cdn_key do client.create_cdn_key( parent: location_path, @@ -150,5 +162,20 @@ class StitcherSnippetSpec < Minitest::Spec end end + ## + # Curl the play_uri first. The last line of the response will contain a + # renditions location. Curl the live session name with the rendition + # location appended. + def get_renditions uri + res = Net::HTTP.get_response URI(uri) + unless res.is_a? Net::HTTPSuccess + return + end + tmp = res.body.strip + renditions = tmp.split("\n").last + renditions_uri = uri.sub(/manifest\.m3u8.*/, renditions) + Net::HTTP.get_response URI(renditions_uri) + end + register_spec_type(self) { |*descs| descs.include? :stitcher_snippet } end diff --git a/google-cloud-video-stitcher/samples/acceptance/list_live_ad_tag_details_test.rb b/google-cloud-video-stitcher/samples/acceptance/list_live_ad_tag_details_test.rb new file mode 100644 index 000000000000..9414c0c09d8c --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/list_live_ad_tag_details_test.rb @@ -0,0 +1,36 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require_relative "helper" + +describe "#list_live_ad_tag_details", :stitcher_snippet do + it "lists the ad tag details for a live session" do + sample = SampleLoader.load "list_live_ad_tag_details.rb" + + refute_nil slate + @slate_created = true + + refute_nil live_session + @session_id = live_session.name.split("/").last + + # Ad tag details + # To get ad tag details, you need to curl the main manifest and + # a rendition first. This supplies media player information to the API. + get_renditions live_session.play_uri + + assert_output %r{Live ad tag details:\n#{live_session.name}/liveAdTagDetails/\S+} do + sample.run project_id: project_id, location: location_id, session_id: @session_id + end + end +end diff --git a/google-cloud-video-stitcher/samples/acceptance/live_session_definition.rb b/google-cloud-video-stitcher/samples/acceptance/live_session_definition.rb new file mode 100644 index 000000000000..7badb0faf2cc --- /dev/null +++ b/google-cloud-video-stitcher/samples/acceptance/live_session_definition.rb @@ -0,0 +1,13 @@ +require "google/cloud/video/stitcher" + +def live_session_def source_uri, ad_tag_uri, slate_id + { + source_uri: source_uri, + ad_tag_map: { + default: { + uri: ad_tag_uri + } + }, + default_slate_id: slate_id + } +end diff --git a/google-cloud-video-stitcher/samples/create_live_session.rb b/google-cloud-video-stitcher/samples/create_live_session.rb new file mode 100644 index 000000000000..b15a58303e46 --- /dev/null +++ b/google-cloud-video-stitcher/samples/create_live_session.rb @@ -0,0 +1,55 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_create_live_session] +require "google/cloud/video/stitcher" + +## +# Create a live stream session. Live sessions are ephemeral resources +# that expire after a few minutes. +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param source_uri [String] The URI of an MPEG-DASH manifest (.mpd) file or +# an M3U playlist manifest (.m3u8) file +# (e.g. "https://storage.googleapis.com/my-bucket/main.mpd") +# @param ad_tag_uri [String] The URI of the ad tag. See Single Inline Linear at +# https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags. +# @param slate_id [String] The user-defined slate ID of the default slate to use +# when no slates are specified in an ad break's message (e.g. "my-slate") +# +def create_live_session project_id:, location:, source_uri:, ad_tag_uri:, slate_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.location_path project: project_id, location: location + + # Set the session fields. + new_live_session = { + source_uri: source_uri, + ad_tag_map: { + default: { + uri: ad_tag_uri + } + }, + default_slate_id: slate_id + } + + response = client.create_live_session parent: parent, live_session: new_live_session + + # Print the live session name. + puts "Live session: #{response.name}" +end +# [END videostitcher_create_live_session] diff --git a/google-cloud-video-stitcher/samples/get_live_ad_tag_detail.rb b/google-cloud-video-stitcher/samples/get_live_ad_tag_detail.rb new file mode 100644 index 000000000000..62cf9ecc5faf --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_live_ad_tag_detail.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_live_ad_tag_detail] +require "google/cloud/video/stitcher" + +## +# Get the specified ad tag detail for a live session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The live session ID (e.g. "my-live-session-id") +# @param ad_tag_detail_id [String] The ad tag detail ID (e.g. "my-ad-tag-id") +# +def get_live_ad_tag_detail project_id:, location:, session_id:, ad_tag_detail_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the live ad tag detail. + name = client.live_ad_tag_detail_path project: project_id, location: location, live_session: session_id, live_ad_tag_detail: ad_tag_detail_id + + # Get the live ad tag detail. + ad_tag_detail = client.get_live_ad_tag_detail name: name + + # Print the live ad tag detail name. + puts "Live ad tag detail: #{ad_tag_detail.name}" +end +# [END videostitcher_get_live_ad_tag_detail] diff --git a/google-cloud-video-stitcher/samples/get_live_session.rb b/google-cloud-video-stitcher/samples/get_live_session.rb new file mode 100644 index 000000000000..cec56e6cdfbb --- /dev/null +++ b/google-cloud-video-stitcher/samples/get_live_session.rb @@ -0,0 +1,39 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_get_live_session] +require "google/cloud/video/stitcher" + +## +# Get a live session. Live sessions are ephemeral resources +# that expire after a few minutes. +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The live session ID (e.g. "my-live-session-id") +# +def get_live_session project_id:, location:, session_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the live session. + name = client.live_session_path project: project_id, location: location, live_session: session_id + + # Get the live session. + session = client.get_live_session name: name + + # Print the live session name. + puts "Live session: #{session.name}" +end +# [END videostitcher_get_live_session] diff --git a/google-cloud-video-stitcher/samples/list_live_ad_tag_details.rb b/google-cloud-video-stitcher/samples/list_live_ad_tag_details.rb new file mode 100644 index 000000000000..4d1aa3762687 --- /dev/null +++ b/google-cloud-video-stitcher/samples/list_live_ad_tag_details.rb @@ -0,0 +1,41 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START videostitcher_list_live_ad_tag_details] +require "google/cloud/video/stitcher" + +## +# List the ad tag details for a live session +# +# @param project_id [String] Your Google Cloud project (e.g. "my-project") +# @param location [String] The location (e.g. "us-central1") +# @param session_id [String] The live session ID (e.g. "my-live-session-id") +# +def list_live_ad_tag_details project_id:, location:, session_id: + # Create a Video Stitcher client. + client = Google::Cloud::Video::Stitcher.video_stitcher_service + + # Build the resource name of the parent. + parent = client.live_session_path project: project_id, location: location, live_session: session_id + + # List all ad tag details for the live session. + response = client.list_live_ad_tag_details parent: parent + + puts "Live ad tag details:" + # Print out all live ad tag details. + response.each do |live_ad_tag_detail| + puts live_ad_tag_detail.name.to_s + end +end +# [END videostitcher_list_live_ad_tag_details] From b6546c60a405fe4076d8f63bb60bc2a92b6c60b8 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Wed, 16 Nov 2022 12:32:37 +0530 Subject: [PATCH 082/112] chore(translate_v2): fix acceptance tests (#19431) - refer https://github.com/googleapis/google-cloud-ruby/pull/19124 --- .../acceptance/translate/translate_test.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/google-cloud-translate-v2/acceptance/translate/translate_test.rb b/google-cloud-translate-v2/acceptance/translate/translate_test.rb index 70fbbc946e54..d17471cb3e0f 100644 --- a/google-cloud-translate-v2/acceptance/translate/translate_test.rb +++ b/google-cloud-translate-v2/acceptance/translate/translate_test.rb @@ -18,10 +18,10 @@ describe Google::Cloud::Translate, :translate do it "detects a langauge" do - _(translate.detect("Hello").results.first.language).must_equal "en" - _(translate.detect("Hola").results.first.language).must_equal "es" + _(translate.detect("Hello World").results.first.language).must_equal "en" + _(translate.detect("Hola Mundo").results.first.language).must_equal "es" - detections = translate.detect "Hello", "Hola" + detections = translate.detect "Hello World", "Hola Mundo" _(detections.count).must_equal 2 detections.each { |d| _(d).must_be_kind_of Google::Cloud::Translate::V2::Detection } @@ -29,7 +29,6 @@ _(detections.first.language).must_equal detections.first.results.first.language _(detections.first.results.first.language).must_equal "en" _(detections.first.confidence).must_equal detections.first.results.first.confidence - _(detections.first.results.first.confidence).must_equal 1.0 _(detections.last.results.first.language).must_equal "es" end @@ -51,7 +50,7 @@ translation = translate.translate "How are you today?", to: "es", model: "base" _(translation.text).must_equal "¿Cómo estás hoy?" - _(translation.model).must_equal "base" + _(translation.model).must_equal "nmt" translations = translate.translate "Hello", "How are you today?", to: :es, model: :nmt _(translations.count).must_equal 2 From 67bd931a0ed79178be4f07ec0055933d62889bbd Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:06:23 -0800 Subject: [PATCH 083/112] chore(main): release google-cloud-ai_platform-v1 0.15.0 (#19432) --- .release-please-manifest.json | 2 +- google-cloud-ai_platform-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/ai_platform/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.aiplatform.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c09211ab268a..ab11020ec8de 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -19,7 +19,7 @@ "google-cloud-access_approval-v1+FILLER": "0.0.0", "google-cloud-ai_platform": "0.2.0", "google-cloud-ai_platform+FILLER": "0.0.0", - "google-cloud-ai_platform-v1": "0.14.0", + "google-cloud-ai_platform-v1": "0.15.0", "google-cloud-ai_platform-v1+FILLER": "0.0.0", "google-cloud-api_gateway": "1.1.0", "google-cloud-api_gateway+FILLER": "0.0.0", diff --git a/google-cloud-ai_platform-v1/CHANGELOG.md b/google-cloud-ai_platform-v1/CHANGELOG.md index 2a8b23834ef8..b851373592a6 100644 --- a/google-cloud-ai_platform-v1/CHANGELOG.md +++ b/google-cloud-ai_platform-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.15.0 (2022-11-16) + +#### Features + +* add service_account to BatchPredictionJob + ### 0.14.0 (2022-11-08) #### Features diff --git a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb index 081e7d70b024..080197118405 100644 --- a/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb +++ b/google-cloud-ai_platform-v1/lib/google/cloud/ai_platform/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module AIPlatform module V1 - VERSION = "0.14.0" + VERSION = "0.15.0" end end end diff --git a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json index 8fb3cc15ed62..e12d72871b76 100644 --- a/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json +++ b/google-cloud-ai_platform-v1/snippets/snippet_metadata_google.cloud.aiplatform.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-ai_platform-v1", - "version": "0.14.0", + "version": "0.15.0", "language": "RUBY", "apis": [ { From c9ed45a318f76b64e73d9a6f0809add906d69d22 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:06:42 -0800 Subject: [PATCH 084/112] chore(main): release google-cloud-bigquery-storage-v1 0.16.0 (#19433) --- .release-please-manifest.json | 2 +- google-cloud-bigquery-storage-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/bigquery/storage/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.bigquery.storage.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ab11020ec8de..03907c89d0ae 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -115,7 +115,7 @@ "google-cloud-bigquery-reservation-v1+FILLER": "0.0.0", "google-cloud-bigquery-storage": "1.3.0", "google-cloud-bigquery-storage+FILLER": "0.0.0", - "google-cloud-bigquery-storage-v1": "0.15.1", + "google-cloud-bigquery-storage-v1": "0.16.0", "google-cloud-bigquery-storage-v1+FILLER": "0.0.0", "google-cloud-bigtable": "2.7.0", "google-cloud-bigtable+FILLER": "0.0.0", diff --git a/google-cloud-bigquery-storage-v1/CHANGELOG.md b/google-cloud-bigquery-storage-v1/CHANGELOG.md index 329e397194b3..a4385d4d279b 100644 --- a/google-cloud-bigquery-storage-v1/CHANGELOG.md +++ b/google-cloud-bigquery-storage-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.16.0 (2022-11-16) + +#### Features + +* add missing_value_interpretations to AppendRowsRequest + ### 0.15.1 (2022-11-08) #### Documentation diff --git a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb index ca329341f617..03a111212e2b 100644 --- a/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb +++ b/google-cloud-bigquery-storage-v1/lib/google/cloud/bigquery/storage/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Bigquery module Storage module V1 - VERSION = "0.15.1" + VERSION = "0.16.0" end end end diff --git a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json index 6e087fc04e54..6c34633e5c6f 100644 --- a/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json +++ b/google-cloud-bigquery-storage-v1/snippets/snippet_metadata_google.cloud.bigquery.storage.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-bigquery-storage-v1", - "version": "0.15.1", + "version": "0.16.0", "language": "RUBY", "apis": [ { From 95d1eeec688cbadec18bc29a4842c8fc7e3dc9b4 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:07:02 -0800 Subject: [PATCH 085/112] chore(main): release google-cloud-billing-v1 0.10.0 (#19434) --- .release-please-manifest.json | 2 +- google-cloud-billing-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/billing/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.billing.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 03907c89d0ae..948061864be4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -131,7 +131,7 @@ "google-cloud-billing-budgets-v1+FILLER": "0.0.0", "google-cloud-billing-budgets-v1beta1": "0.7.0", "google-cloud-billing-budgets-v1beta1+FILLER": "0.0.0", - "google-cloud-billing-v1": "0.9.0", + "google-cloud-billing-v1": "0.10.0", "google-cloud-billing-v1+FILLER": "0.0.0", "google-cloud-binary_authorization": "1.1.0", "google-cloud-binary_authorization+FILLER": "0.0.0", diff --git a/google-cloud-billing-v1/CHANGELOG.md b/google-cloud-billing-v1/CHANGELOG.md index 08535ea4a377..1b20bd5aec3e 100644 --- a/google-cloud-billing-v1/CHANGELOG.md +++ b/google-cloud-billing-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.10.0 (2022-11-16) + +#### Features + +* support geo_taxonomy + ### 0.9.0 (2022-07-01) #### Features diff --git a/google-cloud-billing-v1/lib/google/cloud/billing/v1/version.rb b/google-cloud-billing-v1/lib/google/cloud/billing/v1/version.rb index 5d17aef6d824..164ad54111e5 100644 --- a/google-cloud-billing-v1/lib/google/cloud/billing/v1/version.rb +++ b/google-cloud-billing-v1/lib/google/cloud/billing/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Billing module V1 - VERSION = "0.9.0" + VERSION = "0.10.0" end end end diff --git a/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json b/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json index e64349a7b9e8..7c112b9354f2 100644 --- a/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json +++ b/google-cloud-billing-v1/snippets/snippet_metadata_google.cloud.billing.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-billing-v1", - "version": "0.9.0", + "version": "0.10.0", "language": "RUBY", "apis": [ { From 94f0dcfe1046934b20fedbb21c56cdcce8f11e40 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:07:22 -0800 Subject: [PATCH 086/112] chore(main): release google-cloud-container-v1 0.12.0 (#19435) --- .release-please-manifest.json | 2 +- google-cloud-container-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/container/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.container.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 948061864be4..4ff6a0cdf5c6 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -165,7 +165,7 @@ "google-cloud-contact_center_insights-v1+FILLER": "0.0.0", "google-cloud-container": "1.3.0", "google-cloud-container+FILLER": "0.0.0", - "google-cloud-container-v1": "0.11.0", + "google-cloud-container-v1": "0.12.0", "google-cloud-container-v1+FILLER": "0.0.0", "google-cloud-container-v1beta1": "0.13.0", "google-cloud-container-v1beta1+FILLER": "0.0.0", diff --git a/google-cloud-container-v1/CHANGELOG.md b/google-cloud-container-v1/CHANGELOG.md index fc7a7275f204..225fc276cee3 100644 --- a/google-cloud-container-v1/CHANGELOG.md +++ b/google-cloud-container-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.12.0 (2022-11-16) + +#### Features + +* support placement_policy + ### 0.11.0 (2022-10-18) #### Features diff --git a/google-cloud-container-v1/lib/google/cloud/container/v1/version.rb b/google-cloud-container-v1/lib/google/cloud/container/v1/version.rb index af632d1c9eff..d524924fe0d5 100644 --- a/google-cloud-container-v1/lib/google/cloud/container/v1/version.rb +++ b/google-cloud-container-v1/lib/google/cloud/container/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Container module V1 - VERSION = "0.11.0" + VERSION = "0.12.0" end end end diff --git a/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json b/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json index ad78de9fa5c8..d14b7e3ceb2a 100644 --- a/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json +++ b/google-cloud-container-v1/snippets/snippet_metadata_google.container.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-container-v1", - "version": "0.11.0", + "version": "0.12.0", "language": "RUBY", "apis": [ { From 49f30c5c94f3fd73e097d177e68ca8fba4541474 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:07:48 -0800 Subject: [PATCH 087/112] chore(main): release google-cloud-document_ai-v1beta3 0.14.0 (#19436) --- .release-please-manifest.json | 2 +- google-cloud-document_ai-v1beta3/CHANGELOG.md | 9 +++++++++ .../lib/google/cloud/document_ai/v1beta3/version.rb | 2 +- ...snippet_metadata_google.cloud.documentai.v1beta3.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 4ff6a0cdf5c6..358a28ef2c63 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -247,7 +247,7 @@ "google-cloud-document_ai+FILLER": "0.0.0", "google-cloud-document_ai-v1": "0.6.0", "google-cloud-document_ai-v1+FILLER": "0.0.0", - "google-cloud-document_ai-v1beta3": "0.13.0", + "google-cloud-document_ai-v1beta3": "0.14.0", "google-cloud-document_ai-v1beta3+FILLER": "0.0.0", "google-cloud-domains": "1.1.0", "google-cloud-domains+FILLER": "0.0.0", diff --git a/google-cloud-document_ai-v1beta3/CHANGELOG.md b/google-cloud-document_ai-v1beta3/CHANGELOG.md index a4c4138e8bb2..f6d7a9974c00 100644 --- a/google-cloud-document_ai-v1beta3/CHANGELOG.md +++ b/google-cloud-document_ai-v1beta3/CHANGELOG.md @@ -1,5 +1,14 @@ # Release History +### 0.14.0 (2022-11-16) + +#### Features + +* add documentSchema to ProcessorVersion +* add field_mask to GcsOutputConfig +* add image_quality_scores to Font_size and Provenance to Dimension +* support train_processor_version, evaluate_processor_version and evaluations api + ### 0.13.0 (2022-08-17) #### Features diff --git a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb index a1d57fe2d168..242acd259f51 100644 --- a/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb +++ b/google-cloud-document_ai-v1beta3/lib/google/cloud/document_ai/v1beta3/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module DocumentAI module V1beta3 - VERSION = "0.13.0" + VERSION = "0.14.0" end end end diff --git a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json index 34b49a09e1bb..ae843c689c42 100644 --- a/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json +++ b/google-cloud-document_ai-v1beta3/snippets/snippet_metadata_google.cloud.documentai.v1beta3.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-document_ai-v1beta3", - "version": "0.13.0", + "version": "0.14.0", "language": "RUBY", "apis": [ { From ff62859645f462606e7b5009cfcf666a57553971 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:08:06 -0800 Subject: [PATCH 088/112] chore(main): release google-cloud-kms-v1 0.15.0 (#19437) --- .release-please-manifest.json | 2 +- google-cloud-kms-v1/CHANGELOG.md | 6 ++++++ google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.kms.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 358a28ef2c63..f2659e48dd92 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -325,7 +325,7 @@ "google-cloud-iot-v1+FILLER": "0.0.0", "google-cloud-kms": "2.4.0", "google-cloud-kms+FILLER": "0.0.0", - "google-cloud-kms-v1": "0.14.0", + "google-cloud-kms-v1": "0.15.0", "google-cloud-kms-v1+FILLER": "0.0.0", "google-cloud-language": "1.4.0", "google-cloud-language+FILLER": "0.0.0", diff --git a/google-cloud-kms-v1/CHANGELOG.md b/google-cloud-kms-v1/CHANGELOG.md index 2248081f23e1..b439fe8ce8c4 100644 --- a/google-cloud-kms-v1/CHANGELOG.md +++ b/google-cloud-kms-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.15.0 (2022-11-16) + +#### Features + +* add support for additional HMAC algorithms + ### 0.14.0 (2022-10-21) #### Features diff --git a/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb b/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb index 6425eeed8d01..36fef4d281c9 100644 --- a/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb +++ b/google-cloud-kms-v1/lib/google/cloud/kms/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Kms module V1 - VERSION = "0.14.0" + VERSION = "0.15.0" end end end diff --git a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json index c54ba62852a5..8ccb79cc272d 100644 --- a/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json +++ b/google-cloud-kms-v1/snippets/snippet_metadata_google.cloud.kms.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-kms-v1", - "version": "0.14.0", + "version": "0.15.0", "language": "RUBY", "apis": [ { From 6495e52c923dfcf84b2ae56e81f53728c57d50fa Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:08:30 -0800 Subject: [PATCH 089/112] chore(main): release google-cloud-life_sciences-v2beta 0.3.0 (#19438) --- .release-please-manifest.json | 2 +- google-cloud-life_sciences-v2beta/CHANGELOG.md | 7 +++++++ .../lib/google/cloud/life_sciences/v2beta/version.rb | 2 +- .../snippet_metadata_google.cloud.lifesciences.v2beta.json | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f2659e48dd92..e34b16cc6aaa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -335,7 +335,7 @@ "google-cloud-language-v1beta2+FILLER": "0.0.0", "google-cloud-life_sciences": "0.2.0", "google-cloud-life_sciences+FILLER": "0.0.0", - "google-cloud-life_sciences-v2beta": "0.2.0", + "google-cloud-life_sciences-v2beta": "0.3.0", "google-cloud-life_sciences-v2beta+FILLER": "0.0.0", "google-cloud-location": "0.2.0", "google-cloud-location+FILLER": "0.0.0", diff --git a/google-cloud-life_sciences-v2beta/CHANGELOG.md b/google-cloud-life_sciences-v2beta/CHANGELOG.md index 7a9be65b8ee1..c0240e3af940 100644 --- a/google-cloud-life_sciences-v2beta/CHANGELOG.md +++ b/google-cloud-life_sciences-v2beta/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 0.3.0 (2022-11-16) + +#### Features + +* add encrypted_environment to pipeline and Action +* add reservation to VirtualMachine and support location client + ### 0.2.0 (2022-07-02) #### Features diff --git a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/version.rb b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/version.rb index 2a0aa1ff4a68..be699b7108a0 100644 --- a/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/version.rb +++ b/google-cloud-life_sciences-v2beta/lib/google/cloud/life_sciences/v2beta/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module LifeSciences module V2beta - VERSION = "0.2.0" + VERSION = "0.3.0" end end end diff --git a/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json b/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json index 3613dfc7738f..f16afbdd8e62 100644 --- a/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json +++ b/google-cloud-life_sciences-v2beta/snippets/snippet_metadata_google.cloud.lifesciences.v2beta.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-life_sciences-v2beta", - "version": "0.2.0", + "version": "0.3.0", "language": "RUBY", "apis": [ { From f7608374eea137397dfdd503881b92322c260e64 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:09:03 -0800 Subject: [PATCH 090/112] chore(main): release google-cloud-os_login-v1 0.6.0 (#19439) --- .release-please-manifest.json | 2 +- google-cloud-os_login-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/os_login/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.oslogin.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index e34b16cc6aaa..81a33d225e4c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -411,7 +411,7 @@ "google-cloud-os_config-v1alpha+FILLER": "0.0.0", "google-cloud-os_login": "1.3.0", "google-cloud-os_login+FILLER": "0.0.0", - "google-cloud-os_login-v1": "0.5.0", + "google-cloud-os_login-v1": "0.6.0", "google-cloud-os_login-v1+FILLER": "0.0.0", "google-cloud-os_login-v1beta": "0.5.0", "google-cloud-os_login-v1beta+FILLER": "0.0.0", diff --git a/google-cloud-os_login-v1/CHANGELOG.md b/google-cloud-os_login-v1/CHANGELOG.md index 60968b464f03..788ca2ca5dfd 100644 --- a/google-cloud-os_login-v1/CHANGELOG.md +++ b/google-cloud-os_login-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.6.0 (2022-11-16) + +#### Features + +* support create_ssh_public_key + ### 0.5.0 (2022-07-07) #### Features diff --git a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/version.rb b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/version.rb index 425fb65c4972..b89c6fe4d9cb 100644 --- a/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/version.rb +++ b/google-cloud-os_login-v1/lib/google/cloud/os_login/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module OsLogin module V1 - VERSION = "0.5.0" + VERSION = "0.6.0" end end end diff --git a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json index 1df79f3c51be..c72c6a4812c5 100644 --- a/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json +++ b/google-cloud-os_login-v1/snippets/snippet_metadata_google.cloud.oslogin.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-os_login-v1", - "version": "0.5.0", + "version": "0.6.0", "language": "RUBY", "apis": [ { From efc966b4ff50d425fe3343513f4bc658e5da4314 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Wed, 16 Nov 2022 00:09:34 -0800 Subject: [PATCH 091/112] chore(main): release google-cloud-os_login-v1beta 0.6.0 (#19440) --- .release-please-manifest.json | 2 +- google-cloud-os_login-v1beta/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/os_login/v1beta/version.rb | 2 +- .../snippet_metadata_google.cloud.oslogin.v1beta.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 81a33d225e4c..7a35577949ec 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -413,7 +413,7 @@ "google-cloud-os_login+FILLER": "0.0.0", "google-cloud-os_login-v1": "0.6.0", "google-cloud-os_login-v1+FILLER": "0.0.0", - "google-cloud-os_login-v1beta": "0.5.0", + "google-cloud-os_login-v1beta": "0.6.0", "google-cloud-os_login-v1beta+FILLER": "0.0.0", "google-cloud-phishing_protection": "0.12.0", "google-cloud-phishing_protection+FILLER": "0.0.0", diff --git a/google-cloud-os_login-v1beta/CHANGELOG.md b/google-cloud-os_login-v1beta/CHANGELOG.md index c8eb83f65731..c3161ed17e79 100644 --- a/google-cloud-os_login-v1beta/CHANGELOG.md +++ b/google-cloud-os_login-v1beta/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.6.0 (2022-11-16) + +#### Features + +* support create_ssh_public_key + ### 0.5.0 (2022-07-07) #### Features diff --git a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/version.rb b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/version.rb index e649596f3c90..b6150a30f3d0 100644 --- a/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/version.rb +++ b/google-cloud-os_login-v1beta/lib/google/cloud/os_login/v1beta/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module OsLogin module V1beta - VERSION = "0.5.0" + VERSION = "0.6.0" end end end diff --git a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json index d70f29c7b9f8..619ad995f9d9 100644 --- a/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json +++ b/google-cloud-os_login-v1beta/snippets/snippet_metadata_google.cloud.oslogin.v1beta.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-os_login-v1beta", - "version": "0.5.0", + "version": "0.6.0", "language": "RUBY", "apis": [ { From 5d3a8fc46fb9cffa02b6ccc130e56bd9a4751670 Mon Sep 17 00:00:00 2001 From: Daniel Azuma Date: Wed, 16 Nov 2022 16:58:08 -0800 Subject: [PATCH 092/112] chore: Owlbot scripts for memcache (#19447) --- google-cloud-memcache-v1/.owlbot.rb | 22 ++++++++++++++++++++++ google-cloud-memcache-v1beta2/.owlbot.rb | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 google-cloud-memcache-v1/.owlbot.rb create mode 100644 google-cloud-memcache-v1beta2/.owlbot.rb diff --git a/google-cloud-memcache-v1/.owlbot.rb b/google-cloud-memcache-v1/.owlbot.rb new file mode 100644 index 000000000000..33e04565c9ab --- /dev/null +++ b/google-cloud-memcache-v1/.owlbot.rb @@ -0,0 +1,22 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Remove a spurious link to a class in a different gem. +# See https://github.com/googleapis/gapic-generator-ruby/issues/824 +OwlBot.modifier path: "proto_docs/google/cloud/memcache/v1/cloud_memcache.rb" do |content| + content.gsub "{::Google::Cloud::Location::Location google.cloud.location.Location}", + "`::Google::Cloud::Location::Location`" +end + +OwlBot.move_files diff --git a/google-cloud-memcache-v1beta2/.owlbot.rb b/google-cloud-memcache-v1beta2/.owlbot.rb new file mode 100644 index 000000000000..253716fcb275 --- /dev/null +++ b/google-cloud-memcache-v1beta2/.owlbot.rb @@ -0,0 +1,22 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Remove a spurious link to a class in a different gem. +# See https://github.com/googleapis/gapic-generator-ruby/issues/824 +OwlBot.modifier path: "proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb" do |content| + content.gsub "{::Google::Cloud::Location::Location google.cloud.location.Location}", + "`::Google::Cloud::Location::Location`" +end + +OwlBot.move_files From 168d89168204e529c99f7f88b2d8bc70af7b461b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:24:28 +0530 Subject: [PATCH 093/112] feat(memcache): support scheduled maintenance --- .../.owlbot-manifest.json | 6 +- .../gapic_metadata.json | 5 + .../google-cloud-memcache-v1beta2.gemspec | 1 + .../memcache/v1beta2/cloud_memcache/client.rb | 125 ++++++++++++++++++ .../memcache/v1beta2/cloud_memcache_pb.rb | 38 ++++++ .../v1beta2/cloud_memcache_services_pb.rb | 2 + .../cloud/memcache/v1beta2/cloud_memcache.rb | 115 ++++++++++++++-- .../proto_docs/google/type/dayofweek.rb | 49 +++++++ .../proto_docs/google/type/timeofday.rb | 45 +++++++ .../cloud_memcache/reschedule_maintenance.rb | 46 +++++++ ...etadata_google.cloud.memcache.v1beta2.json | 40 ++++++ .../memcache/v1beta2/cloud_memcache_test.rb | 67 ++++++++++ 12 files changed, 530 insertions(+), 9 deletions(-) create mode 100644 google-cloud-memcache-v1beta2/proto_docs/google/type/dayofweek.rb create mode 100644 google-cloud-memcache-v1beta2/proto_docs/google/type/timeofday.rb create mode 100644 google-cloud-memcache-v1beta2/snippets/cloud_memcache/reschedule_maintenance.rb diff --git a/google-cloud-memcache-v1beta2/.owlbot-manifest.json b/google-cloud-memcache-v1beta2/.owlbot-manifest.json index 1d3c515b6286..13fe6fe52924 100644 --- a/google-cloud-memcache-v1beta2/.owlbot-manifest.json +++ b/google-cloud-memcache-v1beta2/.owlbot-manifest.json @@ -35,6 +35,8 @@ "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/dayofweek.rb", + "proto_docs/google/type/timeofday.rb", "snippets/Gemfile", "snippets/cloud_memcache/apply_parameters.rb", "snippets/cloud_memcache/apply_software_update.rb", @@ -42,6 +44,7 @@ "snippets/cloud_memcache/delete_instance.rb", "snippets/cloud_memcache/get_instance.rb", "snippets/cloud_memcache/list_instances.rb", + "snippets/cloud_memcache/reschedule_maintenance.rb", "snippets/cloud_memcache/update_instance.rb", "snippets/cloud_memcache/update_parameters.rb", "snippets/snippet_metadata_google.cloud.memcache.v1beta2.json", @@ -51,6 +54,7 @@ "test/helper.rb" ], "static": [ - ".OwlBot.yaml" + ".OwlBot.yaml", + ".owlbot.rb" ] } diff --git a/google-cloud-memcache-v1beta2/gapic_metadata.json b/google-cloud-memcache-v1beta2/gapic_metadata.json index c0f058076ce7..c309bd1799b4 100644 --- a/google-cloud-memcache-v1beta2/gapic_metadata.json +++ b/google-cloud-memcache-v1beta2/gapic_metadata.json @@ -49,6 +49,11 @@ "methods": [ "apply_software_update" ] + }, + "RescheduleMaintenance": { + "methods": [ + "reschedule_maintenance" + ] } } } diff --git a/google-cloud-memcache-v1beta2/google-cloud-memcache-v1beta2.gemspec b/google-cloud-memcache-v1beta2/google-cloud-memcache-v1beta2.gemspec index 263b727dc1b5..9257d40e3855 100644 --- a/google-cloud-memcache-v1beta2/google-cloud-memcache-v1beta2.gemspec +++ b/google-cloud-memcache-v1beta2/google-cloud-memcache-v1beta2.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb index fd8507e33b62..467ca9d03af6 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache/client.rb @@ -18,6 +18,7 @@ require "google/cloud/errors" require "google/cloud/memcache/v1beta2/cloud_memcache_pb" +require "google/cloud/location" module Google module Cloud @@ -94,6 +95,8 @@ def self.configure default_config.rpcs.apply_software_update.timeout = 1200.0 + default_config.rpcs.reschedule_maintenance.timeout = 1200.0 + default_config end yield @configure if block_given? @@ -169,6 +172,12 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @cloud_memcache_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Stub, credentials: credentials, @@ -185,6 +194,13 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + # Service calls ## @@ -511,6 +527,7 @@ def create_instance request, options = nil # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Mask of fields to update. + # # * `displayName` # @param resource [::Google::Cloud::Memcache::V1beta2::Instance, ::Hash] # Required. A Memcached [Instance] resource. @@ -986,6 +1003,107 @@ def apply_software_update request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Performs the apply phase of the RescheduleMaintenance verb. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(instance: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::String] + # Required. Memcache instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memcache/v1beta2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_maintenance.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memcache::V1beta2::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance + header_params["instance"] = request.instance + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_memcache_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the CloudMemcache API. # @@ -1161,6 +1279,11 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :apply_software_update + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance # @private def initialize parent_rpcs = nil @@ -1180,6 +1303,8 @@ def initialize parent_rpcs = nil @apply_parameters = ::Gapic::Config::Method.new apply_parameters_config apply_software_update_config = parent_rpcs.apply_software_update if parent_rpcs.respond_to? :apply_software_update @apply_software_update = ::Gapic::Config::Method.new apply_software_update_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config yield self if block_given? end diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_pb.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_pb.rb index 15c6359a68ca..c73fcfc295a7 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_pb.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_pb.rb @@ -8,8 +8,11 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/memcache/v1beta2/cloud_memcache.proto", :syntax => :proto3) do @@ -31,6 +34,8 @@ repeated :instance_messages, :message, 19, "google.cloud.memcache.v1beta2.Instance.InstanceMessage" optional :discovery_endpoint, :string, 20 optional :update_available, :bool, 21 + optional :maintenance_policy, :message, 22, "google.cloud.memcache.v1beta2.MaintenancePolicy" + optional :maintenance_schedule, :message, 23, "google.cloud.memcache.v1beta2.MaintenanceSchedule" end add_message "google.cloud.memcache.v1beta2.Instance.NodeConfig" do optional :cpu_count, :int32, 1 @@ -64,9 +69,26 @@ value :STATE_UNSPECIFIED, 0 value :CREATING, 1 value :READY, 2 + value :UPDATING, 3 value :DELETING, 4 value :PERFORMING_MAINTENANCE, 5 end + add_message "google.cloud.memcache.v1beta2.MaintenancePolicy" do + optional :create_time, :message, 1, "google.protobuf.Timestamp" + optional :update_time, :message, 2, "google.protobuf.Timestamp" + optional :description, :string, 3 + repeated :weekly_maintenance_window, :message, 4, "google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow" + end + add_message "google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow" do + optional :day, :enum, 1, "google.type.DayOfWeek" + optional :start_time, :message, 2, "google.type.TimeOfDay" + optional :duration, :message, 3, "google.protobuf.Duration" + end + add_message "google.cloud.memcache.v1beta2.MaintenanceSchedule" do + optional :start_time, :message, 1, "google.protobuf.Timestamp" + optional :end_time, :message, 2, "google.protobuf.Timestamp" + optional :schedule_deadline_time, :message, 4, "google.protobuf.Timestamp" + end add_message "google.cloud.memcache.v1beta2.ListInstancesRequest" do optional :parent, :string, 1 optional :page_size, :int32, 2 @@ -94,6 +116,17 @@ add_message "google.cloud.memcache.v1beta2.DeleteInstanceRequest" do optional :name, :string, 1 end + add_message "google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest" do + optional :instance, :string, 1 + optional :reschedule_type, :enum, 2, "google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType" + optional :schedule_time, :message, 3, "google.protobuf.Timestamp" + end + add_enum "google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType" do + value :RESCHEDULE_TYPE_UNSPECIFIED, 0 + value :IMMEDIATE, 1 + value :NEXT_AVAILABLE_WINDOW, 2 + value :SPECIFIC_TIME, 3 + end add_message "google.cloud.memcache.v1beta2.ApplyParametersRequest" do optional :name, :string, 1 repeated :node_ids, :string, 2 @@ -145,12 +178,17 @@ module V1beta2 Instance::InstanceMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.Instance.InstanceMessage").msgclass Instance::InstanceMessage::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.Instance.InstanceMessage.Code").enummodule Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.Instance.State").enummodule + MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.MaintenancePolicy").msgclass + WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.WeeklyMaintenanceWindow").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.MaintenanceSchedule").msgclass ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ListInstancesRequest").msgclass ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ListInstancesResponse").msgclass GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.GetInstanceRequest").msgclass CreateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.CreateInstanceRequest").msgclass UpdateInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.UpdateInstanceRequest").msgclass DeleteInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.DeleteInstanceRequest").msgclass + RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest").msgclass + RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.RescheduleMaintenanceRequest.RescheduleType").enummodule ApplyParametersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ApplyParametersRequest").msgclass UpdateParametersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.UpdateParametersRequest").msgclass ApplySoftwareUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest").msgclass diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_services_pb.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_services_pb.rb index 5093a1ab6614..684d4c1e17fb 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_services_pb.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/cloud_memcache_services_pb.rb @@ -67,6 +67,8 @@ class Service rpc :ApplyParameters, ::Google::Cloud::Memcache::V1beta2::ApplyParametersRequest, ::Google::Longrunning::Operation # Updates software on the selected nodes of the Instance. rpc :ApplySoftwareUpdate, ::Google::Cloud::Memcache::V1beta2::ApplySoftwareUpdateRequest, ::Google::Longrunning::Operation + # Performs the apply phase of the RescheduleMaintenance verb. + rpc :RescheduleMaintenance, ::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation end Stub = Service.rpc_stub_class diff --git a/google-cloud-memcache-v1beta2/proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb b/google-cloud-memcache-v1beta2/proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb index be56fadfea8e..3f3522d1482d 100644 --- a/google-cloud-memcache-v1beta2/proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb +++ b/google-cloud-memcache-v1beta2/proto_docs/google/cloud/memcache/v1beta2/cloud_memcache.rb @@ -68,7 +68,7 @@ module V1beta2 # the latest supported minor version. # @!attribute [rw] parameters # @return [::Google::Cloud::Memcache::V1beta2::MemcacheParameters] - # Optional: User defined parameters to apply to the memcached process + # User defined parameters to apply to the memcached process # on each node. # @!attribute [r] memcache_nodes # @return [::Array<::Google::Cloud::Memcache::V1beta2::Instance::Node>] @@ -98,6 +98,14 @@ module V1beta2 # @!attribute [r] update_available # @return [::Boolean] # Output only. Returns true if there is an update waiting to be applied + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Memcache::V1beta2::MaintenancePolicy] + # The maintenance policy for the instance. If not provided, + # the maintenance event will be performed based on Memorystore + # internal rollout schedule. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Memcache::V1beta2::MaintenanceSchedule] + # Output only. Published maintenance schedule. class Instance include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -199,6 +207,10 @@ module State # Memcached instance has been created and ready to be used. READY = 2 + # Memcached instance is updating configuration such as maintenance policy + # and schedule. + UPDATING = 3 + # Memcached instance is being deleted. DELETING = 4 @@ -207,6 +219,58 @@ module State end end + # Maintenance policy per instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated. + # @!attribute [rw] description + # @return [::String] + # Description of what this policy is for. Create/Update methods + # return INVALID_ARGUMENT if the length is greater than 512. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Memcache::V1beta2::WeeklyMaintenanceWindow>] + # Required. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_maintenance_windows is expected to be one. + class MaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Required. Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. Start time of the window in UTC. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Required. Duration of the time window. + class WeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maintenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this instance. + # @!attribute [r] schedule_deadline_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The deadline that the maintenance schedule start time can not go beyond, + # including reschedule. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request for {::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#list_instances ListInstances}. # @!attribute [rw] parent # @return [::String] @@ -298,6 +362,7 @@ class CreateInstanceRequest # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # Required. Mask of fields to update. + # # * `displayName` # @!attribute [rw] resource # @return [::Google::Cloud::Memcache::V1beta2::Instance] @@ -319,6 +384,41 @@ class DeleteInstanceRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request for {::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#reschedule_maintenance RescheduleMaintenance}. + # @!attribute [rw] instance + # @return [::String] + # Required. Memcache instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to use the existing maintenance policy to find the + # next available window. + NEXT_AVAILABLE_WINDOW = 2 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + # Request for {::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#apply_parameters ApplyParameters}. # @!attribute [rw] name # @return [::String] @@ -372,14 +472,13 @@ class ApplySoftwareUpdateRequest extend ::Google::Protobuf::MessageExts::ClassMethods end - # The unique ID associated with this set of parameters. Users - # can use this id to determine if the parameters associated with the instance - # differ from the parameters associated with the nodes. A discrepancy between - # parameter ids can inform users that they may need to take action to apply - # parameters on nodes. # @!attribute [r] id # @return [::String] - # Output only. + # Output only. The unique ID associated with this set of parameters. Users + # can use this id to determine if the parameters associated with the instance + # differ from the parameters associated with the nodes. A discrepancy between + # parameter ids can inform users that they may need to take action to apply + # parameters on nodes. # @!attribute [rw] params # @return [::Google::Protobuf::Map{::String => ::String}] # User defined set of parameters to use in the memcached process. @@ -427,7 +526,7 @@ class OperationMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end - # Metadata for the given [google.cloud.location.Location][google.cloud.location.Location]. + # Metadata for the given `::Google::Cloud::Location::Location`. # @!attribute [r] available_zones # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Memcache::V1beta2::ZoneMetadata}] # Output only. The set of available zones in the location. The map is keyed diff --git a/google-cloud-memcache-v1beta2/proto_docs/google/type/dayofweek.rb b/google-cloud-memcache-v1beta2/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..be6bffe93767 --- /dev/null +++ b/google-cloud-memcache-v1beta2/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/google-cloud-memcache-v1beta2/proto_docs/google/type/timeofday.rb b/google-cloud-memcache-v1beta2/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..0c458cd78f61 --- /dev/null +++ b/google-cloud-memcache-v1beta2/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-memcache-v1beta2/snippets/cloud_memcache/reschedule_maintenance.rb b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/reschedule_maintenance.rb new file mode 100644 index 000000000000..bfd6ec17624d --- /dev/null +++ b/google-cloud-memcache-v1beta2/snippets/cloud_memcache/reschedule_maintenance.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_sync] +require "google/cloud/memcache/v1beta2" + +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#reschedule_maintenance +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest.new + + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_sync] diff --git a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json index af4976657c5c..1a0de8176922 100644 --- a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json +++ b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json @@ -330,6 +330,46 @@ "type": "FULL" } ] + }, + { + "region_tag": "memcache_v1beta2_generated_CloudMemcache_RescheduleMaintenance_sync", + "title": "Snippet for reschedule_maintenance in CloudMemcache", + "description": "Basic snippet for reschedule_maintenance in CloudMemcache", + "file": "cloud_memcache/reschedule_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_maintenance", + "full_name": "::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client#reschedule_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudMemcache::Client", + "full_name": "::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client" + }, + "method": { + "short_name": "RescheduleMaintenance", + "full_name": "google.cloud.memcache.v1beta2.CloudMemcache.RescheduleMaintenance", + "service": { + "short_name": "CloudMemcache", + "full_name": "google.cloud.memcache.v1beta2.CloudMemcache" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb index a2cb06401fe9..a2eb8d184629 100644 --- a/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb +++ b/google-cloud-memcache-v1beta2/test/google/cloud/memcache/v1beta2/cloud_memcache_test.rb @@ -572,6 +572,73 @@ def test_apply_software_update end end + def test_reschedule_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["instance"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Memcache::V1beta2::CloudMemcache::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_maintenance({ instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reschedule_maintenance instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reschedule_maintenance ::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest.new(instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reschedule_maintenance({ instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reschedule_maintenance(::Google::Cloud::Memcache::V1beta2::RescheduleMaintenanceRequest.new(instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure From 676a2fcb0aade5cd970fe25eefe37d24e5fa4fb0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:25:08 +0530 Subject: [PATCH 094/112] feat(memcache): support scheduled maintenance --- .../.owlbot-manifest.json | 6 +- google-cloud-memcache-v1/gapic_metadata.json | 5 + .../google-cloud-memcache-v1.gemspec | 1 + .../memcache/v1/cloud_memcache/client.rb | 153 +++++++++++++-- .../cloud/memcache/v1/cloud_memcache_pb.rb | 45 +++++ .../memcache/v1/cloud_memcache_services_pb.rb | 9 +- .../cloud/memcache/v1/cloud_memcache.rb | 174 +++++++++++++++--- .../proto_docs/google/type/dayofweek.rb | 49 +++++ .../proto_docs/google/type/timeofday.rb | 45 +++++ .../cloud_memcache/reschedule_maintenance.rb | 46 +++++ ...pet_metadata_google.cloud.memcache.v1.json | 40 ++++ .../cloud/memcache/v1/cloud_memcache_test.rb | 67 +++++++ 12 files changed, 598 insertions(+), 42 deletions(-) create mode 100644 google-cloud-memcache-v1/proto_docs/google/type/dayofweek.rb create mode 100644 google-cloud-memcache-v1/proto_docs/google/type/timeofday.rb create mode 100644 google-cloud-memcache-v1/snippets/cloud_memcache/reschedule_maintenance.rb diff --git a/google-cloud-memcache-v1/.owlbot-manifest.json b/google-cloud-memcache-v1/.owlbot-manifest.json index d8cbfa2ba7cd..7427d9545503 100644 --- a/google-cloud-memcache-v1/.owlbot-manifest.json +++ b/google-cloud-memcache-v1/.owlbot-manifest.json @@ -35,12 +35,15 @@ "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/dayofweek.rb", + "proto_docs/google/type/timeofday.rb", "snippets/Gemfile", "snippets/cloud_memcache/apply_parameters.rb", "snippets/cloud_memcache/create_instance.rb", "snippets/cloud_memcache/delete_instance.rb", "snippets/cloud_memcache/get_instance.rb", "snippets/cloud_memcache/list_instances.rb", + "snippets/cloud_memcache/reschedule_maintenance.rb", "snippets/cloud_memcache/update_instance.rb", "snippets/cloud_memcache/update_parameters.rb", "snippets/snippet_metadata_google.cloud.memcache.v1.json", @@ -50,6 +53,7 @@ "test/helper.rb" ], "static": [ - ".OwlBot.yaml" + ".OwlBot.yaml", + ".owlbot.rb" ] } diff --git a/google-cloud-memcache-v1/gapic_metadata.json b/google-cloud-memcache-v1/gapic_metadata.json index b2fe2b3f87d2..d7d6f6dd2589 100644 --- a/google-cloud-memcache-v1/gapic_metadata.json +++ b/google-cloud-memcache-v1/gapic_metadata.json @@ -44,6 +44,11 @@ "methods": [ "apply_parameters" ] + }, + "RescheduleMaintenance": { + "methods": [ + "reschedule_maintenance" + ] } } } diff --git a/google-cloud-memcache-v1/google-cloud-memcache-v1.gemspec b/google-cloud-memcache-v1/google-cloud-memcache-v1.gemspec index 4668182f7fac..ee45dc5f12a9 100644 --- a/google-cloud-memcache-v1/google-cloud-memcache-v1.gemspec +++ b/google-cloud-memcache-v1/google-cloud-memcache-v1.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb index a8baa3d887dd..959bdfcf0a1e 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache/client.rb @@ -18,6 +18,7 @@ require "google/cloud/errors" require "google/cloud/memcache/v1/cloud_memcache_pb" +require "google/cloud/location" module Google module Cloud @@ -92,6 +93,8 @@ def self.configure default_config.rpcs.apply_parameters.timeout = 1200.0 + default_config.rpcs.reschedule_maintenance.timeout = 1200.0 + default_config end yield @configure if block_given? @@ -167,6 +170,12 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @cloud_memcache_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Memcache::V1::CloudMemcache::Stub, credentials: credentials, @@ -183,6 +192,13 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + # Service calls ## @@ -211,16 +227,15 @@ def initialize # The maximum number of items to return. # # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + # Regardless of the `page_size` value, the response may include a partial + # list and a caller should only rely on response's + # {::Google::Cloud::Memcache::V1::ListInstancesResponse#next_page_token `next_page_token`} # to determine if there are more instances left to be queried. # @param page_token [::String] - # The next_page_token value returned from a previous List request, - # if any. + # The `next_page_token` value returned from a previous List request, if any. # @param filter [::String] # List filter. For example, exclude all Memcached instances with name as - # my-instance by specifying "name != my-instance". + # my-instance by specifying `"name != my-instance"`. # @param order_by [::String] # Sort results. Supported values are "name", "name desc" or "" (unsorted). # @@ -412,9 +427,9 @@ def get_instance request, options = nil # * Must start with a letter. # * Must be between 1-40 characters. # * Must end with a number or a letter. - # * Must be unique within the user project / location + # * Must be unique within the user project / location. # - # If any of the above are not met, will raise an invalid argument error. + # If any of the above are not met, the API raises an invalid argument error. # @param instance [::Google::Cloud::Memcache::V1::Instance, ::Hash] # Required. A Memcached Instance # @@ -510,6 +525,7 @@ def create_instance request, options = nil # # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Mask of fields to update. + # # * `displayName` # @param instance [::Google::Cloud::Memcache::V1::Instance, ::Hash] # Required. A Memcached Instance. @@ -588,9 +604,10 @@ def update_instance request, options = nil end ## - # Updates the defined Memcached Parameters for an existing Instance. + # Updates the defined Memcached parameters for an existing instance. # This method only stages the parameters, it must be followed by - # ApplyParameters to apply the parameters to nodes of the Memcached Instance. + # `ApplyParameters` to apply the parameters to nodes of the Memcached + # instance. # # @overload update_parameters(request, options = nil) # Pass arguments to `update_parameters` via a request object, either of type @@ -783,7 +800,7 @@ def delete_instance request, options = nil end ## - # ApplyParameters will restart the set of specified nodes in order to update + # `ApplyParameters` restarts the set of specified nodes in order to update # them to the current set of parameters for the Memcached Instance. # # @overload apply_parameters(request, options = nil) @@ -805,11 +822,11 @@ def delete_instance request, options = nil # Required. Resource name of the Memcached instance for which parameter group updates # should be applied. # @param node_ids [::Array<::String>] - # Nodes to which we should apply the instance-level parameter group. + # Nodes to which the instance-level parameter group is applied. # @param apply_all [::Boolean] # Whether to apply instance-level parameter group to all nodes. If set to - # true, will explicitly restrict users from specifying any nodes, and apply - # parameter group updates to all nodes within the instance. + # true, users are restricted from specifying individual nodes, and + # `ApplyParameters` updates all nodes within the instance. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] @@ -883,6 +900,107 @@ def apply_parameters request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Reschedules upcoming maintenance event. + # + # @overload reschedule_maintenance(request, options = nil) + # Pass arguments to `reschedule_maintenance` via a request object, either of type + # {::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reschedule_maintenance(instance: nil, reschedule_type: nil, schedule_time: nil) + # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param instance [::String] + # Required. Memcache instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @param reschedule_type [::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @param schedule_time [::Google::Protobuf::Timestamp, ::Hash] + # Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/memcache/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest.new + # + # # Call the reschedule_maintenance method. + # result = client.reschedule_maintenance request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def reschedule_maintenance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.reschedule_maintenance.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Memcache::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.instance + header_params["instance"] = request.instance + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reschedule_maintenance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @cloud_memcache_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the CloudMemcache API. # @@ -1053,6 +1171,11 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :apply_parameters + ## + # RPC-specific configuration for `reschedule_maintenance` + # @return [::Gapic::Config::Method] + # + attr_reader :reschedule_maintenance # @private def initialize parent_rpcs = nil @@ -1070,6 +1193,8 @@ def initialize parent_rpcs = nil @delete_instance = ::Gapic::Config::Method.new delete_instance_config apply_parameters_config = parent_rpcs.apply_parameters if parent_rpcs.respond_to? :apply_parameters @apply_parameters = ::Gapic::Config::Method.new apply_parameters_config + reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance + @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config yield self if block_given? end diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_pb.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_pb.rb index 601a16d7bd8a..7db270eb54b0 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_pb.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_pb.rb @@ -8,8 +8,11 @@ require 'google/api/field_behavior_pb' require 'google/api/resource_pb' require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' +require 'google/type/dayofweek_pb' +require 'google/type/timeofday_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/memcache/v1/cloud_memcache.proto", :syntax => :proto3) do @@ -30,6 +33,8 @@ optional :memcache_full_version, :string, 18 repeated :instance_messages, :message, 19, "google.cloud.memcache.v1.Instance.InstanceMessage" optional :discovery_endpoint, :string, 20 + optional :maintenance_policy, :message, 21, "google.cloud.memcache.v1.MaintenancePolicy" + optional :maintenance_schedule, :message, 22, "google.cloud.memcache.v1.MaintenanceSchedule" end add_message "google.cloud.memcache.v1.Instance.NodeConfig" do optional :cpu_count, :int32, 1 @@ -62,9 +67,37 @@ value :STATE_UNSPECIFIED, 0 value :CREATING, 1 value :READY, 2 + value :UPDATING, 3 value :DELETING, 4 value :PERFORMING_MAINTENANCE, 5 end + add_message "google.cloud.memcache.v1.MaintenancePolicy" do + optional :create_time, :message, 1, "google.protobuf.Timestamp" + optional :update_time, :message, 2, "google.protobuf.Timestamp" + optional :description, :string, 3 + repeated :weekly_maintenance_window, :message, 4, "google.cloud.memcache.v1.WeeklyMaintenanceWindow" + end + add_message "google.cloud.memcache.v1.WeeklyMaintenanceWindow" do + optional :day, :enum, 1, "google.type.DayOfWeek" + optional :start_time, :message, 2, "google.type.TimeOfDay" + optional :duration, :message, 3, "google.protobuf.Duration" + end + add_message "google.cloud.memcache.v1.MaintenanceSchedule" do + optional :start_time, :message, 1, "google.protobuf.Timestamp" + optional :end_time, :message, 2, "google.protobuf.Timestamp" + optional :schedule_deadline_time, :message, 4, "google.protobuf.Timestamp" + end + add_message "google.cloud.memcache.v1.RescheduleMaintenanceRequest" do + optional :instance, :string, 1 + optional :reschedule_type, :enum, 2, "google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType" + optional :schedule_time, :message, 3, "google.protobuf.Timestamp" + end + add_enum "google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType" do + value :RESCHEDULE_TYPE_UNSPECIFIED, 0 + value :IMMEDIATE, 1 + value :NEXT_AVAILABLE_WINDOW, 2 + value :SPECIFIC_TIME, 3 + end add_message "google.cloud.memcache.v1.ListInstancesRequest" do optional :parent, :string, 1 optional :page_size, :int32, 2 @@ -115,6 +148,11 @@ optional :cancel_requested, :bool, 6 optional :api_version, :string, 7 end + add_message "google.cloud.memcache.v1.LocationMetadata" do + map :available_zones, :string, :message, 1, "google.cloud.memcache.v1.ZoneMetadata" + end + add_message "google.cloud.memcache.v1.ZoneMetadata" do + end add_enum "google.cloud.memcache.v1.MemcacheVersion" do value :MEMCACHE_VERSION_UNSPECIFIED, 0 value :MEMCACHE_1_5, 1 @@ -133,6 +171,11 @@ module V1 Instance::InstanceMessage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.Instance.InstanceMessage").msgclass Instance::InstanceMessage::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.Instance.InstanceMessage.Code").enummodule Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.Instance.State").enummodule + MaintenancePolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.MaintenancePolicy").msgclass + WeeklyMaintenanceWindow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.WeeklyMaintenanceWindow").msgclass + MaintenanceSchedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.MaintenanceSchedule").msgclass + RescheduleMaintenanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.RescheduleMaintenanceRequest").msgclass + RescheduleMaintenanceRequest::RescheduleType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.RescheduleMaintenanceRequest.RescheduleType").enummodule ListInstancesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.ListInstancesRequest").msgclass ListInstancesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.ListInstancesResponse").msgclass GetInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.GetInstanceRequest").msgclass @@ -143,6 +186,8 @@ module V1 UpdateParametersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.UpdateParametersRequest").msgclass MemcacheParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.MemcacheParameters").msgclass OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.OperationMetadata").msgclass + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.LocationMetadata").msgclass + ZoneMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.ZoneMetadata").msgclass MemcacheVersion = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.memcache.v1.MemcacheVersion").enummodule end end diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_services_pb.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_services_pb.rb index 215786cc0bb9..18ec826c223b 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_services_pb.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/cloud_memcache_services_pb.rb @@ -55,15 +55,18 @@ class Service rpc :CreateInstance, ::Google::Cloud::Memcache::V1::CreateInstanceRequest, ::Google::Longrunning::Operation # Updates an existing Instance in a given project and location. rpc :UpdateInstance, ::Google::Cloud::Memcache::V1::UpdateInstanceRequest, ::Google::Longrunning::Operation - # Updates the defined Memcached Parameters for an existing Instance. + # Updates the defined Memcached parameters for an existing instance. # This method only stages the parameters, it must be followed by - # ApplyParameters to apply the parameters to nodes of the Memcached Instance. + # `ApplyParameters` to apply the parameters to nodes of the Memcached + # instance. rpc :UpdateParameters, ::Google::Cloud::Memcache::V1::UpdateParametersRequest, ::Google::Longrunning::Operation # Deletes a single Instance. rpc :DeleteInstance, ::Google::Cloud::Memcache::V1::DeleteInstanceRequest, ::Google::Longrunning::Operation - # ApplyParameters will restart the set of specified nodes in order to update + # `ApplyParameters` restarts the set of specified nodes in order to update # them to the current set of parameters for the Memcached Instance. rpc :ApplyParameters, ::Google::Cloud::Memcache::V1::ApplyParametersRequest, ::Google::Longrunning::Operation + # Reschedules upcoming maintenance event. + rpc :RescheduleMaintenance, ::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest, ::Google::Longrunning::Operation end Stub = Service.rpc_stub_class diff --git a/google-cloud-memcache-v1/proto_docs/google/cloud/memcache/v1/cloud_memcache.rb b/google-cloud-memcache-v1/proto_docs/google/cloud/memcache/v1/cloud_memcache.rb index a4b518f59347..4847cafb2fc6 100644 --- a/google-cloud-memcache-v1/proto_docs/google/cloud/memcache/v1/cloud_memcache.rb +++ b/google-cloud-memcache-v1/proto_docs/google/cloud/memcache/v1/cloud_memcache.rb @@ -21,19 +21,20 @@ module Google module Cloud module Memcache module V1 + # A Memorystore for Memcached instance # @!attribute [rw] name # @return [::String] # Required. Unique name of the resource in this scope including project and # location using the form: # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` # - # Note: Memcached instances are managed and addressed at regional level so - # location_id here refers to a GCP region; however, users may choose which - # zones Memcached nodes within an instances should be provisioned in. - # Refer to [zones] field for more details. + # Note: Memcached instances are managed and addressed at the regional level + # so `location_id` here refers to a Google Cloud region; however, users may + # choose which zones Memcached nodes should be provisioned in within an + # instance. Refer to {::Google::Cloud::Memcache::V1::Instance#zones zones} field for more details. # @!attribute [rw] display_name # @return [::String] - # User provided name for the instance only used for display + # User provided name for the instance, which is only used for display # purposes. Cannot be more than 80 characters. # @!attribute [rw] labels # @return [::Google::Protobuf::Map{::String => ::String}] @@ -48,7 +49,7 @@ module V1 # will be used. # @!attribute [rw] zones # @return [::Array<::String>] - # Zones where Memcached nodes should be provisioned in. + # Zones in which Memcached nodes should be provisioned. # Memcached nodes will be equally distributed across these zones. If not # provided, the service will by default create nodes in all zones in the # region for the instance. @@ -62,17 +63,17 @@ module V1 # @return [::Google::Cloud::Memcache::V1::MemcacheVersion] # The major version of Memcached software. # If not provided, latest supported version will be used. Currently the - # latest supported major version is MEMCACHE_1_5. + # latest supported major version is `MEMCACHE_1_5`. # The minor version will be automatically determined by our system based on # the latest supported minor version. # @!attribute [rw] parameters # @return [::Google::Cloud::Memcache::V1::MemcacheParameters] - # Optional: User defined parameters to apply to the memcached process + # User defined parameters to apply to the memcached process # on each node. # @!attribute [r] memcache_nodes # @return [::Array<::Google::Cloud::Memcache::V1::Instance::Node>] # Output only. List of Memcached nodes. - # Refer to [Node] message for more details. + # Refer to {::Google::Cloud::Memcache::V1::Instance::Node Node} message for more details. # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. The time the instance was created. @@ -90,10 +91,18 @@ module V1 # The full version format will be "memcached-1.5.16". # @!attribute [rw] instance_messages # @return [::Array<::Google::Cloud::Memcache::V1::Instance::InstanceMessage>] - # List of messages that describe current statuses of memcached instance. + # List of messages that describe the current state of the Memcached instance. # @!attribute [r] discovery_endpoint # @return [::String] - # Output only. Endpoint for Discovery API + # Output only. Endpoint for the Discovery API. + # @!attribute [rw] maintenance_policy + # @return [::Google::Cloud::Memcache::V1::MaintenancePolicy] + # The maintenance policy for the instance. If not provided, + # the maintenance event will be performed based on Memorystore + # internal rollout schedule. + # @!attribute [r] maintenance_schedule + # @return [::Google::Cloud::Memcache::V1::MaintenanceSchedule] + # Output only. Published maintenance schedule. class Instance include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -192,6 +201,10 @@ module State # Memcached instance has been created and ready to be used. READY = 2 + # Memcached instance is updating configuration such as maintenance policy + # and schedule. + UPDATING = 3 + # Memcached instance is being deleted. DELETING = 4 @@ -200,6 +213,93 @@ module State end end + # Maintenance policy per instance. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the policy was updated. + # @!attribute [rw] description + # @return [::String] + # Description of what this policy is for. Create/Update methods + # return INVALID_ARGUMENT if the length is greater than 512. + # @!attribute [rw] weekly_maintenance_window + # @return [::Array<::Google::Cloud::Memcache::V1::WeeklyMaintenanceWindow>] + # Required. Maintenance window that is applied to resources covered by this + # policy. Minimum 1. For the current version, the maximum number of + # weekly_maintenance_windows is expected to be one. + class MaintenancePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Time window specified for weekly operations. + # @!attribute [rw] day + # @return [::Google::Type::DayOfWeek] + # Required. Allows to define schedule that runs specified day of the week. + # @!attribute [rw] start_time + # @return [::Google::Type::TimeOfDay] + # Required. Start time of the window in UTC. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Required. Duration of the time window. + class WeeklyMaintenanceWindow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Upcoming maintenance schedule. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The start time of any upcoming scheduled maintenance for this instance. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The end time of any upcoming scheduled maintenance for this instance. + # @!attribute [r] schedule_deadline_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The deadline that the maintenance schedule start time can not go beyond, + # including reschedule. + class MaintenanceSchedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for {::Google::Cloud::Memcache::V1::CloudMemcache::Client#reschedule_maintenance RescheduleMaintenance}. + # @!attribute [rw] instance + # @return [::String] + # Required. Memcache instance resource name using the form: + # `projects/{project_id}/locations/{location_id}/instances/{instance_id}` + # where `location_id` refers to a GCP region. + # @!attribute [rw] reschedule_type + # @return [::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest::RescheduleType] + # Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the maintenance shall be rescheduled to if + # reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for + # example `2012-11-15T16:19:00.094Z`. + class RescheduleMaintenanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Reschedule options. + module RescheduleType + # Not set. + RESCHEDULE_TYPE_UNSPECIFIED = 0 + + # If the user wants to schedule the maintenance to happen now. + IMMEDIATE = 1 + + # If the user wants to use the existing maintenance policy to find the + # next available window. + NEXT_AVAILABLE_WINDOW = 2 + + # If the user wants to reschedule the maintenance to a specific time. + SPECIFIC_TIME = 3 + end + end + # Request for {::Google::Cloud::Memcache::V1::CloudMemcache::Client#list_instances ListInstances}. # @!attribute [rw] parent # @return [::String] @@ -211,18 +311,17 @@ module State # The maximum number of items to return. # # If not specified, a default value of 1000 will be used by the service. - # Regardless of the page_size value, the response may include a partial list - # and a caller should only rely on response's - # [next_page_token][CloudMemcache.ListInstancesResponse.next_page_token] + # Regardless of the `page_size` value, the response may include a partial + # list and a caller should only rely on response's + # {::Google::Cloud::Memcache::V1::ListInstancesResponse#next_page_token `next_page_token`} # to determine if there are more instances left to be queried. # @!attribute [rw] page_token # @return [::String] - # The next_page_token value returned from a previous List request, - # if any. + # The `next_page_token` value returned from a previous List request, if any. # @!attribute [rw] filter # @return [::String] # List filter. For example, exclude all Memcached instances with name as - # my-instance by specifying "name != my-instance". + # my-instance by specifying `"name != my-instance"`. # @!attribute [rw] order_by # @return [::String] # Sort results. Supported values are "name", "name desc" or "" (unsorted). @@ -277,9 +376,9 @@ class GetInstanceRequest # * Must start with a letter. # * Must be between 1-40 characters. # * Must end with a number or a letter. - # * Must be unique within the user project / location + # * Must be unique within the user project / location. # - # If any of the above are not met, will raise an invalid argument error. + # If any of the above are not met, the API raises an invalid argument error. # @!attribute [rw] instance # @return [::Google::Cloud::Memcache::V1::Instance] # Required. A Memcached Instance @@ -292,6 +391,7 @@ class CreateInstanceRequest # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # Required. Mask of fields to update. + # # * `displayName` # @!attribute [rw] instance # @return [::Google::Cloud::Memcache::V1::Instance] @@ -320,12 +420,12 @@ class DeleteInstanceRequest # should be applied. # @!attribute [rw] node_ids # @return [::Array<::String>] - # Nodes to which we should apply the instance-level parameter group. + # Nodes to which the instance-level parameter group is applied. # @!attribute [rw] apply_all # @return [::Boolean] # Whether to apply instance-level parameter group to all nodes. If set to - # true, will explicitly restrict users from specifying any nodes, and apply - # parameter group updates to all nodes within the instance. + # true, users are restricted from specifying individual nodes, and + # `ApplyParameters` updates all nodes within the instance. class ApplyParametersRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -351,8 +451,9 @@ class UpdateParametersRequest # @return [::String] # Output only. The unique ID associated with this set of parameters. Users # can use this id to determine if the parameters associated with the instance - # differ from the parameters associated with the nodes and any action needs - # to be taken to apply parameters on nodes. + # differ from the parameters associated with the nodes. A discrepancy between + # parameter ids can inform users that they may need to take action to apply + # parameters on nodes. # @!attribute [rw] params # @return [::Google::Protobuf::Map{::String => ::String}] # User defined set of parameters to use in the memcached process. @@ -400,6 +501,31 @@ class OperationMetadata extend ::Google::Protobuf::MessageExts::ClassMethods end + # Metadata for the given `::Google::Cloud::Location::Location`. + # @!attribute [r] available_zones + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Memcache::V1::ZoneMetadata}] + # Output only. The set of available zones in the location. The map is keyed + # by the lowercase ID of each zone, as defined by GCE. These keys can be + # specified in the `zones` field when creating a Memcached instance. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::Memcache::V1::ZoneMetadata] + class AvailableZonesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + class ZoneMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Memcached versions supported by our service. module MemcacheVersion MEMCACHE_VERSION_UNSPECIFIED = 0 diff --git a/google-cloud-memcache-v1/proto_docs/google/type/dayofweek.rb b/google-cloud-memcache-v1/proto_docs/google/type/dayofweek.rb new file mode 100644 index 000000000000..be6bffe93767 --- /dev/null +++ b/google-cloud-memcache-v1/proto_docs/google/type/dayofweek.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a day of the week. + module DayOfWeek + # The day of the week is unspecified. + DAY_OF_WEEK_UNSPECIFIED = 0 + + # Monday + MONDAY = 1 + + # Tuesday + TUESDAY = 2 + + # Wednesday + WEDNESDAY = 3 + + # Thursday + THURSDAY = 4 + + # Friday + FRIDAY = 5 + + # Saturday + SATURDAY = 6 + + # Sunday + SUNDAY = 7 + end + end +end diff --git a/google-cloud-memcache-v1/proto_docs/google/type/timeofday.rb b/google-cloud-memcache-v1/proto_docs/google/type/timeofday.rb new file mode 100644 index 000000000000..0c458cd78f61 --- /dev/null +++ b/google-cloud-memcache-v1/proto_docs/google/type/timeofday.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a time of day. The date and time zone are either not significant + # or are specified elsewhere. An API may choose to allow leap seconds. Related + # types are [google.type.Date][google.type.Date] and + # `google.protobuf.Timestamp`. + # @!attribute [rw] hours + # @return [::Integer] + # Hours of day in 24 hour format. Should be from 0 to 23. An API may choose + # to allow the value "24:00:00" for scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Minutes of hour of day. Must be from 0 to 59. + # @!attribute [rw] seconds + # @return [::Integer] + # Seconds of minutes of the time. Must normally be from 0 to 59. An API may + # allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. + class TimeOfDay + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-memcache-v1/snippets/cloud_memcache/reschedule_maintenance.rb b/google-cloud-memcache-v1/snippets/cloud_memcache/reschedule_maintenance.rb new file mode 100644 index 000000000000..f584f3d0a010 --- /dev/null +++ b/google-cloud-memcache-v1/snippets/cloud_memcache/reschedule_maintenance.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START memcache_v1_generated_CloudMemcache_RescheduleMaintenance_sync] +require "google/cloud/memcache/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Memcache::V1::CloudMemcache::Client#reschedule_maintenance +# +def reschedule_maintenance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Memcache::V1::CloudMemcache::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest.new + + # Call the reschedule_maintenance method. + result = client.reschedule_maintenance request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END memcache_v1_generated_CloudMemcache_RescheduleMaintenance_sync] diff --git a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json index 3f5b653c99bc..a62874790e45 100644 --- a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json +++ b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json @@ -290,6 +290,46 @@ "type": "FULL" } ] + }, + { + "region_tag": "memcache_v1_generated_CloudMemcache_RescheduleMaintenance_sync", + "title": "Snippet for reschedule_maintenance in CloudMemcache", + "description": "Basic snippet for reschedule_maintenance in CloudMemcache", + "file": "cloud_memcache/reschedule_maintenance.rb", + "language": "RUBY", + "client_method": { + "short_name": "reschedule_maintenance", + "full_name": "::Google::Cloud::Memcache::V1::CloudMemcache::Client#reschedule_maintenance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "CloudMemcache::Client", + "full_name": "::Google::Cloud::Memcache::V1::CloudMemcache::Client" + }, + "method": { + "short_name": "RescheduleMaintenance", + "full_name": "google.cloud.memcache.v1.CloudMemcache.RescheduleMaintenance", + "service": { + "short_name": "CloudMemcache", + "full_name": "google.cloud.memcache.v1.CloudMemcache" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] } ] } \ No newline at end of file diff --git a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb index 872e5ccb93df..fd5e7217fc22 100644 --- a/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb +++ b/google-cloud-memcache-v1/test/google/cloud/memcache/v1/cloud_memcache_test.rb @@ -505,6 +505,73 @@ def test_apply_parameters end end + def test_reschedule_maintenance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + instance = "hello world" + reschedule_type = :RESCHEDULE_TYPE_UNSPECIFIED + schedule_time = {} + + reschedule_maintenance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reschedule_maintenance, name + assert_kind_of ::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest, request + assert_equal "hello world", request["instance"] + assert_equal :RESCHEDULE_TYPE_UNSPECIFIED, request["reschedule_type"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["schedule_time"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reschedule_maintenance_client_stub do + # Create client + client = ::Google::Cloud::Memcache::V1::CloudMemcache::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reschedule_maintenance({ instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.reschedule_maintenance instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.reschedule_maintenance ::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest.new(instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.reschedule_maintenance({ instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.reschedule_maintenance(::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest.new(instance: instance, reschedule_type: reschedule_type, schedule_time: schedule_time), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, reschedule_maintenance_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure From b9bc1de459c08b6b1dae851563a93a5c341d730c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:27:53 +0530 Subject: [PATCH 095/112] feat(notebooks): support nic_type, reservation_affinity, can_ip_forward for Instance --- .../.owlbot-manifest.json | 2 + .../google-cloud-notebooks-v1beta1.gemspec | 2 + .../cloud/notebooks/v1beta1/instance_pb.rb | 24 ++ .../v1beta1/notebook_service/client.rb | 53 +++- .../cloud/notebooks/v1beta1/service_pb.rb | 3 +- .../notebooks/v1beta1/service_services_pb.rb | 3 + .../cloud/notebooks/v1beta1/instance.rb | 117 ++++++--- .../google/cloud/notebooks/v1beta1/service.rb | 24 +- .../proto_docs/google/protobuf/field_mask.rb | 229 ++++++++++++++++++ .../proto_docs/google/type/expr.rb | 75 ++++++ 10 files changed, 484 insertions(+), 48 deletions(-) create mode 100644 google-cloud-notebooks-v1beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 google-cloud-notebooks-v1beta1/proto_docs/google/type/expr.rb diff --git a/google-cloud-notebooks-v1beta1/.owlbot-manifest.json b/google-cloud-notebooks-v1beta1/.owlbot-manifest.json index 88176aaca8f0..d2ff1a16eeb3 100644 --- a/google-cloud-notebooks-v1beta1/.owlbot-manifest.json +++ b/google-cloud-notebooks-v1beta1/.owlbot-manifest.json @@ -36,8 +36,10 @@ "proto_docs/google/protobuf/any.rb", "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", + "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/expr.rb", "snippets/Gemfile", "snippets/notebook_service/create_environment.rb", "snippets/notebook_service/create_instance.rb", diff --git a/google-cloud-notebooks-v1beta1/google-cloud-notebooks-v1beta1.gemspec b/google-cloud-notebooks-v1beta1/google-cloud-notebooks-v1beta1.gemspec index 6f51fbc17ad7..4d6b194941e3 100644 --- a/google-cloud-notebooks-v1beta1/google-cloud-notebooks-v1beta1.gemspec +++ b/google-cloud-notebooks-v1beta1/google-cloud-notebooks-v1beta1.gemspec @@ -25,6 +25,8 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" + gem.add_dependency "google-iam-v1", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/instance_pb.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/instance_pb.rb index 14fb7f6aede4..d01ed32d5f38 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/instance_pb.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/instance_pb.rb @@ -10,6 +10,17 @@ Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/notebooks/v1beta1/instance.proto", :syntax => :proto3) do + add_message "google.cloud.notebooks.v1beta1.ReservationAffinity" do + optional :consume_reservation_type, :enum, 1, "google.cloud.notebooks.v1beta1.ReservationAffinity.Type" + optional :key, :string, 2 + repeated :values, :string, 3 + end + add_enum "google.cloud.notebooks.v1beta1.ReservationAffinity.Type" do + value :TYPE_UNSPECIFIED, 0 + value :NO_RESERVATION, 1 + value :ANY_RESERVATION, 2 + value :SPECIFIC_RESERVATION, 3 + end add_message "google.cloud.notebooks.v1beta1.Instance" do optional :name, :string, 1 optional :post_startup_script, :string, 4 @@ -34,6 +45,9 @@ optional :subnet, :string, 20 map :labels, :string, :string, 21 map :metadata, :string, :string, 22 + optional :nic_type, :enum, 28, "google.cloud.notebooks.v1beta1.Instance.NicType" + optional :reservation_affinity, :message, 29, "google.cloud.notebooks.v1beta1.ReservationAffinity" + optional :can_ip_forward, :bool, 31 optional :create_time, :message, 23, "google.protobuf.Timestamp" optional :update_time, :message, 24, "google.protobuf.Timestamp" oneof :environment do @@ -69,6 +83,8 @@ value :UPGRADING, 7 value :INITIALIZING, 8 value :REGISTERING, 9 + value :SUSPENDING, 10 + value :SUSPENDED, 11 end add_enum "google.cloud.notebooks.v1beta1.Instance.DiskType" do value :DISK_TYPE_UNSPECIFIED, 0 @@ -81,6 +97,11 @@ value :GMEK, 1 value :CMEK, 2 end + add_enum "google.cloud.notebooks.v1beta1.Instance.NicType" do + value :UNSPECIFIED_NIC_TYPE, 0 + value :VIRTIO_NET, 1 + value :GVNIC, 2 + end end end @@ -88,12 +109,15 @@ module Google module Cloud module Notebooks module V1beta1 + ReservationAffinity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.ReservationAffinity").msgclass + ReservationAffinity::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.ReservationAffinity.Type").enummodule Instance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance").msgclass Instance::AcceleratorConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.AcceleratorConfig").msgclass Instance::AcceleratorType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.AcceleratorType").enummodule Instance::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.State").enummodule Instance::DiskType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.DiskType").enummodule Instance::DiskEncryption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.DiskEncryption").enummodule + Instance::NicType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1beta1.Instance.NicType").enummodule end end end diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb index 4e4ba46ab576..8768b6c7cc76 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/notebook_service/client.rb @@ -18,6 +18,8 @@ require "google/cloud/errors" require "google/cloud/notebooks/v1beta1/service_pb" +require "google/cloud/location" +require "google/iam/v1" module Google module Cloud @@ -182,6 +184,18 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1beta1::NotebookService::Stub, credentials: credentials, @@ -198,6 +212,20 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + # Service calls ## @@ -608,10 +636,10 @@ def register_instance request, options = nil # @param type [::Google::Cloud::Notebooks::V1beta1::Instance::AcceleratorType] # Required. Type of this accelerator. # @param core_count [::Integer] - # Required. Count of cores of this accelerator. Note that not all - # combinations of `type` and `core_count` are valid. Check [GPUs on Compute - # Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a - # valid combination. TPUs are not supported. + # Required. Count of cores of this accelerator. Note that not all combinations + # of `type` and `core_count` are valid. Check [GPUs on + # Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to + # find a valid combination. TPUs are not supported. # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Gapic::Operation] @@ -1360,6 +1388,9 @@ def report_instance_info request, options = nil ## # Check if a notebook instance is upgradable. + # Deprecated. Please consider using v1. + # + # @deprecated This method is deprecated and may be removed in the next major version update. # # @overload is_instance_upgradeable(request, options = nil) # Pass arguments to `is_instance_upgradeable` via a request object, either of type @@ -1446,6 +1477,9 @@ def is_instance_upgradeable request, options = nil ## # Upgrades a notebook instance to the latest version. + # Deprecated. Please consider using v1. + # + # @deprecated This method is deprecated and may be removed in the next major version update. # # @overload upgrade_instance(request, options = nil) # Pass arguments to `upgrade_instance` via a request object, either of type @@ -1541,6 +1575,9 @@ def upgrade_instance request, options = nil ## # Allows notebook instances to # call this endpoint to upgrade themselves. Do not use this method directly. + # Deprecated. Please consider using v1. + # + # @deprecated This method is deprecated and may be removed in the next major version update. # # @overload upgrade_instance_internal(request, options = nil) # Pass arguments to `upgrade_instance_internal` via a request object, either of type @@ -1840,10 +1877,10 @@ def get_environment request, options = nil # @param parent [::String] # Required. Format: `projects/{project_id}/locations/{location}` # @param environment_id [::String] - # Required. User-defined unique ID of this environment. The `environment_id` - # must be 1 to 63 characters long and contain only lowercase letters, numeric - # characters, and dashes. The first character must be a lowercase letter and - # the last character cannot be a dash. + # Required. User-defined unique ID of this environment. The `environment_id` must + # be 1 to 63 characters long and contain only lowercase letters, + # numeric characters, and dashes. The first character must be a lowercase + # letter and the last character cannot be a dash. # @param environment [::Google::Cloud::Notebooks::V1beta1::Environment, ::Hash] # Required. The environment to be created. # diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_pb.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_pb.rb index ee3b5d0450b1..45b7eaa2929b 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_pb.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_pb.rb @@ -4,12 +4,12 @@ require 'google/protobuf' require 'google/api/annotations_pb' +require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/cloud/notebooks/v1beta1/environment_pb' require 'google/cloud/notebooks/v1beta1/instance_pb' require 'google/longrunning/operations_pb' require 'google/protobuf/timestamp_pb' -require 'google/api/client_pb' Google::Protobuf::DescriptorPool.generated_pool.build do add_file("google/cloud/notebooks/v1beta1/service.proto", :syntax => :proto3) do @@ -82,6 +82,7 @@ optional :upgradeable, :bool, 1 optional :upgrade_version, :string, 2 optional :upgrade_info, :string, 3 + optional :upgrade_image, :string, 4 end add_message "google.cloud.notebooks.v1beta1.UpgradeInstanceRequest" do optional :name, :string, 1 diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_services_pb.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_services_pb.rb index 495921e31cf6..8fc9ca2e063c 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_services_pb.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/service_services_pb.rb @@ -64,11 +64,14 @@ class Service # the instance metadata store. Do not use this method directly. rpc :ReportInstanceInfo, ::Google::Cloud::Notebooks::V1beta1::ReportInstanceInfoRequest, ::Google::Longrunning::Operation # Check if a notebook instance is upgradable. + # Deprecated. Please consider using v1. rpc :IsInstanceUpgradeable, ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableRequest, ::Google::Cloud::Notebooks::V1beta1::IsInstanceUpgradeableResponse # Upgrades a notebook instance to the latest version. + # Deprecated. Please consider using v1. rpc :UpgradeInstance, ::Google::Cloud::Notebooks::V1beta1::UpgradeInstanceRequest, ::Google::Longrunning::Operation # Allows notebook instances to # call this endpoint to upgrade themselves. Do not use this method directly. + # Deprecated. Please consider using v1. rpc :UpgradeInstanceInternal, ::Google::Cloud::Notebooks::V1beta1::UpgradeInstanceInternalRequest, ::Google::Longrunning::Operation # Lists environments in a project. rpc :ListEnvironments, ::Google::Cloud::Notebooks::V1beta1::ListEnvironmentsRequest, ::Google::Cloud::Notebooks::V1beta1::ListEnvironmentsResponse diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/instance.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/instance.rb index da435e256f4c..b9e8fc57a2c8 100644 --- a/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/instance.rb +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/instance.rb @@ -21,6 +21,37 @@ module Google module Cloud module Notebooks module V1beta1 + # Reservation Affinity for consuming Zonal reservation. + # @!attribute [rw] consume_reservation_type + # @return [::Google::Cloud::Notebooks::V1beta1::ReservationAffinity::Type] + # Optional. Type of reservation to consume + # @!attribute [rw] key + # @return [::String] + # Optional. Corresponds to the label key of reservation resource. + # @!attribute [rw] values + # @return [::Array<::String>] + # Optional. Corresponds to the label values of reservation resource. + class ReservationAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Indicates whether to consume capacity from an reservation or not. + module Type + # Default type. + TYPE_UNSPECIFIED = 0 + + # Do not consume from any allocated capacity. + NO_RESERVATION = 1 + + # Consume any reservation available. + ANY_RESERVATION = 2 + + # Must consume from a specific reservation. Must specify key value fields + # for specifying the reservations. + SPECIFIC_RESERVATION = 3 + end + end + # The definition of a notebook instance. # @!attribute [r] name # @return [::String] @@ -36,15 +67,13 @@ module V1beta1 # @return [::String] # Path to a Bash script that automatically runs after a notebook instance # fully boots up. The path must be a URL or - # Cloud Storage path (`gs://path-to-file/file-name`). + # Cloud Storage path (gs://path-to-file/file-name). # @!attribute [r] proxy_uri # @return [::String] - # Output only. The proxy endpoint that is used to access the Jupyter - # notebook. + # Output only. The proxy endpoint that is used to access the Jupyter notebook. # @!attribute [rw] instance_owners # @return [::Array<::String>] - # Input only. The owner of this instance after creation. Format: - # `alias@example.com` + # Input only. The owner of this instance after creation. Format: `alias@example.com` # # Currently supports one owner only. If not specified, all of the service # account users of your VM instance's service account can use @@ -61,15 +90,14 @@ module V1beta1 # is used. # @!attribute [rw] machine_type # @return [::String] - # Required. The [Compute Engine machine - # type](https://cloud.google.com/compute/docs/machine-types) of this + # Required. The [Compute Engine machine type](/compute/docs/machine-types) of this # instance. # @!attribute [rw] accelerator_config # @return [::Google::Cloud::Notebooks::V1beta1::Instance::AcceleratorConfig] # The hardware accelerator used on this instance. If you use # accelerators, make sure that your configuration has # [enough vCPUs and memory to support the `machine_type` you - # have selected](https://cloud.google.com/compute/docs/gpus/#gpus-list). + # have selected](/compute/docs/gpus/#gpus-list). # @!attribute [r] state # @return [::Google::Cloud::Notebooks::V1beta1::Instance::State] # Output only. The state of this instance. @@ -85,39 +113,37 @@ module V1beta1 # If not specified, we'll automatically choose from official GPU drivers. # @!attribute [rw] boot_disk_type # @return [::Google::Cloud::Notebooks::V1beta1::Instance::DiskType] - # Input only. The type of the boot disk attached to this instance, defaults - # to standard persistent disk (`PD_STANDARD`). + # Input only. The type of the boot disk attached to this instance, defaults to + # standard persistent disk (`PD_STANDARD`). # @!attribute [rw] boot_disk_size_gb # @return [::Integer] - # Input only. The size of the boot disk in GB attached to this instance, up - # to a maximum of 64000 GB (64 TB). The minimum recommended value - # is 100 GB. If not specified, this defaults to 100. + # Input only. The size of the boot disk in GB attached to this instance, up to a maximum + # of 64000 GB (64 TB). The minimum recommended value is + # 100 GB. If not specified, this defaults to 100. # @!attribute [rw] data_disk_type # @return [::Google::Cloud::Notebooks::V1beta1::Instance::DiskType] - # Input only. The type of the data disk attached to this instance, defaults - # to standard persistent disk (`PD_STANDARD`). + # Input only. The type of the data disk attached to this instance, defaults to + # standard persistent disk (`PD_STANDARD`). # @!attribute [rw] data_disk_size_gb # @return [::Integer] - # Input only. The size of the data disk in GB attached to this instance, up - # to a maximum of 64000 GB (64 TB). You can choose the size of the - # data disk based on how big your notebooks and data are. If not specified, - # this defaults to 100. + # Input only. The size of the data disk in GB attached to this instance, up to a maximum + # of 64000 GB (64 TB). You can choose the size of the data disk + # based on how big your notebooks and data are. If not specified, this + # defaults to 100. # @!attribute [rw] no_remove_data_disk # @return [::Boolean] - # Input only. If true, the data disk will not be auto deleted when deleting - # the instance. + # Input only. If true, the data disk will not be auto deleted when deleting the instance. # @!attribute [rw] disk_encryption # @return [::Google::Cloud::Notebooks::V1beta1::Instance::DiskEncryption] - # Input only. Disk encryption method used on the boot and data disks, - # defaults to GMEK. + # Input only. Disk encryption method used on the boot and data disks, defaults to GMEK. # @!attribute [rw] kms_key # @return [::String] - # Input only. The KMS key used to encrypt the disks, only applicable if - # disk_encryption is CMEK. Format: + # Input only. The KMS key used to encrypt the disks, only applicable if disk_encryption + # is CMEK. + # Format: # `projects/{project_id}/locations/{location}/keyRings/{key_ring_id}/cryptoKeys/{key_id}` # - # Learn more about [using your own encryption keys]( - # https://cloud.google.com/kms/docs/quickstart). + # Learn more about [using your own encryption keys](/kms/docs/quickstart). # @!attribute [rw] no_public_ip # @return [::Boolean] # If true, no public IP will be assigned to this instance. @@ -141,6 +167,20 @@ module V1beta1 # @!attribute [rw] metadata # @return [::Google::Protobuf::Map{::String => ::String}] # Custom metadata to apply to this instance. + # @!attribute [rw] nic_type + # @return [::Google::Cloud::Notebooks::V1beta1::Instance::NicType] + # Optional. The type of vNIC to be used on this interface. This may be gVNIC or + # VirtioNet. + # @!attribute [rw] reservation_affinity + # @return [::Google::Cloud::Notebooks::V1beta1::ReservationAffinity] + # Optional. The optional reservation affinity. Setting this field will apply + # the specified [Zonal Compute + # Reservation](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources) + # to this notebook instance. + # @!attribute [rw] can_ip_forward + # @return [::Boolean] + # Optional. Flag to enable ip forwarding or not, default false/off. + # https://cloud.google.com/vpc/docs/using-routes#canipforward # @!attribute [r] create_time # @return [::Google::Protobuf::Timestamp] # Output only. Instance creation time. @@ -199,7 +239,7 @@ module AcceleratorType # Accelerator type is Nvidia Tesla V100. NVIDIA_TESLA_V100 = 3 - # Accelerator type is Nvidia Tesla P_4. + # Accelerator type is Nvidia Tesla P4. NVIDIA_TESLA_P4 = 4 # Accelerator type is Nvidia Tesla T4. @@ -211,7 +251,7 @@ module AcceleratorType # Accelerator type is NVIDIA Tesla P100 Virtual Workstations. NVIDIA_TESLA_P100_VWS = 9 - # Accelerator type is NVIDIA Tesla P_4 Virtual Workstations. + # Accelerator type is NVIDIA Tesla P4 Virtual Workstations. NVIDIA_TESLA_P4_VWS = 10 # (Coming soon) Accelerator type is TPU V2. @@ -253,6 +293,12 @@ module State # The instance is getting registered. REGISTERING = 9 + + # The instance is suspending. + SUSPENDING = 10 + + # The instance is suspended. + SUSPENDED = 11 end # Possible disk types for notebook instances. @@ -281,6 +327,19 @@ module DiskEncryption # Use customer managed encryption keys to encrypt the boot disk. CMEK = 2 end + + # The type of vNIC driver. + module NicType + # No type specified. Default should be UNSPECIFIED_NIC_TYPE. + UNSPECIFIED_NIC_TYPE = 0 + + # VIRTIO. Default in Notebooks DLVM. + VIRTIO_NET = 1 + + # GVNIC. Alternative to VIRTIO. + # https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux + GVNIC = 2 + end end end end diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/service.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/service.rb index d8aac893899c..228a576c6c76 100644 --- a/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/service.rb +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/cloud/notebooks/v1beta1/service.rb @@ -42,8 +42,7 @@ module V1beta1 # Identifies whether the user has requested cancellation # of the operation. Operations that have successfully been cancelled # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to `Code.CANCELLED`. # @!attribute [rw] api_version # @return [::String] # API version used to start the operation. @@ -142,10 +141,10 @@ class RegisterInstanceRequest # Required. Type of this accelerator. # @!attribute [rw] core_count # @return [::Integer] - # Required. Count of cores of this accelerator. Note that not all - # combinations of `type` and `core_count` are valid. Check [GPUs on Compute - # Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to find a - # valid combination. TPUs are not supported. + # Required. Count of cores of this accelerator. Note that not all combinations + # of `type` and `core_count` are valid. Check [GPUs on + # Compute Engine](https://cloud.google.com/compute/docs/gpus/#gpus-list) to + # find a valid combination. TPUs are not supported. class SetInstanceAcceleratorRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -276,6 +275,11 @@ class IsInstanceUpgradeableRequest # @!attribute [rw] upgrade_info # @return [::String] # Additional information about upgrade. + # @!attribute [rw] upgrade_image + # @return [::String] + # The new image self link this instance will be upgraded to if calling the + # upgrade endpoint. This field will only be populated if field upgradeable + # is true. class IsInstanceUpgradeableResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -353,10 +357,10 @@ class GetEnvironmentRequest # Required. Format: `projects/{project_id}/locations/{location}` # @!attribute [rw] environment_id # @return [::String] - # Required. User-defined unique ID of this environment. The `environment_id` - # must be 1 to 63 characters long and contain only lowercase letters, numeric - # characters, and dashes. The first character must be a lowercase letter and - # the last character cannot be a dash. + # Required. User-defined unique ID of this environment. The `environment_id` must + # be 1 to 63 characters long and contain only lowercase letters, + # numeric characters, and dashes. The first character must be a lowercase + # letter and the last character cannot be a dash. # @!attribute [rw] environment # @return [::Google::Cloud::Notebooks::V1beta1::Environment] # Required. The environment to be created. diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/protobuf/field_mask.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..5f816f4a2702 --- /dev/null +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-notebooks-v1beta1/proto_docs/google/type/expr.rb b/google-cloud-notebooks-v1beta1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..0602180c6ada --- /dev/null +++ b/google-cloud-notebooks-v1beta1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end From dc739d2f84a854e623604c5866226f40f7b5ecff Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:50:08 +0530 Subject: [PATCH 096/112] feat(notebooks): Support UpdateRuntime, UpgradeRuntime, DiagnoseRuntime, DiagnoseInstance feat(notebooks): add Instance.reservation_affinity, nic_type, can_ip_forward feat(notebooks): add IsInstanceUpgradeableResponse.upgrade_image feat(notebooks): added Location and IAM methods --- .../.owlbot-manifest.json | 8 + google-cloud-notebooks-v1/gapic_metadata.json | 20 + .../google-cloud-notebooks-v1.gemspec | 2 + .../notebooks/v1/diagnostic_config_pb.rb | 28 ++ .../v1/managed_notebook_service/client.rb | 364 ++++++++++++++++++ .../v1/managed_notebook_service/paths.rb | 17 + .../cloud/notebooks/v1/managed_service_pb.rb | 18 + .../v1/managed_service_services_pb.rb | 6 + .../notebooks/v1/notebook_service/client.rb | 133 +++++++ .../google/cloud/notebooks/v1/runtime_pb.rb | 9 + .../google/cloud/notebooks/v1/service_pb.rb | 6 + .../cloud/notebooks/v1/service_services_pb.rb | 2 + .../cloud/notebooks/v1/diagnostic_config.rb | 62 +++ .../cloud/notebooks/v1/managed_service.rb | 65 ++++ .../google/cloud/notebooks/v1/runtime.rb | 26 +- .../google/cloud/notebooks/v1/service.rb | 13 + .../proto_docs/google/protobuf/field_mask.rb | 229 +++++++++++ .../proto_docs/google/type/expr.rb | 75 ++++ .../diagnose_runtime.rb | 46 +++ .../update_runtime.rb | 46 +++ .../upgrade_runtime.rb | 46 +++ .../notebook_service/diagnose_instance.rb | 46 +++ ...et_metadata_google.cloud.notebooks.v1.json | 160 ++++++++ .../v1/managed_notebook_service_paths_test.rb | 12 + .../v1/managed_notebook_service_test.rb | 197 ++++++++++ .../notebooks/v1/notebook_service_test.rb | 65 ++++ 26 files changed, 1699 insertions(+), 2 deletions(-) create mode 100644 google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb create mode 100644 google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb create mode 100644 google-cloud-notebooks-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 google-cloud-notebooks-v1/proto_docs/google/type/expr.rb create mode 100644 google-cloud-notebooks-v1/snippets/managed_notebook_service/diagnose_runtime.rb create mode 100644 google-cloud-notebooks-v1/snippets/managed_notebook_service/update_runtime.rb create mode 100644 google-cloud-notebooks-v1/snippets/managed_notebook_service/upgrade_runtime.rb create mode 100644 google-cloud-notebooks-v1/snippets/notebook_service/diagnose_instance.rb diff --git a/google-cloud-notebooks-v1/.owlbot-manifest.json b/google-cloud-notebooks-v1/.owlbot-manifest.json index 0b4fdfd89bbf..95905ce63800 100644 --- a/google-cloud-notebooks-v1/.owlbot-manifest.json +++ b/google-cloud-notebooks-v1/.owlbot-manifest.json @@ -14,6 +14,7 @@ "google-cloud-notebooks-v1.gemspec", "lib/google-cloud-notebooks-v1.rb", "lib/google/cloud/notebooks/v1.rb", + "lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb", "lib/google/cloud/notebooks/v1/environment_pb.rb", "lib/google/cloud/notebooks/v1/event_pb.rb", "lib/google/cloud/notebooks/v1/execution_pb.rb", @@ -41,6 +42,7 @@ "proto_docs/google/api/field_behavior.rb", "proto_docs/google/api/launch_stage.rb", "proto_docs/google/api/resource.rb", + "proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb", "proto_docs/google/cloud/notebooks/v1/environment.rb", "proto_docs/google/cloud/notebooks/v1/event.rb", "proto_docs/google/cloud/notebooks/v1/execution.rb", @@ -54,11 +56,14 @@ "proto_docs/google/protobuf/any.rb", "proto_docs/google/protobuf/duration.rb", "proto_docs/google/protobuf/empty.rb", + "proto_docs/google/protobuf/field_mask.rb", "proto_docs/google/protobuf/timestamp.rb", "proto_docs/google/rpc/status.rb", + "proto_docs/google/type/expr.rb", "snippets/Gemfile", "snippets/managed_notebook_service/create_runtime.rb", "snippets/managed_notebook_service/delete_runtime.rb", + "snippets/managed_notebook_service/diagnose_runtime.rb", "snippets/managed_notebook_service/get_runtime.rb", "snippets/managed_notebook_service/list_runtimes.rb", "snippets/managed_notebook_service/refresh_runtime_token_internal.rb", @@ -67,6 +72,8 @@ "snippets/managed_notebook_service/start_runtime.rb", "snippets/managed_notebook_service/stop_runtime.rb", "snippets/managed_notebook_service/switch_runtime.rb", + "snippets/managed_notebook_service/update_runtime.rb", + "snippets/managed_notebook_service/upgrade_runtime.rb", "snippets/notebook_service/create_environment.rb", "snippets/notebook_service/create_execution.rb", "snippets/notebook_service/create_instance.rb", @@ -75,6 +82,7 @@ "snippets/notebook_service/delete_execution.rb", "snippets/notebook_service/delete_instance.rb", "snippets/notebook_service/delete_schedule.rb", + "snippets/notebook_service/diagnose_instance.rb", "snippets/notebook_service/get_environment.rb", "snippets/notebook_service/get_execution.rb", "snippets/notebook_service/get_instance.rb", diff --git a/google-cloud-notebooks-v1/gapic_metadata.json b/google-cloud-notebooks-v1/gapic_metadata.json index a0b6d7ce9987..719f4c1cc86a 100644 --- a/google-cloud-notebooks-v1/gapic_metadata.json +++ b/google-cloud-notebooks-v1/gapic_metadata.json @@ -25,6 +25,11 @@ "create_runtime" ] }, + "UpdateRuntime": { + "methods": [ + "update_runtime" + ] + }, "DeleteRuntime": { "methods": [ "delete_runtime" @@ -50,6 +55,11 @@ "reset_runtime" ] }, + "UpgradeRuntime": { + "methods": [ + "upgrade_runtime" + ] + }, "ReportRuntimeEvent": { "methods": [ "report_runtime_event" @@ -59,6 +69,11 @@ "methods": [ "refresh_runtime_token_internal" ] + }, + "DiagnoseRuntime": { + "methods": [ + "diagnose_runtime" + ] } } } @@ -164,6 +179,11 @@ "rollback_instance" ] }, + "DiagnoseInstance": { + "methods": [ + "diagnose_instance" + ] + }, "UpgradeInstanceInternal": { "methods": [ "upgrade_instance_internal" diff --git a/google-cloud-notebooks-v1/google-cloud-notebooks-v1.gemspec b/google-cloud-notebooks-v1/google-cloud-notebooks-v1.gemspec index 78a8de8f8ec7..569641a17f5a 100644 --- a/google-cloud-notebooks-v1/google-cloud-notebooks-v1.gemspec +++ b/google-cloud-notebooks-v1/google-cloud-notebooks-v1.gemspec @@ -25,6 +25,8 @@ Gem::Specification.new do |gem| gem.add_dependency "gapic-common", ">= 0.12", "< 2.a" gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", ">= 0.0", "< 2.a" + gem.add_dependency "google-iam-v1", ">= 0.0", "< 2.a" gem.add_development_dependency "google-style", "~> 1.26.1" gem.add_development_dependency "minitest", "~> 5.16" diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb new file mode 100644 index 000000000000..d3dcdf6a259f --- /dev/null +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/diagnostic_config_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/notebooks/v1/diagnostic_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("google/cloud/notebooks/v1/diagnostic_config.proto", :syntax => :proto3) do + add_message "google.cloud.notebooks.v1.DiagnosticConfig" do + optional :gcs_bucket, :string, 1 + optional :relative_path, :string, 2 + optional :repair_flag_enabled, :bool, 3 + optional :packet_capture_flag_enabled, :bool, 4 + optional :copy_home_files_flag_enabled, :bool, 5 + end + end +end + +module Google + module Cloud + module Notebooks + module V1 + DiagnosticConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.DiagnosticConfig").msgclass + end + end + end +end diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb index 49656d491afb..89aacf7c90d8 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/client.rb @@ -18,6 +18,8 @@ require "google/cloud/errors" require "google/cloud/notebooks/v1/managed_service_pb" +require "google/cloud/location" +require "google/iam/v1" module Google module Cloud @@ -75,6 +77,8 @@ def self.configure default_config.rpcs.create_runtime.timeout = 60.0 + default_config.rpcs.update_runtime.timeout = 60.0 + default_config.rpcs.delete_runtime.timeout = 60.0 default_config.rpcs.start_runtime.timeout = 60.0 @@ -85,6 +89,8 @@ def self.configure default_config.rpcs.report_runtime_event.timeout = 60.0 + default_config.rpcs.diagnose_runtime.timeout = 60.0 + default_config end yield @configure if block_given? @@ -160,6 +166,18 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @managed_notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Stub, credentials: credentials, @@ -176,6 +194,20 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + # Service calls ## @@ -463,6 +495,125 @@ def create_runtime request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Update Notebook Runtime configuration. + # + # @overload update_runtime(request, options = nil) + # Pass arguments to `update_runtime` via a request object, either of type + # {::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload update_runtime(runtime: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param runtime [::Google::Cloud::Notebooks::V1::Runtime, ::Hash] + # Required. The Runtime to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Specifies the path, relative to `Runtime`, of + # the field to update. For example, to change the software configuration + # kernels, the `update_mask` parameter would be + # specified as `software_config.kernels`, + # and the `PATCH` request body would specify the new value, as follows: + # + # { + # "software_config":{ + # "kernels": [{ + # 'repository': + # 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': + # 'latest' }], + # } + # } + # + # + # Currently, only the following fields can be updated: + # - software_config.kernels + # - software_config.post_startup_script + # - software_config.custom_gpu_driver_path + # - software_config.idle_shutdown + # - software_config.idle_shutdown_timeout + # - software_config.disable_terminal + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new + # + # # Call the update_runtime method. + # result = client.update_runtime request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def update_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.update_runtime.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Notebooks::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.runtime&.name + header_params["runtime.name"] = request.runtime.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.update_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @managed_notebook_service_stub.call_rpc :update_runtime, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Deletes a single Runtime. # @@ -955,6 +1106,102 @@ def reset_runtime request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Upgrades a Managed Notebook Runtime to the latest version. + # + # @overload upgrade_runtime(request, options = nil) + # Pass arguments to `upgrade_runtime` via a request object, either of type + # {::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upgrade_runtime(name: nil, request_id: nil) + # Pass arguments to `upgrade_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/runtimes/{runtime_id}` + # @param request_id [::String] + # Idempotent request UUID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new + # + # # Call the upgrade_runtime method. + # result = client.upgrade_runtime request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def upgrade_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.upgrade_runtime.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Notebooks::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.upgrade_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @managed_notebook_service_stub.call_rpc :upgrade_runtime, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Report and process a runtime event. # @@ -1144,6 +1391,102 @@ def refresh_runtime_token_internal request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + # + # @overload diagnose_runtime(request, options = nil) + # Pass arguments to `diagnose_runtime` via a request object, either of type + # {::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload diagnose_runtime(name: nil, diagnostic_config: nil) + # Pass arguments to `diagnose_runtime` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}` + # @param diagnostic_config [::Google::Cloud::Notebooks::V1::DiagnosticConfig, ::Hash] + # Required. Defines flags that are used to run the diagnostic tool + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new + # + # # Call the diagnose_runtime method. + # result = client.diagnose_runtime request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def diagnose_runtime request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.diagnose_runtime.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Notebooks::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.diagnose_runtime.timeout, + metadata: metadata, + retry_policy: @config.rpcs.diagnose_runtime.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @managed_notebook_service_stub.call_rpc :diagnose_runtime, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Configuration class for the ManagedNotebookService API. # @@ -1295,6 +1638,11 @@ class Rpcs # attr_reader :create_runtime ## + # RPC-specific configuration for `update_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :update_runtime + ## # RPC-specific configuration for `delete_runtime` # @return [::Gapic::Config::Method] # @@ -1320,6 +1668,11 @@ class Rpcs # attr_reader :reset_runtime ## + # RPC-specific configuration for `upgrade_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_runtime + ## # RPC-specific configuration for `report_runtime_event` # @return [::Gapic::Config::Method] # @@ -1329,6 +1682,11 @@ class Rpcs # @return [::Gapic::Config::Method] # attr_reader :refresh_runtime_token_internal + ## + # RPC-specific configuration for `diagnose_runtime` + # @return [::Gapic::Config::Method] + # + attr_reader :diagnose_runtime # @private def initialize parent_rpcs = nil @@ -1338,6 +1696,8 @@ def initialize parent_rpcs = nil @get_runtime = ::Gapic::Config::Method.new get_runtime_config create_runtime_config = parent_rpcs.create_runtime if parent_rpcs.respond_to? :create_runtime @create_runtime = ::Gapic::Config::Method.new create_runtime_config + update_runtime_config = parent_rpcs.update_runtime if parent_rpcs.respond_to? :update_runtime + @update_runtime = ::Gapic::Config::Method.new update_runtime_config delete_runtime_config = parent_rpcs.delete_runtime if parent_rpcs.respond_to? :delete_runtime @delete_runtime = ::Gapic::Config::Method.new delete_runtime_config start_runtime_config = parent_rpcs.start_runtime if parent_rpcs.respond_to? :start_runtime @@ -1348,10 +1708,14 @@ def initialize parent_rpcs = nil @switch_runtime = ::Gapic::Config::Method.new switch_runtime_config reset_runtime_config = parent_rpcs.reset_runtime if parent_rpcs.respond_to? :reset_runtime @reset_runtime = ::Gapic::Config::Method.new reset_runtime_config + upgrade_runtime_config = parent_rpcs.upgrade_runtime if parent_rpcs.respond_to? :upgrade_runtime + @upgrade_runtime = ::Gapic::Config::Method.new upgrade_runtime_config report_runtime_event_config = parent_rpcs.report_runtime_event if parent_rpcs.respond_to? :report_runtime_event @report_runtime_event = ::Gapic::Config::Method.new report_runtime_event_config refresh_runtime_token_internal_config = parent_rpcs.refresh_runtime_token_internal if parent_rpcs.respond_to? :refresh_runtime_token_internal @refresh_runtime_token_internal = ::Gapic::Config::Method.new refresh_runtime_token_internal_config + diagnose_runtime_config = parent_rpcs.diagnose_runtime if parent_rpcs.respond_to? :diagnose_runtime + @diagnose_runtime = ::Gapic::Config::Method.new diagnose_runtime_config yield self if block_given? end diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb index e1571e8c8c47..ef24cae94979 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_notebook_service/paths.rb @@ -24,6 +24,23 @@ module V1 module ManagedNotebookService # Path helper methods for the ManagedNotebookService API. module Paths + ## + # Create a fully-qualified Location resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def location_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}" + end + ## # Create a fully-qualified Runtime resource string. # diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_pb.rb index 979ff93ba83d..abe73c542371 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_pb.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_pb.rb @@ -7,9 +7,11 @@ require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/cloud/notebooks/v1/diagnostic_config_pb' require 'google/cloud/notebooks/v1/event_pb' require 'google/cloud/notebooks/v1/runtime_pb' require 'google/longrunning/operations_pb' +require 'google/protobuf/field_mask_pb' require 'google/protobuf/timestamp_pb' Google::Protobuf::DescriptorPool.generated_pool.build do @@ -55,11 +57,20 @@ optional :name, :string, 1 optional :request_id, :string, 2 end + add_message "google.cloud.notebooks.v1.UpgradeRuntimeRequest" do + optional :name, :string, 1 + optional :request_id, :string, 2 + end add_message "google.cloud.notebooks.v1.ReportRuntimeEventRequest" do optional :name, :string, 1 optional :vm_id, :string, 2 optional :event, :message, 3, "google.cloud.notebooks.v1.Event" end + add_message "google.cloud.notebooks.v1.UpdateRuntimeRequest" do + optional :runtime, :message, 1, "google.cloud.notebooks.v1.Runtime" + optional :update_mask, :message, 2, "google.protobuf.FieldMask" + optional :request_id, :string, 3 + end add_message "google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest" do optional :name, :string, 1 optional :vm_id, :string, 2 @@ -68,6 +79,10 @@ optional :access_token, :string, 1 optional :expire_time, :message, 2, "google.protobuf.Timestamp" end + add_message "google.cloud.notebooks.v1.DiagnoseRuntimeRequest" do + optional :name, :string, 1 + optional :diagnostic_config, :message, 2, "google.cloud.notebooks.v1.DiagnosticConfig" + end end end @@ -84,9 +99,12 @@ module V1 StopRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.StopRuntimeRequest").msgclass SwitchRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.SwitchRuntimeRequest").msgclass ResetRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ResetRuntimeRequest").msgclass + UpgradeRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.UpgradeRuntimeRequest").msgclass ReportRuntimeEventRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ReportRuntimeEventRequest").msgclass + UpdateRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.UpdateRuntimeRequest").msgclass RefreshRuntimeTokenInternalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RefreshRuntimeTokenInternalRequest").msgclass RefreshRuntimeTokenInternalResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RefreshRuntimeTokenInternalResponse").msgclass + DiagnoseRuntimeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.DiagnoseRuntimeRequest").msgclass end end end diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb index b31a3475473a..5b823798097b 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/managed_service_services_pb.rb @@ -40,6 +40,8 @@ class Service rpc :GetRuntime, ::Google::Cloud::Notebooks::V1::GetRuntimeRequest, ::Google::Cloud::Notebooks::V1::Runtime # Creates a new Runtime in a given project and location. rpc :CreateRuntime, ::Google::Cloud::Notebooks::V1::CreateRuntimeRequest, ::Google::Longrunning::Operation + # Update Notebook Runtime configuration. + rpc :UpdateRuntime, ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, ::Google::Longrunning::Operation # Deletes a single Runtime. rpc :DeleteRuntime, ::Google::Cloud::Notebooks::V1::DeleteRuntimeRequest, ::Google::Longrunning::Operation # Starts a Managed Notebook Runtime. @@ -58,11 +60,15 @@ class Service rpc :SwitchRuntime, ::Google::Cloud::Notebooks::V1::SwitchRuntimeRequest, ::Google::Longrunning::Operation # Resets a Managed Notebook Runtime. rpc :ResetRuntime, ::Google::Cloud::Notebooks::V1::ResetRuntimeRequest, ::Google::Longrunning::Operation + # Upgrades a Managed Notebook Runtime to the latest version. + rpc :UpgradeRuntime, ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, ::Google::Longrunning::Operation # Report and process a runtime event. rpc :ReportRuntimeEvent, ::Google::Cloud::Notebooks::V1::ReportRuntimeEventRequest, ::Google::Longrunning::Operation # Gets an access token for the consumer service account that the customer # attached to the runtime. Only accessible from the tenant instance. rpc :RefreshRuntimeTokenInternal, ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalRequest, ::Google::Cloud::Notebooks::V1::RefreshRuntimeTokenInternalResponse + # Creates a Diagnostic File and runs Diagnostic Tool given a Runtime. + rpc :DiagnoseRuntime, ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, ::Google::Longrunning::Operation end Stub = Service.rpc_stub_class diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb index 4291901a375b..d5962a0dbf21 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/notebook_service/client.rb @@ -18,6 +18,8 @@ require "google/cloud/errors" require "google/cloud/notebooks/v1/service_pb" +require "google/cloud/location" +require "google/iam/v1" module Google module Cloud @@ -105,6 +107,8 @@ def self.configure default_config.rpcs.rollback_instance.timeout = 60.0 + default_config.rpcs.diagnose_instance.timeout = 60.0 + default_config.rpcs.upgrade_instance_internal.timeout = 60.0 default_config.rpcs.list_environments.timeout = 60.0 @@ -206,6 +210,18 @@ def initialize config.endpoint = @config.endpoint end + @location_client = Google::Cloud::Location::Locations::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + + @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = credentials + config.quota_project = @quota_project_id + config.endpoint = @config.endpoint + end + @notebook_service_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Notebooks::V1::NotebookService::Stub, credentials: credentials, @@ -222,6 +238,20 @@ def initialize # attr_reader :operations_client + ## + # Get the associated client for mix-in of the Locations. + # + # @return [Google::Cloud::Location::Locations::Client] + # + attr_reader :location_client + + ## + # Get the associated client for mix-in of the IAMPolicy. + # + # @return [Google::Iam::V1::IAMPolicy::Client] + # + attr_reader :iam_policy_client + # Service calls ## @@ -2031,6 +2061,102 @@ def rollback_instance request, options = nil raise ::Google::Cloud::Error.from_error(e) end + ## + # Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + # + # @overload diagnose_instance(request, options = nil) + # Pass arguments to `diagnose_instance` via a request object, either of type + # {::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload diagnose_instance(name: nil, diagnostic_config: nil) + # Pass arguments to `diagnose_instance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param name [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/instances/{instance_id}` + # @param diagnostic_config [::Google::Cloud::Notebooks::V1::DiagnosticConfig, ::Hash] + # Required. Defines flags that are used to run the diagnostic tool + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::Operation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::Operation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/notebooks/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Notebooks::V1::NotebookService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest.new + # + # # Call the diagnose_instance method. + # result = client.diagnose_instance request + # + # # The returned object is of type Gapic::Operation. You can use this + # # object to check the status of an operation, cancel it, or wait + # # for results. Here is how to block until completion: + # result.wait_until_done! timeout: 60 + # if result.response? + # p result.response + # else + # puts "Error!" + # end + # + def diagnose_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest + + # Converts hash and nil to an options object + options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h + + # Customize the options with defaults + metadata = @config.rpcs.diagnose_instance.metadata.to_h + + # Set x-goog-api-client and x-goog-user-project headers + metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ + lib_name: @config.lib_name, lib_version: @config.lib_version, + gapic_version: ::Google::Cloud::Notebooks::V1::VERSION + metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id + + header_params = {} + if request.name + header_params["name"] = request.name + end + + request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") + metadata[:"x-goog-request-params"] ||= request_params_header + + options.apply_defaults timeout: @config.rpcs.diagnose_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.diagnose_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @notebook_service_stub.call_rpc :diagnose_instance, request, options: options do |response, operation| + response = ::Gapic::Operation.new response, @operations_client, options: options + yield response, operation if block_given? + return response + end + rescue ::GRPC::BadStatus => e + raise ::Google::Cloud::Error.from_error(e) + end + ## # Allows notebook instances to # call this endpoint to upgrade themselves. Do not use this method directly. @@ -3596,6 +3722,11 @@ class Rpcs # attr_reader :rollback_instance ## + # RPC-specific configuration for `diagnose_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :diagnose_instance + ## # RPC-specific configuration for `upgrade_instance_internal` # @return [::Gapic::Config::Method] # @@ -3706,6 +3837,8 @@ def initialize parent_rpcs = nil @upgrade_instance = ::Gapic::Config::Method.new upgrade_instance_config rollback_instance_config = parent_rpcs.rollback_instance if parent_rpcs.respond_to? :rollback_instance @rollback_instance = ::Gapic::Config::Method.new rollback_instance_config + diagnose_instance_config = parent_rpcs.diagnose_instance if parent_rpcs.respond_to? :diagnose_instance + @diagnose_instance = ::Gapic::Config::Method.new diagnose_instance_config upgrade_instance_internal_config = parent_rpcs.upgrade_instance_internal if parent_rpcs.respond_to? :upgrade_instance_internal @upgrade_instance_internal = ::Gapic::Config::Method.new upgrade_instance_internal_config list_environments_config = parent_rpcs.list_environments if parent_rpcs.respond_to? :list_environments diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/runtime_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/runtime_pb.rb index cbac1000c1c6..b7b3def18ae5 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/runtime_pb.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/runtime_pb.rb @@ -113,6 +113,14 @@ optional :post_startup_script, :string, 7 repeated :kernels, :message, 8, "google.cloud.notebooks.v1.ContainerImage" proto3_optional :upgradeable, :bool, 9 + optional :post_startup_script_behavior, :enum, 10, "google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior" + proto3_optional :disable_terminal, :bool, 11 + proto3_optional :version, :string, 12 + end + add_enum "google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior" do + value :POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED, 0 + value :RUN_EVERY_START, 1 + value :DOWNLOAD_AND_RUN_EVERY_START, 2 end add_message "google.cloud.notebooks.v1.RuntimeMetrics" do map :system_metrics, :string, :string, 1 @@ -173,6 +181,7 @@ module V1 RuntimeAccessConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeAccessConfig").msgclass RuntimeAccessConfig::RuntimeAccessType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeAccessConfig.RuntimeAccessType").enummodule RuntimeSoftwareConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeSoftwareConfig").msgclass + RuntimeSoftwareConfig::PostStartupScriptBehavior = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeSoftwareConfig.PostStartupScriptBehavior").enummodule RuntimeMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeMetrics").msgclass RuntimeShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RuntimeShieldedInstanceConfig").msgclass VirtualMachine = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.VirtualMachine").msgclass diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_pb.rb index dfa89c6ce23e..d16fc601416b 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_pb.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_pb.rb @@ -7,6 +7,7 @@ require 'google/api/client_pb' require 'google/api/field_behavior_pb' require 'google/api/resource_pb' +require 'google/cloud/notebooks/v1/diagnostic_config_pb' require 'google/cloud/notebooks/v1/environment_pb' require 'google/cloud/notebooks/v1/execution_pb' require 'google/cloud/notebooks/v1/instance_pb' @@ -136,6 +137,10 @@ optional :page_size, :int32, 2 optional :page_token, :string, 3 end + add_message "google.cloud.notebooks.v1.DiagnoseInstanceRequest" do + optional :name, :string, 1 + optional :diagnostic_config, :message, 2, "google.cloud.notebooks.v1.DiagnosticConfig" + end add_message "google.cloud.notebooks.v1.ListEnvironmentsResponse" do repeated :environments, :message, 1, "google.cloud.notebooks.v1.Environment" optional :next_page_token, :string, 2 @@ -242,6 +247,7 @@ module V1 RollbackInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.RollbackInstanceRequest").msgclass UpgradeInstanceInternalRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.UpgradeInstanceInternalRequest").msgclass ListEnvironmentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ListEnvironmentsRequest").msgclass + DiagnoseInstanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.DiagnoseInstanceRequest").msgclass ListEnvironmentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.ListEnvironmentsResponse").msgclass GetEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.GetEnvironmentRequest").msgclass CreateEnvironmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.notebooks.v1.CreateEnvironmentRequest").msgclass diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_services_pb.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_services_pb.rb index 58c2f3d81a73..741b551d4423 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_services_pb.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/service_services_pb.rb @@ -77,6 +77,8 @@ class Service rpc :UpgradeInstance, ::Google::Cloud::Notebooks::V1::UpgradeInstanceRequest, ::Google::Longrunning::Operation # Rollbacks a notebook instance to the previous version. rpc :RollbackInstance, ::Google::Cloud::Notebooks::V1::RollbackInstanceRequest, ::Google::Longrunning::Operation + # Creates a Diagnostic File and runs Diagnostic Tool given an Instance. + rpc :DiagnoseInstance, ::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest, ::Google::Longrunning::Operation # Allows notebook instances to # call this endpoint to upgrade themselves. Do not use this method directly. rpc :UpgradeInstanceInternal, ::Google::Cloud::Notebooks::V1::UpgradeInstanceInternalRequest, ::Google::Longrunning::Operation diff --git a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb new file mode 100644 index 000000000000..7b725b9905c5 --- /dev/null +++ b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/diagnostic_config.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Cloud + module Notebooks + module V1 + # Defines flags that are used to run the diagnostic tool + # @!attribute [rw] gcs_bucket + # @return [::String] + # Required. User Cloud Storage bucket location (REQUIRED) + # ## Must be formatted with path prefix (gs://$GCS_BUCKET) + # + # Permissions: + # User Managed Notebooks: + # - storage.buckets.writer: Must be given to the project's service account + # attached to VM. + # Google Managed Notebooks: + # - storage.buckets.writer: Must be given to the project's service account or + # ## user credentials attached to VM depending on authentication mode. + # + # Cloud Storage bucket Log file will be written to + # gs://$GCS_BUCKET/$RELATIVE_PATH/$VM_DATE_$TIME.tar.gz + # @!attribute [rw] relative_path + # @return [::String] + # Optional. Defines the relative storage path in the Cloud Storage bucket where the + # diagnostic logs will be written: Default path will be the root directory of + # the Cloud Storage bucket (gs://$GCS_BUCKET/$DATE_$TIME.tar.gz) Example of + # full path where Log file will be written: gs://$GCS_BUCKET/$RELATIVE_PATH/ + # @!attribute [rw] repair_flag_enabled + # @return [::Boolean] + # Optional. Enables flag to repair service for instance + # @!attribute [rw] packet_capture_flag_enabled + # @return [::Boolean] + # Optional. Enables flag to capture packets from the instance for 30 seconds + # @!attribute [rw] copy_home_files_flag_enabled + # @return [::Boolean] + # Optional. Enables flag to copy all `/home/jupyter` folder contents + class DiagnosticConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/managed_service.rb b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/managed_service.rb index 37f8f0f2f02d..4c489f6a8b7b 100644 --- a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/managed_service.rb +++ b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/managed_service.rb @@ -156,6 +156,21 @@ class ResetRuntimeRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request for upgrading a Managed Notebook Runtime to the latest version. + # option (google.api.message_visibility).restriction = + # "TRUSTED_TESTER,SPECIAL_TESTER"; + # @!attribute [rw] name + # @return [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/runtimes/{runtime_id}` + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class UpgradeRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request for reporting a Managed Notebook Event. # @!attribute [rw] name # @return [::String] @@ -173,6 +188,43 @@ class ReportRuntimeEventRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request for updating a Managed Notebook configuration. + # @!attribute [rw] runtime + # @return [::Google::Cloud::Notebooks::V1::Runtime] + # Required. The Runtime to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Specifies the path, relative to `Runtime`, of + # the field to update. For example, to change the software configuration + # kernels, the `update_mask` parameter would be + # specified as `software_config.kernels`, + # and the `PATCH` request body would specify the new value, as follows: + # + # { + # "software_config":{ + # "kernels": [{ + # 'repository': + # 'gcr.io/deeplearning-platform-release/pytorch-gpu', 'tag': + # 'latest' }], + # } + # } + # + # + # Currently, only the following fields can be updated: + # - software_config.kernels + # - software_config.post_startup_script + # - software_config.custom_gpu_driver_path + # - software_config.idle_shutdown + # - software_config.idle_shutdown_timeout + # - software_config.disable_terminal + # @!attribute [rw] request_id + # @return [::String] + # Idempotent request UUID. + class UpdateRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Request for getting a new access token. # @!attribute [rw] name # @return [::String] @@ -198,6 +250,19 @@ class RefreshRuntimeTokenInternalResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Request for creating a notebook instance diagnostic file. + # @!attribute [rw] name + # @return [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/runtimes/{runtimes_id}` + # @!attribute [rw] diagnostic_config + # @return [::Google::Cloud::Notebooks::V1::DiagnosticConfig] + # Required. Defines flags that are used to run the diagnostic tool + class DiagnoseRuntimeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end end end end diff --git a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/runtime.rb b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/runtime.rb index f563d3808f09..1f65b62d2dbf 100644 --- a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/runtime.rb +++ b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/runtime.rb @@ -423,9 +423,31 @@ module RuntimeAccessType # @!attribute [r] upgradeable # @return [::Boolean] # Output only. Bool indicating whether an newer image is available in an image family. + # @!attribute [rw] post_startup_script_behavior + # @return [::Google::Cloud::Notebooks::V1::RuntimeSoftwareConfig::PostStartupScriptBehavior] + # Behavior for the post startup script. + # @!attribute [rw] disable_terminal + # @return [::Boolean] + # Bool indicating whether JupyterLab terminal will be available or not. + # Default: False + # @!attribute [r] version + # @return [::String] + # Output only. version of boot image such as M100, from release label of the image. class RuntimeSoftwareConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods + + # Behavior for the post startup script. + module PostStartupScriptBehavior + # Unspecified post startup script behavior. Will run only once at creation. + POST_STARTUP_SCRIPT_BEHAVIOR_UNSPECIFIED = 0 + + # Runs the post startup script provided during creation at every start. + RUN_EVERY_START = 1 + + # Downloads and runs the provided post startup script at every start. + DOWNLOAD_AND_RUN_EVERY_START = 2 + end end # Contains runtime daemon metrics, such as OS and kernels and sessions stats. @@ -526,8 +548,8 @@ class VirtualMachine # # A full URL or partial URI. Examples: # - # * `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default` - # * `projects/[project_id]/regions/global/default` + # * `https://www.googleapis.com/compute/v1/projects/[project_id]/global/networks/default` + # * `projects/[project_id]/global/networks/default` # # Runtimes are managed resources inside Google Infrastructure. # Runtimes support the following network configurations: diff --git a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/service.rb b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/service.rb index 3b41e5a0ca86..41c7b430e217 100644 --- a/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/service.rb +++ b/google-cloud-notebooks-v1/proto_docs/google/cloud/notebooks/v1/service.rb @@ -481,6 +481,19 @@ class ListEnvironmentsRequest extend ::Google::Protobuf::MessageExts::ClassMethods end + # Request for creating a notebook instance diagnostic file. + # @!attribute [rw] name + # @return [::String] + # Required. Format: + # `projects/{project_id}/locations/{location}/instances/{instance_id}` + # @!attribute [rw] diagnostic_config + # @return [::Google::Cloud::Notebooks::V1::DiagnosticConfig] + # Required. Defines flags that are used to run the diagnostic tool + class DiagnoseInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + # Response for listing environments. # @!attribute [rw] environments # @return [::Array<::Google::Cloud::Notebooks::V1::Environment>] diff --git a/google-cloud-notebooks-v1/proto_docs/google/protobuf/field_mask.rb b/google-cloud-notebooks-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..5f816f4a2702 --- /dev/null +++ b/google-cloud-notebooks-v1/proto_docs/google/protobuf/field_mask.rb @@ -0,0 +1,229 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Protobuf + # `FieldMask` represents a set of symbolic field paths, for example: + # + # paths: "f.a" + # paths: "f.b.d" + # + # Here `f` represents a field in some root message, `a` and `b` + # fields in the message found in `f`, and `d` a field found in the + # message in `f.b`. + # + # Field masks are used to specify a subset of fields that should be + # returned by a get operation or modified by an update operation. + # Field masks also have a custom JSON encoding (see below). + # + # # Field Masks in Projections + # + # When used in the context of a projection, a response message or + # sub-message is filtered by the API to only contain those fields as + # specified in the mask. For example, if the mask in the previous + # example is applied to a response message as follows: + # + # f { + # a : 22 + # b { + # d : 1 + # x : 2 + # } + # y : 13 + # } + # z: 8 + # + # The result will not contain specific values for fields x,y and z + # (their value will be set to the default, and omitted in proto text + # output): + # + # + # f { + # a : 22 + # b { + # d : 1 + # } + # } + # + # A repeated field is not allowed except at the last position of a + # paths string. + # + # If a FieldMask object is not present in a get operation, the + # operation applies to all fields (as if a FieldMask of all fields + # had been specified). + # + # Note that a field mask does not necessarily apply to the + # top-level response message. In case of a REST get operation, the + # field mask applies directly to the response, but in case of a REST + # list operation, the mask instead applies to each individual message + # in the returned resource list. In case of a REST custom method, + # other definitions may be used. Where the mask applies will be + # clearly documented together with its declaration in the API. In + # any case, the effect on the returned resource/resources is required + # behavior for APIs. + # + # # Field Masks in Update Operations + # + # A field mask in update operations specifies which fields of the + # targeted resource are going to be updated. The API is required + # to only change the values of the fields as specified in the mask + # and leave the others untouched. If a resource is passed in to + # describe the updated values, the API ignores the values of all + # fields not covered by the mask. + # + # If a repeated field is specified for an update operation, new values will + # be appended to the existing repeated field in the target resource. Note that + # a repeated field is only allowed in the last position of a `paths` string. + # + # If a sub-message is specified in the last position of the field mask for an + # update operation, then new value will be merged into the existing sub-message + # in the target resource. + # + # For example, given the target message: + # + # f { + # b { + # d: 1 + # x: 2 + # } + # c: [1] + # } + # + # And an update message: + # + # f { + # b { + # d: 10 + # } + # c: [2] + # } + # + # then if the field mask is: + # + # paths: ["f.b", "f.c"] + # + # then the result will be: + # + # f { + # b { + # d: 10 + # x: 2 + # } + # c: [1, 2] + # } + # + # An implementation may provide options to override this default behavior for + # repeated and message fields. + # + # In order to reset a field's value to the default, the field must + # be in the mask and set to the default value in the provided resource. + # Hence, in order to reset all fields of a resource, provide a default + # instance of the resource and set all fields in the mask, or do + # not provide a mask as described below. + # + # If a field mask is not present on update, the operation applies to + # all fields (as if a field mask of all fields has been specified). + # Note that in the presence of schema evolution, this may mean that + # fields the client does not know and has therefore not filled into + # the request will be reset to their default. If this is unwanted + # behavior, a specific service may require a client to always specify + # a field mask, producing an error if not. + # + # As with get operations, the location of the resource which + # describes the updated values in the request message depends on the + # operation kind. In any case, the effect of the field mask is + # required to be honored by the API. + # + # ## Considerations for HTTP REST + # + # The HTTP kind of an update operation which uses a field mask must + # be set to PATCH instead of PUT in order to satisfy HTTP semantics + # (PUT must only be used for full updates). + # + # # JSON Encoding of Field Masks + # + # In JSON, a field mask is encoded as a single string where paths are + # separated by a comma. Fields name in each path are converted + # to/from lower-camel naming conventions. + # + # As an example, consider the following message declarations: + # + # message Profile { + # User user = 1; + # Photo photo = 2; + # } + # message User { + # string display_name = 1; + # string address = 2; + # } + # + # In proto a field mask for `Profile` may look as such: + # + # mask { + # paths: "user.display_name" + # paths: "photo" + # } + # + # In JSON, the same mask is represented as below: + # + # { + # mask: "user.displayName,photo" + # } + # + # # Field Masks and Oneof Fields + # + # Field masks treat fields in oneofs just as regular fields. Consider the + # following message: + # + # message SampleMessage { + # oneof test_oneof { + # string name = 4; + # SubMessage sub_message = 9; + # } + # } + # + # The field mask can be: + # + # mask { + # paths: "name" + # } + # + # Or: + # + # mask { + # paths: "sub_message" + # } + # + # Note that oneof type names ("test_oneof" in this case) cannot be used in + # paths. + # + # ## Field Mask Verification + # + # The implementation of any API method which has a FieldMask type field in the + # request should verify the included field paths, and return an + # `INVALID_ARGUMENT` error if any path is unmappable. + # @!attribute [rw] paths + # @return [::Array<::String>] + # The set of field mask paths. + class FieldMask + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-notebooks-v1/proto_docs/google/type/expr.rb b/google-cloud-notebooks-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..0602180c6ada --- /dev/null +++ b/google-cloud-notebooks-v1/proto_docs/google/type/expr.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + + +module Google + module Type + # Represents a textual expression in the Common Expression Language (CEL) + # syntax. CEL is a C-like expression language. The syntax and semantics of CEL + # are documented at https://github.com/google/cel-spec. + # + # Example (Comparison): + # + # title: "Summary size limit" + # description: "Determines if a summary is less than 100 chars" + # expression: "document.summary.size() < 100" + # + # Example (Equality): + # + # title: "Requestor is owner" + # description: "Determines if requestor is the document owner" + # expression: "document.owner == request.auth.claims.email" + # + # Example (Logic): + # + # title: "Public documents" + # description: "Determine whether the document should be publicly visible" + # expression: "document.type != 'private' && document.type != 'internal'" + # + # Example (Data Manipulation): + # + # title: "Notification string" + # description: "Create a notification string with a timestamp." + # expression: "'New message received at ' + string(document.create_time)" + # + # The exact variables and functions that may be referenced within an expression + # are determined by the service that evaluates it. See the service + # documentation for additional information. + # @!attribute [rw] expression + # @return [::String] + # Textual representation of an expression in Common Expression Language + # syntax. + # @!attribute [rw] title + # @return [::String] + # Optional. Title for the expression, i.e. a short string describing + # its purpose. This can be used e.g. in UIs which allow to enter the + # expression. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the expression. This is a longer text which + # describes the expression, e.g. when hovered over it in a UI. + # @!attribute [rw] location + # @return [::String] + # Optional. String indicating the location of the expression for error + # reporting, e.g. a file name and a position in the file. + class Expr + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/diagnose_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/diagnose_runtime.rb new file mode 100644 index 000000000000..c41b040fbaae --- /dev/null +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/diagnose_runtime.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync] +require "google/cloud/notebooks/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#diagnose_runtime +# +def diagnose_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new + + # Call the diagnose_runtime method. + result = client.diagnose_runtime request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/update_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/update_runtime.rb new file mode 100644 index 000000000000..2f9c405c0e81 --- /dev/null +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/update_runtime.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_sync] +require "google/cloud/notebooks/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#update_runtime +# +def update_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new + + # Call the update_runtime method. + result = client.update_runtime request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/managed_notebook_service/upgrade_runtime.rb b/google-cloud-notebooks-v1/snippets/managed_notebook_service/upgrade_runtime.rb new file mode 100644 index 000000000000..7c4ff0d3ce4e --- /dev/null +++ b/google-cloud-notebooks-v1/snippets/managed_notebook_service/upgrade_runtime.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_sync] +require "google/cloud/notebooks/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#upgrade_runtime +# +def upgrade_runtime + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new + + # Call the upgrade_runtime method. + result = client.upgrade_runtime request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_sync] diff --git a/google-cloud-notebooks-v1/snippets/notebook_service/diagnose_instance.rb b/google-cloud-notebooks-v1/snippets/notebook_service/diagnose_instance.rb new file mode 100644 index 000000000000..455186f30a02 --- /dev/null +++ b/google-cloud-notebooks-v1/snippets/notebook_service/diagnose_instance.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Auto-generated by gapic-generator-ruby. DO NOT EDIT! + +# [START notebooks_v1_generated_NotebookService_DiagnoseInstance_sync] +require "google/cloud/notebooks/v1" + +## +# Example demonstrating basic usage of +# Google::Cloud::Notebooks::V1::NotebookService::Client#diagnose_instance +# +def diagnose_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Notebooks::V1::NotebookService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest.new + + # Call the diagnose_instance method. + result = client.diagnose_instance request + + # The returned object is of type Gapic::Operation. You can use this + # object to check the status of an operation, cancel it, or wait + # for results. Here is how to block until completion: + result.wait_until_done! timeout: 60 + if result.response? + p result.response + else + puts "Error!" + end +end +# [END notebooks_v1_generated_NotebookService_DiagnoseInstance_sync] diff --git a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json index ccd67521ff78..6bf0f8d67a21 100644 --- a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json +++ b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json @@ -131,6 +131,46 @@ } ] }, + { + "region_tag": "notebooks_v1_generated_ManagedNotebookService_UpdateRuntime_sync", + "title": "Snippet for update_runtime in ManagedNotebookService", + "description": "Basic snippet for update_runtime in ManagedNotebookService", + "file": "managed_notebook_service/update_runtime.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_runtime", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#update_runtime", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ManagedNotebookService::Client", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client" + }, + "method": { + "short_name": "UpdateRuntime", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService.UpdateRuntime", + "service": { + "short_name": "ManagedNotebookService", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, { "region_tag": "notebooks_v1_generated_ManagedNotebookService_DeleteRuntime_sync", "title": "Snippet for delete_runtime in ManagedNotebookService", @@ -331,6 +371,46 @@ } ] }, + { + "region_tag": "notebooks_v1_generated_ManagedNotebookService_UpgradeRuntime_sync", + "title": "Snippet for upgrade_runtime in ManagedNotebookService", + "description": "Basic snippet for upgrade_runtime in ManagedNotebookService", + "file": "managed_notebook_service/upgrade_runtime.rb", + "language": "RUBY", + "client_method": { + "short_name": "upgrade_runtime", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#upgrade_runtime", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ManagedNotebookService::Client", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client" + }, + "method": { + "short_name": "UpgradeRuntime", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService.UpgradeRuntime", + "service": { + "short_name": "ManagedNotebookService", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, { "region_tag": "notebooks_v1_generated_ManagedNotebookService_ReportRuntimeEvent_sync", "title": "Snippet for report_runtime_event in ManagedNotebookService", @@ -411,6 +491,46 @@ } ] }, + { + "region_tag": "notebooks_v1_generated_ManagedNotebookService_DiagnoseRuntime_sync", + "title": "Snippet for diagnose_runtime in ManagedNotebookService", + "description": "Basic snippet for diagnose_runtime in ManagedNotebookService", + "file": "managed_notebook_service/diagnose_runtime.rb", + "language": "RUBY", + "client_method": { + "short_name": "diagnose_runtime", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client#diagnose_runtime", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ManagedNotebookService::Client", + "full_name": "::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client" + }, + "method": { + "short_name": "DiagnoseRuntime", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService.DiagnoseRuntime", + "service": { + "short_name": "ManagedNotebookService", + "full_name": "google.cloud.notebooks.v1.ManagedNotebookService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, { "region_tag": "notebooks_v1_generated_NotebookService_ListInstances_sync", "title": "Snippet for list_instances in NotebookService", @@ -1171,6 +1291,46 @@ } ] }, + { + "region_tag": "notebooks_v1_generated_NotebookService_DiagnoseInstance_sync", + "title": "Snippet for diagnose_instance in NotebookService", + "description": "Basic snippet for diagnose_instance in NotebookService", + "file": "notebook_service/diagnose_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "diagnose_instance", + "full_name": "::Google::Cloud::Notebooks::V1::NotebookService::Client#diagnose_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "NotebookService::Client", + "full_name": "::Google::Cloud::Notebooks::V1::NotebookService::Client" + }, + "method": { + "short_name": "DiagnoseInstance", + "full_name": "google.cloud.notebooks.v1.NotebookService.DiagnoseInstance", + "service": { + "short_name": "NotebookService", + "full_name": "google.cloud.notebooks.v1.NotebookService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 45, + "type": "FULL" + } + ] + }, { "region_tag": "notebooks_v1_generated_NotebookService_UpgradeInstanceInternal_sync", "title": "Snippet for upgrade_instance_internal in NotebookService", diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb index cc3eefb48515..61e59daa0798 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_paths_test.rb @@ -23,6 +23,18 @@ require "google/cloud/notebooks/v1/managed_notebook_service" class ::Google::Cloud::Notebooks::V1::ManagedNotebookService::ClientPathsTest < Minitest::Test + def test_location_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, nil do + client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.location_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1", path + end + end + def test_runtime_path grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure ::Gapic::ServiceStub.stub :new, nil do diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb index 7ddc4c9f8ce5..be3b2ef30ea6 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/managed_notebook_service_test.rb @@ -241,6 +241,73 @@ def test_create_runtime end end + def test_update_runtime + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + runtime = {} + update_mask = {} + request_id = "hello world" + + update_runtime_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_runtime, name + assert_kind_of ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Notebooks::V1::Runtime), request["runtime"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_runtime_client_stub do + # Create client + client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_runtime({ runtime: runtime, update_mask: update_mask, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_runtime runtime: runtime, update_mask: update_mask, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_runtime ::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new(runtime: runtime, update_mask: update_mask, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.update_runtime({ runtime: runtime, update_mask: update_mask, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.update_runtime(::Google::Cloud::Notebooks::V1::UpdateRuntimeRequest.new(runtime: runtime, update_mask: update_mask, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, update_runtime_client_stub.call_rpc_count + end + end + def test_delete_runtime # Create GRPC objects. grpc_response = ::Google::Longrunning::Operation.new @@ -570,6 +637,71 @@ def test_reset_runtime end end + def test_upgrade_runtime + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + request_id = "hello world" + + upgrade_runtime_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upgrade_runtime, name + assert_kind_of ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upgrade_runtime_client_stub do + # Create client + client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upgrade_runtime({ name: name, request_id: request_id }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.upgrade_runtime name: name, request_id: request_id do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.upgrade_runtime ::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new(name: name, request_id: request_id) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.upgrade_runtime({ name: name, request_id: request_id }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.upgrade_runtime(::Google::Cloud::Notebooks::V1::UpgradeRuntimeRequest.new(name: name, request_id: request_id), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, upgrade_runtime_client_stub.call_rpc_count + end + end + def test_report_runtime_event # Create GRPC objects. grpc_response = ::Google::Longrunning::Operation.new @@ -697,6 +829,71 @@ def test_refresh_runtime_token_internal end end + def test_diagnose_runtime + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + diagnostic_config = {} + + diagnose_runtime_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :diagnose_runtime, name + assert_kind_of ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Notebooks::V1::DiagnosticConfig), request["diagnostic_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, diagnose_runtime_client_stub do + # Create client + client = ::Google::Cloud::Notebooks::V1::ManagedNotebookService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.diagnose_runtime({ name: name, diagnostic_config: diagnostic_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.diagnose_runtime name: name, diagnostic_config: diagnostic_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.diagnose_runtime ::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new(name: name, diagnostic_config: diagnostic_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.diagnose_runtime({ name: name, diagnostic_config: diagnostic_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.diagnose_runtime(::Google::Cloud::Notebooks::V1::DiagnoseRuntimeRequest.new(name: name, diagnostic_config: diagnostic_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, diagnose_runtime_client_stub.call_rpc_count + end + end + def test_configure grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure diff --git a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb index 3d5fd26c0b54..07ffea48fbdd 100644 --- a/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb +++ b/google-cloud-notebooks-v1/test/google/cloud/notebooks/v1/notebook_service_test.rb @@ -1258,6 +1258,71 @@ def test_rollback_instance end end + def test_diagnose_instance + # Create GRPC objects. + grpc_response = ::Google::Longrunning::Operation.new + grpc_operation = GRPC::ActiveCall::Operation.new nil + grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + grpc_options = {} + + # Create request parameters for a unary method. + name = "hello world" + diagnostic_config = {} + + diagnose_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :diagnose_instance, name + assert_kind_of ::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Notebooks::V1::DiagnosticConfig), request["diagnostic_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, diagnose_instance_client_stub do + # Create client + client = ::Google::Cloud::Notebooks::V1::NotebookService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.diagnose_instance({ name: name, diagnostic_config: diagnostic_config }) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use named arguments + client.diagnose_instance name: name, diagnostic_config: diagnostic_config do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.diagnose_instance ::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest.new(name: name, diagnostic_config: diagnostic_config) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.diagnose_instance({ name: name, diagnostic_config: diagnostic_config }, grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.diagnose_instance(::Google::Cloud::Notebooks::V1::DiagnoseInstanceRequest.new(name: name, diagnostic_config: diagnostic_config), grpc_options) do |response, operation| + assert_kind_of Gapic::Operation, response + assert_equal grpc_response, response.grpc_op + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, diagnose_instance_client_stub.call_rpc_count + end + end + def test_upgrade_instance_internal # Create GRPC objects. grpc_response = ::Google::Longrunning::Operation.new From fae0ffe8650b6fbbd4cf748593209c0d6ece7eb3 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:51:51 +0530 Subject: [PATCH 097/112] docs(bigquery-data_transfer): Format and clean up docs --- .../v1/data_transfer_service/client.rb | 136 ++++++++++-------- .../v1/datatransfer_services_pb.rb | 10 +- .../bigquery/datatransfer/v1/datatransfer.rb | 132 +++++++++-------- .../bigquery/datatransfer/v1/transfer.rb | 4 +- 4 files changed, 164 insertions(+), 118 deletions(-) diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb index 347b2c48bdd6..013caca95397 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/data_transfer_service/client.rb @@ -309,7 +309,7 @@ def get_data_source request, options = nil # @param parent [::String] # Required. The BigQuery project id for which data sources should be returned. # Must be in the form: `projects/{project_id}` or - # `projects/{project_id}/locations/{location_id} + # `projects/{project_id}/locations/{location_id}` # @param page_token [::String] # Pagination token, which can be used to request a specific page # of `ListDataSourcesRequest` list results. For multiple-page @@ -417,34 +417,45 @@ def list_data_sources request, options = nil # Required. Data transfer configuration to create. # @param authorization_code [::String] # Optional OAuth2 authorization code to use with this transfer configuration. - # This is required if new credentials are needed, as indicated by - # `CheckValidCreds`. - # In order to obtain authorization_code, please make a - # request to - # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= - # - # * client_id should be OAuth client_id of BigQuery DTS API for the given - # data source returned by ListDataSources method. - # * data_source_scopes are the scopes returned by ListDataSources method. - # * redirect_uri is an optional parameter. If not specified, then - # authorization code is posted to the opener of authorization flow window. - # Otherwise it will be sent to the redirect uri. A special value of - # urn:ietf:wg:oauth:2.0:oob means that authorization code should be - # returned in the title bar of the browser, with the page text prompting - # the user to copy the code and paste it in the application. + # This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + # and new credentials are needed, as indicated by `CheckValidCreds`. In order + # to obtain authorization_code, make a request to the following URL: + #
+              #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+              #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # create the transfer config. # @param version_info [::String] - # Optional version info. If users want to find a very recent access token, - # that is, immediately after approving access, users have to set the - # version_info claim in the token request. To obtain the version_info, users - # must use the "none+gsession" response type. which be return a - # version_info back in the authorization response which be be put in a JWT - # claim in the token request. + # Optional version info. This is required only if + # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + # are needed, as indicated by `CheckValidCreds`. In order to obtain version + # info, make a request to the following URL: + #
+              #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+              #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # create the transfer config. # @param service_account_name [::String] - # Optional service account name. If this field is set, transfer config will - # be created with this service account credentials. It requires that - # requesting user calling this API has permissions to act as this service + # Optional service account name. If this field is set, the transfer config + # will be created with this service account's credentials. It requires that + # the requesting user calling this API has permissions to act as this service # account. # + # Note that not all data sources support service account credentials when + # creating a transfer config. For the latest list of data sources, read about + # [using service + # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig] # @yieldparam operation [::GRPC::ActiveCall::Operation] @@ -532,37 +543,47 @@ def create_transfer_config request, options = nil # Required. Data transfer configuration to create. # @param authorization_code [::String] # Optional OAuth2 authorization code to use with this transfer configuration. - # If it is provided, the transfer configuration will be associated with the - # authorizing user. - # In order to obtain authorization_code, please make a - # request to - # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= - # - # * client_id should be OAuth client_id of BigQuery DTS API for the given - # data source returned by ListDataSources method. - # * data_source_scopes are the scopes returned by ListDataSources method. - # * redirect_uri is an optional parameter. If not specified, then - # authorization code is posted to the opener of authorization flow window. - # Otherwise it will be sent to the redirect uri. A special value of - # urn:ietf:wg:oauth:2.0:oob means that authorization code should be - # returned in the title bar of the browser, with the page text prompting - # the user to copy the code and paste it in the application. + # This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + # and new credentials are needed, as indicated by `CheckValidCreds`. In order + # to obtain authorization_code, make a request to the following URL: + #
+              #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+              #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # update the transfer config. # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] # Required. Required list of fields to be updated in this request. # @param version_info [::String] - # Optional version info. If users want to find a very recent access token, - # that is, immediately after approving access, users have to set the - # version_info claim in the token request. To obtain the version_info, users - # must use the "none+gsession" response type. which be return a - # version_info back in the authorization response which be be put in a JWT - # claim in the token request. + # Optional version info. This is required only if + # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + # are needed, as indicated by `CheckValidCreds`. In order to obtain version + # info, make a request to the following URL: + #
+              #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+              #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # update the transfer config. # @param service_account_name [::String] - # Optional service account name. If this field is set and - # "service_account_name" is set in update_mask, transfer config will be - # updated to use this service account credentials. It requires that - # requesting user calling this API has permissions to act as this service + # Optional service account name. If this field is set, the transfer config + # will be created with this service account's credentials. It requires that + # the requesting user calling this API has permissions to act as this service # account. # + # Note that not all data sources support service account credentials when + # creating a transfer config. For the latest list of data sources, read about + # [using service + # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). + # # @yield [response, operation] Access the result along with the RPC operation # @yieldparam response [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig] # @yieldparam operation [::GRPC::ActiveCall::Operation] @@ -822,7 +843,7 @@ def get_transfer_config request, options = nil # the default parameter values, pass an empty Hash as a request object (see above). # # @param parent [::String] - # Required. The BigQuery project id for which data sources + # Required. The BigQuery project id for which transfer configs # should be returned: `projects/{project_id}` or # `projects/{project_id}/locations/{location_id}` # @param data_source_ids [::Array<::String>] @@ -1578,10 +1599,12 @@ def check_valid_creds request, options = nil ## # Enroll data sources in a user project. This allows users to create transfer # configurations for these data sources. They will also appear in the - # ListDataSources RPC and as such, will appear in the BigQuery UI - # 'https://bigquery.cloud.google.com' (and the documents can be found at - # https://cloud.google.com/bigquery/bigquery-web-ui and - # https://cloud.google.com/bigquery/docs/working-with-transfers). + # ListDataSources RPC and as such, will appear in the + # [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents + # can be found in the public guide for + # [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and + # [Data Transfer + # Service](https://cloud.google.com/bigquery/docs/working-with-transfers). # # @overload enroll_data_sources(request, options = nil) # Pass arguments to `enroll_data_sources` via a request object, either of type @@ -1599,8 +1622,7 @@ def check_valid_creds request, options = nil # the default parameter values, pass an empty Hash as a request object (see above). # # @param name [::String] - # The name of the project resource in the form: - # `projects/{project_id}` + # The name of the project resource in the form: `projects/{project_id}` # @param data_source_ids [::Array<::String>] # Data sources that are enrolled. It is required to provide at least one # data source id. diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb index 8843b3ef2f2e..769aa2c53e70 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/datatransfer/v1/datatransfer_services_pb.rb @@ -75,10 +75,12 @@ class Service rpc :CheckValidCreds, ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest, ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse # Enroll data sources in a user project. This allows users to create transfer # configurations for these data sources. They will also appear in the - # ListDataSources RPC and as such, will appear in the BigQuery UI - # 'https://bigquery.cloud.google.com' (and the documents can be found at - # https://cloud.google.com/bigquery/bigquery-web-ui and - # https://cloud.google.com/bigquery/docs/working-with-transfers). + # ListDataSources RPC and as such, will appear in the + # [BigQuery UI](https://console.cloud.google.com/bigquery), and the documents + # can be found in the public guide for + # [BigQuery Web UI](https://cloud.google.com/bigquery/bigquery-web-ui) and + # [Data Transfer + # Service](https://cloud.google.com/bigquery/docs/working-with-transfers). rpc :EnrollDataSources, ::Google::Cloud::Bigquery::DataTransfer::V1::EnrollDataSourcesRequest, ::Google::Protobuf::Empty end diff --git a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/datatransfer.rb b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/datatransfer.rb index e8648e0740fb..21846939df77 100644 --- a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/datatransfer.rb +++ b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/datatransfer.rb @@ -52,7 +52,7 @@ module V1 # For integer and double values specifies minimum allowed value. # @!attribute [rw] max_value # @return [::Google::Protobuf::DoubleValue] - # For integer and double values specifies maxminum allowed value. + # For integer and double values specifies maximum allowed value. # @!attribute [rw] fields # @return [::Array<::Google::Cloud::Bigquery::DataTransfer::V1::DataSourceParameter>] # Deprecated. This field has no effect. @@ -226,7 +226,7 @@ class GetDataSourceRequest # @return [::String] # Required. The BigQuery project id for which data sources should be returned. # Must be in the form: `projects/{project_id}` or - # `projects/{project_id}/locations/{location_id} + # `projects/{project_id}/locations/{location_id}` # @!attribute [rw] page_token # @return [::String] # Pagination token, which can be used to request a specific page @@ -258,9 +258,9 @@ class ListDataSourcesResponse end # A request to create a data transfer configuration. If new credentials are - # needed for this transfer configuration, an authorization code must be - # provided. If an authorization code is provided, the transfer configuration - # will be associated with the user id corresponding to the authorization code. + # needed for this transfer configuration, authorization info must be provided. + # If authorization info is provided, the transfer configuration will be + # associated with the user id corresponding to the authorization info. # Otherwise, the transfer configuration will be associated with the calling # user. # @!attribute [rw] parent @@ -275,81 +275,102 @@ class ListDataSourcesResponse # @!attribute [rw] authorization_code # @return [::String] # Optional OAuth2 authorization code to use with this transfer configuration. - # This is required if new credentials are needed, as indicated by - # `CheckValidCreds`. - # In order to obtain authorization_code, please make a - # request to - # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + # This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + # and new credentials are needed, as indicated by `CheckValidCreds`. In order + # to obtain authorization_code, make a request to the following URL: + #
+          #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+          #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. # - # * client_id should be OAuth client_id of BigQuery DTS API for the given - # data source returned by ListDataSources method. - # * data_source_scopes are the scopes returned by ListDataSources method. - # * redirect_uri is an optional parameter. If not specified, then - # authorization code is posted to the opener of authorization flow window. - # Otherwise it will be sent to the redirect uri. A special value of - # urn:ietf:wg:oauth:2.0:oob means that authorization code should be - # returned in the title bar of the browser, with the page text prompting - # the user to copy the code and paste it in the application. + # Note that this should not be set when `service_account_name` is used to + # create the transfer config. # @!attribute [rw] version_info # @return [::String] - # Optional version info. If users want to find a very recent access token, - # that is, immediately after approving access, users have to set the - # version_info claim in the token request. To obtain the version_info, users - # must use the "none+gsession" response type. which be return a - # version_info back in the authorization response which be be put in a JWT - # claim in the token request. + # Optional version info. This is required only if + # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + # are needed, as indicated by `CheckValidCreds`. In order to obtain version + # info, make a request to the following URL: + #
+          #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+          #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # create the transfer config. # @!attribute [rw] service_account_name # @return [::String] - # Optional service account name. If this field is set, transfer config will - # be created with this service account credentials. It requires that - # requesting user calling this API has permissions to act as this service + # Optional service account name. If this field is set, the transfer config + # will be created with this service account's credentials. It requires that + # the requesting user calling this API has permissions to act as this service # account. + # + # Note that not all data sources support service account credentials when + # creating a transfer config. For the latest list of data sources, read about + # [using service + # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). class CreateTransferConfigRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # A request to update a transfer configuration. To update the user id of the - # transfer configuration, an authorization code needs to be provided. + # transfer configuration, authorization info needs to be provided. # @!attribute [rw] transfer_config # @return [::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig] # Required. Data transfer configuration to create. # @!attribute [rw] authorization_code # @return [::String] # Optional OAuth2 authorization code to use with this transfer configuration. - # If it is provided, the transfer configuration will be associated with the - # authorizing user. - # In order to obtain authorization_code, please make a - # request to - # https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=&redirect_uri= + # This is required only if `transferConfig.dataSourceId` is 'youtube_channel' + # and new credentials are needed, as indicated by `CheckValidCreds`. In order + # to obtain authorization_code, make a request to the following URL: + #
+          #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes
+          #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. # - # * client_id should be OAuth client_id of BigQuery DTS API for the given - # data source returned by ListDataSources method. - # * data_source_scopes are the scopes returned by ListDataSources method. - # * redirect_uri is an optional parameter. If not specified, then - # authorization code is posted to the opener of authorization flow window. - # Otherwise it will be sent to the redirect uri. A special value of - # urn:ietf:wg:oauth:2.0:oob means that authorization code should be - # returned in the title bar of the browser, with the page text prompting - # the user to copy the code and paste it in the application. + # Note that this should not be set when `service_account_name` is used to + # update the transfer config. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # Required. Required list of fields to be updated in this request. # @!attribute [rw] version_info # @return [::String] - # Optional version info. If users want to find a very recent access token, - # that is, immediately after approving access, users have to set the - # version_info claim in the token request. To obtain the version_info, users - # must use the "none+gsession" response type. which be return a - # version_info back in the authorization response which be be put in a JWT - # claim in the token request. + # Optional version info. This is required only if + # `transferConfig.dataSourceId` is not 'youtube_channel' and new credentials + # are needed, as indicated by `CheckValidCreds`. In order to obtain version + # info, make a request to the following URL: + #
+          #     https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes
+          #     
+ # * The client_id is the OAuth client_id of the a data source as + # returned by ListDataSources method. + # * data_source_scopes are the scopes returned by ListDataSources + # method. + # + # Note that this should not be set when `service_account_name` is used to + # update the transfer config. # @!attribute [rw] service_account_name # @return [::String] - # Optional service account name. If this field is set and - # "service_account_name" is set in update_mask, transfer config will be - # updated to use this service account credentials. It requires that - # requesting user calling this API has permissions to act as this service + # Optional service account name. If this field is set, the transfer config + # will be created with this service account's credentials. It requires that + # the requesting user calling this API has permissions to act as this service # account. + # + # Note that not all data sources support service account credentials when + # creating a transfer config. For the latest list of data sources, read about + # [using service + # accounts](https://cloud.google.com/bigquery-transfer/docs/use-service-accounts). class UpdateTransferConfigRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -403,7 +424,7 @@ class DeleteTransferRunRequest # A request to list data transfers configured for a BigQuery project. # @!attribute [rw] parent # @return [::String] - # Required. The BigQuery project id for which data sources + # Required. The BigQuery project id for which transfer configs # should be returned: `projects/{project_id}` or # `projects/{project_id}/locations/{location_id}` # @!attribute [rw] data_source_ids @@ -634,8 +655,7 @@ class StartManualTransferRunsResponse # BigQuery UI's `Transfer` tab. # @!attribute [rw] name # @return [::String] - # The name of the project resource in the form: - # `projects/{project_id}` + # The name of the project resource in the form: `projects/{project_id}` # @!attribute [rw] data_source_ids # @return [::Array<::String>] # Data sources that are enrolled. It is required to provide at least one diff --git a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/transfer.rb b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/transfer.rb index 1395c9188fe5..a4cec734c1b0 100644 --- a/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/transfer.rb +++ b/google-cloud-bigquery-data_transfer-v1/proto_docs/google/cloud/bigquery/datatransfer/v1/transfer.rb @@ -88,7 +88,9 @@ class UserInfo # User specified display name for the data transfer. # @!attribute [rw] data_source_id # @return [::String] - # Data source id. Cannot be changed once data transfer is created. + # Data source ID. This cannot be changed once data transfer is created. The + # full list of available data source IDs can be returned through an API call: + # https://cloud.google.com/bigquery-transfer/docs/reference/datatransfer/rest/v1/projects.locations.dataSources/list # @!attribute [rw] params # @return [::Google::Protobuf::Struct] # Parameters specific to each data source. For more information see the From 806dc87e32bd3e7b3a070c62b29ff0ca97fae226 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 11:53:08 +0530 Subject: [PATCH 098/112] feat(cloud-shell): add :ENVIRONMENT_UNAVAILABLE to cloudshell error code --- .../lib/google/cloud/shell/v1/cloudshell_pb.rb | 1 + .../proto_docs/google/cloud/shell/v1/cloudshell.rb | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb b/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb index 2d5fd9e9c710..5689040b960d 100644 --- a/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb +++ b/google-cloud-shell-v1/lib/google/cloud/shell/v1/cloudshell_pb.rb @@ -91,6 +91,7 @@ value :CLOUD_SHELL_DISABLED, 2 value :TOS_VIOLATION, 4 value :QUOTA_EXCEEDED, 5 + value :ENVIRONMENT_UNAVAILABLE, 6 end end end diff --git a/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb b/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb index 7281e3d2b700..a8a8fa6fa78d 100644 --- a/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb +++ b/google-cloud-shell-v1/proto_docs/google/cloud/shell/v1/cloudshell.rb @@ -319,6 +319,10 @@ module CloudShellErrorCode # The user has exhausted their weekly Cloud Shell quota, and Cloud Shell # will be disabled until the quota resets. QUOTA_EXCEEDED = 5 + + # The Cloud Shell environment is unavailable and cannot be connected to at + # the moment. + ENVIRONMENT_UNAVAILABLE = 6 end end end From 1dac2002d215f385c0ebc071114827ec68931edc Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:56:54 -0800 Subject: [PATCH 099/112] chore(main): release google-cloud-bigquery-data_transfer-v1 0.6.1 (#19450) --- .release-please-manifest.json | 2 +- google-cloud-bigquery-data_transfer-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/bigquery/data_transfer/v1/version.rb | 2 +- ...ppet_metadata_google.cloud.bigquery.datatransfer.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7a35577949ec..108d23760560 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -103,7 +103,7 @@ "google-cloud-bigquery-data_policies-v1beta1+FILLER": "0.0.0", "google-cloud-bigquery-data_transfer": "1.3.0", "google-cloud-bigquery-data_transfer+FILLER": "0.0.0", - "google-cloud-bigquery-data_transfer-v1": "0.6.0", + "google-cloud-bigquery-data_transfer-v1": "0.6.1", "google-cloud-bigquery-data_transfer-v1+FILLER": "0.0.0", "google-cloud-bigquery-migration": "0.2.0", "google-cloud-bigquery-migration+FILLER": "0.0.0", diff --git a/google-cloud-bigquery-data_transfer-v1/CHANGELOG.md b/google-cloud-bigquery-data_transfer-v1/CHANGELOG.md index cd2977028a24..d315ca8cb035 100644 --- a/google-cloud-bigquery-data_transfer-v1/CHANGELOG.md +++ b/google-cloud-bigquery-data_transfer-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.6.1 (2022-11-17) + +#### Documentation + +* Format and clean up docs + ### 0.6.0 (2022-07-01) #### Features diff --git a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/version.rb b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/version.rb index 9e847922970b..eac958e53f70 100644 --- a/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/version.rb +++ b/google-cloud-bigquery-data_transfer-v1/lib/google/cloud/bigquery/data_transfer/v1/version.rb @@ -22,7 +22,7 @@ module Cloud module Bigquery module DataTransfer module V1 - VERSION = "0.6.0" + VERSION = "0.6.1" end end end diff --git a/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json b/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json index 3100e0316543..078be0cdd750 100644 --- a/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json +++ b/google-cloud-bigquery-data_transfer-v1/snippets/snippet_metadata_google.cloud.bigquery.datatransfer.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-bigquery-data_transfer-v1", - "version": "0.6.0", + "version": "0.6.1", "language": "RUBY", "apis": [ { From 2f68de29f0daa4390c526a4de4f558db882b286d Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:57:13 -0800 Subject: [PATCH 100/112] chore(main): release google-cloud-memcache-v1 0.4.0 (#19451) --- .release-please-manifest.json | 2 +- google-cloud-memcache-v1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/memcache/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.memcache.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 108d23760560..f97bc5f12486 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -353,7 +353,7 @@ "google-cloud-media_translation-v1beta1+FILLER": "0.0.0", "google-cloud-memcache": "1.2.0", "google-cloud-memcache+FILLER": "0.0.0", - "google-cloud-memcache-v1": "0.3.0", + "google-cloud-memcache-v1": "0.4.0", "google-cloud-memcache-v1+FILLER": "0.0.0", "google-cloud-memcache-v1beta2": "0.3.0", "google-cloud-memcache-v1beta2+FILLER": "0.0.0", diff --git a/google-cloud-memcache-v1/CHANGELOG.md b/google-cloud-memcache-v1/CHANGELOG.md index e3369538a6a3..eb4b04e95c27 100644 --- a/google-cloud-memcache-v1/CHANGELOG.md +++ b/google-cloud-memcache-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.4.0 (2022-11-17) + +#### Features + +* support scheduled maintenance + ### 0.3.0 (2022-07-05) #### Features diff --git a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/version.rb b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/version.rb index 1a33909025ea..5e493f9c564f 100644 --- a/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/version.rb +++ b/google-cloud-memcache-v1/lib/google/cloud/memcache/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Memcache module V1 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json index a62874790e45..28380a5bfe88 100644 --- a/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json +++ b/google-cloud-memcache-v1/snippets/snippet_metadata_google.cloud.memcache.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-memcache-v1", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 61c9cbfccf9584bc5a13fd2b7d223c940fd7d5f4 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:57:35 -0800 Subject: [PATCH 101/112] chore(main): release google-cloud-memcache-v1beta2 0.4.0 (#19452) --- .release-please-manifest.json | 2 +- google-cloud-memcache-v1beta2/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/memcache/v1beta2/version.rb | 2 +- .../snippet_metadata_google.cloud.memcache.v1beta2.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f97bc5f12486..6f86ed2aa7a7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -355,7 +355,7 @@ "google-cloud-memcache+FILLER": "0.0.0", "google-cloud-memcache-v1": "0.4.0", "google-cloud-memcache-v1+FILLER": "0.0.0", - "google-cloud-memcache-v1beta2": "0.3.0", + "google-cloud-memcache-v1beta2": "0.4.0", "google-cloud-memcache-v1beta2+FILLER": "0.0.0", "google-cloud-metastore": "1.1.0", "google-cloud-metastore+FILLER": "0.0.0", diff --git a/google-cloud-memcache-v1beta2/CHANGELOG.md b/google-cloud-memcache-v1beta2/CHANGELOG.md index 3e2aaffa51b0..51f7fd01ebc0 100644 --- a/google-cloud-memcache-v1beta2/CHANGELOG.md +++ b/google-cloud-memcache-v1beta2/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.4.0 (2022-11-17) + +#### Features + +* support scheduled maintenance + ### 0.3.0 (2022-07-05) #### Features diff --git a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/version.rb b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/version.rb index bd15061ee96d..306d314ce93c 100644 --- a/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/version.rb +++ b/google-cloud-memcache-v1beta2/lib/google/cloud/memcache/v1beta2/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Memcache module V1beta2 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json index 1a0de8176922..a1801cf62e71 100644 --- a/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json +++ b/google-cloud-memcache-v1beta2/snippets/snippet_metadata_google.cloud.memcache.v1beta2.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-memcache-v1beta2", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 53d08b7216aeba873f5f2ae3015eab639bbc39d8 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:59:25 -0800 Subject: [PATCH 102/112] chore(main): release google-cloud-notebooks-v1 0.4.0 (#19453) --- .release-please-manifest.json | 2 +- google-cloud-notebooks-v1/CHANGELOG.md | 9 +++++++++ .../lib/google/cloud/notebooks/v1/version.rb | 2 +- .../snippet_metadata_google.cloud.notebooks.v1.json | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6f86ed2aa7a7..3f4c9ced9e3f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -387,7 +387,7 @@ "google-cloud-network_security-v1beta1+FILLER": "0.0.0", "google-cloud-notebooks": "2.1.0", "google-cloud-notebooks+FILLER": "0.0.0", - "google-cloud-notebooks-v1": "0.3.0", + "google-cloud-notebooks-v1": "0.4.0", "google-cloud-notebooks-v1+FILLER": "0.0.0", "google-cloud-notebooks-v1beta1": "0.5.0", "google-cloud-notebooks-v1beta1+FILLER": "0.0.0", diff --git a/google-cloud-notebooks-v1/CHANGELOG.md b/google-cloud-notebooks-v1/CHANGELOG.md index 9b8901b9dcfe..7bb57f407916 100644 --- a/google-cloud-notebooks-v1/CHANGELOG.md +++ b/google-cloud-notebooks-v1/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +### 0.4.0 (2022-11-17) + +#### Features + +* add Instance.reservation_affinity, nic_type, can_ip_forward +* add IsInstanceUpgradeableResponse.upgrade_image +* added Location and IAM methods +* Support UpdateRuntime, UpgradeRuntime, DiagnoseRuntime, DiagnoseInstance + ### 0.3.0 (2022-07-06) #### Features diff --git a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/version.rb b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/version.rb index b2380fa92901..54fd954f4ff8 100644 --- a/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/version.rb +++ b/google-cloud-notebooks-v1/lib/google/cloud/notebooks/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Notebooks module V1 - VERSION = "0.3.0" + VERSION = "0.4.0" end end end diff --git a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json index 6bf0f8d67a21..17fca58c580a 100644 --- a/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json +++ b/google-cloud-notebooks-v1/snippets/snippet_metadata_google.cloud.notebooks.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-notebooks-v1", - "version": "0.3.0", + "version": "0.4.0", "language": "RUBY", "apis": [ { From 9993ee26ccbfedca2807036c964f7fe41a9645c7 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:59:43 -0800 Subject: [PATCH 103/112] chore(main): release google-cloud-notebooks-v1beta1 0.6.0 (#19454) --- .release-please-manifest.json | 2 +- google-cloud-notebooks-v1beta1/CHANGELOG.md | 6 ++++++ .../lib/google/cloud/notebooks/v1beta1/version.rb | 2 +- .../snippet_metadata_google.cloud.notebooks.v1beta1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3f4c9ced9e3f..6495d2b9fc8b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -389,7 +389,7 @@ "google-cloud-notebooks+FILLER": "0.0.0", "google-cloud-notebooks-v1": "0.4.0", "google-cloud-notebooks-v1+FILLER": "0.0.0", - "google-cloud-notebooks-v1beta1": "0.5.0", + "google-cloud-notebooks-v1beta1": "0.6.0", "google-cloud-notebooks-v1beta1+FILLER": "0.0.0", "google-cloud-optimization": "0.2.0", "google-cloud-optimization+FILLER": "0.0.0", diff --git a/google-cloud-notebooks-v1beta1/CHANGELOG.md b/google-cloud-notebooks-v1beta1/CHANGELOG.md index 832ca57f11da..213fabfeef5b 100644 --- a/google-cloud-notebooks-v1beta1/CHANGELOG.md +++ b/google-cloud-notebooks-v1beta1/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +### 0.6.0 (2022-11-17) + +#### Features + +* support nic_type, reservation_affinity, can_ip_forward for Instance + ### 0.5.0 (2022-07-06) #### Features diff --git a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/version.rb b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/version.rb index 68f2e8f9a50d..53a62b629273 100644 --- a/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/version.rb +++ b/google-cloud-notebooks-v1beta1/lib/google/cloud/notebooks/v1beta1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Notebooks module V1beta1 - VERSION = "0.5.0" + VERSION = "0.6.0" end end end diff --git a/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json b/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json index aebe0bb806f2..ef17579fb58c 100644 --- a/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json +++ b/google-cloud-notebooks-v1beta1/snippets/snippet_metadata_google.cloud.notebooks.v1beta1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-notebooks-v1beta1", - "version": "0.5.0", + "version": "0.6.0", "language": "RUBY", "apis": [ { From 344ff6fd27bd7a7934a24a44745810ce81fc5e46 Mon Sep 17 00:00:00 2001 From: yoshi-code-bot <70984784+yoshi-code-bot@users.noreply.github.com> Date: Thu, 17 Nov 2022 02:00:00 -0800 Subject: [PATCH 104/112] chore(main): release google-cloud-shell-v1 0.3.0 (#19455) --- .release-please-manifest.json | 2 +- google-cloud-shell-v1/CHANGELOG.md | 6 ++++++ google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb | 2 +- .../snippets/snippet_metadata_google.cloud.shell.v1.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6495d2b9fc8b..0f0c31dc4ae1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -519,7 +519,7 @@ "google-cloud-service_usage-v1+FILLER": "0.0.0", "google-cloud-shell": "1.1.0", "google-cloud-shell+FILLER": "0.0.0", - "google-cloud-shell-v1": "0.2.0", + "google-cloud-shell-v1": "0.3.0", "google-cloud-shell-v1+FILLER": "0.0.0", "google-cloud-spanner-admin-database-v1": "0.11.0", "google-cloud-spanner-admin-database-v1+FILLER": "0.0.0", diff --git a/google-cloud-shell-v1/CHANGELOG.md b/google-cloud-shell-v1/CHANGELOG.md index 0c4f7dbe374b..f740827bd7b2 100644 --- a/google-cloud-shell-v1/CHANGELOG.md +++ b/google-cloud-shell-v1/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.3.0 (2022-11-17) + +#### Features + +* add :ENVIRONMENT_UNAVAILABLE to cloudshell error code + ### 0.2.0 (2022-07-08) #### Features diff --git a/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb b/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb index 7d99c0f69f5f..86c7f9201a12 100644 --- a/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb +++ b/google-cloud-shell-v1/lib/google/cloud/shell/v1/version.rb @@ -21,7 +21,7 @@ module Google module Cloud module Shell module V1 - VERSION = "0.2.0" + VERSION = "0.3.0" end end end diff --git a/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json b/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json index f3d3a0fd1a2c..bcc6742eb0bf 100644 --- a/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json +++ b/google-cloud-shell-v1/snippets/snippet_metadata_google.cloud.shell.v1.json @@ -1,7 +1,7 @@ { "client_library": { "name": "google-cloud-shell-v1", - "version": "0.2.0", + "version": "0.3.0", "language": "RUBY", "apis": [ { From b9bbd9f258017aae517790038e8bd62ca65d5379 Mon Sep 17 00:00:00 2001 From: Nivedha Date: Fri, 18 Nov 2022 10:35:41 +0530 Subject: [PATCH 105/112] chore(monitoring): retry metric descriptor operations (#19441) --- .../samples/acceptance/metrics_test.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/google-cloud-monitoring/samples/acceptance/metrics_test.rb b/google-cloud-monitoring/samples/acceptance/metrics_test.rb index aa8fe13563c5..cd6ccebdaf12 100644 --- a/google-cloud-monitoring/samples/acceptance/metrics_test.rb +++ b/google-cloud-monitoring/samples/acceptance/metrics_test.rb @@ -43,7 +43,9 @@ client.create_metric_descriptor name: project_path, metric_descriptor: descriptor out, _err = capture_io do - delete_metric_descriptor project_id: project_id, metric_type: metric_type + retry_block 3 do + delete_metric_descriptor project_id: project_id, metric_type: metric_type + end end assert_match(/Deleted metric descriptor #{metric_name}/, out) end @@ -94,7 +96,9 @@ it "writes time series data that can be read back" do start_secs = (Time.now - 2).to_i out, _err = capture_io do - write_time_series project_id: project_id, metric_type: metric_type + retry_block 3 do + write_time_series project_id: project_id, metric_type: metric_type + end end end_secs = (Time.now + 2).to_i assert_match(/Time series created/, out) From 5896694cdb1f26507c2355bb1b2bd2c9af856c3a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:08:18 +0530 Subject: [PATCH 106/112] chore(dialogflow): Clarify Agent Assist max retention is 30 days --- .../cloud/dialogflow/cx/v3/security_settings.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb index a1b306676db1..93b76f523480 100644 --- a/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +++ b/google-cloud-dialogflow-cx-v3/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb @@ -164,12 +164,11 @@ class DeleteSecuritySettingsRequest # `SecuritySettings`. # @!attribute [rw] retention_window_days # @return [::Integer] - # Retains data in interaction logging for the specified number of days. - # This does not apply to Cloud logging, which is owned by the user - not - # Dialogflow. - # User must set a value lower than Dialogflow's default 365d TTL (time to - # live). Setting a value higher than that has no effect. A missing value or - # setting to 0 also means we use Dialogflow's default TTL. + # Retains the data for the specified number of days. + # User must set a value lower than Dialogflow's default 365d TTL (30 days + # for Agent Assist traffic), higher value will be ignored and use default. + # Setting a value higher than that has no effect. A missing value or + # setting to 0 also means we use default TTL. # @!attribute [rw] purge_data_types # @return [::Array<::Google::Cloud::Dialogflow::CX::V3::SecuritySettings::PurgeDataType>] # List of types of data to remove when retention settings triggers purge. From b3dbaa293945d7665cd1644b6ecbf575f3ace11b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Nov 2022 11:10:10 +0530 Subject: [PATCH 107/112] feat(video-transcoder): add Deinterlace to PreprocessingConfig --- .../cloud/video/transcoder/v1/resources_pb.rb | 21 ++++ .../cloud/video/transcoder/v1/resources.rb | 113 ++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/resources_pb.rb b/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/resources_pb.rb index 81fb6f799af9..8b2c10ff074c 100644 --- a/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/resources_pb.rb +++ b/google-cloud-video-transcoder-v1/lib/google/cloud/video/transcoder/v1/resources_pb.rb @@ -156,6 +156,7 @@ optional :audio, :message, 4, "google.cloud.video.transcoder.v1.PreprocessingConfig.Audio" optional :crop, :message, 5, "google.cloud.video.transcoder.v1.PreprocessingConfig.Crop" optional :pad, :message, 6, "google.cloud.video.transcoder.v1.PreprocessingConfig.Pad" + optional :deinterlace, :message, 7, "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace" end add_message "google.cloud.video.transcoder.v1.PreprocessingConfig.Color" do optional :saturation, :double, 1 @@ -187,6 +188,23 @@ optional :left_pixels, :int32, 3 optional :right_pixels, :int32, 4 end + add_message "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace" do + oneof :deinterlacing_filter do + optional :yadif, :message, 1, "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig" + optional :bwdif, :message, 2, "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig" + end + end + add_message "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig" do + optional :mode, :string, 1 + optional :disable_spatial_interlacing, :bool, 2 + optional :parity, :string, 3 + optional :deinterlace_all_frames, :bool, 4 + end + add_message "google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig" do + optional :mode, :string, 1 + optional :parity, :string, 2 + optional :deinterlace_all_frames, :bool, 3 + end add_message "google.cloud.video.transcoder.v1.VideoStream" do oneof :codec_settings do optional :h264, :message, 1, "google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings" @@ -321,6 +339,9 @@ module V1 PreprocessingConfig::Audio = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Audio").msgclass PreprocessingConfig::Crop = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Crop").msgclass PreprocessingConfig::Pad = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Pad").msgclass + PreprocessingConfig::Deinterlace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace").msgclass + PreprocessingConfig::Deinterlace::YadifConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.YadifConfig").msgclass + PreprocessingConfig::Deinterlace::BwdifConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.PreprocessingConfig.Deinterlace.BwdifConfig").msgclass VideoStream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.VideoStream").msgclass VideoStream::H264CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.VideoStream.H264CodecSettings").msgclass VideoStream::H265CodecSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.video.transcoder.v1.VideoStream.H265CodecSettings").msgclass diff --git a/google-cloud-video-transcoder-v1/proto_docs/google/cloud/video/transcoder/v1/resources.rb b/google-cloud-video-transcoder-v1/proto_docs/google/cloud/video/transcoder/v1/resources.rb index 9ee89f0c7eeb..82eeff24b5d1 100644 --- a/google-cloud-video-transcoder-v1/proto_docs/google/cloud/video/transcoder/v1/resources.rb +++ b/google-cloud-video-transcoder-v1/proto_docs/google/cloud/video/transcoder/v1/resources.rb @@ -363,12 +363,22 @@ class PubsubDestination # source aspect ratio, set the {::Google::Cloud::Video::Transcoder::V1::SpriteSheet#sprite_width_pixels SpriteSheet.sprite_width_pixels} field or # the {::Google::Cloud::Video::Transcoder::V1::SpriteSheet#sprite_height_pixels SpriteSheet.sprite_height_pixels} field, but not both (the API will # automatically calculate the missing field). + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the width, in pixels, per the horizontal ASR. The API calculates + # the height per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] sprite_height_pixels # @return [::Integer] # Required. The height of sprite in pixels. Must be an even integer. To preserve the # source aspect ratio, set the {::Google::Cloud::Video::Transcoder::V1::SpriteSheet#sprite_height_pixels SpriteSheet.sprite_height_pixels} field or # the {::Google::Cloud::Video::Transcoder::V1::SpriteSheet#sprite_width_pixels SpriteSheet.sprite_width_pixels} field, but not both (the API will # automatically calculate the missing field). + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the height, in pixels, per the horizontal ASR. The API calculates + # the width per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] column_count # @return [::Integer] # The maximum number of sprites per row in a sprite sheet. The default is 0, @@ -548,6 +558,9 @@ module FadeType # @!attribute [rw] pad # @return [::Google::Cloud::Video::Transcoder::V1::PreprocessingConfig::Pad] # Specify the video pad filter configuration. + # @!attribute [rw] deinterlace + # @return [::Google::Cloud::Video::Transcoder::V1::PreprocessingConfig::Deinterlace] + # Specify the video deinterlace configuration. class PreprocessingConfig include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -677,6 +690,76 @@ class Pad include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end + + # Deinterlace configuration for input video. + # @!attribute [rw] yadif + # @return [::Google::Cloud::Video::Transcoder::V1::PreprocessingConfig::Deinterlace::YadifConfig] + # Specifies the Yet Another Deinterlacing Filter Configuration. + # @!attribute [rw] bwdif + # @return [::Google::Cloud::Video::Transcoder::V1::PreprocessingConfig::Deinterlace::BwdifConfig] + # Specifies the Bob Weaver Deinterlacing Filter Configuration. + class Deinterlace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Yet Another Deinterlacing Filter Configuration. + # @!attribute [rw] mode + # @return [::String] + # Specifies the deinterlacing mode to adopt. + # The default is `send_frame`. + # Supported values: + # + # - `send_frame`: Output one frame for each frame + # - `send_field`: Output one frame for each field + # @!attribute [rw] disable_spatial_interlacing + # @return [::Boolean] + # Disable spacial interlacing. + # The default is `false`. + # @!attribute [rw] parity + # @return [::String] + # The picture field parity assumed for the input interlaced video. + # The default is `auto`. + # Supported values: + # + # - `tff`: Assume the top field is first + # - `bff`: Assume the bottom field is first + # - `auto`: Enable automatic detection of field parity + # @!attribute [rw] deinterlace_all_frames + # @return [::Boolean] + # Deinterlace all frames rather than just the frames identified as + # interlaced. The default is `false`. + class YadifConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Bob Weaver Deinterlacing Filter Configuration. + # @!attribute [rw] mode + # @return [::String] + # Specifies the deinterlacing mode to adopt. + # The default is `send_frame`. + # Supported values: + # + # - `send_frame`: Output one frame for each frame + # - `send_field`: Output one frame for each field + # @!attribute [rw] parity + # @return [::String] + # The picture field parity assumed for the input interlaced video. + # The default is `auto`. + # Supported values: + # + # - `tff`: Assume the top field is first + # - `bff`: Assume the bottom field is first + # - `auto`: Enable automatic detection of field parity + # @!attribute [rw] deinterlace_all_frames + # @return [::Boolean] + # Deinterlace all frames rather than just the frames identified as + # interlaced. The default is `false`. + class BwdifConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end end # Video stream resource. @@ -699,11 +782,21 @@ class VideoStream # The width of the video in pixels. Must be an even integer. # When not specified, the width is adjusted to match the specified height # and input aspect ratio. If both are omitted, the input width is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the width, in pixels, per the horizontal ASR. The API calculates + # the height per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] height_pixels # @return [::Integer] # The height of the video in pixels. Must be an even integer. # When not specified, the height is adjusted to match the specified width # and input aspect ratio. If both are omitted, the input height is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the height, in pixels, per the horizontal ASR. The API calculates + # the width per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] frame_rate # @return [::Float] # Required. The target video frame rate in frames per second (FPS). Must be less than @@ -834,11 +927,21 @@ class H264CodecSettings # The width of the video in pixels. Must be an even integer. # When not specified, the width is adjusted to match the specified height # and input aspect ratio. If both are omitted, the input width is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the width, in pixels, per the horizontal ASR. The API calculates + # the height per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] height_pixels # @return [::Integer] # The height of the video in pixels. Must be an even integer. # When not specified, the height is adjusted to match the specified width # and input aspect ratio. If both are omitted, the input height is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the height, in pixels, per the horizontal ASR. The API calculates + # the width per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] frame_rate # @return [::Float] # Required. The target video frame rate in frames per second (FPS). Must be less than @@ -976,11 +1079,21 @@ class H265CodecSettings # The width of the video in pixels. Must be an even integer. # When not specified, the width is adjusted to match the specified height # and input aspect ratio. If both are omitted, the input width is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the width, in pixels, per the horizontal ASR. The API calculates + # the height per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] height_pixels # @return [::Integer] # The height of the video in pixels. Must be an even integer. # When not specified, the height is adjusted to match the specified width # and input aspect ratio. If both are omitted, the input height is used. + # + # For portrait videos that contain horizontal ASR and rotation metadata, + # provide the height, in pixels, per the horizontal ASR. The API calculates + # the width per the horizontal ASR. The API detects any rotation metadata + # and swaps the requested height and width for the output. # @!attribute [rw] frame_rate # @return [::Float] # Required. The target video frame rate in frames per second (FPS). Must be less than From e787a09d5650ea3a4a9dc09bb147242e3e06695a Mon Sep 17 00:00:00 2001 From: Nivedha Date: Fri, 18 Nov 2022 12:15:20 +0530 Subject: [PATCH 108/112] feat(bigquery): support table snapshot and clone (#19354) * feat(bigquery): add a method to access type of table --- .../acceptance/bigquery/table_policy_test.rb | 2 +- .../acceptance/bigquery/table_test.rb | 55 +++- .../lib/google/cloud/bigquery/copy_job.rb | 21 +- .../lib/google/cloud/bigquery/table.rb | 288 +++++++++++++++++- .../google/cloud/bigquery/table_clone_test.rb | 128 ++++++++ .../google/cloud/bigquery/table_copy_test.rb | 3 +- .../cloud/bigquery/table_reference_test.rb | 1 + .../cloud/bigquery/table_restore_test.rb | 193 ++++++++++++ .../cloud/bigquery/table_snapshot_test.rb | 128 ++++++++ .../test/google/cloud/bigquery/table_test.rb | 18 ++ google-cloud-bigquery/test/helper.rb | 55 +++- 11 files changed, 874 insertions(+), 18 deletions(-) create mode 100644 google-cloud-bigquery/test/google/cloud/bigquery/table_clone_test.rb create mode 100644 google-cloud-bigquery/test/google/cloud/bigquery/table_restore_test.rb create mode 100644 google-cloud-bigquery/test/google/cloud/bigquery/table_snapshot_test.rb diff --git a/google-cloud-bigquery/acceptance/bigquery/table_policy_test.rb b/google-cloud-bigquery/acceptance/bigquery/table_policy_test.rb index 3c79386fb3dc..2865fff84a9c 100644 --- a/google-cloud-bigquery/acceptance/bigquery/table_policy_test.rb +++ b/google-cloud-bigquery/acceptance/bigquery/table_policy_test.rb @@ -23,7 +23,7 @@ end d end - let(:table_id) { "kittens" } + let(:table_id) { "kittens_policy" } let(:table) do t = dataset.table table_id if t.nil? diff --git a/google-cloud-bigquery/acceptance/bigquery/table_test.rb b/google-cloud-bigquery/acceptance/bigquery/table_test.rb index 5fd2c37dc7fa..00b79db54536 100644 --- a/google-cloud-bigquery/acceptance/bigquery/table_test.rb +++ b/google-cloud-bigquery/acceptance/bigquery/table_test.rb @@ -23,7 +23,7 @@ end d end - let(:table_id) { "kittens" } + let(:table_id) { "kittens_table" } let(:table) do t = dataset.table table_id if t.nil? @@ -96,6 +96,8 @@ let(:target_table_2_id) { "kittens_copy_2" } let(:target_table_3_id) { "kittens_copy_3" } let(:target_table_4_id) { "kittens_copy_4" } + let(:target_snapshot_table) { "kittens_copy_5" } + let(:target_clone_table) { "kittens_copy_6" } let(:labels) { { "foo" => "bar" } } it "has the attributes of a table" do @@ -810,7 +812,7 @@ gs_url = "gs://#{file2.bucket}/#{file2.name}" # Test both by file object and URL as string - result = table.load [file1, gs_url] + result = safe_gcs_execute { table.load [file1, gs_url] } _(result).must_equal true end @@ -932,9 +934,11 @@ Tempfile.open "empty_extract_file.json" do |tmp| dest_file_name = random_file_destination_name extract_url = "gs://#{bucket.name}/#{dest_file_name}" - extract_job = table.extract_job extract_url do |j| - j.labels = labels - end + extract_job = safe_gcs_execute do + table.extract_job extract_url do |j| + j.labels = labels + end + end _(extract_job).must_be_kind_of Google::Cloud::Bigquery::ExtractJob _(extract_job.labels).must_equal labels @@ -966,7 +970,9 @@ extract_file = bucket.create_file tmp, dest_file_name job_id = "test_job_#{SecureRandom.urlsafe_base64(21)}" # client-generated - extract_job = table.extract_job extract_file, job_id: job_id + extract_job = safe_gcs_execute do + table.extract_job extract_file, job_id: job_id + end _(extract_job.job_id).must_equal job_id extract_job.wait_until_done! _(extract_job).wont_be :failed? @@ -985,7 +991,7 @@ Tempfile.open "empty_extract_file.json" do |tmp| dest_file_name = random_file_destination_name extract_url = "gs://#{bucket.name}/#{dest_file_name}" - result = table.extract extract_url + result = safe_gcs_execute { table.extract extract_url } _(result).must_equal true extract_file = bucket.file dest_file_name @@ -1003,7 +1009,7 @@ dest_file_name = random_file_destination_name extract_file = bucket.create_file tmp, dest_file_name - result = table.extract extract_file + result = safe_gcs_execute { table.extract extract_file } _(result).must_equal true # Refresh to get the latest file data extract_file = bucket.file dest_file_name @@ -1011,4 +1017,37 @@ _(downloaded_file.size).must_be :>, 0 end end + + it "creates snapshot of a table" do + begin + result = table.snapshot target_snapshot_table + _(result).must_equal true + table_snapshot = dataset.table target_snapshot_table + _(table_snapshot.snapshot?).must_equal true + ensure + table_snapshot.delete + end + end + + it "creates clone of a table" do + begin + result = table.clone target_clone_table + _(result).must_equal true + table_clone = dataset.table target_clone_table + _(table_clone.clone?).must_equal true + ensure + table_clone.delete + end + end + + it "restores snapshot into a table" do + begin + result = table.clone target_clone_table + _(result).must_equal true + restored_table = dataset.table target_clone_table + _(restored_table.table?).must_equal true + ensure + restored_table.delete + end + end end diff --git a/google-cloud-bigquery/lib/google/cloud/bigquery/copy_job.rb b/google-cloud-bigquery/lib/google/cloud/bigquery/copy_job.rb index c763a666f9a8..3bbadd8f1799 100644 --- a/google-cloud-bigquery/lib/google/cloud/bigquery/copy_job.rb +++ b/google-cloud-bigquery/lib/google/cloud/bigquery/copy_job.rb @@ -17,6 +17,24 @@ module Google module Cloud module Bigquery + module OperationType + # Different operation types supported in table copy job. + # https://cloud.google.com/bigquery/docs/reference/rest/v2/Job#operationtype + + # The source and destination table have the same table type. + COPY = "COPY".freeze + + # The source table type is TABLE and the destination table type is SNAPSHOT. + SNAPSHOT = "SNAPSHOT".freeze + + # The source table type is SNAPSHOT and the destination table type is TABLE. + RESTORE = "RESTORE".freeze + + # The source and destination table have the same table type, but only bill for + # unique data. + CLONE = "CLONE".freeze + end + ## # # CopyJob # @@ -157,7 +175,8 @@ def self.from_options service, source, target, options job_ref = service.job_ref_from options[:job_id], options[:prefix] copy_cfg = Google::Apis::BigqueryV2::JobConfigurationTableCopy.new( source_table: source, - destination_table: target + destination_table: target, + operation_type: options[:operation_type] ) req = Google::Apis::BigqueryV2::Job.new( job_reference: job_ref, diff --git a/google-cloud-bigquery/lib/google/cloud/bigquery/table.rb b/google-cloud-bigquery/lib/google/cloud/bigquery/table.rb index 1d0af5149e2d..b8cf0396a5a8 100644 --- a/google-cloud-bigquery/lib/google/cloud/bigquery/table.rb +++ b/google-cloud-bigquery/lib/google/cloud/bigquery/table.rb @@ -154,6 +154,45 @@ def project_id @gapi.table_reference.project_id end + ## + # The type of the table like if its a TABLE, VIEW or SNAPSHOT etc., + # + # @return [String, nil] Type of the table, or + # `nil` if the object is a reference (see {#reference?}). + # + # @!group Attributes + # + def type + return nil if reference? + @gapi.type + end + + ## + # The Information about base table and snapshot time of the table. + # + # @return [Google::Apis::BigqueryV2::SnapshotDefinition, nil] Snapshot definition of table snapshot, or + # `nil` if not snapshot or the object is a reference (see {#reference?}). + # + # @!group Attributes + # + def snapshot_definition + return nil if reference? + @gapi.snapshot_definition + end + + ## + # The Information about base table and clone time of the table. + # + # @return [Google::Apis::BigqueryV2::CloneDefinition, nil] Clone definition of table clone, or + # `nil` if not clone or the object is a reference (see {#reference?}). + # + # @!group Attributes + # + def clone_definition + return nil if reference? + @gapi.clone_definition + end + ## # @private The gapi fragment containing the Project ID, Dataset ID, and # Table ID. @@ -820,6 +859,40 @@ def view? @gapi.type == "VIEW" end + ## + # Checks if the table's type is `SNAPSHOT`, indicating that the table + # represents a BigQuery table snapshot. + # + # @see https://cloud.google.com/bigquery/docs/table-snapshots-intro + # + # @return [Boolean, nil] `true` when the type is `SNAPSHOT`, `false` + # otherwise, if the object is a resource (see {#resource?}); `nil` if + # the object is a reference (see {#reference?}). + # + # @!group Attributes + # + def snapshot? + return nil if reference? + @gapi.type == "SNAPSHOT" + end + + ## + # Checks if the table's type is `CLONE`, indicating that the table + # represents a BigQuery table clone. + # + # @see https://cloud.google.com/bigquery/docs/table-clones-intro + # + # @return [Boolean, nil] `true` when the type is `CLONE`, `false` + # otherwise, if the object is a resource (see {#resource?}); `nil` if + # the object is a reference (see {#reference?}). + # + # @!group Attributes + # + def clone? + return nil if reference? + !@gapi.clone_definition.nil? + end + ## # Checks if the table's type is `MATERIALIZED_VIEW`, indicating that # the table represents a BigQuery materialized view. @@ -1697,9 +1770,16 @@ def data token: nil, max: nil, start: nil # # @!group Data # - def copy_job destination_table, create: nil, write: nil, job_id: nil, prefix: nil, labels: nil, dryrun: nil + def copy_job destination_table, create: nil, write: nil, job_id: nil, prefix: nil, labels: nil, dryrun: nil, + operation_type: nil ensure_service! - options = { create: create, write: write, dryrun: dryrun, labels: labels, job_id: job_id, prefix: prefix } + options = { create: create, + write: write, + dryrun: dryrun, + labels: labels, + job_id: job_id, + prefix: prefix, + operation_type: operation_type } updater = CopyJob::Updater.from_options( service, table_ref, @@ -1780,10 +1860,195 @@ def copy_job destination_table, create: nil, write: nil, job_id: nil, prefix: ni # @!group Data # def copy destination_table, create: nil, write: nil, &block - job = copy_job destination_table, create: create, write: write, &block - job.wait_until_done! - ensure_job_succeeded! job - true + copy_job_with_operation_type destination_table, + create: create, + write: write, + operation_type: OperationType::COPY, + &block + end + + ## + # Clones the data from the table to another table using a synchronous + # method that blocks for a response. + # The source and destination table have the same table type, but only bill for + # unique data. + # Timeouts and transient errors are generally handled as needed to complete the job. + # See also {#copy_job}. + # + # The geographic location for the job ("US", "EU", etc.) can be set via + # {CopyJob::Updater#location=} in a block passed to this method. If the + # table is a full resource representation (see {#resource_full?}), the + # location of the job will be automatically set to the location of the + # table. + # + # @param [Table, String] destination_table The destination for the + # copied data. This can also be a string identifier as specified by + # the [Standard SQL Query + # Reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#from-clause) + # (`project-name.dataset_id.table_id`) or the [Legacy SQL Query + # Reference](https://cloud.google.com/bigquery/query-reference#from) + # (`project-name:dataset_id.table_id`). This is useful for referencing + # tables in other projects and datasets. + # + # @yield [job] a job configuration object + # @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job + # configuration object for setting additional options. + # + # @return [Boolean] Returns `true` if the copy operation succeeded. + # + # @example + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # destination_table = dataset.table "my_destination_table" + # + # table.clone destination_table + # + # @example Passing a string identifier for the destination table: + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # + # table.clone "other-project:other_dataset.other_table" + # + # @!group Data + # + def clone destination_table, &block + copy_job_with_operation_type destination_table, + operation_type: OperationType::CLONE, + &block + end + + ## + # Takes snapshot of the data from the table to another table using a synchronous + # method that blocks for a response. + # The source table type is TABLE and the destination table type is SNAPSHOT. + # Timeouts and transient errors are generally handled as needed to complete the job. + # See also {#copy_job}. + # + # The geographic location for the job ("US", "EU", etc.) can be set via + # {CopyJob::Updater#location=} in a block passed to this method. If the + # table is a full resource representation (see {#resource_full?}), the + # location of the job will be automatically set to the location of the + # table. + # + # @param [Table, String] destination_table The destination for the + # copied data. This can also be a string identifier as specified by + # the [Standard SQL Query + # Reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#from-clause) + # (`project-name.dataset_id.table_id`) or the [Legacy SQL Query + # Reference](https://cloud.google.com/bigquery/query-reference#from) + # (`project-name:dataset_id.table_id`). This is useful for referencing + # tables in other projects and datasets. + # + # @yield [job] a job configuration object + # @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job + # configuration object for setting additional options. + # + # @return [Boolean] Returns `true` if the copy operation succeeded. + # + # @example + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # destination_table = dataset.table "my_destination_table" + # + # table.snapshot destination_table + # + # @example Passing a string identifier for the destination table: + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # + # table.snapshot "other-project:other_dataset.other_table" + # + # @!group Data + # + def snapshot destination_table, &block + copy_job_with_operation_type destination_table, + operation_type: OperationType::SNAPSHOT, + &block + end + + ## + # Restore the data from the table to another table using a synchronous + # method that blocks for a response. + # The source table type is SNAPSHOT and the destination table type is TABLE. + # Timeouts and transient errors are generally handled as needed to complete the job. + # See also {#copy_job}. + # + # The geographic location for the job ("US", "EU", etc.) can be set via + # {CopyJob::Updater#location=} in a block passed to this method. If the + # table is a full resource representation (see {#resource_full?}), the + # location of the job will be automatically set to the location of the + # table. + # + # @param [Table, String] destination_table The destination for the + # copied data. This can also be a string identifier as specified by + # the [Standard SQL Query + # Reference](https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#from-clause) + # (`project-name.dataset_id.table_id`) or the [Legacy SQL Query + # Reference](https://cloud.google.com/bigquery/query-reference#from) + # (`project-name:dataset_id.table_id`). This is useful for referencing + # tables in other projects and datasets. + # @param [String] create Specifies whether the job is allowed to create + # new tables. The default value is `needed`. + # + # The following values are supported: + # + # * `needed` - Create the table if it does not exist. + # * `never` - The table must already exist. A 'notFound' error is + # raised if the table does not exist. + # @param [String] write Specifies how to handle data already present in + # the destination table. The default value is `empty`. + # + # The following values are supported: + # + # * `truncate` - BigQuery overwrites the table data. + # * `append` - BigQuery appends the data to the table. + # * `empty` - An error will be returned if the destination table + # already contains data. + # @yield [job] a job configuration object + # @yieldparam [Google::Cloud::Bigquery::CopyJob::Updater] job a job + # configuration object for setting additional options. + # + # @return [Boolean] Returns `true` if the copy operation succeeded. + # + # @example + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # destination_table = dataset.table "my_destination_table" + # + # table.restore destination_table + # + # @example Passing a string identifier for the destination table: + # require "google/cloud/bigquery" + # + # bigquery = Google::Cloud::Bigquery.new + # dataset = bigquery.dataset "my_dataset" + # table = dataset.table "my_table" + # + # table.restore "other-project:other_dataset.other_table" + # + # @!group Data + # + def restore destination_table, create: nil, write: nil, &block + copy_job_with_operation_type destination_table, + create: create, + write: write, + operation_type: OperationType::RESTORE, + &block end ## @@ -2739,6 +3004,17 @@ def self.new_reference_from_gapi gapi, service protected + def copy_job_with_operation_type destination_table, create: nil, write: nil, operation_type: nil, &block + job = copy_job destination_table, + create: create, + write: write, + operation_type: operation_type, + &block + job.wait_until_done! + ensure_job_succeeded! job + true + end + ## # Raise an error unless an active service is available. def ensure_service! diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_clone_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_clone_test.rb new file mode 100644 index 000000000000..a1ff59e7786d --- /dev/null +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_clone_test.rb @@ -0,0 +1,128 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "helper" + +describe Google::Cloud::Bigquery::Table, :copy, :mock_bigquery do + let(:source_dataset) { "source_dataset" } + let(:source_table_id) { "source_table_id" } + let(:source_table_name) { "Source Table" } + let(:source_description) { "This is the source table" } + let(:source_table_gapi) { random_table_gapi source_dataset, + source_table_id, + source_table_name, + source_description } + let(:source_table) { Google::Cloud::Bigquery::Table.from_gapi source_table_gapi, + bigquery.service } + let(:target_dataset) { "target_dataset" } + let(:target_table_id) { "target_table_id" } + let(:target_table_name) { "Target Table" } + let(:target_description) { "This is the target table" } + let(:target_table_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description } + let(:target_table) { Google::Cloud::Bigquery::Table.from_gapi target_table_gapi, + bigquery.service } + let(:target_table_other_proj_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description, + "target-project" } + let(:target_table_other_proj) { Google::Cloud::Bigquery::Table.from_gapi target_table_other_proj_gapi, + bigquery.service } + + it "can clone itself" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + job_gapi = copy_job_gapi(source_table, target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.clone target_table + mock.verify + + _(result).must_equal true + end + + it "can clone to a table identified by a string" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table_other_proj) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, ["test-project", job_gapi] + + result = source_table.clone "target-project:target_dataset.target_table_id" + mock.verify + + _(result).must_equal true + end + + it "can clone to a table name string only" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + new_target_table = Google::Cloud::Bigquery::Table.from_gapi( + random_table_gapi(source_dataset, + "new_target_table_id", + target_table_name, + target_description), + bigquery.service + ) + + job_gapi = copy_job_gapi(source_table, new_target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.clone "new_target_table_id" + mock.verify + + _(result).must_equal true + end + + def copy_job_gapi source, target, job_id: "job_9876543210", location: "US" + Google::Apis::BigqueryV2::Job.from_json copy_job_json(source, target, job_id, location: location) + end + + def copy_job_json source, target, job_id, location: "US" + { + "jobReference" => { + "projectId" => project, + "jobId" => job_id, + "location" => location + }, + "configuration" => { + "copy" => { + "sourceTable" => { + "projectId" => source.project_id, + "datasetId" => source.dataset_id, + "tableId" => source.table_id + }, + "destinationTable" => { + "projectId" => target.project_id, + "datasetId" => target.dataset_id, + "tableId" => target.table_id + }, + "createDisposition" => nil, + "writeDisposition" => nil, + "operationType" => "CLONE" + }, + "dryRun" => nil + } + }.to_json + end +end diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_copy_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_copy_test.rb index e63f616597fe..54fe4627cbf8 100644 --- a/google-cloud-bigquery/test/google/cloud/bigquery/table_copy_test.rb +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_copy_test.rb @@ -183,7 +183,8 @@ def copy_job_json source, target, job_id, location: "US" "tableId" => target.table_id }, "createDisposition" => nil, - "writeDisposition" => nil + "writeDisposition" => nil, + "operationType" => "COPY" }, "dryRun" => nil } diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_reference_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_reference_test.rb index 041d32ce8c42..7fff20ca96b4 100644 --- a/google-cloud-bigquery/test/google/cloud/bigquery/table_reference_test.rb +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_reference_test.rb @@ -236,6 +236,7 @@ job_gapi = copy_job_gapi(table, target_table, location: nil) job_resp_gapi = job_gapi.dup job_resp_gapi.status = status "done" + job_resp_gapi.configuration.copy.operation_type = "COPY" mock.expect :insert_job, job_resp_gapi, [project, job_gapi] result = table.copy target_table diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_restore_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_restore_test.rb new file mode 100644 index 000000000000..273f8146efff --- /dev/null +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_restore_test.rb @@ -0,0 +1,193 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "helper" + +describe Google::Cloud::Bigquery::Table, :copy, :mock_bigquery do + let(:source_dataset) { "source_dataset" } + let(:source_table_id) { "source_table_id" } + let(:source_table_name) { "Source Table" } + let(:source_description) { "This is the source table" } + let(:source_table_gapi) { random_table_gapi source_dataset, + source_table_id, + source_table_name, + source_description } + let(:source_table) { Google::Cloud::Bigquery::Table.from_gapi source_table_gapi, + bigquery.service } + let(:target_dataset) { "target_dataset" } + let(:target_table_id) { "target_table_id" } + let(:target_table_name) { "Target Table" } + let(:target_description) { "This is the target table" } + let(:target_table_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description } + let(:target_table) { Google::Cloud::Bigquery::Table.from_gapi target_table_gapi, + bigquery.service } + let(:target_table_other_proj_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description, + "target-project" } + let(:target_table_other_proj) { Google::Cloud::Bigquery::Table.from_gapi target_table_other_proj_gapi, + bigquery.service } + + it "can restore itself" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + job_gapi = copy_job_gapi(source_table, target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore target_table + mock.verify + + _(result).must_equal true + end + + it "can restore to a table identified by a string" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table_other_proj) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, ["test-project", job_gapi] + + result = source_table.restore "target-project:target_dataset.target_table_id" + mock.verify + + _(result).must_equal true + end + + it "can restore to a table name string only" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + new_target_table = Google::Cloud::Bigquery::Table.from_gapi( + random_table_gapi(source_dataset, + "new_target_table_id", + target_table_name, + target_description), + bigquery.service + ) + + job_gapi = copy_job_gapi(source_table, new_target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore "new_target_table_id" + mock.verify + + _(result).must_equal true + end + + it "can restore itself with create disposition" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table) + job_gapi.configuration.copy.create_disposition = "CREATE_NEVER" + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore target_table, create: "CREATE_NEVER" + mock.verify + + _(result).must_equal true + end + + it "can restore itself with create disposition symbol" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table) + job_gapi.configuration.copy.create_disposition = "CREATE_NEVER" + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore target_table, create: :never + mock.verify + + _(result).must_equal true + end + + + it "can restore itself with write disposition" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table) + job_gapi.configuration.copy.write_disposition = "WRITE_TRUNCATE" + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore target_table, write: "WRITE_TRUNCATE" + mock.verify + + _(result).must_equal true + end + + it "can restore itself with write disposition symbol" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table) + job_gapi.configuration.copy.write_disposition = "WRITE_TRUNCATE" + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.restore target_table, write: :truncate + mock.verify + + _(result).must_equal true + end + + def copy_job_gapi source, target, job_id: "job_9876543210", location: "US" + Google::Apis::BigqueryV2::Job.from_json copy_job_json(source, target, job_id, location: location) + end + + def copy_job_json source, target, job_id, location: "US" + { + "jobReference" => { + "projectId" => project, + "jobId" => job_id, + "location" => location + }, + "configuration" => { + "copy" => { + "sourceTable" => { + "projectId" => source.project_id, + "datasetId" => source.dataset_id, + "tableId" => source.table_id + }, + "destinationTable" => { + "projectId" => target.project_id, + "datasetId" => target.dataset_id, + "tableId" => target.table_id + }, + "createDisposition" => nil, + "writeDisposition" => nil, + "operationType" => "RESTORE" + }, + "dryRun" => nil + } + }.to_json + end +end diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_snapshot_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_snapshot_test.rb new file mode 100644 index 000000000000..676978c7c41a --- /dev/null +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_snapshot_test.rb @@ -0,0 +1,128 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require "helper" + +describe Google::Cloud::Bigquery::Table, :copy, :mock_bigquery do + let(:source_dataset) { "source_dataset" } + let(:source_table_id) { "source_table_id" } + let(:source_table_name) { "Source Table" } + let(:source_description) { "This is the source table" } + let(:source_table_gapi) { random_table_gapi source_dataset, + source_table_id, + source_table_name, + source_description } + let(:source_table) { Google::Cloud::Bigquery::Table.from_gapi source_table_gapi, + bigquery.service } + let(:target_dataset) { "target_dataset" } + let(:target_table_id) { "target_table_id" } + let(:target_table_name) { "Target Table" } + let(:target_description) { "This is the target table" } + let(:target_table_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description } + let(:target_table) { Google::Cloud::Bigquery::Table.from_gapi target_table_gapi, + bigquery.service } + let(:target_table_other_proj_gapi) { random_table_gapi target_dataset, + target_table_id, + target_table_name, + target_description, + "target-project" } + let(:target_table_other_proj) { Google::Cloud::Bigquery::Table.from_gapi target_table_other_proj_gapi, + bigquery.service } + + it "can snapshot itself" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + job_gapi = copy_job_gapi(source_table, target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.snapshot target_table + mock.verify + + _(result).must_equal true + end + + it "can snapshot to a table identified by a string" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + + job_gapi = copy_job_gapi(source_table, target_table_other_proj) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, ["test-project", job_gapi] + + result = source_table.snapshot "target-project:target_dataset.target_table_id" + mock.verify + + _(result).must_equal true + end + + it "can snapshot to a table name string only" do + mock = Minitest::Mock.new + bigquery.service.mocked_service = mock + new_target_table = Google::Cloud::Bigquery::Table.from_gapi( + random_table_gapi(source_dataset, + "new_target_table_id", + target_table_name, + target_description), + bigquery.service + ) + + job_gapi = copy_job_gapi(source_table, new_target_table) + job_resp_gapi = job_gapi.dup + job_resp_gapi.status = status "done" + mock.expect :insert_job, job_resp_gapi, [project, job_gapi] + + result = source_table.snapshot "new_target_table_id" + mock.verify + + _(result).must_equal true + end + + def copy_job_gapi source, target, job_id: "job_9876543210", location: "US" + Google::Apis::BigqueryV2::Job.from_json copy_job_json(source, target, job_id, location: location) + end + + def copy_job_json source, target, job_id, location: "US" + { + "jobReference" => { + "projectId" => project, + "jobId" => job_id, + "location" => location + }, + "configuration" => { + "copy" => { + "sourceTable" => { + "projectId" => source.project_id, + "datasetId" => source.dataset_id, + "tableId" => source.table_id + }, + "destinationTable" => { + "projectId" => target.project_id, + "datasetId" => target.dataset_id, + "tableId" => target.table_id + }, + "createDisposition" => nil, + "writeDisposition" => nil, + "operationType" => "SNAPSHOT" + }, + "dryRun" => nil + } + }.to_json + end +end diff --git a/google-cloud-bigquery/test/google/cloud/bigquery/table_test.rb b/google-cloud-bigquery/test/google/cloud/bigquery/table_test.rb index 99251be5ec06..01b4d184e646 100644 --- a/google-cloud-bigquery/test/google/cloud/bigquery/table_test.rb +++ b/google-cloud-bigquery/test/google/cloud/bigquery/table_test.rb @@ -31,6 +31,8 @@ let(:table_hash) { random_table_hash dataset, table_id, table_name, description } let(:table_gapi) { Google::Apis::BigqueryV2::Table.from_json(table_hash.to_json).tap { |t| t.encryption_configuration = gapi_encrypt_config } } let(:table) { Google::Cloud::Bigquery::Table.from_gapi table_gapi, bigquery.service } + let(:clone_table) { Google::Cloud::Bigquery::Table.from_gapi random_clone_gapi(dataset), bigquery.service } + let(:snapshot_table) { Google::Cloud::Bigquery::Table.from_gapi random_snapshot_gapi(dataset), bigquery.service } it "knows its attributes" do _(table.table_id).must_equal table_id @@ -138,4 +140,20 @@ mock.verify end + + it "know if its a snapshot" do + _(snapshot_table.snapshot?).must_equal true + end + + it "know if its a clone" do + _(clone_table.clone?).must_equal true + end + + it "know snapshot definition if its a snapshot" do + _(snapshot_table.snapshot_definition).must_be_kind_of Google::Apis::BigqueryV2::SnapshotDefinition + end + + it "knows clone definition if its a clone" do + _(clone_table.clone_definition).must_be_kind_of Google::Apis::BigqueryV2::CloneDefinition + end end diff --git a/google-cloud-bigquery/test/helper.rb b/google-cloud-bigquery/test/helper.rb index 9f1fca2a6fbe..140de72195d6 100644 --- a/google-cloud-bigquery/test/helper.rb +++ b/google-cloud-bigquery/test/helper.rb @@ -341,7 +341,8 @@ def copy_job_json source, target, job_id, location: "US" "tableId" => target.table_id }, "createDisposition" => nil, - "writeDisposition" => nil + "writeDisposition" => nil, + "operationType" => nil }, "dryRun" => nil } @@ -350,6 +351,58 @@ def copy_job_json source, target, job_id, location: "US" hash.to_json end + def random_snapshot_gapi dataset, id = nil, name = nil, description = nil + json = random_snapshot_hash(dataset, id, name, description).to_json + Google::Apis::BigqueryV2::Table.from_json json + end + + def random_snapshot_hash dataset, id = nil, name = nil, description = nil + id ||= "my_snapshot" + name ||= "Snapshot Name" + + base = random_table_partial_hash dataset, id, name, type: "SNAPSHOT" + base.merge({ + "etag" => "etag123456789", + "selfLink" => "http://googleapi/bigquery/v2/projects/#{project}/datasets/#{dataset}/tables/#{id}", + "description" => description, + "schema" => random_schema_hash, + "creationTime" => time_millis, + "expirationTime" => time_millis, + "lastModifiedTime" => time_millis, + "snapshotDefinition" => { + "snapshotTime" => DateTime.now, + "baseTableReference" => Google::Apis::BigqueryV2::TableReference.new + }, + "location" => "US" + }) + end + + def random_clone_gapi dataset, id = nil, name = nil, description = nil + json = random_clone_hash(dataset, id, name, description).to_json + Google::Apis::BigqueryV2::Table.from_json json + end + + def random_clone_hash dataset, id = nil, name = nil, description = nil + id ||= "my_clone" + name ||= "Clone Name" + + base = random_table_partial_hash dataset, id, name, type: "TABLE" + base.merge({ + "etag" => "etag123456789", + "selfLink" => "http://googleapi/bigquery/v2/projects/#{project}/datasets/#{dataset}/tables/#{id}", + "description" => description, + "schema" => random_schema_hash, + "creationTime" => time_millis, + "expirationTime" => time_millis, + "lastModifiedTime" => time_millis, + "cloneDefinition" => { + "cloneTime" => DateTime.now, + "baseTableReference" => Google::Apis::BigqueryV2::TableReference.new + }, + "location" => "US" + }) + end + def random_view_gapi dataset, id = nil, name = nil, description = nil json = random_view_hash(dataset, id, name, description).to_json Google::Apis::BigqueryV2::Table.from_json json From 3df19bf670af6298227747d3051744fb9bf68f92 Mon Sep 17 00:00:00 2001 From: Diptanshu Mittal <43611881+diptanshumittal@users.noreply.github.com> Date: Wed, 23 Nov 2022 12:53:53 +0530 Subject: [PATCH 109/112] fix(datastore): fixed request limit --- google-cloud-datastore/Gemfile | 1 + .../acceptance/datastore/datastore_test.rb | 54 +++++++++++++++++++ .../acceptance/datastore_helper.rb | 1 + .../cloud/datastore/dataset/query_results.rb | 4 ++ 4 files changed, 60 insertions(+) diff --git a/google-cloud-datastore/Gemfile b/google-cloud-datastore/Gemfile index 3c81e70b5436..698af60db2eb 100644 --- a/google-cloud-datastore/Gemfile +++ b/google-cloud-datastore/Gemfile @@ -6,4 +6,5 @@ gem "google-cloud-core", path: "../google-cloud-core" gem "google-cloud-datastore-v1", path: "../google-cloud-datastore-v1" gem "google-cloud-errors", path: "../google-cloud-errors" +gem "minitest-hooks", "~> 1.5" gem "rake" diff --git a/google-cloud-datastore/acceptance/datastore/datastore_test.rb b/google-cloud-datastore/acceptance/datastore/datastore_test.rb index 57205cb8a314..6b625e128571 100644 --- a/google-cloud-datastore/acceptance/datastore/datastore_test.rb +++ b/google-cloud-datastore/acceptance/datastore/datastore_test.rb @@ -815,4 +815,58 @@ _(refresh).must_be :nil? end end + + describe "querying with limit > 300" do + let(:kind_val) { "Post_#{SecureRandom.hex(4)}" } + let(:limit) { 700 } + let(:post) do + Google::Cloud::Datastore::Entity.new.tap do |e| + e["title"] = "How to make the perfect pizza in your grill" + end + end + + before :all do + # Add 1000 entities of the same kind to the datastore + 1000.times.each do |id| + post_temp = post.dup + post_temp.key = Google::Cloud::Datastore::Key.new kind_val, "Post_#{id+1}" + dataset.save post_temp + end + end + + after :all do + # Delete the entities added + 1000.times.each do |id| + post_temp = post.dup + post_temp.key = Google::Cloud::Datastore::Key.new kind_val, "Post_#{id+1}" + dataset.delete post_temp + end + end + + it "should limit results when limit > 300 in query" do + # Testing limit with query + query = dataset.query(kind_val).limit(limit) + entities_count = 0 + results = dataset.run query + loop do + entities_count += results.count + break unless results.next? + results = results.next + end + _(entities_count).must_equal limit + end + + it "should limit results when limit > 300 in GQL query" do + # Testing limit with GQL query + query_gql = dataset.gql "SELECT * FROM #{kind_val} LIMIT @limit", {limit: limit} + entities_count = 0 + results = dataset.run query_gql + loop do + entities_count += results.count + break unless results.next? + results = results.next + end + _(entities_count).must_equal limit + end + end end diff --git a/google-cloud-datastore/acceptance/datastore_helper.rb b/google-cloud-datastore/acceptance/datastore_helper.rb index b01a201e15a3..a73409ebb9cb 100644 --- a/google-cloud-datastore/acceptance/datastore_helper.rb +++ b/google-cloud-datastore/acceptance/datastore_helper.rb @@ -20,6 +20,7 @@ require "minitest/rg" require "google/cloud/datastore" require "securerandom" +require "minitest/hooks/default" # Create shared dataset object so we don't create new for each test $dataset = Google::Cloud.new.datastore diff --git a/google-cloud-datastore/lib/google/cloud/datastore/dataset/query_results.rb b/google-cloud-datastore/lib/google/cloud/datastore/dataset/query_results.rb index 3ec8f342ab3f..60d39baa8256 100644 --- a/google-cloud-datastore/lib/google/cloud/datastore/dataset/query_results.rb +++ b/google-cloud-datastore/lib/google/cloud/datastore/dataset/query_results.rb @@ -158,6 +158,10 @@ def next ensure_service! query.start_cursor = cursor.to_grpc # should always be a Cursor... query.offset = 0 # Never carry an offset across batches + unless query.limit.nil? + # Reduce the limit by the number of entities returned in the current batch + query.limit.value -= count + end query_res = service.run_query query, namespace self.class.from_grpc query_res, service, namespace, query end From 6524e41b5510eb722fb2a15b9d649a9546474faf Mon Sep 17 00:00:00 2001 From: Neha Bajaj Date: Thu, 24 Nov 2022 12:19:40 +0530 Subject: [PATCH 110/112] chore(storage): Add tests to cover empty string/file upload (#19312) --- ...try-conformance-test-against-emulator.yaml | 2 +- .../acceptance/storage/file_test.rb | 19 +++++++++++ .../test/google/cloud/storage/bucket_test.rb | 32 +++++++++++++++++++ .../google/cloud/storage/lazy/bucket_test.rb | 17 ++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/.github/workflows/storage-retry-conformance-test-against-emulator.yaml b/.github/workflows/storage-retry-conformance-test-against-emulator.yaml index ca5f51cbc7de..42b18223c7f2 100644 --- a/.github/workflows/storage-retry-conformance-test-against-emulator.yaml +++ b/.github/workflows/storage-retry-conformance-test-against-emulator.yaml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-ruby@v1 + - uses: ruby/setup-ruby@v1 with: ruby-version: '2.6' - run: ruby --version diff --git a/google-cloud-storage/acceptance/storage/file_test.rb b/google-cloud-storage/acceptance/storage/file_test.rb index bc42dd72f9df..4374ae58f1cd 100644 --- a/google-cloud-storage/acceptance/storage/file_test.rb +++ b/google-cloud-storage/acceptance/storage/file_test.rb @@ -457,6 +457,25 @@ uploaded.delete end + it "should upload and download an empty file" do + begin + data = "" + file = StringIO.new + + uploaded = bucket.create_file file, "uploaded/empty-file.txt" + _(uploaded.name).must_equal "uploaded/empty-file.txt" + + downloadio = StringIO.new + downloaded = uploaded.download downloadio + _(downloaded).must_be_kind_of StringIO + + downloaded_data = downloaded.string + _(downloaded_data).must_equal data + ensure + uploaded.delete + end + end + it "should download and verify when Content-Encoding gzip response header with skip_decompress" do bucket = bucket_public file = bucket.file bucket_public_file_gzip diff --git a/google-cloud-storage/test/google/cloud/storage/bucket_test.rb b/google-cloud-storage/test/google/cloud/storage/bucket_test.rb index dd507f23e8e8..20a4e8828fa4 100644 --- a/google-cloud-storage/test/google/cloud/storage/bucket_test.rb +++ b/google-cloud-storage/test/google/cloud/storage/bucket_test.rb @@ -588,6 +588,38 @@ end end + it "creates an empty file" do + new_file_name = random_file_path + + Tempfile.create ["google-cloud", ".txt"] do |tmpfile| + mock = Minitest::Mock.new + mock.expect :insert_object, create_file_gapi(bucket_user_project.name, new_file_name), + [bucket.name, empty_file_gapi], **insert_object_args(name: new_file_name, upload_source: tmpfile, user_project: "test", options: {retries: 0}) + + bucket_user_project.service.mocked_service = mock + + created = bucket_user_project.create_file tmpfile, new_file_name + _(created.user_project).must_equal true + + mock.verify + end + end + + it "creates an file with a StringIO" do + new_file_name = random_file_path + new_file_contents = StringIO.new + + mock = Minitest::Mock.new + mock.expect :insert_object, create_file_gapi(bucket.name, new_file_name), + [bucket.name, empty_file_gapi], **insert_object_args(name: new_file_name, upload_source: new_file_contents, options: {retries: 0}) + + bucket.service.mocked_service = mock + + bucket.create_file new_file_contents, new_file_name + + mock.verify + end + it "raises when given a file that does not exist" do bad_file_path = "/this/file/does/not/exist.ext" diff --git a/google-cloud-storage/test/google/cloud/storage/lazy/bucket_test.rb b/google-cloud-storage/test/google/cloud/storage/lazy/bucket_test.rb index 428477c1ec58..29ff912473b7 100644 --- a/google-cloud-storage/test/google/cloud/storage/lazy/bucket_test.rb +++ b/google-cloud-storage/test/google/cloud/storage/lazy/bucket_test.rb @@ -336,6 +336,23 @@ end end + it "creates an empty file" do + new_file_name = random_file_path + + Tempfile.create ["google-cloud", ".txt"] do |tmpfile| + mock = Minitest::Mock.new + mock.expect :insert_object, create_file_gapi(bucket_user_project.name, new_file_name), + [bucket.name, empty_file_gapi], **insert_object_args(name: new_file_name, upload_source: tmpfile, user_project: "test", options: {retries: 0}) + + bucket_user_project.service.mocked_service = mock + + created = bucket_user_project.create_file tmpfile, new_file_name + _(created.user_project).must_equal true + + mock.verify + end + end + it "raises when given a file that does not exist" do bad_file_path = "/this/file/does/not/exist.ext" From fe08b91b2953676108d9594307e5906c06e3f200 Mon Sep 17 00:00:00 2001 From: Shiv Gautam <85628657+shivgautam@users.noreply.github.com> Date: Thu, 24 Nov 2022 16:06:18 +0530 Subject: [PATCH 111/112] samples(storage): Add Requester Pays Status Sample (#19467) --- google-cloud-storage/samples/README.md | 1 + .../samples/acceptance/buckets_test.rb | 17 ++++++++-- .../storage_get_requester_pays_status.rb | 33 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 google-cloud-storage/samples/storage_get_requester_pays_status.rb diff --git a/google-cloud-storage/samples/README.md b/google-cloud-storage/samples/README.md index 3e579d42a995..fb68a5e87acb 100644 --- a/google-cloud-storage/samples/README.md +++ b/google-cloud-storage/samples/README.md @@ -103,6 +103,7 @@ Run the tests for these samples by running `bundle exec rake test`. | storage_get_default_event_based_hold.rb | `bucket` | Get state of event-based hold for a bucket | | storage_get_hmac_key | `access_id` | Get HMAC Key metadata | | storage_get_metadata.rb | `bucket` `file` | Display metadata for a file in a bucket | +| storage_get_rerequester_pays_status.rb | `bucket` | Get requester pays status for a bucket | | storage_get_retention_policy.rb | `bucket` | Get retention policy for a bucket | | storage_get_service_account.rb | | Display the GCS service account for the project | | storage_get_uniform_bucket_level_access.rb | `bucket` | Get uniform bucket-level access for a bucket | diff --git a/google-cloud-storage/samples/acceptance/buckets_test.rb b/google-cloud-storage/samples/acceptance/buckets_test.rb index 58b2ce239a75..bcade325eb02 100644 --- a/google-cloud-storage/samples/acceptance/buckets_test.rb +++ b/google-cloud-storage/samples/acceptance/buckets_test.rb @@ -35,6 +35,7 @@ require_relative "../storage_get_bucket_metadata" require_relative "../storage_get_default_event_based_hold" require_relative "../storage_get_public_access_prevention" +require_relative "../storage_get_requester_pays_status" require_relative "../storage_get_retention_policy" require_relative "../storage_get_uniform_bucket_level_access" require_relative "../storage_list_buckets" @@ -190,7 +191,7 @@ end describe "requester_pays" do - it "enable_requester_pays, disable_requester_pays" do + it "enable_requester_pays, disable_requester_pays, get_requester_pays_status" do # enable_requester_pays bucket.requester_pays = false @@ -200,12 +201,24 @@ bucket.refresh! assert bucket.requester_pays? + # get_requester_pays_status + assert_output "Requester pays status is enabled for #{bucket.name}\n" do + get_requester_pays_status bucket_name: bucket.name + end + assert bucket.requester_pays? + # disable_requester_pays assert_output "Requester pays has been disabled for #{bucket.name}\n" do disable_requester_pays bucket_name: bucket.name end bucket.refresh! refute bucket.requester_pays? + + # get_requester_pays_status + assert_output "Requester pays status is disabled for #{bucket.name}\n" do + get_requester_pays_status bucket_name: bucket.name + end + refute bucket.requester_pays? end end @@ -291,7 +304,7 @@ end bucket.refresh! - assert bucket.labels.empty? + assert bucket.labels[label_key].empty? end end diff --git a/google-cloud-storage/samples/storage_get_requester_pays_status.rb b/google-cloud-storage/samples/storage_get_requester_pays_status.rb new file mode 100644 index 000000000000..58794b9e1d85 --- /dev/null +++ b/google-cloud-storage/samples/storage_get_requester_pays_status.rb @@ -0,0 +1,33 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# [START storage_get_requester_pays_status] +def get_requester_pays_status bucket_name: + # The ID of your GCS bucket + # bucket_name = "your-unique-bucket-name" + + require "google/cloud/storage" + + storage = Google::Cloud::Storage.new + bucket = storage.bucket bucket_name + + if bucket.requester_pays + puts "Requester pays status is enabled for #{bucket_name}" + else + puts "Requester pays status is disabled for #{bucket_name}" + end +end +# [END storage_get_requester_pays_status] + +get_requester_pays_status bucket_name: ARGV.shift if $PROGRAM_NAME == __FILE__ From 31c2cb2033f18faef8096f98a9c09cbd5035f47f Mon Sep 17 00:00:00 2001 From: Nivedha Date: Fri, 25 Nov 2022 15:27:17 +0530 Subject: [PATCH 112/112] chore(bigquery): avoid reusing table variable (#19474) --- .../acceptance/bigquery/table_test.rb | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/google-cloud-bigquery/acceptance/bigquery/table_test.rb b/google-cloud-bigquery/acceptance/bigquery/table_test.rb index 00b79db54536..75fb79a14923 100644 --- a/google-cloud-bigquery/acceptance/bigquery/table_test.rb +++ b/google-cloud-bigquery/acceptance/bigquery/table_test.rb @@ -150,10 +150,11 @@ end it "deletes itself and knows it no longer exists" do - _(table.exists?).must_equal true - _(table.delete).must_equal true - _(table.exists?).must_equal false - _(table.exists?(force: true)).must_equal false + test_table = dataset.create_table "kittens_delete_table" + _(test_table.exists?).must_equal true + _(test_table.delete).must_equal true + _(test_table.exists?).must_equal false + _(test_table.exists?(force: true)).must_equal false end it "gets and sets metadata" do @@ -227,17 +228,17 @@ it "creates a table, loading the schema from a File" do begin - table = dataset.create_table "schema_kittens" do |t| + schema_kittens_table = dataset.create_table "schema_kittens" do |t| t.schema.load File.open("acceptance/data/schema.json") end - _(table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema - _(table.schema).wont_be :empty? + _(schema_kittens_table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema + _(schema_kittens_table.schema).wont_be :empty? %i[id breed name dob features].each do |k| - _(table.headers).must_include k + _(schema_kittens_table.headers).must_include k end - fields = table.schema.fields + fields = schema_kittens_table.schema.fields fields.each do |f| _(f.name).wont_be :nil? _(f.type).wont_be :nil? @@ -261,18 +262,18 @@ it "creates a table, loading the schema from a JSON string" do begin - table = dataset.create_table "schema_kittens" do |t| + schema_kittens_table = dataset.create_table "schema_kittens" do |t| json = File.read("acceptance/data/schema.json") t.schema.load json end - _(table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema - _(table.schema).wont_be :empty? + _(schema_kittens_table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema + _(schema_kittens_table.schema).wont_be :empty? %i[id breed name dob features].each do |k| - _(table.headers).must_include k + _(schema_kittens_table.headers).must_include k end - fields = table.schema.fields + fields = schema_kittens_table.schema.fields fields.each do |f| _(f.name).wont_be :nil? _(f.type).wont_be :nil? @@ -296,18 +297,18 @@ it "creates a table, loading the schema from an Array of Hashes" do begin - table = dataset.create_table "schema_kittens" do |t| + schema_kittens_table = dataset.create_table "schema_kittens" do |t| json = JSON.parse(File.read("acceptance/data/schema.json")) t.schema.load json end - _(table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema - _(table.schema).wont_be :empty? + _(schema_kittens_table.schema).must_be_kind_of Google::Cloud::Bigquery::Schema + _(schema_kittens_table.schema).wont_be :empty? %i[id breed name dob features].each do |k| - _(table.headers).must_include k + _(schema_kittens_table.headers).must_include k end - fields = table.schema.fields + fields = schema_kittens_table.schema.fields fields.each do |f| _(f.name).wont_be :nil? _(f.type).wont_be :nil? @@ -486,18 +487,18 @@ it "allows tables to be created and updated with time_partitioning and clustering" do begin - table = time_partitioned_table - _(table.time_partitioning?).must_equal true - _(table.time_partitioning_type).must_equal "DAY" - _(table.time_partitioning_field).must_equal "dob" - _(table.time_partitioning_expiration).must_equal seven_days - _(table.clustering_fields).must_equal clustering_fields + tp_table = time_partitioned_table + _(tp_table.time_partitioning?).must_equal true + _(tp_table.time_partitioning_type).must_equal "DAY" + _(tp_table.time_partitioning_field).must_equal "dob" + _(tp_table.time_partitioning_expiration).must_equal seven_days + _(tp_table.clustering_fields).must_equal clustering_fields new_clustering_fields = ["last_name"] - table.clustering_fields = new_clustering_fields - _(table.clustering_fields).must_equal new_clustering_fields + tp_table.clustering_fields = new_clustering_fields + _(tp_table.clustering_fields).must_equal new_clustering_fields - table.clustering_fields = nil + tp_table.clustering_fields = nil _(table.clustering_fields).must_be :nil? ensure time_partitioned_table.delete @@ -505,12 +506,12 @@ end it "allows tables to be created with range_partitioning" do - table = range_partitioned_table - _(table.range_partitioning?).must_equal true - _(table.range_partitioning_field).must_equal "my_table_id" - _(table.range_partitioning_start).must_equal 0 - _(table.range_partitioning_interval).must_equal 10 - _(table.range_partitioning_end).must_equal 100 + rp_table = range_partitioned_table + _(rp_table.range_partitioning?).must_equal true + _(rp_table.range_partitioning_field).must_equal "my_table_id" + _(rp_table.range_partitioning_start).must_equal 0 + _(rp_table.range_partitioning_interval).must_equal 10 + _(rp_table.range_partitioning_end).must_equal 100 end it "inserts rows directly and gets its data" do